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

Eli Friedman eli.friedman at gmail.com
Tue Feb 24 20:20:47 PST 2009


Author: efriedma
Date: Tue Feb 24 22:20:42 2009
New Revision: 65428

URL: http://llvm.org/viewvc/llvm-project?rev=65428&view=rev
Log:
Minor cleanup for IntToBlockPointer so it applies to all callers of 
Sema::CheckAssignmentConstraints; not really visible, but the right 
thing to do.


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=65428&r1=65427&r2=65428&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Feb 24 22:20:42 2009
@@ -2696,7 +2696,7 @@
 
   if (isa<BlockPointerType>(lhsType)) {
     if (rhsType->isIntegerType())
-      return IntToPointer;
+      return IntToBlockPointer;
 
     // Treat block pointers as objects.
     if (getLangOptions().ObjC1 &&
@@ -2765,10 +2765,6 @@
     return Compatible;
   }
 
-  // We don't allow conversion of non-null-pointer constants to integers.
-  if (lhsType->isBlockPointerType() && rExpr->getType()->isIntegerType())
-    return IntToBlockPointer;
-
   // This check seems unnatural, however it is necessary to ensure the proper
   // conversion of functions/arrays. If the conversion were done for all
   // DeclExpr's (created by ActOnIdentifierExpr), it would mess up the unary





More information about the cfe-commits mailing list