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
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 814b730..4df6fee 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3155,10 +3155,12 @@
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 @@
Elements.push_back(L);
Body->setStmts(Context, &Elements[0], Elements.size());
}
- LabelMap.clear();
+ FunctionLabelMap.clear();
if (!Body) return D;