aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGStmt.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-10-17 16:15:48 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-10-17 16:15:48 +0000
commit66031a5594bc9a7dc0dc5137c3e7955f835e4639 (patch)
tree799a56539bb2faf5f68cfc113b1cdcf87ddfe5fe /lib/CodeGen/CGStmt.cpp
parente5fd2d92cf8e5549f2ee7b2253b6730ee4aaa2db (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.cpp11
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);
}