summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2013-05-16 00:41:29 +0000
committerAdrian Prantl <aprantl@apple.com>2013-05-16 00:41:29 +0000
commit5e5ff6e170faddd31ff3e08f6d7e8ad45a2db46e (patch)
tree2699502a427191613283eb76f1031822ab449f02 /clang/lib
parentdc237b52bc916c5156dcdadf143e73d97a5c0ccf (diff)
downloadbcm5719-llvm-5e5ff6e170faddd31ff3e08f6d7e8ad45a2db46e.tar.gz
bcm5719-llvm-5e5ff6e170faddd31ff3e08f6d7e8ad45a2db46e.zip
Set the debug location for landing pad code to the canonical EH location.
It used to point to the first call that caused the landing pad to be generated. rdar://problem/13888152 llvm-svn: 181958
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.h3
-rw-r--r--clang/lib/CodeGen/CGException.cpp7
2 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index 4080492a1c6..bad13b96ad2 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -206,6 +206,9 @@ public:
/// invalid it is ignored.
void setLocation(SourceLocation Loc);
+ /// getLocation - Return the current source location.
+ SourceLocation getLocation() const { return CurLoc; }
+
/// EmitLocation - Emit metadata to indicate a change in line/column
/// information in the source file.
/// \param ForceColumnInfo Assume DebugColumnInfo option is true.
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
index a088d78641f..4b09e973448 100644
--- a/clang/lib/CodeGen/CGException.cpp
+++ b/clang/lib/CodeGen/CGException.cpp
@@ -766,6 +766,11 @@ llvm::BasicBlock *CodeGenFunction::EmitLandingPad() {
// Save the current IR generation state.
CGBuilderTy::InsertPoint savedIP = Builder.saveAndClearIP();
+ SourceLocation SavedLocation;
+ if (CGDebugInfo *DI = getDebugInfo()) {
+ SavedLocation = DI->getLocation();
+ DI->EmitLocation(Builder, CurEHLocation);
+ }
const EHPersonality &personality = EHPersonality::get(getLangOpts());
@@ -887,6 +892,8 @@ llvm::BasicBlock *CodeGenFunction::EmitLandingPad() {
// Restore the old IR generation state.
Builder.restoreIP(savedIP);
+ if (CGDebugInfo *DI = getDebugInfo())
+ DI->EmitLocation(Builder, SavedLocation);
return lpad;
}
OpenPOWER on IntegriCloud