Skip to content

Commit 9a87c94

Browse files
committed
MIPS: Replace MCExpr::print with MCAsmInfo::printExpr
1 parent 489dcc9 commit 9a87c94

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

llvm/lib/Target/Mips/MCTargetDesc/MipsInstPrinter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "MipsInstPrinter.h"
1414
#include "Mips.h"
1515
#include "llvm/ADT/StringExtras.h"
16+
#include "llvm/MC/MCAsmInfo.h"
1617
#include "llvm/MC/MCExpr.h"
1718
#include "llvm/MC/MCInst.h"
1819
#include "llvm/MC/MCInstrInfo.h"
@@ -138,7 +139,7 @@ void MipsInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
138139
}
139140

140141
assert(Op.isExpr() && "unknown operand kind in printOperand");
141-
Op.getExpr()->print(O, &MAI);
142+
MAI.printExpr(O, *Op.getExpr());
142143
}
143144

144145
void MipsInstPrinter::printJumpOperand(const MCInst *MI, unsigned OpNo,

llvm/lib/Target/Mips/MCTargetDesc/MipsMCExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void MipsMCExpr::printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const {
4747
case MEK_DTPREL:
4848
// MEK_DTPREL is used for marking TLS DIEExpr only
4949
// and contains a regular sub-expression.
50-
getSubExpr()->print(OS, MAI);
50+
MAI->printExpr(OS, *getSubExpr());
5151
return;
5252
case MEK_CALL_HI16:
5353
OS << "%call_hi";

llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -398,42 +398,42 @@ MipsTargetAsmStreamer::MipsTargetAsmStreamer(MCStreamer &S,
398398
void MipsTargetAsmStreamer::emitDTPRel32Value(const MCExpr *Value) {
399399
auto *MAI = getStreamer().getContext().getAsmInfo();
400400
OS << "\t.dtprelword\t";
401-
Value->print(OS, MAI);
401+
MAI->printExpr(OS, *Value);
402402
OS << '\n';
403403
}
404404

405405
void MipsTargetAsmStreamer::emitDTPRel64Value(const MCExpr *Value) {
406406
auto *MAI = getStreamer().getContext().getAsmInfo();
407407
OS << "\t.dtpreldword\t";
408-
Value->print(OS, MAI);
408+
MAI->printExpr(OS, *Value);
409409
OS << '\n';
410410
}
411411

412412
void MipsTargetAsmStreamer::emitTPRel32Value(const MCExpr *Value) {
413413
auto *MAI = getStreamer().getContext().getAsmInfo();
414414
OS << "\t.tprelword\t";
415-
Value->print(OS, MAI);
415+
MAI->printExpr(OS, *Value);
416416
OS << '\n';
417417
}
418418

419419
void MipsTargetAsmStreamer::emitTPRel64Value(const MCExpr *Value) {
420420
auto *MAI = getStreamer().getContext().getAsmInfo();
421421
OS << "\t.tpreldword\t";
422-
Value->print(OS, MAI);
422+
MAI->printExpr(OS, *Value);
423423
OS << '\n';
424424
}
425425

426426
void MipsTargetAsmStreamer::emitGPRel32Value(const MCExpr *Value) {
427427
auto *MAI = getStreamer().getContext().getAsmInfo();
428428
OS << "\t.gpword\t";
429-
Value->print(OS, MAI);
429+
MAI->printExpr(OS, *Value);
430430
OS << '\n';
431431
}
432432

433433
void MipsTargetAsmStreamer::emitGPRel64Value(const MCExpr *Value) {
434434
auto *MAI = getStreamer().getContext().getAsmInfo();
435435
OS << "\t.gpdword\t";
436-
Value->print(OS, MAI);
436+
MAI->printExpr(OS, *Value);
437437
OS << '\n';
438438
}
439439

0 commit comments

Comments
 (0)