Skip to content

Commit 4b41799

Browse files
committed
[CodeGen] Rename PLTRelativeVariantKind. NFC
Migrate away from the deprecated MCSymbolRefExpr::VariantKind. The name "Specifier" is utilized in a few *MCExpr. > "Relocation specifier" is clear, aligns with Arm and IBM AIX's documentation, and fits the assembler's role seamlessly.
1 parent dad7f79 commit 4b41799

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed

llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ class TargetLoweringObjectFileELF : public TargetLoweringObjectFile {
3737
SmallPtrSet<GlobalObject *, 2> Used;
3838

3939
protected:
40-
MCSymbolRefExpr::VariantKind PLTRelativeVariantKind =
41-
MCSymbolRefExpr::VK_None;
40+
uint8_t PLTRelativeSpecifier = 0;
4241

4342
public:
4443
TargetLoweringObjectFileELF();

llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,7 @@ const MCExpr *TargetLoweringObjectFileELF::lowerRelativeReference(
11891189
return nullptr;
11901190

11911191
return MCBinaryExpr::createSub(
1192-
MCSymbolRefExpr::create(TM.getSymbol(LHS), PLTRelativeVariantKind,
1192+
MCSymbolRefExpr::create(TM.getSymbol(LHS), PLTRelativeSpecifier,
11931193
getContext()),
11941194
MCSymbolRefExpr::create(TM.getSymbol(RHS), getContext()), getContext());
11951195
}
@@ -1204,7 +1204,7 @@ const MCExpr *TargetLoweringObjectFileELF::lowerDSOLocalEquivalent(
12041204
if (GV->isDSOLocal() || GV->isImplicitDSOLocal())
12051205
return MCSymbolRefExpr::create(TM.getSymbol(GV), getContext());
12061206

1207-
return MCSymbolRefExpr::create(TM.getSymbol(GV), PLTRelativeVariantKind,
1207+
return MCSymbolRefExpr::create(TM.getSymbol(GV), PLTRelativeSpecifier,
12081208
getContext());
12091209
}
12101210

llvm/lib/Target/AArch64/AArch64TargetObjectFile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class AArch64_ELFTargetObjectFile : public TargetLoweringObjectFileELF {
2121

2222
public:
2323
AArch64_ELFTargetObjectFile() {
24-
PLTRelativeVariantKind = MCSymbolRefExpr::VK_PLT;
24+
PLTRelativeSpecifier = MCSymbolRefExpr::VK_PLT;
2525
SupportIndirectSymViaGOTPCRel = true;
2626
}
2727

llvm/lib/Target/ARM/ARMTargetObjectFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ using namespace dwarf;
2929
//===----------------------------------------------------------------------===//
3030

3131
ARMElfTargetObjectFile::ARMElfTargetObjectFile() {
32-
PLTRelativeVariantKind = MCSymbolRefExpr::VK_ARM_PREL31;
32+
PLTRelativeSpecifier = MCSymbolRefExpr::VK_ARM_PREL31;
3333
SupportIndirectSymViaGOTPCRel = true;
3434
}
3535

llvm/lib/Target/RISCV/RISCVTargetObjectFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void RISCVELFTargetObjectFile::Initialize(MCContext &Ctx,
2626
const TargetMachine &TM) {
2727
TargetLoweringObjectFileELF::Initialize(Ctx, TM);
2828

29-
PLTRelativeVariantKind = MCSymbolRefExpr::VK_PLT;
29+
PLTRelativeSpecifier = MCSymbolRefExpr::VK_PLT;
3030
SupportIndirectSymViaGOTPCRel = true;
3131

3232
SmallDataSection = getContext().getELFSection(

llvm/lib/Target/X86/X86TargetObjectFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const MCExpr *X86_64MachoTargetObjectFile::getIndirectSymViaGOTPCRel(
5454
}
5555

5656
X86ELFTargetObjectFile::X86ELFTargetObjectFile() {
57-
PLTRelativeVariantKind = MCSymbolRefExpr::VariantKind(X86MCExpr::VK_PLT);
57+
PLTRelativeSpecifier = X86MCExpr::VK_PLT;
5858
}
5959

6060
const MCExpr *X86ELFTargetObjectFile::getDebugThreadLocalSymbol(

0 commit comments

Comments
 (0)