diff options
author | Chris Lattner <sabre@nondot.org> | 2006-01-24 05:48:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-01-24 05:48:21 +0000 |
commit | 6a5428934ba6159c1acc541944332e51a6cfa59a (patch) | |
tree | 76400606d90ae4c00783fd0a4e4601167593b285 /lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 1e326009fad277b5dd39fd6639c06d7f1c01c255 (diff) |
Fix an infinite loop I caused by making sure to legalize the flag operand
of CALLSEQ_* nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25582 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index c1ba5ebc4a..ed96bd61ae 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/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, |