[JITLink][AArch64] Remove unused Pointer64Anon edge kind.
authorLang Hames <lhames@gmail.com>
Sun, 30 Oct 2022 18:11:27 +0000 (11:11 -0700)
committerLang Hames <lhames@gmail.com>
Sun, 30 Oct 2022 18:21:08 +0000 (11:21 -0700)
Pointer64Anon was lifted out of the MachO backend and into aarch64.h when that
header was created, but Pointer64Anon is really a MachO-specific "normalized"
relocation value, rather than a generic Edge::Kind. Any uses can be safely
replaced with Pointer64.

(Side note: the role of MachOPointer64Anon is to aid MachO relocation parsing:
For MachOPointer64, the target symbol is specified by the r_symbolnum field in
the relocation. For MachOPointer64Anon the address of the anonymous target is
read from the fixup location.)

llvm/include/llvm/ExecutionEngine/JITLink/aarch64.h
llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp
llvm/lib/ExecutionEngine/JITLink/aarch64.cpp

index 9b50fb1..55ba22a 100644 (file)
@@ -25,7 +25,6 @@ enum EdgeKind_aarch64 : Edge::Kind {
   Branch26 = Edge::FirstRelocation,
   Pointer32,
   Pointer64,
-  Pointer64Anon,
   Page21,
   PageOffset12,
   MoveWide16,
@@ -131,8 +130,7 @@ inline Error applyFixup(LinkGraph &G, Block &B, const Edge &E) {
     *(ulittle32_t *)FixupPtr = Value;
     break;
   }
-  case Pointer64:
-  case Pointer64Anon: {
+  case Pointer64: {
     uint64_t Value = E.getTarget().getAddress().getValue() + E.getAddend();
     *(ulittle64_t *)FixupPtr = Value;
     break;
index d243a1f..28beb07 100644 (file)
@@ -362,7 +362,7 @@ private:
           else
             return TargetSymbolOrErr.takeError();
           Addend = TargetAddress - TargetSymbol->getAddress();
-          Kind = aarch64::Pointer64Anon;
+          Kind = aarch64::Pointer64;
           break;
         }
         case MachOPage21:
index 1b75e54..ada92f1 100644 (file)
@@ -32,8 +32,6 @@ const char *getEdgeKindName(Edge::Kind R) {
     return "Branch26";
   case Pointer64:
     return "Pointer64";
-  case Pointer64Anon:
-    return "Pointer64Anon";
   case Page21:
     return "Page21";
   case PageOffset12: