summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2018-09-11 17:52:01 +0000
committerJosh Stone <jistone@redhat.com>2018-09-11 17:52:01 +0000
commitf446facab0e38c7496ac581f31335e60ec896cb9 (patch)
tree91b4d1fb0782961bc25c1d819c21a61be6124bd5 /llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
parent8b7b743cc1b83eec0f43dab625dff9b3817a5a3a (diff)
downloadbcm5719-llvm-f446facab0e38c7496ac581f31335e60ec896cb9.tar.gz
bcm5719-llvm-f446facab0e38c7496ac581f31335e60ec896cb9.zip
[GlobalISel] Lower dbg.declare into indirect DBG_VALUE
Summary: D31439 changed the semantics of dbg.declare to take the address of a variable as the first argument, making it indirect. It specifically updated FastISel for this change here: https://reviews.llvm.org/D31439#change-WVArzi177jPl GlobalISel needs to follow suit, or else it will be missing a level of indirection in the generated debuginfo. This problem was seen in a Rust debuginfo test on aarch64, since GlobalISel is used at -O0 for aarch64. https://github.com/rust-lang/rust/issues/49807 https://bugzilla.redhat.com/show_bug.cgi?id=1611597 https://bugzilla.redhat.com/show_bug.cgi?id=1625768 Reviewers: dblaikie, aprantl, t.p.northover, javed.absar, rnk Reviewed By: rnk Subscribers: #debug-info, rovka, kristof.beyls, JDevlieghere, llvm-commits, tstellar Differential Revision: https://reviews.llvm.org/D51749 llvm-svn: 341969
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
index 974629bc4f4..f7b905c9db4 100644
--- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
@@ -758,9 +758,12 @@ bool IRTranslator::translateKnownIntrinsic(const CallInst &CI, Intrinsic::ID ID,
// instructions (in fact, they get ignored if they *do* exist).
MF->setVariableDbgInfo(DI.getVariable(), DI.getExpression(),
getOrCreateFrameIndex(*AI), DI.getDebugLoc());
- } else
- MIRBuilder.buildDirectDbgValue(getOrCreateVReg(*Address),
- DI.getVariable(), DI.getExpression());
+ } else {
+ // A dbg.declare describes the address of a source variable, so lower it
+ // into an indirect DBG_VALUE.
+ MIRBuilder.buildIndirectDbgValue(getOrCreateVReg(*Address),
+ DI.getVariable(), DI.getExpression());
+ }
return true;
}
case Intrinsic::dbg_label: {
OpenPOWER on IntegriCloud