Skip to content

Commit dca2b26

Browse files
committed
Lanai: Replace deprecated MCExpr::print with MCAsmInfo::printExpr
1 parent a7e5de4 commit dca2b26

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

llvm/lib/Target/Lanai/MCTargetDesc/LanaiInstPrinter.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ void LanaiInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
152152
OS << formatHex(Op.getImm());
153153
else {
154154
assert(Op.isExpr() && "Expected an expression");
155-
Op.getExpr()->print(OS, &MAI);
155+
MAI.printExpr(OS, *Op.getExpr());
156156
}
157157
}
158158

@@ -165,7 +165,7 @@ void LanaiInstPrinter::printMemImmOperand(const MCInst *MI, unsigned OpNo,
165165
// Symbolic operand will be lowered to immediate value by linker
166166
assert(Op.isExpr() && "Expected an expression");
167167
OS << '[';
168-
Op.getExpr()->print(OS, &MAI);
168+
MAI.printExpr(OS, *Op.getExpr());
169169
OS << ']';
170170
}
171171
}
@@ -178,7 +178,7 @@ void LanaiInstPrinter::printHi16ImmOperand(const MCInst *MI, unsigned OpNo,
178178
} else {
179179
// Symbolic operand will be lowered to immediate value by linker
180180
assert(Op.isExpr() && "Expected an expression");
181-
Op.getExpr()->print(OS, &MAI);
181+
MAI.printExpr(OS, *Op.getExpr());
182182
}
183183
}
184184

@@ -190,7 +190,7 @@ void LanaiInstPrinter::printHi16AndImmOperand(const MCInst *MI, unsigned OpNo,
190190
} else {
191191
// Symbolic operand will be lowered to immediate value by linker
192192
assert(Op.isExpr() && "Expected an expression");
193-
Op.getExpr()->print(OS, &MAI);
193+
MAI.printExpr(OS, *Op.getExpr());
194194
}
195195
}
196196

@@ -202,7 +202,7 @@ void LanaiInstPrinter::printLo16AndImmOperand(const MCInst *MI, unsigned OpNo,
202202
} else {
203203
// Symbolic operand will be lowered to immediate value by linker
204204
assert(Op.isExpr() && "Expected an expression");
205-
Op.getExpr()->print(OS, &MAI);
205+
MAI.printExpr(OS, *Op.getExpr());
206206
}
207207
}
208208

@@ -227,7 +227,7 @@ static void printMemoryImmediateOffset(const MCAsmInfo &MAI,
227227
assert(isInt<SizeInBits>(OffsetOp.getImm()) && "Constant value truncated");
228228
OS << OffsetOp.getImm();
229229
} else
230-
OffsetOp.getExpr()->print(OS, &MAI);
230+
MAI.printExpr(OS, *OffsetOp.getExpr());
231231
}
232232

233233
void LanaiInstPrinter::printMemRiOperand(const MCInst *MI, int OpNo,

llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCExpr.cpp

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

99
#include "LanaiMCExpr.h"
10+
#include "llvm/MC/MCAsmInfo.h"
1011
#include "llvm/MC/MCAssembler.h"
1112
#include "llvm/MC/MCContext.h"
1213
#include "llvm/MC/MCStreamer.h"
@@ -21,7 +22,7 @@ const LanaiMCExpr *LanaiMCExpr::create(Spec S, const MCExpr *Expr,
2122

2223
void LanaiMCExpr::printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const {
2324
if (specifier == VK_Lanai_None) {
24-
Expr->print(OS, MAI);
25+
MAI->printExpr(OS, *Expr);
2526
return;
2627
}
2728

@@ -38,6 +39,6 @@ void LanaiMCExpr::printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const {
3839

3940
OS << '(';
4041
const MCExpr *Expr = getSubExpr();
41-
Expr->print(OS, MAI);
42+
MAI->printExpr(OS, *Expr);
4243
OS << ')';
4344
}

0 commit comments

Comments
 (0)