[llvm-commits] CVS: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Wed Apr 7 15:41:42 PDT 2004


Changes in directory reopt/lib/LightWtProfiling:

UnpackTraceFunction.cpp updated: 1.49 -> 1.50

---
Log message:

Fix bug in "mvec" handling -- need to clear out the mvec each time we intend to
use it. Also, there was an operand which was supposed to be a Def, which was
marked as use-and-def.


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

Index: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp
diff -u reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.49 reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.50
--- reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.49	Wed Apr  7 13:32:55 2004
+++ reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp	Wed Apr  7 15:39:12 2004
@@ -185,21 +185,22 @@
   unsigned stackSize = getStaticStackSize (MF);
   int Size = (stackSize + 32 * 8);
   E.push_back (BuildMI (V9::ADDi, 3).addMReg (sp).addSImm (-Size).addMReg (sp,
-    MachineOperand::UseAndDef));
+    MachineOperand::Def));
 
   // 2. Save used registers onto the stack.
   std::vector<MachineInstr *> mvec;
   int RegType;
   for (std::set<unsigned>::iterator i = regSet.begin (), e = regSet.end ();
     i != e; ++i) {
+    mvec.clear ();
     unsigned R = *i;
     unsigned RegType = TRI.getRegType (R);
     TRI.cpReg2MemMI (mvec, R, sp, stackSize + R * 8, RegType);
     // Add whatever the TargetRegInfo gave us to the MachineBasicBlock we were
     // provided.
-    for (std::vector<MachineInstr *>::iterator i = mvec.begin (),
-           e = mvec.end (); i != e; ++i)
-      E.push_back (*i);
+    for (std::vector<MachineInstr *>::iterator vi = mvec.begin (),
+           ve = mvec.end (); vi != ve; ++vi)
+      E.push_back (*vi);
   }
   
 }





More information about the llvm-commits mailing list