Minor cleanup for IntToBlockPointer so it applies to all callers of

Sema::CheckAssignmentConstraints; not really visible, but the right 
thing to do.

llvm-svn: 65428
This commit is contained in:
Eli Friedman 2009-02-25 04:20:42 +00:00
parent e2fdc31759
commit 8163b7aa20
1 changed files with 1 additions and 5 deletions

View File

@ -2696,7 +2696,7 @@ Sema::CheckAssignmentConstraints(QualType lhsType, QualType rhsType) {
if (isa<BlockPointerType>(lhsType)) {
if (rhsType->isIntegerType())
return IntToPointer;
return IntToBlockPointer;
// Treat block pointers as objects.
if (getLangOptions().ObjC1 &&
@ -2765,10 +2765,6 @@ Sema::CheckSingleAssignmentConstraints(QualType lhsType, Expr *&rExpr) {
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