Skip to content

Commit 658c03d

Browse files
committed
[MC] Remove the MCAsmLayout parameter from evaluateTargetFixup
1 parent 15ca5a8 commit 658c03d

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

llvm/include/llvm/MC/MCAsmBackend.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ class MCAsmBackend {
115115
}
116116

117117
virtual bool evaluateTargetFixup(const MCAssembler &Asm,
118-
const MCAsmLayout &Layout,
119118
const MCFixup &Fixup, const MCFragment *DF,
120119
const MCValue &Target,
121120
const MCSubtargetInfo *STI, uint64_t &Value,

llvm/lib/MC/MCAssembler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ bool MCAssembler::evaluateFixup(const MCFixup &Fixup, const MCFragment *DF,
204204
MCFixupKindInfo::FKF_IsTarget;
205205

206206
if (IsTarget)
207-
return getBackend().evaluateTargetFixup(*this, *Layout, Fixup, DF, Target,
208-
STI, Value, WasForced);
207+
return getBackend().evaluateTargetFixup(*this, Fixup, DF, Target, STI,
208+
Value, WasForced);
209209

210210
unsigned FixupFlags = getBackendPtr()->getFixupKindInfo(Fixup.getKind()).Flags;
211211
bool IsPCRel = getBackendPtr()->getFixupKindInfo(Fixup.getKind()).Flags &

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -519,10 +519,12 @@ static uint64_t adjustFixupValue(const MCFixup &Fixup, uint64_t Value,
519519
}
520520
}
521521

522-
bool RISCVAsmBackend::evaluateTargetFixup(
523-
const MCAssembler &Asm, const MCFixup &Fixup,
524-
const MCFragment *DF, const MCValue &Target, const MCSubtargetInfo *STI,
525-
uint64_t &Value, bool &WasForced) {
522+
bool RISCVAsmBackend::evaluateTargetFixup(const MCAssembler &Asm,
523+
const MCFixup &Fixup,
524+
const MCFragment *DF,
525+
const MCValue &Target,
526+
const MCSubtargetInfo *STI,
527+
uint64_t &Value, bool &WasForced) {
526528
const MCFixup *AUIPCFixup;
527529
const MCFragment *AUIPCDF;
528530
MCValue AUIPCTarget;
@@ -547,7 +549,8 @@ bool RISCVAsmBackend::evaluateTargetFixup(
547549
// MCAssembler::evaluateFixup will emit an error for this case when it sees
548550
// the %pcrel_hi, so don't duplicate it when also seeing the %pcrel_lo.
549551
const MCExpr *AUIPCExpr = AUIPCFixup->getValue();
550-
if (!AUIPCExpr->evaluateAsRelocatable(AUIPCTarget, &Layout, AUIPCFixup))
552+
if (!AUIPCExpr->evaluateAsRelocatable(AUIPCTarget, Asm.getLayout(),
553+
AUIPCFixup))
551554
return true;
552555
break;
553556
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ class RISCVAsmBackend : public MCAsmBackend {
4747
bool shouldInsertFixupForCodeAlign(MCAssembler &Asm,
4848
MCAlignFragment &AF) override;
4949

50-
bool evaluateTargetFixup(const MCAssembler &Asm,
51-
const MCFixup &Fixup, const MCFragment *DF,
52-
const MCValue &Target, const MCSubtargetInfo *STI,
53-
uint64_t &Value, bool &WasForced) override;
50+
bool evaluateTargetFixup(const MCAssembler &Asm, const MCFixup &Fixup,
51+
const MCFragment *DF, const MCValue &Target,
52+
const MCSubtargetInfo *STI, uint64_t &Value,
53+
bool &WasForced) override;
5454

5555
bool handleAddSubRelocations(const MCAssembler &Asm, const MCFragment &F,
5656
const MCFixup &Fixup, const MCValue &Target,

0 commit comments

Comments
 (0)