[cfe-commits] r159292 - /cfe/trunk/lib/Sema/SemaExpr.cpp

Richard Smith richard-llvm at metafoo.co.uk
Wed Jun 27 13:29:39 PDT 2012


Author: rsmith
Date: Wed Jun 27 15:29:39 2012
New Revision: 159292

URL: http://llvm.org/viewvc/llvm-project?rev=159292&view=rev
Log:
Refactoring after r159290: don't hold onto and check a misleading QualType.

Modified:
    cfe/trunk/lib/Sema/SemaExpr.cpp

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=159292&r1=159291&r2=159292&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Wed Jun 27 15:29:39 2012
@@ -649,8 +649,7 @@
 /// interfaces passed by value.
 ExprResult Sema::DefaultVariadicArgumentPromotion(Expr *E, VariadicCallType CT,
                                                   FunctionDecl *FDecl) {
-  const QualType &Ty = E->getType();
-  if (const BuiltinType *PlaceholderTy = Ty->getAsPlaceholderType()) {
+  if (const BuiltinType *PlaceholderTy = E->getType()->getAsPlaceholderType()) {
     // Strip the unbridged-cast placeholder expression off, if applicable.
     if (PlaceholderTy->getKind() == BuiltinType::ARCUnbridgedCast &&
         (CT == VariadicMethod ||
@@ -671,10 +670,10 @@
     return ExprError();
   E = ExprRes.take();
 
-  if (Ty->isObjCObjectType() &&
+  if (E->getType()->isObjCObjectType() &&
     DiagRuntimeBehavior(E->getLocStart(), 0,
                         PDiag(diag::err_cannot_pass_objc_interface_to_vararg)
-                          << Ty << CT))
+                          << E->getType() << CT))
     return ExprError();
 
   // Diagnostics regarding non-POD argument types are





More information about the cfe-commits mailing list