summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-02-25 04:20:42 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-02-25 04:20:42 +0000
commit8163b7aa20b0edc577dfa8a83f41e3f44e47bfd0 (patch)
tree70cd3f7b19b070ca9e956259fb7a2b9811252da0 /clang/lib/Sema/SemaExpr.cpp
parente2fdc31759c54d3be7ee408757ad7624aed29be8 (diff)
downloadbcm5719-llvm-8163b7aa20b0edc577dfa8a83f41e3f44e47bfd0.tar.gz
bcm5719-llvm-8163b7aa20b0edc577dfa8a83f41e3f44e47bfd0.zip
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
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index a58752cb42a..174e408ead4 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -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
OpenPOWER on IntegriCloud