Reduce dependencies in the ARM MC instruction printer.
[oota-llvm.git] / lib / CodeGen / MachineRegisterInfo.cpp
index 64a3753ab07c04a2eec4354c2f0b1ab8b1d88cda..5d852f26beda66908799a6259dd54d63e739378d 100644 (file)
@@ -194,12 +194,9 @@ MachineRegisterInfo::EmitLiveInCopies(MachineBasicBlock *EntryMBB,
         --i; --e;
       } else {
         // Emit a copy.
-        const TargetRegisterClass *RC = getRegClass(LiveIns[i].second);
-        bool Emitted = TII.copyRegToReg(*EntryMBB, EntryMBB->begin(),
-                                        LiveIns[i].second, LiveIns[i].first,
-                                        RC, RC, DebugLoc());
-        assert(Emitted && "Unable to issue a live-in copy instruction!\n");
-        (void) Emitted;
+        BuildMI(*EntryMBB, EntryMBB->begin(), DebugLoc(),
+                TII.get(TargetOpcode::COPY), LiveIns[i].second)
+          .addReg(LiveIns[i].first);
 
         // Add the register to the entry block live-in set.
         EntryMBB->addLiveIn(LiveIns[i].first);