Use buildmi not MI ctor directly
authorChris Lattner <sabre@nondot.org>
Wed, 15 Jan 2003 18:08:07 +0000 (18:08 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 15 Jan 2003 18:08:07 +0000 (18:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5293 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegAlloc/PhyRegAlloc.cpp
lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp

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