/// 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) {
+ void MorphNodeTo(unsigned Opc, SDVTList L) {
NodeType = Opc;
- ValueList = 0;
- NumValues = 0;
+ ValueList = L.VTs;
+ NumValues = L.NumVTs;
// Clear the operands list, updating used nodes to remove this from their
// use list.
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
public:
HandleSDNode(SDOperand X) : SDNode(ISD::HANDLENODE, X) {}
- ~HandleSDNode() {
- MorphNodeTo(ISD::HANDLENODE); // Drops operand uses.
- }
-
+ ~HandleSDNode();
SDOperand getValue() const { return getOperand(0); }
};
RemoveNodeFromCSEMaps(N);
- N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
- N->setValueTypes(VTs);
+ N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc, VTs);
CSEMap.InsertNode(N, IP);
return N;
RemoveNodeFromCSEMaps(N);
SDOperand OperandList[] = { Op1 };
- N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
- N->setValueTypes(VTs);
+ N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc, VTs);
N->setOperands(OperandList, 1);
CSEMap.InsertNode(N, IP);
return N;
SDOperand OperandList[] = { Op1, Op2 };
- N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
- N->setValueTypes(VTs);
+ N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc, VTs);
N->setOperands(OperandList, 2);
CSEMap.InsertNode(N, IP); // Memoize the new node.
RemoveNodeFromCSEMaps(N);
SDOperand OperandList[] = { Op1, Op2, Op3 };
- N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
- N->setValueTypes(VTs);
+ N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc, VTs);
N->setOperands(OperandList, 3);
CSEMap.InsertNode(N, IP); // Memoize the new node.
return ON;
RemoveNodeFromCSEMaps(N);
- N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
- N->setValueTypes(VTs);
+ N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc, VTs);
N->setOperands(Ops, NumOps);
CSEMap.InsertNode(N, IP); // Memoize the new node.
RemoveNodeFromCSEMaps(N);
SDOperand OperandList[] = { Op1, Op2 };
- N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
- N->setValueTypes(VTs);
+ N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc, VTs);
N->setOperands(OperandList, 2);
CSEMap.InsertNode(N, IP); // Memoize the new node.
RemoveNodeFromCSEMaps(N);
SDOperand OperandList[] = { Op1, Op2, Op3 };
- N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
- N->setValueTypes(VTs);
+ N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc, VTs);
N->setOperands(OperandList, 3);
CSEMap.InsertNode(N, IP); // Memoize the new node.
void LoadSDNode::ANCHOR() {}
void StoreSDNode::ANCHOR() {}
+HandleSDNode::~HandleSDNode() {
+ SDVTList VTs = { 0, 0 };
+ MorphNodeTo(ISD::HANDLENODE, VTs); // Drops operand uses.
+}
+
+
/// Profile - Gather unique data for the node.
///
void SDNode::Profile(FoldingSetNodeID &ID) {