Skip to content

Commit 63bb4ba

Browse files
committed
[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.
1 parent a1984ec commit 63bb4ba

File tree

1 file changed

+24
-0
lines changed
  • llvm/include/llvm/ExecutionEngine/Orc

1 file changed

+24
-0
lines changed

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,6 +1556,30 @@ class ExecutionSession {
15561556
EPC->getDispatcher().dispatch(std::move(T));
15571557
}
15581558

1559+
/// Returns the bootstrap map.
1560+
const StringMap<std::vector<char>> &getBootstrapMap() const {
1561+
return EPC->getBootstrapMap();
1562+
}
1563+
1564+
/// Look up and SPS-deserialize a bootstrap map value.
1565+
template <typename T, typename SPSTagT>
1566+
Error getBootstrapMapValue(StringRef Key, std::optional<T> &Val) const {
1567+
return EPC->getBootstrapMapValue<T, SPSTagT>(Key, Val);
1568+
}
1569+
1570+
/// Returns the bootstrap symbol map.
1571+
const StringMap<ExecutorAddr> &getBootstrapSymbolsMap() const {
1572+
return EPC->getBootstrapSymbolsMap();
1573+
}
1574+
1575+
/// For each (ExecutorAddr&, StringRef) pair, looks up the string in the
1576+
/// bootstrap symbols map and writes its address to the ExecutorAddr if
1577+
/// found. If any symbol is not found then the function returns an error.
1578+
Error getBootstrapSymbols(
1579+
ArrayRef<std::pair<ExecutorAddr &, StringRef>> Pairs) const {
1580+
return EPC->getBootstrapSymbols(Pairs);
1581+
}
1582+
15591583
/// Run a wrapper function in the executor.
15601584
///
15611585
/// The wrapper function should be callable as:

0 commit comments

Comments
 (0)