Skip to content

Commit 5ba458c

Browse files
committed
MCFixup: Replace getTargetKind with getKind
1 parent 0991435 commit 5ba458c

File tree

15 files changed

+23
-22
lines changed

15 files changed

+23
-22
lines changed

llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ static bool shouldForceRelocation(const MCFixup &Fixup) {
417417
// same page as the ADRP and the instruction should encode 0x0. Assuming the
418418
// section isn't 0x1000-aligned, we therefore need to delegate this decision
419419
// to the linker -- a relocation!
420-
return Fixup.getTargetKind() == AArch64::fixup_aarch64_pcrel_adrp_imm21;
420+
return Fixup.getKind() == AArch64::fixup_aarch64_pcrel_adrp_imm21;
421421
}
422422

423423
void AArch64AsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
@@ -431,7 +431,7 @@ void AArch64AsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
431431
if (mc::isRelocation(Kind))
432432
return;
433433

434-
if (Fixup.getTargetKind() == FK_Data_8 && TheTriple.isOSBinFormatELF()) {
434+
if (Fixup.getKind() == FK_Data_8 && TheTriple.isOSBinFormatELF()) {
435435
auto RefKind = static_cast<AArch64::Specifier>(Target.getSpecifier());
436436
AArch64::Specifier SymLoc = AArch64::getSymbolLoc(RefKind);
437437
if (SymLoc == AArch64::S_AUTH || SymLoc == AArch64::S_AUTHADDR) {
@@ -488,7 +488,7 @@ void AArch64AsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
488488
AArch64::Specifier RefKind =
489489
static_cast<AArch64::Specifier>(Target.getSpecifier());
490490
if (AArch64::getSymbolLoc(RefKind) == AArch64::S_SABS ||
491-
(!RefKind && Fixup.getTargetKind() == AArch64::fixup_aarch64_movw)) {
491+
(!RefKind && Fixup.getKind() == AArch64::fixup_aarch64_movw)) {
492492
// If the immediate is negative, generate MOVN else MOVZ.
493493
// (Bit 30 = 0) ==> MOVN, (Bit 30 = 1) ==> MOVZ.
494494
if (SignedValue < 0)

llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ AArch64ELFObjectWriter::AArch64ELFObjectWriter(uint8_t OSABI, bool IsILP32)
5757
// assumes IsILP32 is true
5858
bool AArch64ELFObjectWriter::isNonILP32reloc(const MCFixup &Fixup,
5959
AArch64::Specifier RefKind) const {
60-
if (Fixup.getTargetKind() != AArch64::fixup_aarch64_movw)
60+
if (Fixup.getKind() != AArch64::fixup_aarch64_movw)
6161
return false;
6262
switch (RefKind) {
6363
case AArch64::S_ABS_G3:
@@ -84,7 +84,7 @@ bool AArch64ELFObjectWriter::isNonILP32reloc(const MCFixup &Fixup,
8484
unsigned AArch64ELFObjectWriter::getRelocType(const MCFixup &Fixup,
8585
const MCValue &Target,
8686
bool IsPCRel) const {
87-
unsigned Kind = Fixup.getTargetKind();
87+
auto Kind = Fixup.getKind();
8888
AArch64::Specifier RefKind =
8989
static_cast<AArch64::Specifier>(Target.getSpecifier());
9090
AArch64::Specifier SymLoc = AArch64::getSymbolLoc(RefKind);

llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFObjectWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ unsigned AMDGPUELFObjectWriter::getRelocType(const MCFixup &Fixup,
7676
return IsPCRel ? ELF::R_AMDGPU_REL64 : ELF::R_AMDGPU_ABS64;
7777
}
7878

79-
if (Fixup.getTargetKind() == AMDGPU::fixup_si_sopp_br) {
79+
if (Fixup.getKind() == AMDGPU::fixup_si_sopp_br) {
8080
const auto *SymA = Target.getAddSym();
8181
assert(SymA);
8282

llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ bool ARMAsmBackend::fixupNeedsRelaxationAdvanced(const MCFixup &Fixup,
316316
uint64_t Value,
317317
bool Resolved) const {
318318
const MCSymbol *Sym = Target.getAddSym();
319-
if (needsInterworking(*Asm, Sym, Fixup.getTargetKind()))
319+
if (needsInterworking(*Asm, Sym, Fixup.getKind()))
320320
return true;
321321

322322
if (!Resolved)
@@ -947,7 +947,7 @@ bool ARMAsmBackend::shouldForceRelocation(const MCFixup &Fixup,
947947
}
948948
// Create relocations for unconditional branches to function symbols with
949949
// different execution mode in ELF binaries.
950-
if (needsInterworking(*Asm, Sym, Fixup.getTargetKind()))
950+
if (needsInterworking(*Asm, Sym, Fixup.getKind()))
951951
return true;
952952
// We must always generate a relocation for BL/BLX instructions if we have
953953
// a symbol to reference, as the linker relies on knowing the destination

llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ bool ARMELFObjectWriter::needsRelocateWithSymbol(const MCValue &V,
7575
unsigned ARMELFObjectWriter::getRelocType(const MCFixup &Fixup,
7676
const MCValue &Target,
7777
bool IsPCRel) const {
78-
unsigned Kind = Fixup.getTargetKind();
78+
auto Kind = Fixup.getKind();
7979
uint8_t Specifier = Target.getSpecifier();
8080
auto CheckFDPIC = [&](uint32_t Type) {
8181
if (getOSABI() != ELF::ELFOSABI_ARM_FDPIC)

llvm/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void BPFAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
9090
Data[Fixup.getOffset() + 1] = 0x1;
9191
support::endian::write32be(&Data[Fixup.getOffset() + 4], Value);
9292
}
93-
} else if (Fixup.getTargetKind() == BPF::FK_BPF_PCRel_4) {
93+
} else if (Fixup.getKind() == BPF::FK_BPF_PCRel_4) {
9494
// The input Value represents the number of bytes.
9595
Value = (uint32_t)((Value - 8) / 8);
9696
support::endian::write<uint32_t>(&Data[Fixup.getOffset() + 4], Value,

llvm/lib/Target/CSKY/MCTargetDesc/CSKYELFObjectWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ unsigned CSKYELFObjectWriter::getRelocType(const MCFixup &Fixup,
3939
bool IsPCRel) const {
4040
const MCExpr *Expr = Fixup.getValue();
4141
// Determine the type of the relocation
42-
unsigned Kind = Fixup.getTargetKind();
42+
auto Kind = Fixup.getKind();
4343
uint8_t Modifier = Target.getSpecifier();
4444

4545
switch (Target.getSpecifier()) {

llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ void LoongArchAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
157157
MCContext &Ctx = getContext();
158158

159159
// Fixup leb128 separately.
160-
if (Fixup.getTargetKind() == FK_Data_leb128)
160+
if (Fixup.getKind() == FK_Data_leb128)
161161
return fixupLeb128(Ctx, Fixup, Data, Value);
162162

163163
// Apply any target-specific value adjustments.

llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchELFObjectWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ unsigned LoongArchELFObjectWriter::getRelocType(const MCFixup &Fixup,
6868
break;
6969
}
7070

71-
unsigned Kind = Fixup.getTargetKind();
71+
auto Kind = Fixup.getKind();
7272
if (mc::isRelocation(Fixup.getKind()))
7373
return Kind;
7474
switch (Kind) {

llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ unsigned MipsELFObjectWriter::getRelocType(const MCFixup &Fixup,
156156
const MCValue &Target,
157157
bool IsPCRel) const {
158158
// Determine the type of the relocation.
159-
unsigned Kind = Fixup.getTargetKind();
159+
auto Kind = Fixup.getKind();
160160
switch (Target.getSpecifier()) {
161161
case Mips::S_DTPREL:
162162
case Mips::S_DTPREL_HI:

0 commit comments

Comments
 (0)