[llvm] 8f0baab - [ORC] Drive COFFPlatform bootstrap calls via proxies (#225007)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 00:05:33 PDT 2026


Author: Lang Hames
Date: 2026-09-21T17:05:27+10:00
New Revision: 8f0baab45375336f4c972c4800376a4938da0d97

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

LOG: [ORC] Drive COFFPlatform bootstrap calls via proxies (#225007)

Replace the three callSPSWrapper sites in bootstrapCOFFRuntime (platform
bootstrap, register_jitdylib, register_object_sections) with Proxy
dispatch. CI descriptors are kept local to the .cpp, since these are
COFFPlatform specific.

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp b/llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp
index a183e2570c4a8..d3c46063c431a 100644
--- a/llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp
@@ -44,6 +44,29 @@ using SPSCOFFDeregisterObjectSectionsArgs =
 } // namespace shared
 } // namespace orc
 } // namespace llvm
+// Controller-interface descriptors for the COFF platform runtime's
+// bootstrap-time SPS wrapper calls. Kept in the .cpp (the COFF platform's
+// private contract with its runtime; the SPS arg types live here too), and in
+// a named namespace so the constexpr Name members -- read only as constants by
+// ProxySpec -- don't trip -Wunused-const-variable.
+namespace llvm::orc::coff_sps_ci {
+struct PlatformBootstrap {
+  static constexpr SymbolNameSpec Name =
+      SymbolNameSpec::verbatim("__orc_rt_coff_platform_bootstrap");
+  using SPSSig = void();
+};
+struct RegisterJITDylib {
+  static constexpr SymbolNameSpec Name =
+      SymbolNameSpec::verbatim("__orc_rt_coff_register_jitdylib");
+  using SPSSig = void(SPSString, SPSExecutorAddr);
+};
+struct RegisterObjectSections {
+  static constexpr SymbolNameSpec Name =
+      SymbolNameSpec::verbatim("__orc_rt_coff_register_object_sections");
+  using SPSSig = void(SPSExecutorAddr, SPSCOFFObjectSectionsMap, bool);
+};
+} // namespace llvm::orc::coff_sps_ci
+
 namespace {
 
 class COFFHeaderMaterializationUnit : public MaterializationUnit {
@@ -703,24 +726,43 @@ Error COFFPlatform::bootstrapCOFFRuntime(JITDylib &PlatformJD) {
                       &orc_rt_coff_deregister_object_sections)}))
     return Err;
 
+  // These runtime entry points are held as addresses because their primary use
+  // is as alloc-action tags (see the register/deregister sites below). The
+  // direct dispatches here are a bootstrap-time artifact, so rather than
+  // holding proxies as members we build them over the resolved addresses.
+  // TODO: drop these dispatches once bootstrap no longer needs them.
+  using PlatformBootstrapProxy = Proxy<void()>;
+  using RegisterJITDylibProxy = Proxy<void(std::string, ExecutorAddr)>;
+  using RegisterObjectSectionsProxy =
+      Proxy<void(ExecutorAddr, COFFObjectSectionsMap, bool)>;
+  using sps::ProxySpec;
+
+  PlatformBootstrapProxy PlatformBootstrap(
+      ProxySpec<PlatformBootstrapProxy,
+                coff_sps_ci::PlatformBootstrap>::dispatch,
+      orc_rt_coff_platform_bootstrap);
+  RegisterJITDylibProxy RegisterJITDylib(
+      ProxySpec<RegisterJITDylibProxy, coff_sps_ci::RegisterJITDylib>::dispatch,
+      orc_rt_coff_register_jitdylib);
+  RegisterObjectSectionsProxy RegisterObjectSections(
+      ProxySpec<RegisterObjectSectionsProxy,
+                coff_sps_ci::RegisterObjectSections>::dispatch,
+      orc_rt_coff_register_object_sections);
+
   // Call bootstrap functions
-  if (auto Err = ES.callSPSWrapper<void()>(orc_rt_coff_platform_bootstrap))
+  if (auto Err = PlatformBootstrap(ES))
     return Err;
 
   // Do the pending jitdylib registration actions that we couldn't do
   // because orc runtime was not linked fully.
   for (auto KV : JDBootstrapStates) {
     auto &JDBState = KV.second;
-    if (auto Err = ES.callSPSWrapper<void(SPSString, SPSExecutorAddr)>(
-            orc_rt_coff_register_jitdylib, JDBState.JDName,
-            JDBState.HeaderAddr))
+    if (auto Err = RegisterJITDylib(ES, JDBState.JDName, JDBState.HeaderAddr))
       return Err;
 
     for (auto &ObjSectionMap : JDBState.ObjectSectionsMaps)
-      if (auto Err = ES.callSPSWrapper<void(SPSExecutorAddr,
-                                            SPSCOFFObjectSectionsMap, bool)>(
-              orc_rt_coff_register_object_sections, JDBState.HeaderAddr,
-              ObjSectionMap, false))
+      if (auto Err = RegisterObjectSections(ES, JDBState.HeaderAddr,
+                                            ObjSectionMap, false))
         return Err;
   }
 


        


More information about the llvm-commits mailing list