[RISCV][NFC] Use addExpr() instead of createExpr()

It seems to be neater.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D123675
This commit is contained in:
wangpc 2022-04-14 10:47:08 +08:00
parent ffd656a2fe
commit d0828c5af9
1 changed files with 1 additions and 3 deletions

View File

@ -132,9 +132,7 @@ void RISCVMCCodeEmitter::expandFunctionCall(const MCInst &MI, raw_ostream &OS,
const MCExpr *CallExpr = Func.getExpr();
// Emit AUIPC Ra, Func with R_RISCV_CALL relocation type.
TmpInst = MCInstBuilder(RISCV::AUIPC)
.addReg(Ra)
.addOperand(MCOperand::createExpr(CallExpr));
TmpInst = MCInstBuilder(RISCV::AUIPC).addReg(Ra).addExpr(CallExpr);
Binary = getBinaryCodeForInstr(TmpInst, Fixups, STI);
support::endian::write(OS, Binary, support::little);