aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.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/CodeGenFunction.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/CodeGenFunction.cpp')
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index b182ecf055..12e468c127 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -73,9 +73,7 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) {
// Emit debug descriptor for function end.
if (CGDebugInfo *DI = CGM.getDebugInfo()) {
- if (EndLoc.isValid()) {
- DI->setLocation(EndLoc);
- }
+ DI->setLocation(EndLoc);
DI->EmitRegionEnd(CurFn, Builder);
}
@@ -126,10 +124,8 @@ void CodeGenFunction::StartFunction(const Decl *D, QualType RetTy,
// FIXME: The cast here is a huge hack.
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
if (CGDebugInfo *DI = CGM.getDebugInfo()) {
- CompoundStmt* body = dyn_cast<CompoundStmt>(FD->getBody());
- if (body && body->getLBracLoc().isValid()) {
+ if (CompoundStmt* body = dyn_cast<CompoundStmt>(FD->getBody()))
DI->setLocation(body->getLBracLoc());
- }
DI->EmitFunctionStart(FD, CurFn, Builder);
}
}