Make integer promotions work correctly on PIC16 and other platforms 
where sizeof(short) == sizeof(int).  Move UsualArithmeticConversionsType 
out of Sema, since it was only there as a historical artifact.  Patch by 
Enea Zaffanella.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79412 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 6b76ce8..d338e42 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -3101,9 +3101,10 @@
       for (unsigned Right = FirstPromotedArithmeticType; 
            Right < LastPromotedArithmeticType; ++Right) {
         QualType LandR[2] = { ArithmeticTypes[Left], ArithmeticTypes[Right] };
-        QualType Result 
-          = isComparison? Context.BoolTy 
-                        : UsualArithmeticConversionsType(LandR[0], LandR[1]);
+        QualType Result
+          = isComparison
+          ? Context.BoolTy
+          : Context.UsualArithmeticConversionsType(LandR[0], LandR[1]);
         AddBuiltinCandidate(Result, LandR, Args, 2, CandidateSet);
       }
     }
@@ -3136,7 +3137,7 @@
         QualType LandR[2] = { ArithmeticTypes[Left], ArithmeticTypes[Right] };
         QualType Result = (Op == OO_LessLess || Op == OO_GreaterGreater)
             ? LandR[0]
-            : UsualArithmeticConversionsType(LandR[0], LandR[1]);
+            : Context.UsualArithmeticConversionsType(LandR[0], LandR[1]);
         AddBuiltinCandidate(Result, LandR, Args, 2, CandidateSet);
       }
     }