Generate code for va_start and va_end.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42939 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp
index 44b3e73..54e6714 100644
--- a/Sema/SemaExpr.cpp
+++ b/Sema/SemaExpr.cpp
@@ -1014,7 +1014,10 @@
   if (lhsType == rhsType) // common case, fast path...
     return Compatible;
 
-  if (lhsType->isArithmeticType() && rhsType->isArithmeticType()) {
+  if (lhsType->isReferenceType() || rhsType->isReferenceType()) {
+    if (Type::referenceTypesAreCompatible(lhsType, rhsType))
+      return Compatible;
+  } else if (lhsType->isArithmeticType() && rhsType->isArithmeticType()) {
     if (lhsType->isVectorType() || rhsType->isVectorType()) {
       if (lhsType.getCanonicalType() != rhsType.getCanonicalType())
         return Incompatible;
@@ -1036,9 +1039,6 @@
   } else if (isa<TagType>(lhsType) && isa<TagType>(rhsType)) {
     if (Type::tagTypesAreCompatible(lhsType, rhsType))
       return Compatible;
-  } else if (lhsType->isReferenceType() || rhsType->isReferenceType()) {
-    if (Type::referenceTypesAreCompatible(lhsType, rhsType))
-      return Compatible;
   }
   return Incompatible;
 }