Simplify the processFixupValue interface. NFC.

llvm-svn: 306202
This commit is contained in:
Rafael Espindola 2017-06-24 05:22:28 +00:00
parent 25d51d66df
commit 6418856127
8 changed files with 18 additions and 35 deletions

View File

@ -63,11 +63,8 @@ public:
/// Target hook to adjust the literal value of a fixup if necessary.
/// IsResolved signals whether the caller believes a relocation is needed; the
/// target can modify the value. The default does nothing.
virtual void processFixupValue(const MCAssembler &Asm,
const MCAsmLayout &Layout,
const MCFixup &Fixup, const MCFragment *DF,
const MCValue &Target, uint64_t &Value,
bool &IsResolved) {}
virtual void processFixupValue(const MCAssembler &Asm, const MCFixup &Fixup,
const MCValue &Target, bool &IsResolved) {}
/// Apply the \p Value for given \p Fixup into the provided data fragment, at
/// the offset specified by the fixup and following the fixup kind as

View File

@ -263,8 +263,7 @@ bool MCAssembler::evaluateFixup(const MCAsmLayout &Layout,
// Let the backend adjust the fixup value if necessary, including whether
// we need a relocation.
Backend.processFixupValue(*this, Layout, Fixup, DF, Target, Value,
IsResolved);
Backend.processFixupValue(*this, Fixup, Target, IsResolved);
return IsResolved;
}

View File

@ -541,16 +541,14 @@ public:
return createAArch64ELFObjectWriter(OS, OSABI, IsLittleEndian, IsILP32);
}
void processFixupValue(const MCAssembler &Asm, const MCAsmLayout &Layout,
const MCFixup &Fixup, const MCFragment *DF,
const MCValue &Target, uint64_t &Value,
bool &IsResolved) override;
void processFixupValue(const MCAssembler &Asm, const MCFixup &Fixup,
const MCValue &Target, bool &IsResolved) override;
};
void ELFAArch64AsmBackend::processFixupValue(
const MCAssembler &Asm, const MCAsmLayout &Layout, const MCFixup &Fixup,
const MCFragment *DF, const MCValue &Target, uint64_t &Value,
bool &IsResolved) {
void ELFAArch64AsmBackend::processFixupValue(const MCAssembler &Asm,
const MCFixup &Fixup,
const MCValue &Target,
bool &IsResolved) {
// The ADRP instruction adds some multiple of 0x1000 to the current PC &
// ~0xfff. This means that the required offset to reach a symbol can vary by
// up to one step depending on where the ADRP is in memory. For example:

View File

@ -739,11 +739,8 @@ unsigned ARMAsmBackend::adjustFixupValue(const MCAssembler &Asm,
}
void ARMAsmBackend::processFixupValue(const MCAssembler &Asm,
const MCAsmLayout &Layout,
const MCFixup &Fixup,
const MCFragment *DF,
const MCValue &Target, uint64_t &Value,
bool &IsResolved) {
const MCValue &Target, bool &IsResolved) {
const MCSymbolRefExpr *A = Target.getSymA();
const MCSymbol *Sym = A ? &A->getSymbol() : nullptr;
const unsigned FixupKind = Fixup.getKind() ;

View File

@ -40,10 +40,8 @@ public:
/// processFixupValue - Target hook to process the literal value of a fixup
/// if necessary.
void processFixupValue(const MCAssembler &Asm, const MCAsmLayout &Layout,
const MCFixup &Fixup, const MCFragment *DF,
const MCValue &Target, uint64_t &Value,
bool &IsResolved) override;
void processFixupValue(const MCAssembler &Asm, const MCFixup &Fixup,
const MCValue &Target, bool &IsResolved) override;
unsigned adjustFixupValue(const MCAssembler &Asm, const MCFixup &Fixup,
const MCValue &Target, uint64_t Value, bool IsPCRel,

View File

@ -202,10 +202,8 @@ public:
/// processFixupValue - Target hook to adjust the literal value of a fixup
/// if necessary. IsResolved signals whether the caller believes a relocation
/// is needed; the target can modify the value. The default does nothing.
void processFixupValue(const MCAssembler &Asm, const MCAsmLayout &Layout,
const MCFixup &Fixup, const MCFragment *DF,
const MCValue &Target, uint64_t &Value,
bool &IsResolved) override {
void processFixupValue(const MCAssembler &Asm, const MCFixup &Fixup,
const MCValue &Target, bool &IsResolved) override {
MCFixupKind Kind = Fixup.getKind();
switch((unsigned)Kind) {

View File

@ -131,10 +131,8 @@ public:
}
}
void processFixupValue(const MCAssembler &Asm, const MCAsmLayout &Layout,
const MCFixup &Fixup, const MCFragment *DF,
const MCValue &Target, uint64_t &Value,
bool &IsResolved) override {
void processFixupValue(const MCAssembler &Asm, const MCFixup &Fixup,
const MCValue &Target, bool &IsResolved) override {
switch ((PPC::Fixups)Fixup.getKind()) {
default: break;
case PPC::fixup_ppc_br24:

View File

@ -203,10 +203,8 @@ namespace {
return InfosBE[Kind - FirstTargetFixupKind];
}
void processFixupValue(const MCAssembler &Asm, const MCAsmLayout &Layout,
const MCFixup &Fixup, const MCFragment *DF,
const MCValue &Target, uint64_t &Value,
bool &IsResolved) override {
void processFixupValue(const MCAssembler &Asm, const MCFixup &Fixup,
const MCValue &Target, bool &IsResolved) override {
switch ((Sparc::Fixups)Fixup.getKind()) {
default: break;
case Sparc::fixup_sparc_wplt30: