summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-07-26 05:53:16 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-07-26 05:53:16 +0000
commit5a85c7beb896adccd5ad07fc11d31cf2c2fd7964 (patch)
tree0481e698abf05f9c1427d9ee7d161f209c44155e /llvm/lib/CodeGen
parent98655fa4d8205b72fd4b032f899f1f09c25245d7 (diff)
downloadbcm5719-llvm-5a85c7beb896adccd5ad07fc11d31cf2c2fd7964.tar.gz
bcm5719-llvm-5a85c7beb896adccd5ad07fc11d31cf2c2fd7964.zip
[SDAG] Add an assert that we don't mess up the number of values when
replacing nodes in the legalizer. This caught a number of bugs for me during development. llvm-svn: 214022
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 96e569e7b64..0275990dcdf 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -180,6 +180,9 @@ public:
}
}
void ReplaceNode(SDNode *Old, SDNode *New) {
+ assert(Old->getNumValues() == New->getNumValues() &&
+ "Replacing one node with another that produces a different number "
+ "of values!");
DAG.ReplaceAllUsesWith(Old, New);
for (unsigned i = 0, e = Old->getNumValues(); i != e; ++i)
DAG.TransferDbgValues(SDValue(Old, i), SDValue(New, i));
OpenPOWER on IntegriCloud