aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-01-27 17:43:53 +0000
committerDevang Patel <dpatel@apple.com>2011-01-27 17:43:53 +0000
commitbfae5f312c5a726687b4f2201681fb5519568e14 (patch)
tree69757ddccfd3b8748c325d0c7d2528baae5ba113 /lib
parent54b0f4f2a42919e9073c7220394cbc2d2b23f9bf (diff)
downloadexternal_llvm-bfae5f312c5a726687b4f2201681fb5519568e14.zip
external_llvm-bfae5f312c5a726687b4f2201681fb5519568e14.tar.gz
external_llvm-bfae5f312c5a726687b4f2201681fb5519568e14.tar.bz2
While legalizing SDValues do not drop SDDbgValues, trasfer them to new legal nodes.
Take 2. This includes fix for dragonegg crash. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124380 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp3
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp2
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 9c35b40..f588dd0 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -87,6 +87,9 @@ class SelectionDAGLegalize {
// If someone requests legalization of the new node, return itself.
if (From != To)
LegalizedNodes.insert(std::make_pair(To, To));
+
+ // Transfer SDDbgValues.
+ DAG.TransferDbgValues(From, To);
}
public:
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index d14cae3..17be6b1 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -5474,7 +5474,6 @@ void SelectionDAG::TransferDbgValues(SDValue From, SDValue To) {
SDNode *FromNode = From.getNode();
SDNode *ToNode = To.getNode();
SmallVector<SDDbgValue*,2> &DVs = GetDbgValues(FromNode);
- DbgInfo->removeSDDbgValues(FromNode);
for (SmallVector<SDDbgValue *, 2>::iterator I = DVs.begin(), E = DVs.end();
I != E; ++I) {
if ((*I)->getKind() == SDDbgValue::SDNODE) {
@@ -5482,6 +5481,7 @@ void SelectionDAG::TransferDbgValues(SDValue From, SDValue To) {
(*I)->setSDNode(ToNode, To.getResNo());
}
}
+ DbgInfo->removeSDDbgValues(FromNode);
}
//===----------------------------------------------------------------------===//