summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-12-07 22:01:30 +0000
committerTed Kremenek <kremenek@apple.com>2009-12-07 22:01:30 +0000
commit54ad1ab56f8047b7a5cc37825ca8bc39906dc183 (patch)
tree4bd9e9f621adb43d449c4d716c7dbf29c42e76e4
parent58fd941eab793f20af63d96bb7dbb18411529386 (diff)
downloadbcm5719-llvm-54ad1ab56f8047b7a5cc37825ca8bc39906dc183.tar.gz
bcm5719-llvm-54ad1ab56f8047b7a5cc37825ca8bc39906dc183.zip
Add the BlockDecl to the DeclContext.
llvm-svn: 90808
-rw-r--r--clang/lib/Index/ASTVisitor.h2
-rw-r--r--clang/lib/Sema/SemaExpr.cpp1
2 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Index/ASTVisitor.h b/clang/lib/Index/ASTVisitor.h
index 6cfa381608a..943c7202531 100644
--- a/clang/lib/Index/ASTVisitor.h
+++ b/clang/lib/Index/ASTVisitor.h
@@ -104,7 +104,7 @@ public:
}
void VisitBlockExpr(BlockExpr *Node) {
- Visit(Node->getBlockDecl());
+ // The BlockDecl is also visited by 'VisitDeclContext()'. No need to visit it twice.
}
void VisitStmt(Stmt *Node) {
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index b3c5c9fc20b..8332bf8f7b1 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -6499,6 +6499,7 @@ void Sema::ActOnBlockStart(SourceLocation CaretLoc, Scope *BlockScope) {
CurFunctionNeedsScopeChecking = false;
BSI->TheDecl = BlockDecl::Create(Context, CurContext, CaretLoc);
+ CurContext->addDecl(BSI->TheDecl);
PushDeclContext(BlockScope, BSI->TheDecl);
}
OpenPOWER on IntegriCloud