[cfe-commits] r90808 - in /cfe/trunk/lib: Index/ASTVisitor.h Sema/SemaExpr.cpp

Ted Kremenek kremenek at apple.com
Mon Dec 7 14:01:30 PST 2009


Author: kremenek
Date: Mon Dec  7 16:01:30 2009
New Revision: 90808

URL: http://llvm.org/viewvc/llvm-project?rev=90808&view=rev
Log:
Add the BlockDecl to the DeclContext.

Modified:
    cfe/trunk/lib/Index/ASTVisitor.h
    cfe/trunk/lib/Sema/SemaExpr.cpp

Modified: cfe/trunk/lib/Index/ASTVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/ASTVisitor.h?rev=90808&r1=90807&r2=90808&view=diff

==============================================================================
--- cfe/trunk/lib/Index/ASTVisitor.h (original)
+++ cfe/trunk/lib/Index/ASTVisitor.h Mon Dec  7 16:01:30 2009
@@ -104,7 +104,7 @@
   }
 
   void VisitBlockExpr(BlockExpr *Node) {
-    Visit(Node->getBlockDecl());
+    // The BlockDecl is also visited by 'VisitDeclContext()'.  No need to visit it twice.
   }
 
   void VisitStmt(Stmt *Node) {

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=90808&r1=90807&r2=90808&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Mon Dec  7 16:01:30 2009
@@ -6499,6 +6499,7 @@
   CurFunctionNeedsScopeChecking = false;
 
   BSI->TheDecl = BlockDecl::Create(Context, CurContext, CaretLoc);
+  CurContext->addDecl(BSI->TheDecl);
   PushDeclContext(BlockScope, BSI->TheDecl);
 }
 





More information about the cfe-commits mailing list