diff options
author | Fangrui Song <i@maskray.me> | 2025-07-04 15:45:14 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2025-07-04 15:45:14 -0700 |
commit | 7d500b115db5577c206f162b29e90811f1f66a1c (patch) | |
tree | 9f0c0d31080e94634750b3f798003893599e2e0a /llvm/lib/MC/MCAssembler.cpp | |
parent | 83fbd86909111510f973d8e1c4214022368ef810 (diff) | |
download | llvm-7d500b115db5577c206f162b29e90811f1f66a1c.zip llvm-7d500b115db5577c206f162b29e90811f1f66a1c.tar.gz llvm-7d500b115db5577c206f162b29e90811f1f66a1c.tar.bz2 |
SPARC: Remove unneeded MCFixupKindInfo::FKF_IsPCRel
SPARC now sets PCRel at fixup creation and no longer needs to the
MCAssembler::evaluateFixup workaround that checks
MCFixupKindInfo::FKF_IsPCRel.
Diffstat (limited to 'llvm/lib/MC/MCAssembler.cpp')
-rw-r--r-- | llvm/lib/MC/MCAssembler.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp index 4b78453..7e6365a 100644 --- a/llvm/lib/MC/MCAssembler.cpp +++ b/llvm/lib/MC/MCAssembler.cpp @@ -161,9 +161,11 @@ bool MCAssembler::evaluateFixup(const MCFragment &F, MCFixup &Fixup, return true; } - bool IsResolved = false; + // TODO: Require targets to set PCRel at fixup creation time. unsigned FixupFlags = getBackend().getFixupKindInfo(Fixup.getKind()).Flags; - bool IsPCRel = FixupFlags & MCFixupKindInfo::FKF_IsPCRel; + if (FixupFlags & MCFixupKindInfo::FKF_IsPCRel) + Fixup.setPCRel(); + bool IsResolved = false; if (FixupFlags & MCFixupKindInfo::FKF_IsTarget) { IsResolved = getBackend().evaluateTargetFixup(Fixup, Target, Value); } else { @@ -177,7 +179,7 @@ bool MCAssembler::evaluateFixup(const MCFragment &F, MCFixup &Fixup, bool ShouldAlignPC = FixupFlags & MCFixupKindInfo::FKF_IsAlignedDownTo32Bits; - if (IsPCRel) { + if (Fixup.isPCRel()) { uint64_t Offset = getFragmentOffset(F) + Fixup.getOffset(); // A number of ARM fixups in Thumb mode require that the effective PC @@ -202,8 +204,6 @@ bool MCAssembler::evaluateFixup(const MCFragment &F, MCFixup &Fixup, if (IsResolved && mc::isRelocRelocation(Fixup.getKind())) IsResolved = false; - if (IsPCRel) - Fixup.setPCRel(); getBackend().applyFixup(F, Fixup, Target, Contents, Value, IsResolved); return true; } |