19#ifndef LLVM_EXECUTIONENGINE_ORC_RTBRIDGE_SPS_PROXYSPEC_H
20#define LLVM_EXECUTIONENGINE_ORC_RTBRIDGE_SPS_PROXYSPEC_H
27template <
typename ProxyT,
typename SPSSigT,
const char *DefaultName,
28 typename FnType =
typename ProxyT::FnType>
31template <
typename ProxyT,
typename SPSSigT,
const char *DefaultName,
32 typename RetT,
typename... ArgTs>
33class ProxySpec<ProxyT, SPSSigT, DefaultName, RetT(ArgTs...)> {
35 using CalleeRetT =
typename ProxyT::CalleeRetT;
36 using ErrorRetT =
typename ProxyT::ErrorRetT;
40 template <
typename T>
static void consumeResult(
T &V) {}
42 template <
typename T>
static void consumeResult(
Expected<T> &
E) {
47 static constexpr const char *
Name = DefaultName;
51 const ArgTs &...Args) {
52 if constexpr (std::is_void_v<CalleeRetT>) {
60 [OnComplete = std::move(OnComplete)](
Error SerErr,
61 CalleeRetT
Result)
mutable {
64 return OnComplete(std::move(SerErr));
68 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 constexpr const char * Name
static void dispatch(unique_function< void(ErrorRetT)> OnComplete, ExecutionSession &ES, ExecutorAddr CalleeAddr, const ArgTs &...Args)
unique_function is a type-erasing functor similar to std::function.
void consumeError(Error Err)
Consume a Error without doing anything.