[llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp

Alkis Evlogimenos alkis at cs.uiuc.edu
Wed Aug 4 01:33:31 PDT 2004



Changes in directory llvm/lib/Bytecode/Writer:

Writer.cpp updated: 1.72 -> 1.73
---
Log message:

Stop using getValues().


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

Index: llvm/lib/Bytecode/Writer/Writer.cpp
diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.72 llvm/lib/Bytecode/Writer/Writer.cpp:1.73
--- llvm/lib/Bytecode/Writer/Writer.cpp:1.72	Sun Jul 25 16:32:02 2004
+++ llvm/lib/Bytecode/Writer/Writer.cpp	Wed Aug  4 03:33:20 2004
@@ -338,7 +338,7 @@
     const ConstantArray *CPA = cast<ConstantArray>(CPV);
     assert(!CPA->isString() && "Constant strings should be handled specially!");
 
-    for (unsigned i = 0; i != CPA->getNumOperands(); ++i) {
+    for (unsigned i = 0, e = CPA->getNumOperands(); i != e; ++i) {
       int Slot = Table.getSlot(CPA->getOperand(i));
       assert(Slot != -1 && "Constant used but not available!!");
       output_vbr((unsigned)Slot);
@@ -348,10 +348,9 @@
 
   case Type::StructTyID: {
     const ConstantStruct *CPS = cast<ConstantStruct>(CPV);
-    const std::vector<Use> &Vals = CPS->getValues();
 
-    for (unsigned i = 0; i < Vals.size(); ++i) {
-      int Slot = Table.getSlot(Vals[i]);
+    for (unsigned i = 0, e = CPS->getNumOperands(); i != e; ++i) {
+      int Slot = Table.getSlot(CPS->getOperand(i));
       assert(Slot != -1 && "Constant used but not available!!");
       output_vbr((unsigned)Slot);
     }






More information about the llvm-commits mailing list