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 if constexpr (std::is_void_v<CalleeRetT>) {
61 [OnComplete = std::move(OnComplete)](
Error SerErr,
62 CalleeRetT
Result)
mutable {
65 return OnComplete(std::move(SerErr));
69 return OnComplete(std::move(
Result));
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
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 callSPSWrapperAsync(ExecutorAddr WrapperFnAddr, SendResultT &&SendResult, const ArgTs &...Args)
Run a wrapper function using SPS to serialize the arguments and deserialize the results.
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.