Skip to content

Commit 303bc0d

Browse files
committed
SPIRV: Replace deprecated MCExpr::print with MCAsmInfo::printExpr
The questionable use might be copied from BPF.
1 parent f96832a commit 303bc0d

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVInstPrinter.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -369,19 +369,6 @@ void SPIRVInstPrinter::printUnknownType(const MCInst *MI, raw_ostream &O) {
369369
printRemainingVariableOps(MI, NumFixedOps, O, true);
370370
}
371371

372-
static void printExpr(const MCExpr *Expr, raw_ostream &O) {
373-
#ifndef NDEBUG
374-
const MCSymbolRefExpr *SRE;
375-
376-
if (const MCBinaryExpr *BE = dyn_cast<MCBinaryExpr>(Expr))
377-
SRE = cast<MCSymbolRefExpr>(BE->getLHS());
378-
else
379-
SRE = cast<MCSymbolRefExpr>(Expr);
380-
assert(SRE->getSpecifier() == 0);
381-
#endif
382-
O << *Expr;
383-
}
384-
385372
void SPIRVInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
386373
raw_ostream &O) {
387374
if (OpNo < MI->getNumOperands()) {
@@ -393,7 +380,7 @@ void SPIRVInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
393380
else if (Op.isDFPImm())
394381
O << formatImm((double)Op.getDFPImm());
395382
else if (Op.isExpr())
396-
printExpr(Op.getExpr(), O);
383+
MAI.printExpr(O, *Op.getExpr());
397384
else
398385
llvm_unreachable("Unexpected operand type");
399386
}

0 commit comments

Comments
 (0)