summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2014-04-24 23:53:29 +0000
committerAdrian Prantl <aprantl@apple.com>2014-04-24 23:53:29 +0000
commit5ad11841f7fe4ae35165e34fb5574f2e4e8499ed (patch)
tree009a28061bdf37588667007439eb2d3d052fae8a /llvm/lib/Transforms/Utils
parentab1cb0990d9fa22f5f800fea20eb2c5dc8fa5b28 (diff)
downloadbcm5719-llvm-5ad11841f7fe4ae35165e34fb5574f2e4e8499ed.tar.gz
bcm5719-llvm-5ad11841f7fe4ae35165e34fb5574f2e4e8499ed.zip
Revert "Debug info: Let dbg.values inserted by LowerDbgDeclare inherit the location"
This reverts commit 207130 for buildbot breakage. llvm-svn: 207159
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 9199ed79127..e2ba0473fd1 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -995,7 +995,14 @@ bool llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
DbgVal = Builder.insertDbgValueIntrinsic(ExtendedArg, 0, DIVar, SI);
else
DbgVal = Builder.insertDbgValueIntrinsic(SI->getOperand(0), 0, DIVar, SI);
- DbgVal->setDebugLoc(DDI->getDebugLoc());
+
+ // Propagate any debug metadata from the store onto the dbg.value.
+ DebugLoc SIDL = SI->getDebugLoc();
+ if (!SIDL.isUnknown())
+ DbgVal->setDebugLoc(SIDL);
+ // Otherwise propagate debug metadata from dbg.declare.
+ else
+ DbgVal->setDebugLoc(DDI->getDebugLoc());
return true;
}
@@ -1015,7 +1022,14 @@ bool llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
Instruction *DbgVal =
Builder.insertDbgValueIntrinsic(LI->getOperand(0), 0,
DIVar, LI);
- DbgVal->setDebugLoc(DDI->getDebugLoc());
+
+ // Propagate any debug metadata from the store onto the dbg.value.
+ DebugLoc LIDL = LI->getDebugLoc();
+ if (!LIDL.isUnknown())
+ DbgVal->setDebugLoc(LIDL);
+ // Otherwise propagate debug metadata from dbg.declare.
+ else
+ DbgVal->setDebugLoc(DDI->getDebugLoc());
return true;
}
@@ -1054,7 +1068,7 @@ bool llvm::LowerDbgDeclare(Function &F) {
auto DbgVal =
DIB.insertDbgValueIntrinsic(AI, 0,
DIVariable(DDI->getVariable()), I);
- DbgVal->setDebugLoc(DDI->getDebugLoc());
+ DbgVal->setDebugLoc(I->getDebugLoc());
}
DDI->eraseFromParent();
}
OpenPOWER on IntegriCloud