diff --git a/include/llvm/CodeGen/MachineInstrBuilder.h b/include/llvm/CodeGen/MachineInstrBuilder.h index 1dcdf086c85..d33e0aa2ab2 100644 --- a/include/llvm/CodeGen/MachineInstrBuilder.h +++ b/include/llvm/CodeGen/MachineInstrBuilder.h @@ -82,7 +82,7 @@ public: /// Get the register for the operand index. /// The operand at the index should be a register (asserted by /// MachineOperand). - unsigned getReg(unsigned Idx) { return MI->getOperand(Idx).getReg(); } + unsigned getReg(unsigned Idx) const { return MI->getOperand(Idx).getReg(); } /// Add a new virtual register operand. const MachineInstrBuilder &addReg(unsigned RegNo, unsigned flags = 0,