aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/PHIElimination.cpp
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-02-14 01:18:34 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-02-14 01:18:34 +0000
commitf81af21caf9c0f62c60b72762d9a927e8c24f679 (patch)
tree6b7865d9540825fa4d391794ff356793a5dfc235 /lib/CodeGen/PHIElimination.cpp
parentbc79471be19e412eed4d270908db7ac945be10ca (diff)
downloadexternal_llvm-f81af21caf9c0f62c60b72762d9a927e8c24f679.zip
external_llvm-f81af21caf9c0f62c60b72762d9a927e8c24f679.tar.gz
external_llvm-f81af21caf9c0f62c60b72762d9a927e8c24f679.tar.bz2
Use newly added next() and prior() utility functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11430 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PHIElimination.cpp')
-rw-r--r--lib/CodeGen/PHIElimination.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp
index e0025f9..0630582 100644
--- a/lib/CodeGen/PHIElimination.cpp
+++ b/lib/CodeGen/PHIElimination.cpp
@@ -20,6 +20,7 @@
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/CFG.h"
+#include "Support/STLExtras.h"
namespace llvm {
@@ -171,8 +172,7 @@ bool PNE::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB) {
bool HaveNotEmitted = true;
if (I != opBlock.begin()) {
- MachineBasicBlock::iterator PrevInst = I;
- --PrevInst;
+ MachineBasicBlock::iterator PrevInst = prior(I);
for (unsigned i = 0, e = PrevInst->getNumOperands(); i != e; ++i) {
MachineOperand &MO = PrevInst->getOperand(i);
if (MO.isRegister() && MO.getReg() == IncomingReg)
@@ -253,8 +253,7 @@ bool PNE::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB) {
// kills the incoming value!
//
if (!ValueIsLive) {
- MachineBasicBlock::iterator Prev = I;
- --Prev;
+ MachineBasicBlock::iterator Prev = prior(I);
LV->addVirtualRegisterKilled(SrcReg, &opBlock, Prev);
}
}