[llvm-branch-commits] [llvm] c7e085c - [ORC] Add ExecutionSession convenience methods to access bootstrap values.

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Feb 8 13:41:02 PST 2025


Author: Lang Hames
Date: 2025-02-08T16:19:55Z
New Revision: c7e085c5d32def57fffd292174a052bff6d6a241

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

LOG: [ORC] Add ExecutionSession convenience methods to access bootstrap values.

The getBootstrapMap, getBootstrapMapValue, getBootstrapSymbolsMap, and
getBootstrapSymbols methods forward to their respective counterparts in
ExecutorProcessControl, similar to the callWrapper functions.

These methods will be used to simplify an upcoming patch that accesses
the bootstrap values.

(cherry picked from commit 63bb4ba84a22279c1cdd4953f0c19269b23a9d32)

Added: 
    

Modified: 
    llvm/include/llvm/ExecutionEngine/Orc/Core.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ExecutionEngine/Orc/Core.h b/llvm/include/llvm/ExecutionEngine/Orc/Core.h
index 3eddaf4c9c59ff4..cecb4094c9a5717 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Core.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Core.h
@@ -1556,6 +1556,30 @@ class ExecutionSession {
     EPC->getDispatcher().dispatch(std::move(T));
   }
 
+  /// Returns the bootstrap map.
+  const StringMap<std::vector<char>> &getBootstrapMap() const {
+    return EPC->getBootstrapMap();
+  }
+
+  /// Look up and SPS-deserialize a bootstrap map value.
+  template <typename T, typename SPSTagT>
+  Error getBootstrapMapValue(StringRef Key, std::optional<T> &Val) const {
+    return EPC->getBootstrapMapValue<T, SPSTagT>(Key, Val);
+  }
+
+  /// Returns the bootstrap symbol map.
+  const StringMap<ExecutorAddr> &getBootstrapSymbolsMap() const {
+    return EPC->getBootstrapSymbolsMap();
+  }
+
+  /// For each (ExecutorAddr&, StringRef) pair, looks up the string in the
+  /// bootstrap symbols map and writes its address to the ExecutorAddr if
+  /// found. If any symbol is not found then the function returns an error.
+  Error getBootstrapSymbols(
+      ArrayRef<std::pair<ExecutorAddr &, StringRef>> Pairs) const {
+    return EPC->getBootstrapSymbols(Pairs);
+  }
+
   /// Run a wrapper function in the executor.
   ///
   /// The wrapper function should be callable as:


        


More information about the llvm-branch-commits mailing list