return MII.getName(Opcode);
}
-StringRef HexagonInstPrinter::getRegName(unsigned RegNo) const {
- return getRegisterName(RegNo);
+void HexagonInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const {
+ OS << getRegisterName(RegNo);
}
void HexagonInstPrinter::printInst(MCInst const *MI, raw_ostream &O,
const MCOperand& MO = MI->getOperand(OpNo);
if (MO.isReg()) {
- O << getRegisterName(MO.getReg());
+ printRegName(O, MO.getReg());
} else if(MO.isExpr()) {
O << *MO.getExpr();
} else if(MO.isImm()) {
const MCOperand& MO0 = MI->getOperand(OpNo);
const MCOperand& MO1 = MI->getOperand(OpNo + 1);
- O << getRegisterName(MO0.getReg());
+ printRegName(O, MO0.getReg());
O << " + #" << MO1.getImm();
}
const MCOperand& MO0 = MI->getOperand(OpNo);
const MCOperand& MO1 = MI->getOperand(OpNo + 1);
- O << getRegisterName(MO0.getReg()) << ", #" << MO1.getImm();
+ printRegName(O, MO0.getReg());
+ O << ", #" << MO1.getImm();
}
void HexagonInstPrinter::printGlobalOperand(const MCInst *MI, unsigned OpNo,
const MCSubtargetInfo &STI) override;
virtual StringRef getOpcodeName(unsigned Opcode) const;
void printInstruction(const MCInst *MI, raw_ostream &O);
- StringRef getRegName(unsigned RegNo) const;
+ void printRegName(raw_ostream &OS, unsigned RegNo) const override;
static const char *getRegisterName(unsigned RegNo);
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) const;