switch (getStmtClass()) {
default:
return false;
+ case BlockExprClass:
+ return true;
case ParenExprClass:
return cast<ParenExpr>(this)->getSubExpr()->hasGlobalStorage();
case ImplicitCastExprClass:
APValue VisitParenExpr(ParenExpr *E) { return Visit(E->getSubExpr()); }
APValue VisitDeclRefExpr(DeclRefExpr *E);
+ APValue VisitBlockExpr(BlockExpr *E);
APValue VisitPredefinedExpr(PredefinedExpr *E) { return APValue(E, 0); }
APValue VisitCompoundLiteralExpr(CompoundLiteralExpr *E);
APValue VisitMemberExpr(MemberExpr *E);
return APValue(E, 0);
}
+APValue LValueExprEvaluator::VisitBlockExpr(BlockExpr *E)
+{
+ if (E->hasBlockDeclRefExprs())
+ return APValue();
+
+ return APValue(E, 0);
+}
+
APValue LValueExprEvaluator::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
if (E->isFileScope())
return APValue(E, 0);
}
if (SubExpr->getType()->isFunctionType() ||
+ SubExpr->getType()->isBlockPointerType() ||
SubExpr->getType()->isArrayType()) {
APValue Result;
if (EvaluateLValue(SubExpr, Result, Info))
static int global_x = 10;
void (^global_block)(void) = ^{ printf("global x is %d\n", global_x); };
+typedef void (^void_block_t)(void);
+
+static const void_block_t myBlock = ^{ };
+
+static const void_block_t myBlock2 = ^ void(void) { };
+
#if 0
// Old syntax. FIXME: convert/test.
void test_byref() {