-
Notifications
You must be signed in to change notification settings - Fork 14k
MCAsmBackend: Simplify applyFixup #141333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-backend-m68k @llvm/pr-subscribers-backend-aarch64 Author: Fangrui Song (MaskRay) ChangesRemove the MCSubtargetInfo argument from applyFixup, introduced in https://reviews.llvm.org/D45962 , as it's only required by ARM. Instead, add const MCFragment & so that ARMAsmBackend can retrieve MCSubtargetInfo via a static member function. Additionally, make applyReloc non-const. Its arguments now fully cover addReloc's functionality. Patch is 40.88 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/141333.diff 33 Files Affected:
diff --git a/llvm/include/llvm/MC/MCAsmBackend.h b/llvm/include/llvm/MC/MCAsmBackend.h
index ec70dc8811185..fec1ec77a6686 100644
--- a/llvm/include/llvm/MC/MCAsmBackend.h
+++ b/llvm/include/llvm/MC/MCAsmBackend.h
@@ -123,12 +123,9 @@ class MCAsmBackend {
/// the offset specified by the fixup and following the fixup kind as
/// appropriate. Errors (such as an out of range fixup value) should be
/// reported via \p Ctx.
- /// The \p STI is present only for fragments of type MCRelaxableFragment and
- /// MCDataFragment with hasInstructions() == true.
- virtual void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
+ virtual void applyFixup(MCAssembler &, const MCFragment &, const MCFixup &,
const MCValue &Target, MutableArrayRef<char> Data,
- uint64_t Value, bool IsResolved,
- const MCSubtargetInfo *STI) const = 0;
+ uint64_t Value, bool IsResolved) = 0;
/// @}
@@ -216,6 +213,10 @@ class MCAsmBackend {
bool isDarwinCanonicalPersonality(const MCSymbol *Sym) const;
+ // Return STI for fragments of type MCRelaxableFragment and MCDataFragment
+ // with hasInstructions() == true.
+ static const MCSubtargetInfo *getSubtargetInfo(const MCFragment &F);
+
private:
const bool LinkerRelaxation;
};
diff --git a/llvm/include/llvm/MC/MCAssembler.h b/llvm/include/llvm/MC/MCAssembler.h
index becd7cf6e8d1b..ab6321f53a3c9 100644
--- a/llvm/include/llvm/MC/MCAssembler.h
+++ b/llvm/include/llvm/MC/MCAssembler.h
@@ -90,16 +90,15 @@ class MCAssembler {
/// Evaluate a fixup to a relocatable expression and the value which should be
/// placed into the fixup.
///
+ /// \param F The fragment the fixup is inside.
/// \param Fixup The fixup to evaluate.
- /// \param DF The fragment the fixup is inside.
/// \param Target [out] On return, the relocatable expression the fixup
/// evaluates to.
/// \param Value [out] On return, the value of the fixup as currently laid
/// out.
/// \param RecordReloc Record relocation if needed.
/// relocation.
- bool evaluateFixup(const MCFixup &Fixup, const MCFragment *DF,
- MCValue &Target, const MCSubtargetInfo *STI,
+ bool evaluateFixup(const MCFragment *F, const MCFixup &Fixup, MCValue &Target,
uint64_t &Value, bool RecordReloc,
MutableArrayRef<char> Contents) const;
diff --git a/llvm/include/llvm/MC/MCFragment.h b/llvm/include/llvm/MC/MCFragment.h
index b0a39ffacccce..244b898eeb456 100644
--- a/llvm/include/llvm/MC/MCFragment.h
+++ b/llvm/include/llvm/MC/MCFragment.h
@@ -108,6 +108,8 @@ class MCFragment {
/// this is false, but specific fragment types may set it to true.
bool hasInstructions() const { return HasInstructions; }
+ const MCSubtargetInfo *getSubtargetInfo() const;
+
void dump() const;
};
diff --git a/llvm/lib/MC/MCAsmBackend.cpp b/llvm/lib/MC/MCAsmBackend.cpp
index 189ac883c87a9..f8a790bcaf7f2 100644
--- a/llvm/lib/MC/MCAsmBackend.cpp
+++ b/llvm/lib/MC/MCAsmBackend.cpp
@@ -143,3 +143,24 @@ bool MCAsmBackend::isDarwinCanonicalPersonality(const MCSymbol *Sym) const {
// Reserving an empty slot for it seems silly.
return name == "___gxx_personality_v0" || name == "___objc_personality_v0";
}
+
+const MCSubtargetInfo *MCAsmBackend::getSubtargetInfo(const MCFragment &F) {
+ const MCSubtargetInfo *STI = nullptr;
+ switch (F.getKind()) {
+ case MCFragment::FT_Data: {
+ auto &DF = cast<MCDataFragment>(F);
+ STI = DF.getSubtargetInfo();
+ assert(!DF.hasInstructions() || STI != nullptr);
+ break;
+ }
+ case MCFragment::FT_Relaxable: {
+ auto &RF = cast<MCRelaxableFragment>(F);
+ STI = RF.getSubtargetInfo();
+ assert(!RF.hasInstructions() || STI != nullptr);
+ break;
+ }
+ default:
+ break;
+ }
+ return STI;
+}
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp
index f71008826888f..0caf31dfc96f9 100644
--- a/llvm/lib/MC/MCAssembler.cpp
+++ b/llvm/lib/MC/MCAssembler.cpp
@@ -136,9 +136,9 @@ bool MCAssembler::isThumbFunc(const MCSymbol *Symbol) const {
return true;
}
-bool MCAssembler::evaluateFixup(const MCFixup &Fixup, const MCFragment *DF,
- MCValue &Target, const MCSubtargetInfo *STI,
- uint64_t &Value, bool RecordReloc,
+bool MCAssembler::evaluateFixup(const MCFragment *DF, const MCFixup &Fixup,
+ MCValue &Target, uint64_t &Value,
+ bool RecordReloc,
MutableArrayRef<char> Contents) const {
++stats::evaluateFixup;
@@ -200,8 +200,8 @@ bool MCAssembler::evaluateFixup(const MCFixup &Fixup, const MCFragment *DF,
IsResolved = false;
IsResolved = getBackend().addReloc(const_cast<MCAssembler &>(*this), *DF,
Fixup, Target, Value, IsResolved);
- getBackend().applyFixup(*this, Fixup, Target, Contents, Value, IsResolved,
- STI);
+ getBackend().applyFixup(const_cast<MCAssembler &>(*this), *DF, Fixup, Target,
+ Contents, Value, IsResolved);
return true;
}
@@ -906,7 +906,6 @@ void MCAssembler::layout() {
for (MCFragment &Frag : Sec) {
MutableArrayRef<MCFixup> Fixups;
MutableArrayRef<char> Contents;
- const MCSubtargetInfo *STI = nullptr;
// Process MCAlignFragment and MCEncodedFragmentWithFixups here.
switch (Frag.getKind()) {
@@ -924,16 +923,12 @@ void MCAssembler::layout() {
MCDataFragment &DF = cast<MCDataFragment>(Frag);
Fixups = DF.getFixups();
Contents = DF.getContents();
- STI = DF.getSubtargetInfo();
- assert(!DF.hasInstructions() || STI != nullptr);
break;
}
case MCFragment::FT_Relaxable: {
MCRelaxableFragment &RF = cast<MCRelaxableFragment>(Frag);
Fixups = RF.getFixups();
Contents = RF.getContents();
- STI = RF.getSubtargetInfo();
- assert(!RF.hasInstructions() || STI != nullptr);
break;
}
case MCFragment::FT_CVDefRange: {
@@ -970,7 +965,7 @@ void MCAssembler::layout() {
for (const MCFixup &Fixup : Fixups) {
uint64_t FixedValue;
MCValue Target;
- evaluateFixup(Fixup, &Frag, Target, STI, FixedValue,
+ evaluateFixup(&Frag, Fixup, Target, FixedValue,
/*RecordReloc=*/true, Contents);
}
}
@@ -991,9 +986,8 @@ bool MCAssembler::fixupNeedsRelaxation(const MCFixup &Fixup,
assert(getBackendPtr() && "Expected assembler backend");
MCValue Target;
uint64_t Value;
- bool Resolved =
- evaluateFixup(const_cast<MCFixup &>(Fixup), DF, Target,
- DF->getSubtargetInfo(), Value, /*RecordReloc=*/false, {});
+ bool Resolved = evaluateFixup(DF, const_cast<MCFixup &>(Fixup), Target, Value,
+ /*RecordReloc=*/false, {});
return getBackend().fixupNeedsRelaxationAdvanced(*this, Fixup, Target, Value,
Resolved);
}
diff --git a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp
index 74f083cc8845e..d5bdb45ece633 100644
--- a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp
+++ b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp
@@ -81,10 +81,9 @@ class AArch64AsmBackend : public MCAsmBackend {
return Infos[Kind - FirstTargetFixupKind];
}
- void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
+ void applyFixup(MCAssembler &, const MCFragment &, const MCFixup &,
const MCValue &Target, MutableArrayRef<char> Data,
- uint64_t Value, bool IsResolved,
- const MCSubtargetInfo *STI) const override;
+ uint64_t Value, bool IsResolved) override;
bool fixupNeedsRelaxation(const MCFixup &Fixup,
uint64_t Value) const override;
@@ -415,11 +414,10 @@ unsigned AArch64AsmBackend::getFixupKindContainereSizeInBytes(unsigned Kind) con
}
}
-void AArch64AsmBackend::applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
- const MCValue &Target,
+void AArch64AsmBackend::applyFixup(MCAssembler &Asm, const MCFragment &,
+ const MCFixup &Fixup, const MCValue &Target,
MutableArrayRef<char> Data, uint64_t Value,
- bool IsResolved,
- const MCSubtargetInfo *STI) const {
+ bool IsResolved) {
MCFixupKind Kind = Fixup.getKind();
if (mc::isRelocation(Kind))
return;
diff --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp
index 9ec7c3595e555..978fc07c5c8d4 100644
--- a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp
+++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp
@@ -32,11 +32,9 @@ class AMDGPUAsmBackend : public MCAsmBackend {
public:
AMDGPUAsmBackend(const Target &T) : MCAsmBackend(llvm::endianness::little) {}
-
- void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
+ void applyFixup(MCAssembler &, const MCFragment &, const MCFixup &,
const MCValue &Target, MutableArrayRef<char> Data,
- uint64_t Value, bool IsResolved,
- const MCSubtargetInfo *STI) const override;
+ uint64_t Value, bool IsResolved) override;
bool fixupNeedsRelaxation(const MCFixup &Fixup,
uint64_t Value) const override;
@@ -133,11 +131,10 @@ static uint64_t adjustFixupValue(const MCFixup &Fixup, uint64_t Value,
}
}
-void AMDGPUAsmBackend::applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
- const MCValue &Target,
+void AMDGPUAsmBackend::applyFixup(MCAssembler &Asm, const MCFragment &,
+ const MCFixup &Fixup, const MCValue &Target,
MutableArrayRef<char> Data, uint64_t Value,
- bool IsResolved,
- const MCSubtargetInfo *STI) const {
+ bool IsResolved) {
if (mc::isRelocation(Fixup.getKind()))
return;
diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
index 66bbaef5d705d..765de83219078 100644
--- a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
+++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
@@ -1127,16 +1127,16 @@ static unsigned getFixupKindContainerSizeBytes(unsigned Kind) {
}
}
-void ARMAsmBackend::applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
- const MCValue &Target,
+void ARMAsmBackend::applyFixup(MCAssembler &Asm, const MCFragment &F,
+ const MCFixup &Fixup, const MCValue &Target,
MutableArrayRef<char> Data, uint64_t Value,
- bool IsResolved,
- const MCSubtargetInfo* STI) const {
+ bool IsResolved) {
auto Kind = Fixup.getKind();
if (mc::isRelocation(Kind))
return;
MCContext &Ctx = Asm.getContext();
- Value = adjustFixupValue(Asm, Fixup, Target, Value, IsResolved, Ctx, STI);
+ Value = adjustFixupValue(Asm, Fixup, Target, Value, IsResolved, Ctx,
+ getSubtargetInfo(F));
if (!Value)
return; // Doesn't change encoding.
const unsigned NumBytes = getFixupKindNumBytes(Kind);
diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.h b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.h
index e8ade37e0ac5e..d4efa6fb9dfc4 100644
--- a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.h
+++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.h
@@ -38,10 +38,9 @@ class ARMAsmBackend : public MCAsmBackend {
bool IsResolved, MCContext &Ctx,
const MCSubtargetInfo *STI) const;
- void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
+ void applyFixup(MCAssembler &, const MCFragment &, const MCFixup &,
const MCValue &Target, MutableArrayRef<char> Data,
- uint64_t Value, bool IsResolved,
- const MCSubtargetInfo *STI) const override;
+ uint64_t Value, bool IsResolved) override;
unsigned getRelaxedOpcode(unsigned Op, const MCSubtargetInfo &STI) const;
diff --git a/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp b/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp
index dfe192ab7ee80..9651a436d8598 100644
--- a/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp
+++ b/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp
@@ -384,11 +384,10 @@ bool AVRAsmBackend::addReloc(MCAssembler &Asm, const MCFragment &F,
return IsResolved;
}
-void AVRAsmBackend::applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
- const MCValue &Target,
+void AVRAsmBackend::applyFixup(MCAssembler &Asm, const MCFragment &,
+ const MCFixup &Fixup, const MCValue &Target,
MutableArrayRef<char> Data, uint64_t Value,
- bool IsResolved,
- const MCSubtargetInfo *STI) const {
+ bool IsResolved) {
if (mc::isRelocation(Fixup.getKind()))
return;
adjustFixupValue(Fixup, Target, Value, &Asm.getContext());
diff --git a/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.h b/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.h
index d106a0d21a316..0ce563efcff1b 100644
--- a/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.h
+++ b/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.h
@@ -41,10 +41,9 @@ class AVRAsmBackend : public MCAsmBackend {
const MCValue &Target, uint64_t &FixedValue,
bool IsResolved) override;
- void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
+ void applyFixup(MCAssembler &, const MCFragment &, const MCFixup &,
const MCValue &Target, MutableArrayRef<char> Data,
- uint64_t Value, bool IsResolved,
- const MCSubtargetInfo *STI) const override;
+ uint64_t Value, bool IsResolved) override;
std::optional<MCFixupKind> getFixupKind(StringRef Name) const override;
MCFixupKindInfo getFixupKindInfo(MCFixupKind Kind) const override;
diff --git a/llvm/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp b/llvm/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp
index d2610e8a74457..4ab424472fdec 100644
--- a/llvm/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp
+++ b/llvm/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp
@@ -27,10 +27,9 @@ class BPFAsmBackend : public MCAsmBackend {
BPFAsmBackend(llvm::endianness Endian) : MCAsmBackend(Endian) {}
~BPFAsmBackend() override = default;
- void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
+ void applyFixup(MCAssembler &, const MCFragment &, const MCFixup &,
const MCValue &Target, MutableArrayRef<char> Data,
- uint64_t Value, bool IsResolved,
- const MCSubtargetInfo *STI) const override;
+ uint64_t Value, bool IsResolved) override;
std::unique_ptr<MCObjectTargetWriter>
createObjectTargetWriter() const override;
@@ -67,11 +66,10 @@ bool BPFAsmBackend::writeNopData(raw_ostream &OS, uint64_t Count,
return true;
}
-void BPFAsmBackend::applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
- const MCValue &Target,
+void BPFAsmBackend::applyFixup(MCAssembler &Asm, const MCFragment &,
+ const MCFixup &Fixup, const MCValue &Target,
MutableArrayRef<char> Data, uint64_t Value,
- bool IsResolved,
- const MCSubtargetInfo *STI) const {
+ bool IsResolved) {
if (Fixup.getKind() == FK_SecRel_8) {
// The Value is 0 for global variables, and the in-section offset
// for static variables. Write to the immediate field of the inst.
diff --git a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYAsmBackend.cpp b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYAsmBackend.cpp
index 0c710b8ecdfef..c47367412d29c 100644
--- a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYAsmBackend.cpp
+++ b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYAsmBackend.cpp
@@ -189,11 +189,10 @@ bool CSKYAsmBackend::fixupNeedsRelaxationAdvanced(const MCAssembler &,
}
}
-void CSKYAsmBackend::applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
- const MCValue &Target,
+void CSKYAsmBackend::applyFixup(MCAssembler &Asm, const MCFragment &,
+ const MCFixup &Fixup, const MCValue &Target,
MutableArrayRef<char> Data, uint64_t Value,
- bool IsResolved,
- const MCSubtargetInfo *STI) const {
+ bool IsResolved) {
MCFixupKind Kind = Fixup.getKind();
if (mc::isRelocation(Kind))
return;
diff --git a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYAsmBackend.h b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYAsmBackend.h
index 33aaf985577ec..96672fd9213a1 100644
--- a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYAsmBackend.h
+++ b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYAsmBackend.h
@@ -22,11 +22,9 @@ class CSKYAsmBackend : public MCAsmBackend {
CSKYAsmBackend(const MCSubtargetInfo &STI, const MCTargetOptions &OP)
: MCAsmBackend(llvm::endianness::little) {}
-
- void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
+ void applyFixup(MCAssembler &, const MCFragment &, const MCFixup &,
const MCValue &Target, MutableArrayRef<char> Data,
- uint64_t Value, bool IsResolved,
- const MCSubtargetInfo *STI) const override;
+ uint64_t Value, bool IsResolved) override;
MCFixupKindInfo getFixupKindInfo(MCFixupKind Kind) const override;
diff --git a/llvm/lib/Target/DirectX/MCTargetDesc/DirectXMCTargetDesc.cpp b/llvm/lib/Target/DirectX/MCTargetDesc/DirectXMCTargetDesc.cpp
index 02baa1fcd1406..f5c67a6e0c034 100644
--- a/llvm/lib/Target/DirectX/MCTargetDesc/DirectXMCTargetDesc.cpp
+++ b/llvm/lib/Target/DirectX/MCTargetDesc/DirectXMCTargetDesc.cpp
@@ -77,10 +77,9 @@ class DXILAsmBackend : public MCAsmBackend {
: MCAsmBackend(llvm::endianness::little) {}
~DXILAsmBackend() override = default;
- void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
+ void applyFixup(MCAssembler &, const MCFragment &, const MCFixup &,
const MCValue &Target, MutableArrayRef<char> Data,
- uint64_t Value, bool IsResolved,
- const MCSubtargetInfo *STI) const override {}
+ uint64_t Value, bool IsResolved) override {}
std::unique_ptr<MCObjectTargetWriter>
createObjectTargetWriter() const override {
diff --git a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonAsmBackend.cpp b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonAsmBackend.cpp
index 0aa6e63a06fe4..5a92cc2cfd545 100644
--- a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonAsmBackend.cpp
+++ b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonAsmBackend.cpp
@@ -407,10 +407,9 @@ class HexagonAsmBackend : public MCAsmBackend {
/// ApplyFixup - Apply the \arg Value for given \arg Fixup into the provided
/// data fragment, at the offset specified by the fixup and following the
/// fixup kind as appropriate.
- void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
+ void applyFixup(MCAssembler &Asm, const MCFragment &, const MCFixup &Fixup,
const MCValue &Target, MutableArrayRef<char> Data,
- uint64_t FixupValue, bool IsResolved,
- const MCSubtargetInfo *STI) const override {
+ uint64_t FixupValue, bool IsResolved) override {
// When FixupValue is 0 the relocation is external and there
// is nothing for us to do.
diff --git a/llvm/lib/Target/Lanai/MCTargetDesc/LanaiAsmBackend.cpp b...
[truncated]
|
Remove the MCSubtargetInfo argument from applyFixup, introduced in https://reviews.llvm.org/D45962 , as it's only required by ARM. Instead, add const MCFragment & so that ARMAsmBackend can retrieve MCSubtargetInfo via a static member function. Additionally, remove the MCAssembler argument, which is also only required by ARM. Additionally, make applyReloc non-const. Its arguments now fully cover addReloc's functionality.
Remove the MCSubtargetInfo argument from applyFixup, introduced in https://reviews.llvm.org/D45962 , as it's only required by ARM. Instead, add const MCFragment & so that ARMAsmBackend can retrieve MCSubtargetInfo via a static member function. Additionally, remove the MCAssembler argument, which is also only required by ARM. Additionally, make applyReloc non-const. Its arguments now fully cover addReloc's functionality.
Remove the MCSubtargetInfo argument from applyFixup, introduced in
https://reviews.llvm.org/D45962 , as it's only required by ARM. Instead,
add const MCFragment & so that ARMAsmBackend can retrieve
MCSubtargetInfo via a static member function.
Additionally, remove the MCAssembler argument, which is also only
required by ARM.
Additionally, make applyReloc non-const. Its arguments now fully cover
addReloc's functionality.