replacing nodes in the legalizer.
This caught a number of bugs for me during development.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214022
91177308-0d34-0410-b5e6-
96231b3b80d8
}
}
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));