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/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index a34fc24..a5b1886 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -152,7 +152,7 @@
SourceLocation ColonLoc, StmtArg subStmt) {
Stmt *SubStmt = static_cast<Stmt*>(subStmt.release());
// Look up the record for this label identifier.
- LabelStmt *&LabelDecl = CurBlock ? CurBlock->LabelMap[II] : LabelMap[II];
+ LabelStmt *&LabelDecl = getLabelMap()[II];
// If not forward referenced or defined already, just create a new LabelStmt.
if (LabelDecl == 0)
@@ -656,8 +656,7 @@
return StmtError(Diag(GotoLoc, diag::err_goto_in_block));
// Look up the record for this label identifier.
- LabelStmt *&LabelDecl = CurBlock ? CurBlock->LabelMap[LabelII] :
- LabelMap[LabelII];
+ LabelStmt *&LabelDecl = getLabelMap()[LabelII];
// If we haven't seen this label yet, create a forward reference.
if (LabelDecl == 0)