diff options
author | Eric Christopher <echristo@apple.com> | 2011-10-12 18:39:35 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2011-10-12 18:39:35 +0000 |
commit | 28e06354b5d4dd539be6781e388ff27c0dffd807 (patch) | |
tree | 6e224a320ad39dcab3b12a05e16bd4a6c97d162e /lib/CodeGen/CGStmt.cpp | |
parent | d596c4d3f8931f4d479e965bf46d0e7edad85570 (diff) |
Revert file/scope handling patches. gdb testing revealed a couple of bugs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141796 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGStmt.cpp')
-rw-r--r-- | lib/CodeGen/CGStmt.cpp | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp index c56931bbc6..06a045f69b 100644 --- a/lib/CodeGen/CGStmt.cpp +++ b/lib/CodeGen/CGStmt.cpp @@ -31,12 +31,11 @@ using namespace CodeGen; void CodeGenFunction::EmitStopPoint(const Stmt *S) { if (CGDebugInfo *DI = getDebugInfo()) { - SourceLocation Loc; if (isa<DeclStmt>(S)) - Loc = S->getLocEnd(); + DI->setLocation(S->getLocEnd()); else - Loc = S->getLocStart(); - DI->EmitLocation(Builder, Loc); + DI->setLocation(S->getLocStart()); + DI->EmitLocation(Builder); } } @@ -191,8 +190,10 @@ RValue CodeGenFunction::EmitCompoundStmt(const CompoundStmt &S, bool GetLast, "LLVM IR generation of compound statement ('{}')"); CGDebugInfo *DI = getDebugInfo(); - if (DI) - DI->EmitLexicalBlockStart(Builder, S.getLBracLoc()); + if (DI) { + DI->setLocation(S.getLBracLoc()); + DI->EmitLexicalBlockStart(Builder); + } // Keep track of the current cleanup stack depth. RunCleanupsScope Scope(*this); @@ -201,8 +202,10 @@ RValue CodeGenFunction::EmitCompoundStmt(const CompoundStmt &S, bool GetLast, E = S.body_end()-GetLast; I != E; ++I) EmitStmt(*I); - if (DI) - DI->EmitLexicalBlockEnd(Builder, S.getRBracLoc()); + if (DI) { + DI->setLocation(S.getRBracLoc()); + DI->EmitLexicalBlockEnd(Builder); + } RValue RV; if (!GetLast) @@ -567,8 +570,10 @@ void CodeGenFunction::EmitForStmt(const ForStmt &S) { RunCleanupsScope ForScope(*this); CGDebugInfo *DI = getDebugInfo(); - if (DI) - DI->EmitLexicalBlockStart(Builder, S.getSourceRange().getBegin()); + if (DI) { + DI->setLocation(S.getSourceRange().getBegin()); + DI->EmitLexicalBlockStart(Builder); + } // Evaluate the first part before the loop. if (S.getInit()) @@ -647,8 +652,10 @@ void CodeGenFunction::EmitForStmt(const ForStmt &S) { ForScope.ForceCleanup(); - if (DI) - DI->EmitLexicalBlockEnd(Builder, S.getSourceRange().getEnd()); + if (DI) { + DI->setLocation(S.getSourceRange().getEnd()); + DI->EmitLexicalBlockEnd(Builder); + } // Emit the fall-through block. EmitBlock(LoopExit.getBlock(), true); @@ -660,8 +667,10 @@ void CodeGenFunction::EmitCXXForRangeStmt(const CXXForRangeStmt &S) { RunCleanupsScope ForScope(*this); CGDebugInfo *DI = getDebugInfo(); - if (DI) - DI->EmitLexicalBlockStart(Builder, S.getSourceRange().getBegin()); + if (DI) { + DI->setLocation(S.getSourceRange().getBegin()); + DI->EmitLexicalBlockStart(Builder); + } // Evaluate the first pieces before the loop. EmitStmt(S.getRangeStmt()); @@ -717,8 +726,10 @@ void CodeGenFunction::EmitCXXForRangeStmt(const CXXForRangeStmt &S) { ForScope.ForceCleanup(); - if (DI) - DI->EmitLexicalBlockEnd(Builder, S.getSourceRange().getEnd()); + if (DI) { + DI->setLocation(S.getSourceRange().getEnd()); + DI->EmitLexicalBlockEnd(Builder); + } // Emit the fall-through block. EmitBlock(LoopExit.getBlock(), true); |