[llvm-commits] CVS: llvm/lib/CodeGen/InstrSelection/InstrForest.cpp

John Criswell criswell at choi.cs.uiuc.edu
Thu Jun 26 16:38:51 PDT 2003


Changes in directory llvm/lib/CodeGen/InstrSelection:

InstrForest.cpp updated: 1.40.2.1 -> 1.40.2.2

---
Log message:

Merged with mainline on Thursday, June 26, 2003.


---
Diffs of the changes:

Index: llvm/lib/CodeGen/InstrSelection/InstrForest.cpp
diff -u llvm/lib/CodeGen/InstrSelection/InstrForest.cpp:1.40.2.1 llvm/lib/CodeGen/InstrSelection/InstrForest.cpp:1.40.2.2
--- llvm/lib/CodeGen/InstrSelection/InstrForest.cpp:1.40.2.1	Mon Jun 23 14:07:05 2003
+++ llvm/lib/CodeGen/InstrSelection/InstrForest.cpp	Thu Jun 26 16:35:16 2003
@@ -22,8 +22,6 @@
 #include "llvm/CodeGen/MachineInstr.h"
 #include "Support/STLExtras.h"
 #include "Config/alloca.h"
-using std::cerr;
-using std::vector;
 
 //------------------------------------------------------------------------ 
 // class InstrTreeNode
@@ -117,9 +115,9 @@
 InstructionNode::dumpNode(int indent) const
 {
   for (int i=0; i < indent; i++)
-    cerr << "    ";
-  cerr << getInstruction()->getOpcodeName()
-       << " [label " << getOpLabel() << "]" << "\n";
+    std::cerr << "    ";
+  std::cerr << getInstruction()->getOpcodeName()
+            << " [label " << getOpLabel() << "]" << "\n";
 }
 
 
@@ -127,9 +125,9 @@
 VRegListNode::dumpNode(int indent) const
 {
   for (int i=0; i < indent; i++)
-    cerr << "    ";
+    std::cerr << "    ";
   
-  cerr << "List" << "\n";
+  std::cerr << "List" << "\n";
 }
 
 
@@ -137,29 +135,29 @@
 VRegNode::dumpNode(int indent) const
 {
   for (int i=0; i < indent; i++)
-    cerr << "    ";
+    std::cerr << "    ";
   
-  cerr << "VReg " << getValue() << "\t(type "
-       << (int) getValue()->getValueType() << ")" << "\n";
+  std::cerr << "VReg " << getValue() << "\t(type "
+            << (int) getValue()->getValueType() << ")" << "\n";
 }
 
 void
 ConstantNode::dumpNode(int indent) const
 {
   for (int i=0; i < indent; i++)
-    cerr << "    ";
+    std::cerr << "    ";
   
-  cerr << "Constant " << getValue() << "\t(type "
-       << (int) getValue()->getValueType() << ")" << "\n";
+  std::cerr << "Constant " << getValue() << "\t(type "
+            << (int) getValue()->getValueType() << ")" << "\n";
 }
 
 void
 LabelNode::dumpNode(int indent) const
 {
   for (int i=0; i < indent; i++)
-    cerr << "    ";
+    std::cerr << "    ";
   
-  cerr << "Label " << getValue() << "\n";
+  std::cerr << "Label " << getValue() << "\n";
 }
 
 //------------------------------------------------------------------------
@@ -258,8 +256,7 @@
   // if a fixed array is too small.
   // 
   int numChildren = 0;
-  InstrTreeNode **childArray =
-    (InstrTreeNode **)alloca(instr->getNumOperands()*sizeof(InstrTreeNode *));
+  InstrTreeNode** childArray = new InstrTreeNode*[instr->getNumOperands()];
   
   //
   // Walk the operands of the instruction
@@ -366,6 +363,7 @@
       assert(n == 1);
       setRightChild(parent, childArray[numChildren - 1]);
     }
-  
+
+  delete [] childArray;
   return treeNode;
 }





More information about the llvm-commits mailing list