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 | 93663b3c6226fb039aff10cc2edc3df51bf6bc23 (patch) | |
tree | a896daa2415cd71dc86e7f61df16b8ec2790475a /clang/lib/CodeGen/CGStmt.cpp | |
parent | 3d68aa838be45dc2bda53c9abd0089c41a177b5f (diff) | |
download | bcm5719-llvm-93663b3c6226fb039aff10cc2edc3df51bf6bc23.tar.gz bcm5719-llvm-93663b3c6226fb039aff10cc2edc3df51bf6bc23.zip |
Revert file/scope handling patches. gdb testing revealed a couple of bugs.
llvm-svn: 141796
Diffstat (limited to 'clang/lib/CodeGen/CGStmt.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index c56931bbc6f..06a045f69b0 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/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); |