Skip to content

Commit 2b43657

Browse files
committed
Remove the MCAssembler argument from RISCVAsmBackend::isPCRelFixupResolved
1 parent 7407165 commit 2b43657

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,7 @@ static uint64_t adjustFixupValue(const MCFixup &Fixup, uint64_t Value,
544544
}
545545
}
546546

547-
bool RISCVAsmBackend::isPCRelFixupResolved(const MCAssembler &Asm,
548-
const MCSymbol *SymA,
547+
bool RISCVAsmBackend::isPCRelFixupResolved(const MCSymbol *SymA,
549548
const MCFragment &F) {
550549
// If the section does not contain linker-relaxable instructions, PC-relative
551550
// fixups can be resolved.
@@ -560,7 +559,7 @@ bool RISCVAsmBackend::isPCRelFixupResolved(const MCAssembler &Asm,
560559
PCRelTemp = getContext().createTempSymbol();
561560
PCRelTemp->setFragment(const_cast<MCFragment *>(&F));
562561
MCValue Res;
563-
MCExpr::evaluateSymbolicAdd(&Asm, false, MCValue::get(SymA),
562+
MCExpr::evaluateSymbolicAdd(Asm, false, MCValue::get(SymA),
564563
MCValue::get(nullptr, PCRelTemp), Res);
565564
return !Res.getSubSym();
566565
}
@@ -609,7 +608,7 @@ bool RISCVAsmBackend::evaluateTargetFixup(const MCFixup &Fixup,
609608
Value -= Asm->getFragmentOffset(*AUIPCDF) + AUIPCFixup->getOffset();
610609

611610
return AUIPCFixup->getTargetKind() == RISCV::fixup_riscv_pcrel_hi20 &&
612-
isPCRelFixupResolved(*Asm, AUIPCTarget.getAddSym(), *AUIPCDF);
611+
isPCRelFixupResolved(AUIPCTarget.getAddSym(), *AUIPCDF);
613612
}
614613

615614
bool RISCVAsmBackend::addReloc(const MCFragment &F, const MCFixup &Fixup,
@@ -660,7 +659,7 @@ bool RISCVAsmBackend::addReloc(const MCFragment &F, const MCFixup &Fixup,
660659
IsResolved = false;
661660
if (IsResolved &&
662661
(getFixupKindInfo(Fixup.getKind()).Flags & MCFixupKindInfo::FKF_IsPCRel))
663-
IsResolved = isPCRelFixupResolved(*Asm, Target.getAddSym(), F);
662+
IsResolved = isPCRelFixupResolved(Target.getAddSym(), F);
664663
IsResolved = MCAsmBackend::addReloc(F, Fixup, Target, FixedValue, IsResolved);
665664

666665
if (Fixup.isLinkerRelaxable()) {

llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ class RISCVAsmBackend : public MCAsmBackend {
2929
// Temporary symbol used to check whether a PC-relative fixup is resolved.
3030
MCSymbol *PCRelTemp = nullptr;
3131

32-
bool isPCRelFixupResolved(const MCAssembler &Asm, const MCSymbol *SymA,
33-
const MCFragment &F);
32+
bool isPCRelFixupResolved(const MCSymbol *SymA, const MCFragment &F);
3433

3534
public:
3635
RISCVAsmBackend(const MCSubtargetInfo &STI, uint8_t OSABI, bool Is64Bit,

0 commit comments

Comments
 (0)