summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGStmt.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-08-22 21:54:29 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-08-22 21:54:29 +0000
commitac0a5c49534aa989a45894c5d17ffd9aea8fcce1 (patch)
tree2aaab605f90ab83d8d3f7a20fa11672f7a4fda58 /clang/lib/CodeGen/CGStmt.cpp
parent2ccbc621df39d5ea7e4c6e406a10972339ca9d37 (diff)
downloadbcm5719-llvm-ac0a5c49534aa989a45894c5d17ffd9aea8fcce1.tar.gz
bcm5719-llvm-ac0a5c49534aa989a45894c5d17ffd9aea8fcce1.zip
DebugInfo: Provide scopes for C++11 range-for loop variables similar to r216288 (which was for plain-for loop condition variables).
llvm-svn: 216291
Diffstat (limited to 'clang/lib/CodeGen/CGStmt.cpp')
-rw-r--r--clang/lib/CodeGen/CGStmt.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp
index de3b795fc2b..6912378cadf 100644
--- a/clang/lib/CodeGen/CGStmt.cpp
+++ b/clang/lib/CodeGen/CGStmt.cpp
@@ -909,11 +909,7 @@ CodeGenFunction::EmitCXXForRangeStmt(const CXXForRangeStmt &S,
const ArrayRef<const Attr *> &ForAttrs) {
JumpDest LoopExit = getJumpDestInCurrentScope("for.end");
- RunCleanupsScope ForScope(*this);
-
- CGDebugInfo *DI = getDebugInfo();
- if (DI)
- DI->EmitLexicalBlockStart(Builder, S.getSourceRange().getBegin());
+ LexicalScope ForScope(*this, S.getSourceRange());
// Evaluate the first pieces before the loop.
EmitStmt(S.getRangeStmt());
@@ -963,7 +959,7 @@ CodeGenFunction::EmitCXXForRangeStmt(const CXXForRangeStmt &S,
{
// Create a separate cleanup scope for the loop variable and body.
- RunCleanupsScope BodyScope(*this);
+ LexicalScope BodyScope(*this, S.getSourceRange());
EmitStmt(S.getLoopVarStmt());
EmitStmt(S.getBody());
}
@@ -979,9 +975,6 @@ CodeGenFunction::EmitCXXForRangeStmt(const CXXForRangeStmt &S,
ForScope.ForceCleanup();
- if (DI)
- DI->EmitLexicalBlockEnd(Builder, S.getSourceRange().getEnd());
-
LoopStack.pop();
// Emit the fall-through block.
OpenPOWER on IntegriCloud