Skip to content

Commit a7e5de4

Browse files
committed
SystemZ: Replace deprecated MCExpr::print with MCAsmInfo::printExpr
1 parent dcb8cd8 commit a7e5de4

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

llvm/lib/Target/SystemZ/MCTargetDesc/SystemZHLASMAsmStreamer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ void SystemZHLASMAsmStreamer::emitHLASMValueImpl(const MCExpr *Value,
209209
switch (Value->getKind()) {
210210
case MCExpr::Constant: {
211211
OS << "XL" << Size << '\'';
212-
Value->print(OS, MAI);
212+
MAI->printExpr(OS, *Value);
213213
OS << '\'';
214214
return;
215215
}
@@ -258,12 +258,12 @@ void SystemZHLASMAsmStreamer::emitHLASMValueImpl(const MCExpr *Value,
258258
return;
259259
}
260260
case MCExpr::Target:
261-
Value->print(OS, MAI);
261+
MAI->printExpr(OS, *Value);
262262
return;
263263
default:
264264
if (Parens)
265265
OS << "A(";
266-
Value->print(OS, MAI);
266+
MAI->printExpr(OS, *Value);
267267
if (Parens)
268268
OS << ')';
269269
return;

llvm/lib/Target/SystemZ/MCTargetDesc/SystemZInstPrinterCommon.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void SystemZInstPrinterCommon::printOperand(const MCOperand &MO,
5353
} else if (MO.isImm())
5454
markup(O, Markup::Immediate) << MO.getImm();
5555
else if (MO.isExpr())
56-
MO.getExpr()->print(O, MAI);
56+
MAI->printExpr(O, *MO.getExpr());
5757
else
5858
llvm_unreachable("Invalid operand");
5959
}
@@ -171,7 +171,7 @@ void SystemZInstPrinterCommon::printPCRelOperand(const MCInst *MI,
171171
markup(O, Markup::Target) << formatHex((uint64_t)TargetAddress);
172172
} else {
173173
// Otherwise, just print the expression.
174-
MO.getExpr()->print(O, &MAI);
174+
MAI.printExpr(O, *MO.getExpr());
175175
}
176176
}
177177

llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCExpr.cpp

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

99
#include "SystemZMCExpr.h"
10+
#include "llvm/MC/MCAsmInfo.h"
1011
#include "llvm/MC/MCContext.h"
1112
using namespace llvm;
1213

@@ -32,7 +33,7 @@ StringRef SystemZMCExpr::getVariantKindName() const {
3233

3334
void SystemZMCExpr::printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const {
3435
OS << getVariantKindName() << '(';
35-
Expr->print(OS, MAI);
36+
MAI->printExpr(OS, *Expr);
3637
OS << ')';
3738
}
3839

llvm/lib/Target/SystemZ/MCTargetDesc/SystemZTargetStreamer.cpp

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

1515
#include "SystemZTargetStreamer.h"
16+
#include "llvm/MC/MCAsmInfo.h"
1617
#include "llvm/MC/MCObjectFileInfo.h"
1718

1819
using namespace llvm;
@@ -44,7 +45,7 @@ const MCExpr *SystemZTargetHLASMStreamer::createWordDiffExpr(
4445
OS << Temp->getName() << " EQU ";
4546
const MCBinaryExpr *TempExpr = MCBinaryExpr::createSub(
4647
MCSymbolRefExpr::create(Hi, Ctx), MCSymbolRefExpr::create(Lo, Ctx), Ctx);
47-
TempExpr->print(OS, Ctx.getAsmInfo());
48+
Ctx.getAsmInfo()->printExpr(OS, *TempExpr);
4849
OS << "\n";
4950
return MCBinaryExpr::createLShr(MCSymbolRefExpr::create(Temp, Ctx),
5051
MCConstantExpr::create(1, Ctx), Ctx);

llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ static void printOperand(const MCOperand &MCOp, const MCAsmInfo *MAI,
10431043
else if (MCOp.isImm())
10441044
OS << MCOp.getImm();
10451045
else if (MCOp.isExpr())
1046-
MCOp.getExpr()->print(OS, MAI);
1046+
MAI->printExpr(OS, *MCOp.getExpr());
10471047
else
10481048
llvm_unreachable("Invalid operand");
10491049
}

0 commit comments

Comments
 (0)