summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2017-10-24 22:55:12 +0000
committerAdrian Prantl <aprantl@apple.com>2017-10-24 22:55:12 +0000
commit2eb7cbf987f21b4d573af41d11b327d7257d4fe2 (patch)
tree537cf866e3bace697e9ed5da8173e15c44aaa7c8 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parent4f00a71af56e9707711dd44d92f4a9216808076f (diff)
downloadbcm5719-llvm-2eb7cbf987f21b4d573af41d11b327d7257d4fe2.tar.gz
bcm5719-llvm-2eb7cbf987f21b4d573af41d11b327d7257d4fe2.zip
Implement salavageDebugInfo functionality for SelectionDAG.
Similar to how llvm::salvagDebugInfo hooks into InstCombine, this adds a hook that can be invoked before an SDNode that is associated with an SDDbgValue is erased to capture the effect of the deleted node in a DIExpression. The motivating example is an SDDebugValue attached to an ADD operation that gets folded into a LOAD+OFFSET operation. rdar://problem/32121503 llvm-svn: 316525
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 5311ef437e9..4c4d196427e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -3550,6 +3550,7 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
"NodeToMatch was removed partway through selection");
SelectionDAG::DAGNodeDeletedListener NDL(*CurDAG, [&](SDNode *N,
SDNode *E) {
+ CurDAG->salvageDebugInfo(*N);
auto &Chain = ChainNodesMatched;
assert((!E || !is_contained(Chain, N)) &&
"Chain node replaced during MorphNode");
OpenPOWER on IntegriCloud