[Hexagon][NFC] Rename VK_Hexagon_PCREL to VK_PCREL

On PowerPC we will soon need to use pcrel to indicate PC Relative addressing.
Renamed the Hexagon specific variant kind to a non target specific VK so that
it can be used on both Hexagon and PowerPC.

Differential Revision: https://reviews.llvm.org/D74788
This commit is contained in:
Stefan Pintilie 2020-02-19 09:47:14 -06:00
parent bc23e83e45
commit 440ca29ea2
5 changed files with 8 additions and 8 deletions

View File

@ -182,6 +182,7 @@ public:
VK_GOT, VK_GOT,
VK_GOTOFF, VK_GOTOFF,
VK_GOTREL, VK_GOTREL,
VK_PCREL,
VK_GOTPCREL, VK_GOTPCREL,
VK_GOTTPOFF, VK_GOTTPOFF,
VK_INDNTPOFF, VK_INDNTPOFF,
@ -286,7 +287,6 @@ public:
VK_COFF_IMGREL32, // symbol@imgrel (image-relative) VK_COFF_IMGREL32, // symbol@imgrel (image-relative)
VK_Hexagon_PCREL,
VK_Hexagon_LO16, VK_Hexagon_LO16,
VK_Hexagon_HI16, VK_Hexagon_HI16,
VK_Hexagon_GPREL, VK_Hexagon_GPREL,

View File

@ -221,6 +221,7 @@ StringRef MCSymbolRefExpr::getVariantKindName(VariantKind Kind) {
case VK_GOT: return "GOT"; case VK_GOT: return "GOT";
case VK_GOTOFF: return "GOTOFF"; case VK_GOTOFF: return "GOTOFF";
case VK_GOTREL: return "GOTREL"; case VK_GOTREL: return "GOTREL";
case VK_PCREL: return "PCREL";
case VK_GOTPCREL: return "GOTPCREL"; case VK_GOTPCREL: return "GOTPCREL";
case VK_GOTTPOFF: return "GOTTPOFF"; case VK_GOTTPOFF: return "GOTTPOFF";
case VK_INDNTPOFF: return "INDNTPOFF"; case VK_INDNTPOFF: return "INDNTPOFF";
@ -319,7 +320,6 @@ StringRef MCSymbolRefExpr::getVariantKindName(VariantKind Kind) {
case VK_PPC_TLSLD: return "tlsld"; case VK_PPC_TLSLD: return "tlsld";
case VK_PPC_LOCAL: return "local"; case VK_PPC_LOCAL: return "local";
case VK_COFF_IMGREL32: return "IMGREL"; case VK_COFF_IMGREL32: return "IMGREL";
case VK_Hexagon_PCREL: return "PCREL";
case VK_Hexagon_LO16: return "LO16"; case VK_Hexagon_LO16: return "LO16";
case VK_Hexagon_HI16: return "HI16"; case VK_Hexagon_HI16: return "HI16";
case VK_Hexagon_GPREL: return "GPREL"; case VK_Hexagon_GPREL: return "GPREL";
@ -351,6 +351,7 @@ MCSymbolRefExpr::getVariantKindForName(StringRef Name) {
.Case("got", VK_GOT) .Case("got", VK_GOT)
.Case("gotoff", VK_GOTOFF) .Case("gotoff", VK_GOTOFF)
.Case("gotrel", VK_GOTREL) .Case("gotrel", VK_GOTREL)
.Case("pcrel", VK_PCREL)
.Case("gotpcrel", VK_GOTPCREL) .Case("gotpcrel", VK_GOTPCREL)
.Case("gottpoff", VK_GOTTPOFF) .Case("gottpoff", VK_GOTTPOFF)
.Case("indntpoff", VK_INDNTPOFF) .Case("indntpoff", VK_INDNTPOFF)
@ -437,7 +438,6 @@ MCSymbolRefExpr::getVariantKindForName(StringRef Name) {
.Case("ie", VK_Hexagon_IE) .Case("ie", VK_Hexagon_IE)
.Case("ldgot", VK_Hexagon_LD_GOT) .Case("ldgot", VK_Hexagon_LD_GOT)
.Case("ldplt", VK_Hexagon_LD_PLT) .Case("ldplt", VK_Hexagon_LD_PLT)
.Case("pcrel", VK_Hexagon_PCREL)
.Case("none", VK_ARM_NONE) .Case("none", VK_ARM_NONE)
.Case("got_prel", VK_ARM_GOT_PREL) .Case("got_prel", VK_ARM_GOT_PREL)
.Case("target1", VK_ARM_TARGET1) .Case("target1", VK_ARM_TARGET1)

View File

@ -51,7 +51,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
RelocationType = MCSymbolRefExpr::VK_None; RelocationType = MCSymbolRefExpr::VK_None;
break; break;
case HexagonII::MO_PCREL: case HexagonII::MO_PCREL:
RelocationType = MCSymbolRefExpr::VK_Hexagon_PCREL; RelocationType = MCSymbolRefExpr::VK_PCREL;
break; break;
case HexagonII::MO_GOT: case HexagonII::MO_GOT:
RelocationType = MCSymbolRefExpr::VK_GOT; RelocationType = MCSymbolRefExpr::VK_GOT;

View File

@ -64,7 +64,7 @@ unsigned HexagonELFObjectWriter::getRelocType(MCContext &Ctx,
return ELF::R_HEX_IE_GOT_32; return ELF::R_HEX_IE_GOT_32;
case MCSymbolRefExpr::VariantKind::VK_Hexagon_LD_GOT: case MCSymbolRefExpr::VariantKind::VK_Hexagon_LD_GOT:
return ELF::R_HEX_LD_GOT_32; return ELF::R_HEX_LD_GOT_32;
case MCSymbolRefExpr::VariantKind::VK_Hexagon_PCREL: case MCSymbolRefExpr::VariantKind::VK_PCREL:
return ELF::R_HEX_32_PCREL; return ELF::R_HEX_32_PCREL;
case MCSymbolRefExpr::VariantKind::VK_TPREL: case MCSymbolRefExpr::VariantKind::VK_TPREL:
return ELF::R_HEX_TPREL_32; return ELF::R_HEX_TPREL_32;

View File

@ -147,7 +147,7 @@ static const std::map<unsigned, std::vector<unsigned>> ExtFixups = {
_, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _,
_ }}, _ }},
{ MCSymbolRefExpr::VK_Hexagon_PCREL, { MCSymbolRefExpr::VK_PCREL,
{ _, _, _, _, { _, _, _, _,
_, _, P(_6_PCREL_X), _, _, _, P(_6_PCREL_X), _,
_, P(_9_X), _, _, _, P(_9_X), _, _,
@ -311,7 +311,7 @@ static const std::map<unsigned, std::vector<unsigned>> StdFixups = {
_, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _,
_ }}, _ }},
{ MCSymbolRefExpr::VK_Hexagon_PCREL, { MCSymbolRefExpr::VK_PCREL,
{ _, _, _, _, { _, _, _, _,
_, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _,
@ -491,7 +491,7 @@ Hexagon::Fixups HexagonMCCodeEmitter::getFixupNoBits(
{ MCSymbolRefExpr::VK_Hexagon_LD_GOT, fixup_Hexagon_LD_GOT_32_6_X }, { MCSymbolRefExpr::VK_Hexagon_LD_GOT, fixup_Hexagon_LD_GOT_32_6_X },
{ MCSymbolRefExpr::VK_Hexagon_IE, fixup_Hexagon_IE_32_6_X }, { MCSymbolRefExpr::VK_Hexagon_IE, fixup_Hexagon_IE_32_6_X },
{ MCSymbolRefExpr::VK_Hexagon_IE_GOT, fixup_Hexagon_IE_GOT_32_6_X }, { MCSymbolRefExpr::VK_Hexagon_IE_GOT, fixup_Hexagon_IE_GOT_32_6_X },
{ MCSymbolRefExpr::VK_Hexagon_PCREL, fixup_Hexagon_B32_PCREL_X }, { MCSymbolRefExpr::VK_PCREL, fixup_Hexagon_B32_PCREL_X },
{ MCSymbolRefExpr::VK_Hexagon_GD_PLT, fixup_Hexagon_GD_PLT_B32_PCREL_X }, { MCSymbolRefExpr::VK_Hexagon_GD_PLT, fixup_Hexagon_GD_PLT_B32_PCREL_X },
{ MCSymbolRefExpr::VK_Hexagon_LD_PLT, fixup_Hexagon_LD_PLT_B32_PCREL_X }, { MCSymbolRefExpr::VK_Hexagon_LD_PLT, fixup_Hexagon_LD_PLT_B32_PCREL_X },
}; };