CSKY: Replace deprecated MCExpr::print with MCAsmInfo::printExpr
diff --git a/llvm/lib/CodeGen/AsmPrinter/DIE.cpp b/llvm/lib/CodeGen/AsmPrinter/DIE.cpp
index 52b26c9..a2252d8 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DIE.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DIE.cpp
@@ -474,7 +474,7 @@
LLVM_DUMP_METHOD
void DIEExpr::print(raw_ostream &O) const {
O << "Expr: ";
- Expr->print(O, nullptr);
+ MCAsmInfo().printExpr(O, *Expr);
}
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYInstPrinter.cpp b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYInstPrinter.cpp
index 47c05d6..981712a 100644
--- a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYInstPrinter.cpp
+++ b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYInstPrinter.cpp
@@ -138,7 +138,7 @@
}
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 @@
if (MO.isImm())
O << MO.getImm();
else
- MO.getExpr()->print(O, &MAI);
+ MAI.printExpr(O, *MO.getExpr());
O << "]";
}
@@ -173,7 +173,7 @@
assert(MO.isExpr() && "Unknown operand kind in printConstpool");
O << "[";
- MO.getExpr()->print(O, &MAI);
+ MAI.printExpr(O, *MO.getExpr());
O << "]";
}
diff --git a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCExpr.cpp b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCExpr.cpp
index 696cd1d..86e731b 100644
--- a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCExpr.cpp
+++ b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCExpr.cpp
@@ -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::printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const {
- Expr->print(OS, MAI);
+ if (MAI)
+ MAI->printExpr(OS, *Expr);
OS << getVariantKindName(getSpecifier());
}