OSDN Git Service

eliminate some extraneous methods in SDNode
authorChris Lattner <sabre@nondot.org>
Sun, 4 Feb 2007 02:32:44 +0000 (02:32 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 4 Feb 2007 02:32:44 +0000 (02:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33867 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/SelectionDAGNodes.h
lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index e60c856..4a40e83 100644 (file)
@@ -990,31 +990,6 @@ protected:
     NumValues = L.NumVTs;
   }
   
-  void setOperands(SDOperand Op0) {
-    assert(NumOperands == 0 && "Should not have operands yet!");
-    OperandList = new SDOperand[1];
-    OperandList[0] = Op0;
-    NumOperands = 1;
-    Op0.Val->Uses.push_back(this);
-  }
-  void setOperands(SDOperand Op0, SDOperand Op1) {
-    assert(NumOperands == 0 && "Should not have operands yet!");
-    OperandList = new SDOperand[2];
-    OperandList[0] = Op0;
-    OperandList[1] = Op1;
-    NumOperands = 2;
-    Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this);
-  }
-  void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2) {
-    assert(NumOperands == 0 && "Should not have operands yet!");
-    OperandList = new SDOperand[3];
-    OperandList[0] = Op0;
-    OperandList[1] = Op1;
-    OperandList[2] = Op2;
-    NumOperands = 3;
-    Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this);
-    Op2.Val->Uses.push_back(this);
-  }
   void setOperands(const SDOperand *Ops, unsigned NumOps) {
     assert(NumOperands == 0 && "Should not have operands yet!");
     NumOperands = NumOps;
index 9c765b1..0370cc1 100644 (file)
@@ -2103,9 +2103,11 @@ SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
     return ON;
                                        
   RemoveNodeFromCSEMaps(N);
+  SDOperand OperandList[] = { Op1 };
+  
   N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
   N->setValueTypes(VTs);
-  N->setOperands(Op1);
+  N->setOperands(OperandList, 1);
   CSEMap.InsertNode(N, IP);
   return N;
 }
@@ -2122,9 +2124,12 @@ SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
     return ON;
                                        
   RemoveNodeFromCSEMaps(N);
+  
+  SDOperand OperandList[] = { Op1, Op2 };
+
   N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
   N->setValueTypes(VTs);
-  N->setOperands(Op1, Op2);
+  N->setOperands(OperandList, 2);
   
   CSEMap.InsertNode(N, IP);   // Memoize the new node.
   return N;
@@ -2142,9 +2147,11 @@ SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
     return ON;
                                        
   RemoveNodeFromCSEMaps(N);
+  
+  SDOperand OperandList[] = { Op1, Op2, Op3 };
   N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
   N->setValueTypes(VTs);
-  N->setOperands(Op1, Op2, Op3);
+  N->setOperands(OperandList, 3);
 
   CSEMap.InsertNode(N, IP);   // Memoize the new node.
   return N;
@@ -2181,9 +2188,11 @@ SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
     return ON;
 
   RemoveNodeFromCSEMaps(N);
+
+  SDOperand OperandList[] = { Op1, Op2 };
   N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
   N->setValueTypes(VTs);
-  N->setOperands(Op1, Op2);
+  N->setOperands(OperandList, 2);
   
   CSEMap.InsertNode(N, IP);   // Memoize the new node.
   return N;
@@ -2202,9 +2211,11 @@ SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
     return ON;
 
   RemoveNodeFromCSEMaps(N);
+
+  SDOperand OperandList[] = { Op1, Op2, Op3 };
   N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
   N->setValueTypes(VTs);
-  N->setOperands(Op1, Op2, Op3);
+  N->setOperands(OperandList, 3);
   
   CSEMap.InsertNode(N, IP);   // Memoize the new node.
   return N;