LLVM  14.0.0git
Public Member Functions | Static Public Member Functions | List of all members
llvm::orc::shared::WrapperFunctionResult Class Reference

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. More...
 
 WrapperFunctionResult (detail::CWrapperFunctionResult R)
 Create a WrapperFunctionResult by taking ownership of a detail::CWrapperFunctionResult. More...
 
 WrapperFunctionResult (const WrapperFunctionResult &)=delete
 
WrapperFunctionResultoperator= (const WrapperFunctionResult &)=delete
 
 WrapperFunctionResult (WrapperFunctionResult &&Other)
 
WrapperFunctionResultoperator= (WrapperFunctionResult &&Other)
 
 ~WrapperFunctionResult ()
 
detail::CWrapperFunctionResult release ()
 Release ownership of the contained detail::CWrapperFunctionResult. More...
 
char * data ()
 Get a pointer to the data contained in this instance. More...
 
const char * data () const
 Get a const pointer to the data contained in this instance. More...
 
size_t size () const
 Returns the size of the data contained in this instance. More...
 
bool empty () const
 Returns true if this value is equivalent to a default-constructed WrapperFunctionResult. More...
 
const char * getOutOfBandError () const
 If this value is an out-of-band error then this returns the error message, otherwise returns nullptr. More...
 

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. More...
 
static WrapperFunctionResult copyFrom (const char *Source, size_t Size)
 Copy from the given char range. More...
 
static WrapperFunctionResult copyFrom (const char *Source)
 Copy from the given null-terminated string (includes the null-terminator). More...
 
static WrapperFunctionResult copyFrom (const std::string &Source)
 Copy from the given std::string (includes the null terminator). More...
 
static WrapperFunctionResult createOutOfBandError (const char *Msg)
 Create an out-of-band error by copying the given string. More...
 
static WrapperFunctionResult createOutOfBandError (const std::string &Msg)
 Create an out-of-band error by copying the given string. More...
 

Detailed Description

C++ wrapper function result: Same as CWrapperFunctionResult but auto-releases memory.

Definition at line 46 of file WrapperFunctionUtils.h.

Constructor & Destructor Documentation

◆ WrapperFunctionResult() [1/4]

llvm::orc::shared::WrapperFunctionResult::WrapperFunctionResult ( )
inline

Create a default WrapperFunctionResult.

Definition at line 49 of file WrapperFunctionUtils.h.

◆ WrapperFunctionResult() [2/4]

llvm::orc::shared::WrapperFunctionResult::WrapperFunctionResult ( detail::CWrapperFunctionResult  R)
inline

Create a WrapperFunctionResult by taking ownership of a detail::CWrapperFunctionResult.

Warning: This should only be used by clients writing wrapper-function caller utilities (like TargetProcessControl).

Definition at line 56 of file WrapperFunctionUtils.h.

◆ WrapperFunctionResult() [3/4]

llvm::orc::shared::WrapperFunctionResult::WrapperFunctionResult ( const WrapperFunctionResult )
delete

◆ WrapperFunctionResult() [4/4]

llvm::orc::shared::WrapperFunctionResult::WrapperFunctionResult ( WrapperFunctionResult &&  Other)
inline

Definition at line 64 of file WrapperFunctionUtils.h.

References Other, and std::swap().

◆ ~WrapperFunctionResult()

llvm::orc::shared::WrapperFunctionResult::~WrapperFunctionResult ( )
inline

Member Function Documentation

◆ allocate()

static WrapperFunctionResult llvm::orc::shared::WrapperFunctionResult::allocate ( size_t  Size)
inlinestatic

◆ copyFrom() [1/3]

static WrapperFunctionResult llvm::orc::shared::WrapperFunctionResult::copyFrom ( const char *  Source)
inlinestatic

Copy from the given null-terminated string (includes the null-terminator).

Definition at line 136 of file WrapperFunctionUtils.h.

References copyFrom(), and llvm::Sched::Source.

◆ copyFrom() [2/3]

static WrapperFunctionResult llvm::orc::shared::WrapperFunctionResult::copyFrom ( const char *  Source,
size_t  Size 
)
inlinestatic

Copy from the given char range.

Definition at line 129 of file WrapperFunctionUtils.h.

References allocate(), memcpy(), llvm::Check::Size, and llvm::Sched::Source.

Referenced by copyFrom().

◆ copyFrom() [3/3]

static WrapperFunctionResult llvm::orc::shared::WrapperFunctionResult::copyFrom ( const std::string &  Source)
inlinestatic

Copy from the given std::string (includes the null terminator).

Definition at line 141 of file WrapperFunctionUtils.h.

References copyFrom(), and llvm::Sched::Source.

◆ createOutOfBandError() [1/2]

static WrapperFunctionResult llvm::orc::shared::WrapperFunctionResult::createOutOfBandError ( const char *  Msg)
inlinestatic

◆ createOutOfBandError() [2/2]

static WrapperFunctionResult llvm::orc::shared::WrapperFunctionResult::createOutOfBandError ( const std::string &  Msg)
inlinestatic

Create an out-of-band error by copying the given string.

Definition at line 156 of file WrapperFunctionUtils.h.

References createOutOfBandError().

◆ data() [1/2]

char* llvm::orc::shared::WrapperFunctionResult::data ( )
inline

◆ data() [2/2]

const char* llvm::orc::shared::WrapperFunctionResult::data ( ) const
inline

◆ empty()

bool llvm::orc::shared::WrapperFunctionResult::empty ( ) const
inline

◆ getOutOfBandError()

const char* llvm::orc::shared::WrapperFunctionResult::getOutOfBandError ( ) const
inline

◆ operator=() [1/2]

WrapperFunctionResult& llvm::orc::shared::WrapperFunctionResult::operator= ( const WrapperFunctionResult )
delete

◆ operator=() [2/2]

WrapperFunctionResult& llvm::orc::shared::WrapperFunctionResult::operator= ( WrapperFunctionResult &&  Other)
inline

Definition at line 69 of file WrapperFunctionUtils.h.

References move, Other, and std::swap().

◆ release()

detail::CWrapperFunctionResult llvm::orc::shared::WrapperFunctionResult::release ( )
inline

Release ownership of the contained detail::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 85 of file WrapperFunctionUtils.h.

References std::swap().

◆ size()

size_t llvm::orc::shared::WrapperFunctionResult::size ( ) const
inline

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