CSKY: Replace deprecated MCExpr::print with MCAsmInfo::printExpr
This commit is contained in:
@@ -474,7 +474,7 @@ unsigned DIEExpr::sizeOf(const dwarf::FormParams &FormParams,
|
||||
LLVM_DUMP_METHOD
|
||||
void DIEExpr::print(raw_ostream &O) const {
|
||||
O << "Expr: ";
|
||||
Expr->print(O, nullptr);
|
||||
MCAsmInfo().printExpr(O, *Expr);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -138,7 +138,7 @@ void CSKYInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
|
||||
}
|
||||
|
||||
assert(MO.isExpr() && "Unknown operand kind in printOperand");
|
||||
MO.getExpr()->print(O, &MAI);
|
||||
MAI.printExpr(O, *MO.getExpr());
|
||||
}
|
||||
|
||||
void CSKYInstPrinter::printDataSymbol(const MCInst *MI, unsigned OpNo,
|
||||
@@ -150,7 +150,7 @@ void CSKYInstPrinter::printDataSymbol(const MCInst *MI, unsigned OpNo,
|
||||
if (MO.isImm())
|
||||
O << MO.getImm();
|
||||
else
|
||||
MO.getExpr()->print(O, &MAI);
|
||||
MAI.printExpr(O, *MO.getExpr());
|
||||
O << "]";
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ void CSKYInstPrinter::printConstpool(const MCInst *MI, uint64_t Address,
|
||||
assert(MO.isExpr() && "Unknown operand kind in printConstpool");
|
||||
|
||||
O << "[";
|
||||
MO.getExpr()->print(O, &MAI);
|
||||
MAI.printExpr(O, *MO.getExpr());
|
||||
O << "]";
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "CSKYMCExpr.h"
|
||||
#include "CSKYFixupKinds.h"
|
||||
#include "MCTargetDesc/CSKYMCAsmInfo.h"
|
||||
#include "llvm/BinaryFormat/ELF.h"
|
||||
#include "llvm/MC/MCAssembler.h"
|
||||
#include "llvm/MC/MCContext.h"
|
||||
@@ -63,7 +64,8 @@ void CSKYMCExpr::visitUsedExpr(MCStreamer &Streamer) const {
|
||||
}
|
||||
|
||||
void CSKYMCExpr::printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const {
|
||||
Expr->print(OS, MAI);
|
||||
if (MAI)
|
||||
MAI->printExpr(OS, *Expr);
|
||||
OS << getVariantKindName(getSpecifier());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user