summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-10-08 18:44:00 +0000
committerSteve Naroff <snaroff@apple.com>2008-10-08 18:44:00 +0000
commit44078b95eead47fe345c3010d93ec1fd464fa493 (patch)
tree2ec5b2360d35b300680734c47ea72c49fea59b30 /clang/lib/Sema/SemaExpr.cpp
parent944375abae345c55802a6db809b2462cc780d7e2 (diff)
downloadbcm5719-llvm-44078b95eead47fe345c3010d93ec1fd464fa493.tar.gz
bcm5719-llvm-44078b95eead47fe345c3010d93ec1fd464fa493.zip
Instantiate the BlockDecl in ActOnBlockStart() so we can use it as a DeclContext.
This required changes to attach the compound statement later on (like we do for functions). llvm-svn: 57304
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index b8b614db073..cdba6ec6ea6 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -2889,6 +2889,8 @@ void Sema::ActOnBlockStart(SourceLocation CaretLoc, Scope *BlockScope,
BSI->Params.push_back((ParmVarDecl *)FTI.ArgInfo[i].Param);
BSI->isVariadic = FTI.isVariadic;
}
+ BSI->TheDecl = BlockDecl::Create(Context, CurContext, CaretLoc,
+ &BSI->Params[0], BSI->Params.size());
}
/// ActOnBlockError - If there is an error parsing a block, this callback
@@ -2932,10 +2934,8 @@ Sema::ExprResult Sema::ActOnBlockStmtExpr(SourceLocation CaretLoc, StmtTy *body,
BlockTy = Context.getBlockPointerType(BlockTy);
- BlockDecl *NewBD = BlockDecl::Create(Context, CurContext, CaretLoc,
- &BSI->Params[0], BSI->Params.size(),
- Body.take());
- return new BlockExpr(NewBD, BlockTy);
+ BSI->TheDecl->setBody(Body.take());
+ return new BlockExpr(BSI->TheDecl, BlockTy);
}
/// ExprsMatchFnType - return true if the Exprs in array Args have
OpenPOWER on IntegriCloud