LLVM 19.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::orc::shared::WrapperFunctionCall Class Reference

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 ExecutorAddrgetCallee () const
 Returns the address to be called.
 
const ArgDataBufferTypegetArgData () 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, ErrorrunWithSPSRet (RetT &RetVal) const
 Run call and deserialize result using SPS.
 
template<typename SPSRetT >
std::enable_if_t< std::is_same< SPSRetT, void >::value, ErrorrunWithSPSRet () 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< WrapperFunctionCallCreate (ExecutorAddr FnAddr, const ArgTs &...Args)
 Create a WrapperFunctionCall using the given SPS serializer to serialize the arguments.
 

Detailed Description

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.

Member Typedef Documentation

◆ ArgDataBufferType

Definition at line 630 of file WrapperFunctionUtils.h.

Constructor & Destructor Documentation

◆ WrapperFunctionCall() [1/2]

llvm::orc::shared::WrapperFunctionCall::WrapperFunctionCall ( )
default

Referenced by Create().

◆ WrapperFunctionCall() [2/2]

llvm::orc::shared::WrapperFunctionCall::WrapperFunctionCall ( ExecutorAddr  FnAddr,
ArgDataBufferType  ArgData 
)
inline

Create a WrapperFunctionCall from a target function and arg buffer.

Definition at line 651 of file WrapperFunctionUtils.h.

Member Function Documentation

◆ Create()

template<typename SPSSerializer , typename... ArgTs>
static Expected< WrapperFunctionCall > llvm::orc::shared::WrapperFunctionCall::Create ( ExecutorAddr  FnAddr,
const ArgTs &...  Args 
)
inlinestatic

◆ getArgData()

const ArgDataBufferType & llvm::orc::shared::WrapperFunctionCall::getArgData ( ) const
inline

◆ getCallee()

const ExecutorAddr & llvm::orc::shared::WrapperFunctionCall::getCallee ( ) const
inline

◆ operator bool()

llvm::orc::shared::WrapperFunctionCall::operator bool ( ) const
inlineexplicit

WrapperFunctionCalls convert to true if the callee is non-null.

Definition at line 661 of file WrapperFunctionUtils.h.

◆ run()

shared::WrapperFunctionResult llvm::orc::shared::WrapperFunctionCall::run ( ) const
inline

Run call returning raw WrapperFunctionResult.

Definition at line 664 of file WrapperFunctionUtils.h.

References llvm::orc::ExecutorAddr::toPtr().

Referenced by runWithSPSRet().

◆ runWithSPSRet() [1/2]

template<typename SPSRetT >
std::enable_if_t< std::is_same< SPSRetT, void >::value, Error > llvm::orc::shared::WrapperFunctionCall::runWithSPSRet ( ) const
inline

Overload for SPS functions returning void.

Definition at line 689 of file WrapperFunctionUtils.h.

References E.

◆ runWithSPSRet() [2/2]

template<typename SPSRetT , typename RetT >
std::enable_if_t<!std::is_same< SPSRetT, void >::value, Error > llvm::orc::shared::WrapperFunctionCall::runWithSPSRet ( RetT &  RetVal) const
inline

Run call and deserialize result using SPS.

Definition at line 674 of file WrapperFunctionUtils.h.

References llvm::inconvertibleErrorCode(), run(), and llvm::Error::success().

◆ runWithSPSRetErrorMerged()

Error llvm::orc::shared::WrapperFunctionCall::runWithSPSRetErrorMerged ( ) const
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().


The documentation for this class was generated from the following file: