diff options
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 198af93..f0de2ca 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -98,7 +98,7 @@ void MachineInstr::addImplicitDefUseOperands(MachineFunction &MF) { MachineInstr::MachineInstr(MachineFunction &MF, const MCInstrDesc &TID, DebugLoc DL, bool NoImp) : MCID(&TID), NumOperands(0), Flags(0), AsmPrinterFlags(0), - DbgLoc(std::move(DL)), DebugInstrNum(0) { + DbgLoc(std::move(DL)), DebugInstrNum(0), Opcode(TID.Opcode) { assert(DbgLoc.hasTrivialDestructor() && "Expected trivial destructor"); // Reserve space for the expected number of operands. @@ -117,7 +117,8 @@ MachineInstr::MachineInstr(MachineFunction &MF, const MCInstrDesc &TID, /// uniqueness. MachineInstr::MachineInstr(MachineFunction &MF, const MachineInstr &MI) : MCID(&MI.getDesc()), NumOperands(0), Flags(0), AsmPrinterFlags(0), - Info(MI.Info), DbgLoc(MI.getDebugLoc()), DebugInstrNum(0) { + Info(MI.Info), DbgLoc(MI.getDebugLoc()), DebugInstrNum(0), + Opcode(MI.getOpcode()) { assert(DbgLoc.hasTrivialDestructor() && "Expected trivial destructor"); CapOperands = OperandCapacity::get(MI.getNumOperands()); @@ -143,6 +144,7 @@ void MachineInstr::setDesc(const MCInstrDesc &TID) { if (getParent()) getMF()->handleChangeDesc(*this, TID); MCID = &TID; + Opcode = TID.Opcode; } void MachineInstr::moveBefore(MachineInstr *MovePos) { |