diff options
author | Fangrui Song <i@maskray.me> | 2025-06-15 17:25:13 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2025-06-15 17:25:13 -0700 |
commit | dca2b261d77a9b758587b660e5b88b6a312d057c (patch) | |
tree | ce1596baba379a93b1a5ecb88806010d67a6b008 | |
parent | a7e5de472314a891604abee390beb8af5493b29a (diff) | |
download | llvm-dca2b261d77a9b758587b660e5b88b6a312d057c.zip llvm-dca2b261d77a9b758587b660e5b88b6a312d057c.tar.gz llvm-dca2b261d77a9b758587b660e5b88b6a312d057c.tar.bz2 |
Lanai: Replace deprecated MCExpr::print with MCAsmInfo::printExpr
-rw-r--r-- | llvm/lib/Target/Lanai/MCTargetDesc/LanaiInstPrinter.cpp | 12 | ||||
-rw-r--r-- | llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCExpr.cpp | 5 |
2 files changed, 9 insertions, 8 deletions
diff --git a/llvm/lib/Target/Lanai/MCTargetDesc/LanaiInstPrinter.cpp b/llvm/lib/Target/Lanai/MCTargetDesc/LanaiInstPrinter.cpp index 837d8fe..add4096 100644 --- a/llvm/lib/Target/Lanai/MCTargetDesc/LanaiInstPrinter.cpp +++ b/llvm/lib/Target/Lanai/MCTargetDesc/LanaiInstPrinter.cpp @@ -152,7 +152,7 @@ void LanaiInstPrinter::printOperand(const MCInst *MI, unsigned OpNo, OS << formatHex(Op.getImm()); else { assert(Op.isExpr() && "Expected an expression"); - Op.getExpr()->print(OS, &MAI); + MAI.printExpr(OS, *Op.getExpr()); } } @@ -165,7 +165,7 @@ void LanaiInstPrinter::printMemImmOperand(const MCInst *MI, unsigned OpNo, // Symbolic operand will be lowered to immediate value by linker assert(Op.isExpr() && "Expected an expression"); OS << '['; - Op.getExpr()->print(OS, &MAI); + MAI.printExpr(OS, *Op.getExpr()); OS << ']'; } } @@ -178,7 +178,7 @@ void LanaiInstPrinter::printHi16ImmOperand(const MCInst *MI, unsigned OpNo, } else { // Symbolic operand will be lowered to immediate value by linker assert(Op.isExpr() && "Expected an expression"); - Op.getExpr()->print(OS, &MAI); + MAI.printExpr(OS, *Op.getExpr()); } } @@ -190,7 +190,7 @@ void LanaiInstPrinter::printHi16AndImmOperand(const MCInst *MI, unsigned OpNo, } else { // Symbolic operand will be lowered to immediate value by linker assert(Op.isExpr() && "Expected an expression"); - Op.getExpr()->print(OS, &MAI); + MAI.printExpr(OS, *Op.getExpr()); } } @@ -202,7 +202,7 @@ void LanaiInstPrinter::printLo16AndImmOperand(const MCInst *MI, unsigned OpNo, } else { // Symbolic operand will be lowered to immediate value by linker assert(Op.isExpr() && "Expected an expression"); - Op.getExpr()->print(OS, &MAI); + MAI.printExpr(OS, *Op.getExpr()); } } @@ -227,7 +227,7 @@ static void printMemoryImmediateOffset(const MCAsmInfo &MAI, assert(isInt<SizeInBits>(OffsetOp.getImm()) && "Constant value truncated"); OS << OffsetOp.getImm(); } else - OffsetOp.getExpr()->print(OS, &MAI); + MAI.printExpr(OS, *OffsetOp.getExpr()); } void LanaiInstPrinter::printMemRiOperand(const MCInst *MI, int OpNo, diff --git a/llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCExpr.cpp b/llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCExpr.cpp index eec1b7f..b75a099 100644 --- a/llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCExpr.cpp +++ b/llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCExpr.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// #include "LanaiMCExpr.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCAssembler.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCStreamer.h" @@ -21,7 +22,7 @@ const LanaiMCExpr *LanaiMCExpr::create(Spec S, const MCExpr *Expr, void LanaiMCExpr::printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const { if (specifier == VK_Lanai_None) { - Expr->print(OS, MAI); + MAI->printExpr(OS, *Expr); return; } @@ -38,6 +39,6 @@ void LanaiMCExpr::printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const { OS << '('; const MCExpr *Expr = getSubExpr(); - Expr->print(OS, MAI); + MAI->printExpr(OS, *Expr); OS << ')'; } |