LLVM 20.0.0git
|
C++ wrapper function result: Same as CWrapperFunctionResult but auto-releases memory. More...
#include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
Public Member Functions | |
WrapperFunctionResult () | |
Create a default WrapperFunctionResult. | |
WrapperFunctionResult (CWrapperFunctionResult R) | |
Create a WrapperFunctionResult by taking ownership of a CWrapperFunctionResult. | |
WrapperFunctionResult (const WrapperFunctionResult &)=delete | |
WrapperFunctionResult & | operator= (const WrapperFunctionResult &)=delete |
WrapperFunctionResult (WrapperFunctionResult &&Other) | |
WrapperFunctionResult & | operator= (WrapperFunctionResult &&Other) |
~WrapperFunctionResult () | |
CWrapperFunctionResult | release () |
Release ownership of the contained CWrapperFunctionResult. | |
char * | data () |
Get a pointer to the data contained in this instance. | |
const char * | data () const |
Get a const pointer to the data contained in this instance. | |
size_t | size () const |
Returns the size of the data contained in this instance. | |
bool | empty () const |
Returns true if this value is equivalent to a default-constructed WrapperFunctionResult. | |
const char * | getOutOfBandError () const |
If this value is an out-of-band error then this returns the error message, otherwise returns nullptr. | |
Static Public Member Functions | |
static WrapperFunctionResult | allocate (size_t Size) |
Create a WrapperFunctionResult with the given size and return a pointer to the underlying memory. | |
static WrapperFunctionResult | copyFrom (const char *Source, size_t Size) |
Copy from the given char range. | |
static WrapperFunctionResult | copyFrom (const char *Source) |
Copy from the given null-terminated string (includes the null-terminator). | |
static WrapperFunctionResult | copyFrom (const std::string &Source) |
Copy from the given std::string (includes the null terminator). | |
static WrapperFunctionResult | createOutOfBandError (const char *Msg) |
Create an out-of-band error by copying the given string. | |
static WrapperFunctionResult | createOutOfBandError (const std::string &Msg) |
Create an out-of-band error by copying the given string. | |
C++ wrapper function result: Same as CWrapperFunctionResult but auto-releases memory.
Definition at line 40 of file WrapperFunctionUtils.h.
|
inline |
Create a default WrapperFunctionResult.
Definition at line 43 of file WrapperFunctionUtils.h.
|
inline |
Create a WrapperFunctionResult by taking ownership of a CWrapperFunctionResult.
Warning: This should only be used by clients writing wrapper-function caller utilities (like TargetProcessControl).
Definition at line 50 of file WrapperFunctionUtils.h.
|
delete |
|
inline |
Definition at line 58 of file WrapperFunctionUtils.h.
References llvm::Other, and std::swap().
|
inline |
|
inlinestatic |
Create a WrapperFunctionResult with the given size and return a pointer to the underlying memory.
Definition at line 113 of file WrapperFunctionUtils.h.
References llvm::orc::shared::CWrapperFunctionResult::Data, llvm::orc::shared::CWrapperFunctionResult::Size, Size, llvm::orc::shared::CWrapperFunctionResultDataUnion::Value, and llvm::orc::shared::CWrapperFunctionResultDataUnion::ValuePtr.
Referenced by copyFrom(), and llvm::orc::shared::detail::serializeViaSPSToWrapperFunctionResult().
|
inlinestatic |
Copy from the given null-terminated string (includes the null-terminator).
Definition at line 130 of file WrapperFunctionUtils.h.
References copyFrom().
|
inlinestatic |
Copy from the given char range.
Definition at line 123 of file WrapperFunctionUtils.h.
References allocate(), and Size.
Referenced by copyFrom().
|
inlinestatic |
Copy from the given std::string (includes the null terminator).
Definition at line 135 of file WrapperFunctionUtils.h.
References copyFrom().
|
inlinestatic |
Create an out-of-band error by copying the given string.
Definition at line 140 of file WrapperFunctionUtils.h.
References llvm::orc::shared::CWrapperFunctionResult::Data, and llvm::orc::shared::CWrapperFunctionResultDataUnion::ValuePtr.
Referenced by llvm::orc::shared::detail::WrapperFunctionHandlerHelper< RetT(ArgTs...), ResultSerializer, SPSTagTs... >::apply(), llvm::orc::shared::detail::WrapperFunctionAsyncHandlerHelper< RetT(SendResultT, ArgTs...), ResultSerializer, SPSTagTs... >::applyAsync(), createOutOfBandError(), llvm::orc::SimpleRemoteEPCServer::handleDisconnect(), llvm::orc::ExecutionSession::runJITDispatchHandler(), and llvm::orc::shared::detail::serializeViaSPSToWrapperFunctionResult().
|
inlinestatic |
Create an out-of-band error by copying the given string.
Definition at line 150 of file WrapperFunctionUtils.h.
References createOutOfBandError().
|
inline |
Get a pointer to the data contained in this instance.
Definition at line 87 of file WrapperFunctionUtils.h.
References assert(), llvm::orc::shared::CWrapperFunctionResult::Data, llvm::orc::shared::CWrapperFunctionResult::Size, llvm::orc::shared::CWrapperFunctionResultDataUnion::Value, and llvm::orc::shared::CWrapperFunctionResultDataUnion::ValuePtr.
Referenced by llvm::orc::shared::WrapperFunction< SPSRetTagT(SPSTagTs...)>::call().
Get a const pointer to the data contained in this instance.
Definition at line 94 of file WrapperFunctionUtils.h.
References assert(), llvm::orc::shared::CWrapperFunctionResult::Data, llvm::orc::shared::CWrapperFunctionResult::Size, llvm::orc::shared::CWrapperFunctionResultDataUnion::Value, and llvm::orc::shared::CWrapperFunctionResultDataUnion::ValuePtr.
|
inline |
Returns true if this value is equivalent to a default-constructed WrapperFunctionResult.
Definition at line 109 of file WrapperFunctionUtils.h.
References llvm::orc::shared::CWrapperFunctionResult::Data, llvm::orc::shared::CWrapperFunctionResult::Size, and llvm::orc::shared::CWrapperFunctionResultDataUnion::ValuePtr.
If this value is an out-of-band error then this returns the error message, otherwise returns nullptr.
Definition at line 156 of file WrapperFunctionUtils.h.
References llvm::orc::shared::CWrapperFunctionResult::Data, llvm::orc::shared::CWrapperFunctionResult::Size, and llvm::orc::shared::CWrapperFunctionResultDataUnion::ValuePtr.
Referenced by llvm::orc::shared::WrapperFunction< SPSRetTagT(SPSTagTs...)>::call().
|
delete |
|
inline |
Definition at line 63 of file WrapperFunctionUtils.h.
References llvm::Other, and std::swap().
|
inline |
Release ownership of the contained CWrapperFunctionResult.
Warning: Do not use – this method will be removed in the future. It only exists to temporarily support some code that will eventually be moved to the ORC runtime.
Definition at line 79 of file WrapperFunctionUtils.h.
References std::swap().
|
inline |
Returns the size of the data contained in this instance.
Definition at line 101 of file WrapperFunctionUtils.h.
References assert(), llvm::orc::shared::CWrapperFunctionResult::Data, llvm::orc::shared::CWrapperFunctionResult::Size, and llvm::orc::shared::CWrapperFunctionResultDataUnion::ValuePtr.
Referenced by llvm::orc::shared::WrapperFunction< SPSRetTagT(SPSTagTs...)>::call().