LLVM 18.0.0git
|
Represents a serialized wrapper function call. More...
#include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
Public Types | |
using | ArgDataBufferType = SmallVector< char, 24 > |
Public Member Functions | |
WrapperFunctionCall ()=default | |
WrapperFunctionCall (ExecutorAddr FnAddr, ArgDataBufferType ArgData) | |
Create a WrapperFunctionCall from a target function and arg buffer. | |
const ExecutorAddr & | getCallee () const |
Returns the address to be called. | |
const ArgDataBufferType & | getArgData () const |
Returns the argument data. | |
operator bool () const | |
WrapperFunctionCalls convert to true if the callee is non-null. | |
shared::WrapperFunctionResult | run () const |
Run call returning raw WrapperFunctionResult. | |
template<typename SPSRetT , typename RetT > | |
std::enable_if_t<!std::is_same< SPSRetT, void >::value, Error > | runWithSPSRet (RetT &RetVal) const |
Run call and deserialize result using SPS. | |
template<typename SPSRetT > | |
std::enable_if_t< std::is_same< SPSRetT, void >::value, Error > | runWithSPSRet () const |
Overload for SPS functions returning void. | |
Error | runWithSPSRetErrorMerged () const |
Run call and deserialize an SPSError result. | |
Static Public Member Functions | |
template<typename SPSSerializer , typename... ArgTs> | |
static Expected< WrapperFunctionCall > | Create (ExecutorAddr FnAddr, const ArgTs &...Args) |
Create a WrapperFunctionCall using the given SPS serializer to serialize the arguments. | |
Represents a serialized wrapper function call.
Serializing calls themselves allows us to batch them: We can make one "run-wrapper-functions" utility and send it a list of calls to run.
The motivating use-case for this API is JITLink allocation actions, where we want to run multiple functions to finalize linked memory without having to make separate IPC calls for each one.
Definition at line 628 of file WrapperFunctionUtils.h.
Definition at line 630 of file WrapperFunctionUtils.h.
|
default |
Referenced by Create().
|
inline |
Create a WrapperFunctionCall from a target function and arg buffer.
Definition at line 651 of file WrapperFunctionUtils.h.
|
inlinestatic |
Create a WrapperFunctionCall using the given SPS serializer to serialize the arguments.
Definition at line 635 of file WrapperFunctionUtils.h.
References llvm::SmallVectorTemplateCommon< T, typename >::data(), llvm::SmallVectorBase< Size_T >::empty(), llvm::inconvertibleErrorCode(), llvm::SmallVectorImpl< T >::resize(), llvm::SmallVectorBase< Size_T >::size(), and WrapperFunctionCall().
Referenced by llvm::orc::EPCGenericRTDyldMemoryManager::finalizeMemory(), and llvm::orc::PerfSupportPlugin::modifyPassConfig().
|
inline |
Returns the argument data.
Definition at line 658 of file WrapperFunctionUtils.h.
Referenced by llvm::orc::shared::SPSSerializationTraits< SPSWrapperFunctionCall, WrapperFunctionCall >::serialize(), and llvm::orc::shared::SPSSerializationTraits< SPSWrapperFunctionCall, WrapperFunctionCall >::size().
|
inline |
Returns the address to be called.
Definition at line 655 of file WrapperFunctionUtils.h.
Referenced by llvm::orc::shared::SPSSerializationTraits< SPSWrapperFunctionCall, WrapperFunctionCall >::serialize(), and llvm::orc::shared::SPSSerializationTraits< SPSWrapperFunctionCall, WrapperFunctionCall >::size().
|
inlineexplicit |
WrapperFunctionCalls convert to true if the callee is non-null.
Definition at line 661 of file WrapperFunctionUtils.h.
|
inline |
Run call returning raw WrapperFunctionResult.
Definition at line 664 of file WrapperFunctionUtils.h.
References llvm::orc::ExecutorAddr::toPtr().
Referenced by runWithSPSRet().
|
inline |
Overload for SPS functions returning void.
Definition at line 689 of file WrapperFunctionUtils.h.
References E.
|
inline |
Run call and deserialize result using SPS.
Definition at line 674 of file WrapperFunctionUtils.h.
References llvm::inconvertibleErrorCode(), run(), and llvm::Error::success().
|
inline |
Run call and deserialize an SPSError result.
SPSError returns and deserialization failures are merged into the returned error.
Definition at line 696 of file WrapperFunctionUtils.h.
References llvm::orc::shared::detail::fromSPSSerializable().