diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-10-17 16:15:48 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-10-17 16:15:48 +0000 |
commit | 66031a5594bc9a7dc0dc5137c3e7955f835e4639 (patch) | |
tree | 799a56539bb2faf5f68cfc113b1cdcf87ddfe5fe /lib/CodeGen/CGStmt.cpp | |
parent | e5fd2d92cf8e5549f2ee7b2253b6730ee4aaa2db (diff) |
Change CGDebugInfo::setLocation to just ignore invalid locations. This
simplifies clients.
Also, add assert that RegionStack is empty when the CGDebugInfo is
destroyed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57684 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGStmt.cpp')
-rw-r--r-- | lib/CodeGen/CGStmt.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp index fed0eee7f0..20312de5ba 100644 --- a/lib/CodeGen/CGStmt.cpp +++ b/lib/CodeGen/CGStmt.cpp @@ -33,10 +33,7 @@ void CodeGenFunction::EmitStmt(const Stmt *S) { // executable code. So do not generate a stoppoint for that. CGDebugInfo *DI = CGM.getDebugInfo(); if (DI && S->getStmtClass() != Stmt::CompoundStmtClass) { - if (S->getLocStart().isValid()) { - DI->setLocation(S->getLocStart()); - } - + DI->setLocation(S->getLocStart()); DI->EmitStopPoint(CurFn, Builder); } @@ -122,8 +119,7 @@ RValue CodeGenFunction::EmitCompoundStmt(const CompoundStmt &S, bool GetLast, // FIXME: handle vla's etc. CGDebugInfo *DI = CGM.getDebugInfo(); if (DI) { - if (S.getLBracLoc().isValid()) - DI->setLocation(S.getLBracLoc()); + DI->setLocation(S.getLBracLoc()); DI->EmitRegionStart(CurFn, Builder); } @@ -132,8 +128,7 @@ RValue CodeGenFunction::EmitCompoundStmt(const CompoundStmt &S, bool GetLast, EmitStmt(*I); if (DI) { - if (S.getRBracLoc().isValid()) - DI->setLocation(S.getRBracLoc()); + DI->setLocation(S.getRBracLoc()); DI->EmitRegionEnd(CurFn, Builder); } |