20#ifndef LLVM_EXECUTIONENGINE_ORC_SPSPROXYSPEC_H
21#define LLVM_EXECUTIONENGINE_ORC_SPSPROXYSPEC_H
28template <
typename ProxyT,
typename CI,
29 typename FnType =
typename ProxyT::FnType>
32template <
typename ProxyT,
typename CI,
typename RetT,
typename... ArgTs>
35 using SPSSigT =
typename CI::SPSSig;
36 using CalleeRetT =
typename ProxyT::CalleeRetT;
37 using ErrorRetT =
typename ProxyT::ErrorRetT;
41 template <
typename T>
static void consumeResult(
T &V) {}
43 template <
typename T>
static void consumeResult(
Expected<T> &
E) {
48 static constexpr const char *
Name = CI::Name;
52 const ArgTs &...Args) {
53 auto Caller = [&ES, CalleeAddr](
auto &&SendResult,
const char *ArgData,
56 std::forward<
decltype(SendResult)>(SendResult),
60 if constexpr (std::is_void_v<CalleeRetT>) {
68 [OnComplete = std::move(OnComplete)](
Error SerErr,
69 CalleeRetT
Result)
mutable {
72 return OnComplete(std::move(SerErr));
76 return OnComplete(std::move(
Result));
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
An ExecutionSession represents a running JIT program.
void callWrapperAsync(ExecutorAddr WrapperFnAddr, ExecutorProcessControl::IncomingWFRHandler OnComplete, ArrayRef< char > ArgBuffer)
Run a wrapper function in the executor.
Represents an address in the executor process.
static void dispatch(unique_function< void(ErrorRetT)> OnComplete, ExecutionSession &ES, ExecutorAddr CalleeAddr, const ArgTs &...Args)
static constexpr const char * Name
unique_function is a type-erasing functor similar to std::function.
void consumeError(Error Err)
Consume a Error without doing anything.