[llvm] c7f350f - [JITLink][i386] Remove more unnecessary enum value qualifications.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Wed May 7 18:13:39 PDT 2025


Author: Lang Hames
Date: 2025-05-08T11:13:32+10:00
New Revision: c7f350f1428df14e3114977b830ab4dcd3008983

URL: https://github.com/llvm/llvm-project/commit/c7f350f1428df14e3114977b830ab4dcd3008983
DIFF: https://github.com/llvm/llvm-project/commit/c7f350f1428df14e3114977b830ab4dcd3008983.diff

LOG: [JITLink][i386] Remove more unnecessary enum value qualifications.

Added: 
    

Modified: 
    llvm/include/llvm/ExecutionEngine/JITLink/i386.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ExecutionEngine/JITLink/i386.h b/llvm/include/llvm/ExecutionEngine/JITLink/i386.h
index 629e0d8a18729..3900fdc8ec7b1 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/i386.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/i386.h
@@ -181,7 +181,6 @@ const char *getEdgeKindName(Edge::Kind K);
 /// Apply fixup expression for edge to block content.
 inline Error applyFixup(LinkGraph &G, Block &B, const Edge &E,
                         const Symbol *GOTSymbol) {
-  using namespace i386;
   using namespace llvm::support;
 
   char *BlockWorkingMem = B.getAlreadyMutableContent().data();
@@ -189,19 +188,19 @@ inline Error applyFixup(LinkGraph &G, Block &B, const Edge &E,
   auto FixupAddress = B.getAddress() + E.getOffset();
 
   switch (E.getKind()) {
-  case i386::Pointer32: {
+  case Pointer32: {
     uint32_t Value = E.getTarget().getAddress().getValue() + E.getAddend();
     *(ulittle32_t *)FixupPtr = Value;
     break;
   }
 
-  case i386::PCRel32: {
+  case PCRel32: {
     int32_t Value = E.getTarget().getAddress() - FixupAddress + E.getAddend();
     *(little32_t *)FixupPtr = Value;
     break;
   }
 
-  case i386::Pointer16: {
+  case Pointer16: {
     uint32_t Value = E.getTarget().getAddress().getValue() + E.getAddend();
     if (LLVM_LIKELY(isUInt<16>(Value)))
       *(ulittle16_t *)FixupPtr = Value;
@@ -210,7 +209,7 @@ inline Error applyFixup(LinkGraph &G, Block &B, const Edge &E,
     break;
   }
 
-  case i386::PCRel16: {
+  case PCRel16: {
     int32_t Value = E.getTarget().getAddress() - FixupAddress + E.getAddend();
     if (LLVM_LIKELY(isInt<16>(Value)))
       *(little16_t *)FixupPtr = Value;
@@ -219,13 +218,13 @@ inline Error applyFixup(LinkGraph &G, Block &B, const Edge &E,
     break;
   }
 
-  case i386::Delta32: {
+  case Delta32: {
     int32_t Value = E.getTarget().getAddress() - FixupAddress + E.getAddend();
     *(little32_t *)FixupPtr = Value;
     break;
   }
 
-  case i386::Delta32FromGOT: {
+  case Delta32FromGOT: {
     assert(GOTSymbol && "No GOT section symbol");
     int32_t Value =
         E.getTarget().getAddress() - GOTSymbol->getAddress() + E.getAddend();
@@ -233,9 +232,9 @@ inline Error applyFixup(LinkGraph &G, Block &B, const Edge &E,
     break;
   }
 
-  case i386::BranchPCRel32:
-  case i386::BranchPCRel32ToPtrJumpStub:
-  case i386::BranchPCRel32ToPtrJumpStubBypassable: {
+  case BranchPCRel32:
+  case BranchPCRel32ToPtrJumpStub:
+  case BranchPCRel32ToPtrJumpStubBypassable: {
     int32_t Value = E.getTarget().getAddress() - FixupAddress + E.getAddend();
     *(little32_t *)FixupPtr = Value;
     break;
@@ -321,14 +320,14 @@ class GOTTableManager : public TableManager<GOTTableManager> {
   bool visitEdge(LinkGraph &G, Block *B, Edge &E) {
     Edge::Kind KindToSet = Edge::Invalid;
     switch (E.getKind()) {
-    case i386::Delta32FromGOT: {
+    case Delta32FromGOT: {
       // we need to make sure that the GOT section exists, but don't otherwise
       // need to fix up this edge
       getGOTSection(G);
       return false;
     }
-    case i386::RequestGOTAndTransformToDelta32FromGOT:
-      KindToSet = i386::Delta32FromGOT;
+    case RequestGOTAndTransformToDelta32FromGOT:
+      KindToSet = Delta32FromGOT;
       break;
     default:
       return false;
@@ -367,7 +366,7 @@ class PLTTableManager : public TableManager<PLTTableManager> {
   static StringRef getSectionName() { return "$__STUBS"; }
 
   bool visitEdge(LinkGraph &G, Block *B, Edge &E) {
-    if (E.getKind() == i386::BranchPCRel32 && !E.getTarget().isDefined()) {
+    if (E.getKind() == BranchPCRel32 && !E.getTarget().isDefined()) {
       DEBUG_WITH_TYPE("jitlink", {
         dbgs() << "  Fixing " << G.getEdgeKindName(E.getKind()) << " edge at "
                << B->getFixupAddress(E) << " (" << B->getAddress() << " + "
@@ -375,7 +374,7 @@ class PLTTableManager : public TableManager<PLTTableManager> {
       });
       // Set the edge kind to Branch32ToPtrJumpStubBypassable to enable it to
       // be optimized when the target is in-range.
-      E.setKind(i386::BranchPCRel32ToPtrJumpStubBypassable);
+      E.setKind(BranchPCRel32ToPtrJumpStubBypassable);
       E.setTarget(getEntryForTarget(G, E.getTarget()));
       return true;
     }


        


More information about the llvm-commits mailing list