aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp26
1 files changed, 2 insertions, 24 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 3f8eb72a6c..9f915fc7f9 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -4336,20 +4336,13 @@ Sema::ExprResult Sema::ActOnAddrLabel(SourceLocation OpLoc,
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 @@ void Sema::ActOnBlockStart(SourceLocation CaretLoc, Scope *BlockScope) {
// Add BSI to CurBlock.
BSI->PrevBlockInfo = CurBlock;
CurBlock = BSI;
- ActiveScope = BlockScope;
BSI->ReturnType = 0;
BSI->TheScope = BlockScope;
@@ -4617,13 +4609,6 @@ void Sema::ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
// 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 @@ Sema::ExprResult Sema::ActOnBlockStmtExpr(SourceLocation CaretLoc, StmtTy *body,
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;