aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-18 20:01:55 +0000
committerChris Lattner <sabre@nondot.org>2009-04-18 20:01:55 +0000
commitea29a3a0d6948c4a51a261d19ec1a585d2a9c779 (patch)
tree3cfbecbe69e2f6791678916917fad8555fc4a21e /lib/Sema/SemaDecl.cpp
parenta9768b72bb5ea061c9f10d6aa51b3be3241f3ec2 (diff)
refactor some code, adding a new getLabelMap() accessor method
so that clients can't poke the function-local one when they really want the current block label. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69463 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 814b730575..4df6feec9f 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3155,10 +3155,12 @@ Sema::DeclPtrTy Sema::ActOnFinishFunctionBody(DeclPtrTy D, StmtArg BodyArg) {
PopDeclContext();
// Verify and clean out per-function state.
- bool HaveLabels = !LabelMap.empty();
+ //assert(&getLabelMap() == &FunctionLabelMap && "Didn't pop block right?");
+
+ bool HaveLabels = !FunctionLabelMap.empty();
// Check goto/label use.
for (llvm::DenseMap<IdentifierInfo*, LabelStmt*>::iterator
- I = LabelMap.begin(), E = LabelMap.end(); I != E; ++I) {
+ I = FunctionLabelMap.begin(), E = FunctionLabelMap.end(); I != E; ++I) {
LabelStmt *L = I->second;
// Verify that we have no forward references left. If so, there was a goto
@@ -3191,7 +3193,7 @@ Sema::DeclPtrTy Sema::ActOnFinishFunctionBody(DeclPtrTy D, StmtArg BodyArg) {
Elements.push_back(L);
Body->setStmts(Context, &Elements[0], Elements.size());
}
- LabelMap.clear();
+ FunctionLabelMap.clear();
if (!Body) return D;