r183531 - fix up recogtion of block pointer type in my last patch.

Fariborz Jahanian fjahanian at apple.com
Fri Jun 7 09:07:39 PDT 2013


Author: fjahanian
Date: Fri Jun  7 11:07:38 2013
New Revision: 183531

URL: http://llvm.org/viewvc/llvm-project?rev=183531&view=rev
Log:
fix up recogtion of block pointer type in my last patch.
// rdar://14085217.
e-This line, and those below, will be ignored--

M    lib/Sema/SemaExpr.cpp

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=183531&r1=183530&r2=183531&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Fri Jun  7 11:07:38 2013
@@ -5105,9 +5105,11 @@ static QualType checkConditionalPointerC
   QualType lhptee, rhptee;
 
   // Get the pointee types.
+  bool IsBlockPointer = false;
   if (const BlockPointerType *LHSBTy = LHSTy->getAs<BlockPointerType>()) {
     lhptee = LHSBTy->getPointeeType();
     rhptee = RHSTy->castAs<BlockPointerType>()->getPointeeType();
+    IsBlockPointer = true;
   } else {
     lhptee = LHSTy->castAs<PointerType>()->getPointeeType();
     rhptee = RHSTy->castAs<PointerType>()->getPointeeType();
@@ -5149,7 +5151,7 @@ static QualType checkConditionalPointerC
 
   // The pointer types are compatible.
   QualType ResultTy = CompositeTy.withCVRQualifiers(MergedCVRQual);
-  if (isa<BlockPointerType>(LHSTy))
+  if (IsBlockPointer)
     ResultTy = S.Context.getBlockPointerType(ResultTy);
   else
     ResultTy = S.Context.getPointerType(ResultTy);





More information about the cfe-commits mailing list