Minor cleanup for IntToBlockPointer so it applies to all callers of 
Sema::CheckAssignmentConstraints; not really visible, but the right 
thing to do.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65428 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index a58752c..174e408 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -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