summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaStmt.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
commit3318e865410a8fbc48722e2153a1d44ac7d81a8b (patch)
tree7f0bcf34df49570e1fb00dfa7f0bd794fb3eb462 /clang/lib/Sema/SemaStmt.cpp
parent36dec99d1244d1c9b01ba0f8df2adc4c1e54a6c7 (diff)
downloadbcm5719-llvm-3318e865410a8fbc48722e2153a1d44ac7d81a8b.tar.gz
bcm5719-llvm-3318e865410a8fbc48722e2153a1d44ac7d81a8b.zip
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. llvm-svn: 69463
Diffstat (limited to 'clang/lib/Sema/SemaStmt.cpp')
-rw-r--r--clang/lib/Sema/SemaStmt.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index a34fc2410e1..a5b188696a5 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -152,7 +152,7 @@ Sema::ActOnLabelStmt(SourceLocation IdentLoc, IdentifierInfo *II,
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 @@ Sema::ActOnGotoStmt(SourceLocation GotoLoc, SourceLocation LabelLoc,
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)
OpenPOWER on IntegriCloud