summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2013-07-24 20:34:39 +0000
committerAdrian Prantl <aprantl@apple.com>2013-07-24 20:34:39 +0000
commit49a78563d207183bda27e5756464f7c6ae64e289 (patch)
tree7c2dc7f0aa954ddb139e4279a5cace400b2584d8 /clang/lib/CodeGen/CGDebugInfo.cpp
parentd801711efbb45201a0499d01644fab2822242390 (diff)
downloadbcm5719-llvm-49a78563d207183bda27e5756464f7c6ae64e289.tar.gz
bcm5719-llvm-49a78563d207183bda27e5756464f7c6ae64e289.zip
Debug Info: Fix an oversight of r186553. Ensure that the function prologue
of an artificial function gets an artificial location as well. llvm-svn: 187074
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 4de21d2b397..4e77f87cc65 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -72,13 +72,19 @@ ArtificialLocation::ArtificialLocation(CodeGenFunction &CGF, CGBuilderTy &B)
: DI(CGF.getDebugInfo()), Builder(B) {
if (DI) {
SavedLoc = DI->getLocation();
+ DI->CurLoc = SourceLocation();
+ Builder.SetCurrentDebugLocation(llvm::DebugLoc());
+ }
+}
+
+void ArtificialLocation::Emit() {
+ if (DI) {
// Sync the Builder.
DI->EmitLocation(Builder, SavedLoc);
DI->CurLoc = SourceLocation();
// Construct a location that has a valid scope, but no line info.
- llvm::DIDescriptor Scope = DI->LexicalBlockStack.empty() ?
- llvm::DIDescriptor(DI->TheCU) :
- llvm::DIDescriptor(DI->LexicalBlockStack.back());
+ assert(!DI->LexicalBlockStack.empty());
+ llvm::DIDescriptor Scope(DI->LexicalBlockStack.back());
Builder.SetCurrentDebugLocation(llvm::DebugLoc::get(0, 0, Scope));
}
}
OpenPOWER on IntegriCloud