[llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp MachOWriter.cpp

Chris Lattner sabre at nondot.org
Sat Feb 10 12:32:15 PST 2007



Changes in directory llvm/lib/CodeGen:

AsmPrinter.cpp updated: 1.148 -> 1.149
MachOWriter.cpp updated: 1.25 -> 1.26
---
Log message:

eliminate temporary vectors.


---
Diffs of the changes:  (+5 -4)

 AsmPrinter.cpp  |    5 +++--
 MachOWriter.cpp |    4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)


Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.148 llvm/lib/CodeGen/AsmPrinter.cpp:1.149
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.148	Sat Feb 10 13:59:22 2007
+++ llvm/lib/CodeGen/AsmPrinter.cpp	Sat Feb 10 14:31:59 2007
@@ -613,8 +613,9 @@
     case Instruction::GetElementPtr: {
       // generate a symbolic expression for the byte address
       const Constant *ptrVal = CE->getOperand(0);
-      std::vector<Value*> idxVec(CE->op_begin()+1, CE->op_end());
-      if (int64_t Offset = TD->getIndexedOffset(ptrVal->getType(), idxVec)) {
+      SmallVector<Value*, 8> idxVec(CE->op_begin()+1, CE->op_end());
+      if (int64_t Offset = TD->getIndexedOffset(ptrVal->getType(), &idxVec[0],
+                                                idxVec.size())) {
         if (Offset)
           O << "(";
         EmitConstantValueOnly(ptrVal);


Index: llvm/lib/CodeGen/MachOWriter.cpp
diff -u llvm/lib/CodeGen/MachOWriter.cpp:1.25 llvm/lib/CodeGen/MachOWriter.cpp:1.26
--- llvm/lib/CodeGen/MachOWriter.cpp:1.25	Sat Feb 10 13:55:17 2007
+++ llvm/lib/CodeGen/MachOWriter.cpp	Sat Feb 10 14:31:59 2007
@@ -779,9 +779,9 @@
       //
       switch (CE->getOpcode()) {
       case Instruction::GetElementPtr: {
-        std::vector<Value*> Indexes(CE->op_begin()+1, CE->op_end());
+        SmallVector<Value*, 8> Indices(CE->op_begin()+1, CE->op_end());
         ScatteredOffset = TD->getIndexedOffset(CE->getOperand(0)->getType(),
-                                               Indexes);
+                                               &Indices[0], Indices.size());
         WorkList.push_back(CPair(CE->getOperand(0), PA));
         break;
       }






More information about the llvm-commits mailing list