summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-24 05:48:21 +0000
committerChris Lattner <sabre@nondot.org>2006-01-24 05:48:21 +0000
commitf9a1e3aadcbc7239ec59ce37325542b6484358df (patch)
tree230f9cdcba49c7eca0c74380dbd98b784216e292 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent78c38a7bc7891b2714c6e79607be684e87709df9 (diff)
downloadbcm5719-llvm-f9a1e3aadcbc7239ec59ce37325542b6484358df.tar.gz
bcm5719-llvm-f9a1e3aadcbc7239ec59ce37325542b6484358df.zip
Fix an infinite loop I caused by making sure to legalize the flag operand
of CALLSEQ_* nodes llvm-svn: 25582
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index c1ba5ebc4ab..ed96bd61ae2 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1276,6 +1276,19 @@ void SDNode::setAdjCallChain(SDOperand N) {
OperandList[0].Val->Uses.push_back(this);
}
+// setAdjCallFlag - This method changes the flag input of an
+// CALLSEQ_START/END node to be the specified operand.
+void SDNode::setAdjCallFlag(SDOperand N) {
+ assert(N.getValueType() == MVT::Flag);
+ assert((getOpcode() == ISD::CALLSEQ_START ||
+ getOpcode() == ISD::CALLSEQ_END) && "Cannot adjust this node!");
+
+ SDOperand &FlagOp = OperandList[getNumOperands()-1];
+ assert(FlagOp.getValueType() == MVT::Flag);
+ FlagOp.Val->removeUser(this);
+ FlagOp = N;
+ FlagOp.Val->Uses.push_back(this);
+}
SDOperand SelectionDAG::getLoad(MVT::ValueType VT,
OpenPOWER on IntegriCloud