From f81af21caf9c0f62c60b72762d9a927e8c24f679 Mon Sep 17 00:00:00 2001 From: Alkis Evlogimenos Date: Sat, 14 Feb 2004 01:18:34 +0000 Subject: 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 --- lib/CodeGen/TwoAddressInstructionPass.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/CodeGen/TwoAddressInstructionPass.cpp') diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp index 8dc2ffe365..6f1e990140 100644 --- a/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -38,6 +38,7 @@ #include "llvm/Target/TargetMachine.h" #include "Support/Debug.h" #include "Support/Statistic.h" +#include "Support/STLExtras.h" #include using namespace llvm; @@ -134,8 +135,7 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) { unsigned Added = MRI.copyRegToReg(*mbbi, mi, regA, regB, rc); numInstrsAdded += Added; - MachineBasicBlock::iterator prevMi = mi; - --prevMi; + MachineBasicBlock::iterator prevMi = prior(mi); DEBUG(std::cerr << "\t\tadded instruction: "; prevMi->print(std::cerr, TM)); -- cgit v1.2.3