]> granicus.if.org Git - clang/commitdiff
Remove PrevFunctionScope slot (it isn't needed)...use getParent() instead.
authorSteve Naroff <snaroff@apple.com>
Sat, 28 Feb 2009 21:01:15 +0000 (21:01 +0000)
committerSteve Naroff <snaroff@apple.com>
Sat, 28 Feb 2009 21:01:15 +0000 (21:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65718 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/Sema.h
lib/Sema/SemaExpr.cpp

index ead93cb7494c851b98b5503f9e638f46bf63ab45..3e9d07aefb6b755090e2e4ff1deffeed4e71263b 100644 (file)
@@ -2069,10 +2069,6 @@ struct BlockSemaInfo {
   /// arguments etc.
   Scope *TheScope;
   
-  /// PrevFunctionScope - This is the scope for the enclosing function.
-  /// For global blocks, this will be null.
-  Scope *PrevFunctionScope;
-  
   /// ReturnType - This will get set to block result type, by looking at
   /// return types, if any, in the block body.
   Type *ReturnType;
index e34a22e039be663aae117912e509bbdd1f6cb6ef..1a93039b03276fbe4e87e9e5a30b6c120fc49ca7 100644 (file)
@@ -4404,7 +4404,6 @@ void Sema::ActOnBlockStart(SourceLocation CaretLoc, Scope *BlockScope) {
 
   // Add BSI to CurBlock.
   BSI->PrevBlockInfo = CurBlock;
-  BSI->PrevFunctionScope = ActiveScope;
   CurBlock = BSI;
   ActiveScope = BlockScope;
 
@@ -4501,8 +4500,9 @@ Sema::ExprResult Sema::ActOnBlockStmtExpr(SourceLocation CaretLoc, StmtTy *body,
 
   PopDeclContext();
 
-  ActiveScope = CurBlock->PrevFunctionScope;
-    
+  // Before poping CurBlock, set ActiveScope to this scopes parent.
+  ActiveScope = CurBlock->TheScope->getParent();
+  
   // Pop off CurBlock, handle nested blocks.
   CurBlock = CurBlock->PrevBlockInfo;