[llvm-commits] CVS: llvm/lib/Target/Sparc/PeepholeOpts.cpp

Alkis Evlogimenos alkis at cs.uiuc.edu
Fri Feb 13 19:19:30 PST 2004


Changes in directory llvm/lib/Target/Sparc:

PeepholeOpts.cpp updated: 1.20 -> 1.21

---
Log message:

Use newly added next() and prior() utility functions.


---
Diffs of the changes:  (+2 -1)

Index: llvm/lib/Target/Sparc/PeepholeOpts.cpp
diff -u llvm/lib/Target/Sparc/PeepholeOpts.cpp:1.20 llvm/lib/Target/Sparc/PeepholeOpts.cpp:1.21
--- llvm/lib/Target/Sparc/PeepholeOpts.cpp:1.20	Fri Feb 13 15:01:20 2004
+++ llvm/lib/Target/Sparc/PeepholeOpts.cpp	Fri Feb 13 19:18:34 2004
@@ -19,6 +19,7 @@
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/Target/TargetInstrInfo.h"
 #include "llvm/Target/TargetMachine.h"
+#include "Support/STLExtras.h"
 
 namespace llvm {
 
@@ -31,7 +32,7 @@
   // Check if this instruction is in a delay slot of its predecessor.
   if (BBI != mvec.begin()) {
       const TargetInstrInfo& mii = target.getInstrInfo();
-      MachineBasicBlock::iterator predMI = BBI; --predMI;
+      MachineBasicBlock::iterator predMI = prior(BBI);
       if (unsigned ndelay = mii.getNumDelaySlots(predMI->getOpcode())) {
         // This instruction is in a delay slot of its predecessor, so
         // replace it with a nop. By replacing in place, we save having





More information about the llvm-commits mailing list