Skip to content

Commit dcb8cd8

Browse files
committed
ARM: Replace deprecated MCExpr::print with MCAsmInfo::printExpr
1 parent 0894094 commit dcb8cd8

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ void ARMTargetAsmStreamer::emitThumbSet(MCSymbol *Symbol, const MCExpr *Value) {
288288
OS << "\t.thumb_set\t";
289289
Symbol->print(OS, MAI);
290290
OS << ", ";
291-
Value->print(OS, MAI);
291+
MAI->printExpr(OS, *Value);
292292
OS << '\n';
293293
}
294294

llvm/lib/Target/ARM/MCTargetDesc/ARMInstPrinter.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ void ARMInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
350350
switch (Expr->getKind()) {
351351
case MCExpr::Binary:
352352
O << '#';
353-
Expr->print(O, &MAI);
353+
MAI.printExpr(O, *Expr);
354354
break;
355355
case MCExpr::Constant: {
356356
// If a symbolic branch target was added as a constant expression then
@@ -360,7 +360,7 @@ void ARMInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
360360
int64_t TargetAddress;
361361
if (!Constant->evaluateAsAbsolute(TargetAddress)) {
362362
O << '#';
363-
Expr->print(O, &MAI);
363+
MAI.printExpr(O, *Expr);
364364
} else {
365365
O << "0x";
366366
O.write_hex(static_cast<uint32_t>(TargetAddress));
@@ -370,7 +370,7 @@ void ARMInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
370370
default:
371371
// FIXME: Should we always treat this as if it is a constant literal and
372372
// prefix it with '#'?
373-
Expr->print(O, &MAI);
373+
MAI.printExpr(O, *Expr);
374374
break;
375375
}
376376
}
@@ -395,7 +395,7 @@ void ARMInstPrinter::printThumbLdrLabelOperand(const MCInst *MI, unsigned OpNum,
395395
raw_ostream &O) {
396396
const MCOperand &MO1 = MI->getOperand(OpNum);
397397
if (MO1.isExpr()) {
398-
MO1.getExpr()->print(O, &MAI);
398+
MAI.printExpr(O, *MO1.getExpr());
399399
return;
400400
}
401401

@@ -1081,7 +1081,7 @@ void ARMInstPrinter::printAdrLabelOperand(const MCInst *MI, unsigned OpNum,
10811081
const MCOperand &MO = MI->getOperand(OpNum);
10821082

10831083
if (MO.isExpr()) {
1084-
MO.getExpr()->print(O, &MAI);
1084+
MAI.printExpr(O, *MO.getExpr());
10851085
return;
10861086
}
10871087

llvm/lib/Target/ARM/MCTargetDesc/ARMMCExpr.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "ARMMCExpr.h"
10+
#include "llvm/MC/MCAsmInfo.h"
1011
#include "llvm/MC/MCContext.h"
1112
#include "llvm/MC/MCStreamer.h"
1213
using namespace llvm;
@@ -44,7 +45,7 @@ void ARMMCExpr::printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const {
4445
const MCExpr *Expr = getSubExpr();
4546
if (Expr->getKind() != MCExpr::SymbolRef)
4647
OS << '(';
47-
Expr->print(OS, MAI);
48+
MAI->printExpr(OS, *Expr);
4849
if (Expr->getKind() != MCExpr::SymbolRef)
4950
OS << ')';
5051
}

llvm/lib/Target/AVR/MCTargetDesc/AVRMCExpr.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "AVRMCExpr.h"
1010

11+
#include "llvm/MC/MCAsmInfo.h"
1112
#include "llvm/MC/MCAssembler.h"
1213
#include "llvm/MC/MCContext.h"
1314
#include "llvm/MC/MCStreamer.h"
@@ -44,7 +45,7 @@ void AVRMCExpr::printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const {
4445
OS << getName() << '(';
4546
if (isNegated())
4647
OS << '-' << '(';
47-
getSubExpr()->print(OS, MAI);
48+
MAI->printExpr(OS, *getSubExpr());
4849
if (isNegated())
4950
OS << ')';
5051
OS << ')';

0 commit comments

Comments
 (0)