The BLX instruction is encoded differently than the BL, because why not? In
[oota-llvm.git] / lib / CodeGen / MachineInstr.cpp
index 6f0b9719e1a323b51ccd9957ec62ad0973eae010..bc2a545a5f279d6e6ba1a16be648bc99593c11ea 100644 (file)
@@ -1253,6 +1253,17 @@ bool MachineInstr::allDefsAreDead() const {
   return true;
 }
 
+/// copyImplicitOps - Copy implicit register operands from specified
+/// instruction to this instruction.
+void MachineInstr::copyImplicitOps(const MachineInstr *MI) {
+  for (unsigned i = MI->getDesc().getNumOperands(), e = MI->getNumOperands();
+       i != e; ++i) {
+    const MachineOperand &MO = MI->getOperand(i);
+    if (MO.isReg() && MO.isImplicit())
+      addOperand(MO);
+  }
+}
+
 void MachineInstr::dump() const {
   dbgs() << "  " << *this;
 }