diff options
author | Chris Lattner <sabre@nondot.org> | 2005-08-16 18:16:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-08-16 18:16:24 +0000 |
commit | 1b95095857b78e12138c22e76c7936611c51355b (patch) | |
tree | 0cfbe5e7d90663ac695896638b5c14ea750ce34e /include/llvm/CodeGen/SelectionDAGNodes.h | |
parent | 7c5a3d390a463fb50a6eee7ae3174817925e6d28 (diff) |
add some methods for dag->dag isel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22800 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/SelectionDAGNodes.h')
-rw-r--r-- | include/llvm/CodeGen/SelectionDAGNodes.h | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index d1273bc1ba..f0bc0e3ccb 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -592,10 +592,17 @@ protected: NodeDepth = ND+1; } - virtual ~SDNode() { - // FIXME: Drop uses. - } + virtual ~SDNode() {} + /// MorphNodeTo - This clears the return value and operands list, and sets the + /// opcode of the node to the specified value. This should only be used by + /// the SelectionDAG class. + void MorphNodeTo(unsigned Opc) { + NodeType = Opc; + Values.clear(); + Operands.clear(); + } + void setValueTypes(MVT::ValueType VT) { Values.reserve(1); Values.push_back(VT); @@ -609,7 +616,22 @@ protected: void setValueTypes(std::vector<MVT::ValueType> &VTs) { std::swap(Values, VTs); } - + + void setOperands(SDOperand Op0) { + Operands.reserve(1); + Operands.push_back(Op0); + } + void setOperands(SDOperand Op0, SDOperand Op1) { + Operands.reserve(2); + Operands.push_back(Op0); + Operands.push_back(Op1); + } + void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2) { + Operands.reserve(3); + Operands.push_back(Op0); + Operands.push_back(Op1); + Operands.push_back(Op2); + } void removeUser(SDNode *User) { // Remove this user from the operand's use list. for (unsigned i = Uses.size(); ; --i) { |