aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.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/CGDebugInfo.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/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 240343dd82..f326be2769 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -59,6 +59,8 @@ CGDebugInfo::CGDebugInfo(CodeGenModule *m)
CGDebugInfo::~CGDebugInfo()
{
+ assert(RegionStack.empty() && "Region stack mismatch, stack not empty!");
+
delete SR;
// Free CompileUnitCache.
@@ -111,7 +113,8 @@ CGDebugInfo::~CGDebugInfo()
}
void CGDebugInfo::setLocation(SourceLocation loc) {
- CurLoc = M->getContext().getSourceManager().getLogicalLoc(loc);
+ if (loc.isValid())
+ CurLoc = M->getContext().getSourceManager().getLogicalLoc(loc);
}
/// getCastValueFor - Return a llvm representation for a given debug information
@@ -711,6 +714,7 @@ void CGDebugInfo::EmitRegionEnd(llvm::Function *Fn, llvm::IRBuilder<> &Builder)
llvm::DebugInfoDesc *DID = RegionStack.back();
Builder.CreateCall(RegionEndFn, getCastValueFor(DID), "");
RegionStack.pop_back();
+ // FIXME: Should be freeing here?
}
/// EmitDeclare - Emit local variable declaration debug info.