diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 11 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 2 |
2 files changed, 3 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index 1395d60ab07..de3b795fc2b 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -810,11 +810,7 @@ void CodeGenFunction::EmitForStmt(const ForStmt &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 part before the loop. if (S.getInit()) @@ -842,7 +838,7 @@ void CodeGenFunction::EmitForStmt(const ForStmt &S, BreakContinueStack.push_back(BreakContinue(LoopExit, Continue)); // Create a cleanup scope for the condition variable cleanups. - RunCleanupsScope ConditionScope(*this); + LexicalScope ConditionScope(*this, S.getSourceRange()); if (S.getCond()) { // If the for statement has a condition scope, emit the local variable @@ -902,9 +898,6 @@ void CodeGenFunction::EmitForStmt(const ForStmt &S, ForScope.ForceCleanup(); - if (DI) - DI->EmitLexicalBlockEnd(Builder, S.getSourceRange().getEnd()); - LoopStack.pop(); // Emit the fall-through block. diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 04294ec8e57..6d21e78bf23 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -535,7 +535,7 @@ public: } }; - class LexicalScope: protected RunCleanupsScope { + class LexicalScope : public RunCleanupsScope { SourceRange Range; SmallVector<const LabelDecl*, 4> Labels; LexicalScope *ParentScope; |