@@ -98,7 +98,7 @@ void MachineInstr::addImplicitDefUseOperands(MachineFunction &MF) {
98
98
MachineInstr::MachineInstr (MachineFunction &MF, const MCInstrDesc &TID,
99
99
DebugLoc DL, bool NoImp)
100
100
: MCID(&TID), NumOperands(0 ), Flags(0 ), AsmPrinterFlags(0 ),
101
- DbgLoc(std::move(DL)), DebugInstrNum(0 ) {
101
+ DbgLoc(std::move(DL)), DebugInstrNum(0 ), Opcode(TID.Opcode) {
102
102
assert (DbgLoc.hasTrivialDestructor () && " Expected trivial destructor" );
103
103
104
104
// Reserve space for the expected number of operands.
@@ -117,7 +117,8 @@ MachineInstr::MachineInstr(MachineFunction &MF, const MCInstrDesc &TID,
117
117
// / uniqueness.
118
118
MachineInstr::MachineInstr (MachineFunction &MF, const MachineInstr &MI)
119
119
: MCID(&MI.getDesc()), NumOperands(0 ), Flags(0 ), AsmPrinterFlags(0 ),
120
- Info(MI.Info), DbgLoc(MI.getDebugLoc()), DebugInstrNum(0 ) {
120
+ Info(MI.Info), DbgLoc(MI.getDebugLoc()), DebugInstrNum(0 ),
121
+ Opcode(MI.getOpcode()) {
121
122
assert (DbgLoc.hasTrivialDestructor () && " Expected trivial destructor" );
122
123
123
124
CapOperands = OperandCapacity::get (MI.getNumOperands ());
@@ -143,6 +144,7 @@ void MachineInstr::setDesc(const MCInstrDesc &TID) {
143
144
if (getParent ())
144
145
getMF ()->handleChangeDesc (*this , TID);
145
146
MCID = &TID;
147
+ Opcode = TID.Opcode ;
146
148
}
147
149
148
150
void MachineInstr::moveBefore (MachineInstr *MovePos) {
0 commit comments