Address post-commit review comments after r328731. NFC.

- Define a function (canPassInRegisters) that determines whether a
record can be passed in registers based on language rules and
target-specific ABI rules.

- Set flag RecordDecl::ParamDestroyedInCallee to true in MSVC mode and
remove ASTContext::isParamDestroyedInCallee, which is no longer needed.

- Use the same type (unsigned) for RecordDecl's bit-field members.

For more background, see the following discussions that took place on
cfe-commits.

http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180326/223498.html
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180402/223688.html
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180409/224754.html
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180423/226494.html
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180507/227647.html

llvm-svn: 332397
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 4c3c083..d22ac19 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -3071,7 +3071,8 @@
 
   // Deactivate the cleanup for the callee-destructed param that was pushed.
   if (hasAggregateEvaluationKind(type) && !CurFuncIsThunk &&
-      getContext().isParamDestroyedInCallee(type) && type.isDestructedType()) {
+      type->getAs<RecordType>()->getDecl()->isParamDestroyedInCallee() &&
+      type.isDestructedType()) {
     EHScopeStack::stable_iterator cleanup =
         CalleeDestructedParamCleanups.lookup(cast<ParmVarDecl>(param));
     assert(cleanup.isValid() &&
@@ -3553,7 +3554,8 @@
   // In the Microsoft C++ ABI, aggregate arguments are destructed by the callee.
   // However, we still have to push an EH-only cleanup in case we unwind before
   // we make it to the call.
-  if (HasAggregateEvalKind && getContext().isParamDestroyedInCallee(type)) {
+  if (HasAggregateEvalKind &&
+      type->getAs<RecordType>()->getDecl()->isParamDestroyedInCallee()) {
     // If we're using inalloca, use the argument memory.  Otherwise, use a
     // temporary.
     AggValueSlot Slot;