]> granicus.if.org Git - clang/commitdiff
Codegen for int (^bp)(int) = 0;
authorMike Stump <mrs@apple.com>
Wed, 18 Feb 2009 21:44:49 +0000 (21:44 +0000)
committerMike Stump <mrs@apple.com>
Wed, 18 Feb 2009 21:44:49 +0000 (21:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64951 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ExprConstant.cpp

index ccea646fb7876a4ef4eda6741de70cf680490b79..ee698d6c93fb07df747482012559b4fda12dff07 100644 (file)
@@ -265,7 +265,8 @@ public:
 } // end anonymous namespace
 
 static bool EvaluatePointer(const Expr* E, APValue& Result, EvalInfo &Info) {
-  if (!E->getType()->isPointerType())
+  if (!E->getType()->isPointerType()
+      && !E->getType()->isBlockPointerType())
     return false;
   Result = PointerExprEvaluator(Info).Visit(const_cast<Expr*>(E));
   return Result.isLValue();
@@ -1533,7 +1534,8 @@ bool Expr::Evaluate(EvalResult &Result, ASTContext &Ctx) const {
       return false;
     
     Result.Val = APValue(sInt);
-  } else if (getType()->isPointerType()) {
+  } else if (getType()->isPointerType()
+             || getType()->isBlockPointerType()) {
     if (!EvaluatePointer(this, Result.Val, Info))
       return false;
   } else if (getType()->isRealFloatingType()) {