summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-05-09 01:57:44 +0000
committerReid Kleckner <rnk@google.com>2017-05-09 01:57:44 +0000
commit41bb94233bd1a746975f87383722b8e96694f5cd (patch)
tree3f8999dd541bcf0e239cb4d47cf8c8ef00247b04 /llvm/lib
parent2cd7e8652c10bc19c0fb1ab24bb3aa54d8d2f0ff (diff)
downloadbcm5719-llvm-41bb94233bd1a746975f87383722b8e96694f5cd.tar.gz
bcm5719-llvm-41bb94233bd1a746975f87383722b8e96694f5cd.zip
Revert "Don't add DBG_VALUE instructions for static allocas in dbg.declare"
This reverts commit r302461. It appears to be causing failures compiling gtest with debug info on the Linux sanitizer bot. I was unable to reproduce the failure locally, however. llvm-svn: 302504
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 6aa755df147..50313e2da88 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -4957,6 +4957,20 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
// virtual register info from the FuncInfo.ValueMap.
if (!EmitFuncArgumentDbgValue(Address, Variable, Expression, dl, 0, true,
N)) {
+ // If variable is pinned by a alloca in dominating bb then
+ // use StaticAllocaMap.
+ if (const AllocaInst *AI = dyn_cast<AllocaInst>(Address)) {
+ if (AI->getParent() != DI.getParent()) {
+ DenseMap<const AllocaInst*, int>::iterator SI =
+ FuncInfo.StaticAllocaMap.find(AI);
+ if (SI != FuncInfo.StaticAllocaMap.end()) {
+ SDV = DAG.getFrameIndexDbgValue(Variable, Expression, SI->second,
+ 0, dl, SDNodeOrder);
+ DAG.AddDbgValue(SDV, nullptr, false);
+ return nullptr;
+ }
+ }
+ }
DEBUG(dbgs() << "Dropping debug info for " << DI << "\n");
}
}
OpenPOWER on IntegriCloud