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

Chris Lattner lattner at cs.uiuc.edu
Mon Jun 16 17:30:04 PDT 2003


Changes in directory llvm/lib/CodeGen/InstrSelection:

InstrForest.cpp updated: 1.42 -> 1.43

---
Log message:

Actually, change it to use explicit new/delete, which is more likely to be
optimized INTO an alloca


---
Diffs of the changes:

Index: llvm/lib/CodeGen/InstrSelection/InstrForest.cpp
diff -u llvm/lib/CodeGen/InstrSelection/InstrForest.cpp:1.42 llvm/lib/CodeGen/InstrSelection/InstrForest.cpp:1.43
--- llvm/lib/CodeGen/InstrSelection/InstrForest.cpp:1.42	Mon Jun 16 17:18:28 2003
+++ llvm/lib/CodeGen/InstrSelection/InstrForest.cpp	Mon Jun 16 17:29:09 2003
@@ -255,7 +255,7 @@
   // if a fixed array is too small.
   // 
   int numChildren = 0;
-  std::vector<InstrTreeNode*> childArray(instr->getNumOperands());
+  InstrTreeNode** childArray = new InstrTreeNode*[instr->getNumOperands()];
   
   //
   // Walk the operands of the instruction
@@ -362,6 +362,7 @@
       assert(n == 1);
       setRightChild(parent, childArray[numChildren - 1]);
     }
-  
+
+  delete [] childArray;
   return treeNode;
 }





More information about the llvm-commits mailing list