Use buildmi not MI ctor directly

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5293 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-01-15 18:08:07 +00:00
parent 1fbaa0a1ef
commit f6ee49fcf0
2 changed files with 4 additions and 6 deletions

View File

@ -8,7 +8,7 @@
#include "llvm/CodeGen/RegAllocCommon.h" #include "llvm/CodeGen/RegAllocCommon.h"
#include "llvm/CodeGen/IGNode.h" #include "llvm/CodeGen/IGNode.h"
#include "llvm/CodeGen/PhyRegAlloc.h" #include "llvm/CodeGen/PhyRegAlloc.h"
#include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineInstrAnnot.h" #include "llvm/CodeGen/MachineInstrAnnot.h"
#include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionInfo.h" #include "llvm/CodeGen/MachineFunctionInfo.h"
@ -578,8 +578,7 @@ void PhyRegAlloc::updateMachineCode() {
// needs spill code inserted before or after it. // needs spill code inserted before or after it.
// Move it before the preceding branch. // Move it before the preceding branch.
InsertBefore(MInst, MBB, --MII); InsertBefore(MInst, MBB, --MII);
MachineInstr* nopI = MachineInstr* nopI = BuildMI(TM.getInstrInfo().getNOPOpCode(),1);
new MachineInstr(TM.getInstrInfo().getNOPOpCode());
SubstituteInPlace(nopI, MBB, MII+1); // replace orig with NOP SubstituteInPlace(nopI, MBB, MII+1); // replace orig with NOP
--MII; // point to MInst in new location --MII; // point to MInst in new location
bumpIteratorBy = 2; // later skip the branch and the NOP! bumpIteratorBy = 2; // later skip the branch and the NOP!

View File

@ -8,7 +8,7 @@
#include "llvm/CodeGen/RegAllocCommon.h" #include "llvm/CodeGen/RegAllocCommon.h"
#include "llvm/CodeGen/IGNode.h" #include "llvm/CodeGen/IGNode.h"
#include "llvm/CodeGen/PhyRegAlloc.h" #include "llvm/CodeGen/PhyRegAlloc.h"
#include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineInstrAnnot.h" #include "llvm/CodeGen/MachineInstrAnnot.h"
#include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionInfo.h" #include "llvm/CodeGen/MachineFunctionInfo.h"
@ -578,8 +578,7 @@ void PhyRegAlloc::updateMachineCode() {
// needs spill code inserted before or after it. // needs spill code inserted before or after it.
// Move it before the preceding branch. // Move it before the preceding branch.
InsertBefore(MInst, MBB, --MII); InsertBefore(MInst, MBB, --MII);
MachineInstr* nopI = MachineInstr* nopI = BuildMI(TM.getInstrInfo().getNOPOpCode(),1);
new MachineInstr(TM.getInstrInfo().getNOPOpCode());
SubstituteInPlace(nopI, MBB, MII+1); // replace orig with NOP SubstituteInPlace(nopI, MBB, MII+1); // replace orig with NOP
--MII; // point to MInst in new location --MII; // point to MInst in new location
bumpIteratorBy = 2; // later skip the branch and the NOP! bumpIteratorBy = 2; // later skip the branch and the NOP!