Remove ActiveScope (revert http://llvm.org/viewvc/llvm-project?view=rev&revision=65694 and http://llvm.org/viewvc/llvm-project?view=rev&revision=66741).

Will replace with something better today...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66893 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 3f8eb72..9f915fc 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -4336,20 +4336,13 @@
                                       SourceLocation LabLoc,
                                       IdentifierInfo *LabelII) {
   // Look up the record for this label identifier.
-  llvm::DenseMap<IdentifierInfo*, Action::StmtTy*>::iterator I = 
-    ActiveScope->LabelMap.find(LabelII);
+  LabelStmt *&LabelDecl = LabelMap[LabelII];
 
-  LabelStmt *LabelDecl;
-  
   // If we haven't seen this label yet, create a forward reference. It
   // will be validated and/or cleaned up in ActOnFinishFunctionBody.
-  if (I == ActiveScope->LabelMap.end()) {
+  if (LabelDecl == 0)
     LabelDecl = new (Context) LabelStmt(LabLoc, LabelII, 0);
 
-    ActiveScope->LabelMap.insert(std::make_pair(LabelII, LabelDecl));
-  } else
-    LabelDecl = static_cast<LabelStmt *>(I->second);
-    
   // Create the AST node.  The address of a label always has type 'void*'.
   return new (Context) AddrLabelExpr(OpLoc, LabLoc, LabelDecl,
                                      Context.getPointerType(Context.VoidTy));
@@ -4539,7 +4532,6 @@
   // Add BSI to CurBlock.
   BSI->PrevBlockInfo = CurBlock;
   CurBlock = BSI;
-  ActiveScope = BlockScope;
 
   BSI->ReturnType = 0;
   BSI->TheScope = BlockScope;
@@ -4617,13 +4609,6 @@
   // Ensure that CurBlock is deleted.
   llvm::OwningPtr<BlockSemaInfo> CC(CurBlock);
 
-  // Before popping CurBlock, set ActiveScope to this scope's function
-  // or block parent.
-  ActiveScope = CurBlock->TheScope->getParent();
-  while (ActiveScope &&
-         ((ActiveScope->getFlags() & (Scope::FnScope | Scope::BlockScope)) == 0))
-    ActiveScope = ActiveScope->getParent();
-
   // Pop off CurBlock, handle nested blocks.
   CurBlock = CurBlock->PrevBlockInfo;
 
@@ -4641,13 +4626,6 @@
 
   PopDeclContext();
 
-  // Before popping CurBlock, set ActiveScope to this scope's function
-  // or block parent.
-  ActiveScope = CurBlock->TheScope->getParent();
-  while (ActiveScope &&
-         ((ActiveScope->getFlags() & (Scope::FnScope | Scope::BlockScope)) == 0))
-    ActiveScope = ActiveScope->getParent();
-  
   // Pop off CurBlock, handle nested blocks.
   CurBlock = CurBlock->PrevBlockInfo;