LLVM 22.0.0git
llvm::orc::shared::WrapperFunctionBuffer Class Reference

C++ wrapper function buffer: Same as CWrapperFunctionBuffer but auto-releases memory. More...

#include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"

Public Member Functions

 WrapperFunctionBuffer ()
 Create a default WrapperFunctionBuffer.
 WrapperFunctionBuffer (CWrapperFunctionBuffer R)
 Create a WrapperFunctionBuffer by taking ownership of a CWrapperFunctionBuffer.
 WrapperFunctionBuffer (const WrapperFunctionBuffer &)=delete
WrapperFunctionBufferoperator= (const WrapperFunctionBuffer &)=delete
 WrapperFunctionBuffer (WrapperFunctionBuffer &&Other)
WrapperFunctionBufferoperator= (WrapperFunctionBuffer &&Other)
 ~WrapperFunctionBuffer ()
CWrapperFunctionBuffer release ()
 Release ownership of the contained CWrapperFunctionBuffer.
chardata ()
 Get a pointer to the data contained in this instance.
const chardata () 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 WrapperFunctionBuffer.
const chargetOutOfBandError () const
 If this value is an out-of-band error then this returns the error message, otherwise returns nullptr.

Static Public Member Functions

static WrapperFunctionBuffer allocate (size_t Size)
 Create a WrapperFunctionBuffer with the given size and return a pointer to the underlying memory.
static WrapperFunctionBuffer copyFrom (const char *Source, size_t Size)
 Copy from the given char range.
static WrapperFunctionBuffer copyFrom (const char *Source)
 Copy from the given null-terminated string (includes the null-terminator).
static WrapperFunctionBuffer copyFrom (const std::string &Source)
 Copy from the given std::string (includes the null terminator).
static WrapperFunctionBuffer createOutOfBandError (const char *Msg)
 Create an out-of-band error by copying the given string.
static WrapperFunctionBuffer createOutOfBandError (const std::string &Msg)
 Create an out-of-band error by copying the given string.

Detailed Description

C++ wrapper function buffer: Same as CWrapperFunctionBuffer but auto-releases memory.

Definition at line 40 of file WrapperFunctionUtils.h.

Constructor & Destructor Documentation

◆ WrapperFunctionBuffer() [1/4]

llvm::orc::shared::WrapperFunctionBuffer::WrapperFunctionBuffer ( )
inline

◆ WrapperFunctionBuffer() [2/4]

llvm::orc::shared::WrapperFunctionBuffer::WrapperFunctionBuffer ( CWrapperFunctionBuffer R)
inlineexplicit

Create a WrapperFunctionBuffer by taking ownership of a CWrapperFunctionBuffer.

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

Definition at line 50 of file WrapperFunctionUtils.h.

◆ WrapperFunctionBuffer() [3/4]

llvm::orc::shared::WrapperFunctionBuffer::WrapperFunctionBuffer ( const WrapperFunctionBuffer & )
delete

◆ WrapperFunctionBuffer() [4/4]

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

Definition at line 58 of file WrapperFunctionUtils.h.

References llvm::Other, std::swap(), and WrapperFunctionBuffer().

◆ ~WrapperFunctionBuffer()

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

Definition at line 69 of file WrapperFunctionUtils.h.

Member Function Documentation

◆ allocate()

◆ copyFrom() [1/3]

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

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

Definition at line 130 of file WrapperFunctionUtils.h.

References copyFrom(), and WrapperFunctionBuffer().

◆ copyFrom() [2/3]

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

Copy from the given char range.

Definition at line 123 of file WrapperFunctionUtils.h.

References allocate(), Size, and WrapperFunctionBuffer().

Referenced by copyFrom(), and copyFrom().

◆ copyFrom() [3/3]

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

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

Definition at line 135 of file WrapperFunctionUtils.h.

References copyFrom(), and WrapperFunctionBuffer().

◆ createOutOfBandError() [1/2]

◆ createOutOfBandError() [2/2]

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

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

Definition at line 150 of file WrapperFunctionUtils.h.

References createOutOfBandError(), and WrapperFunctionBuffer().

◆ data() [1/2]

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

Get a pointer to the data contained in this instance.

Definition at line 87 of file WrapperFunctionUtils.h.

References assert().

Referenced by llvm::orc::shared::WrapperFunction< SPSRetTagT(SPSTagTs...)>::call(), and llvm::orc::SPSCallSerializer< SPSSig >::deserialize().

◆ data() [2/2]

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

Get a const pointer to the data contained in this instance.

Definition at line 94 of file WrapperFunctionUtils.h.

References assert().

◆ empty()

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

Returns true if this value is equivalent to a default-constructed WrapperFunctionBuffer.

Definition at line 109 of file WrapperFunctionUtils.h.

Referenced by llvm::orc::SPSCallSerializer< void(SPSArgTs...)>::deserialize().

◆ getOutOfBandError()

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

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.

Referenced by llvm::orc::shared::WrapperFunction< SPSRetTagT(SPSTagTs...)>::call().

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

Definition at line 63 of file WrapperFunctionUtils.h.

References llvm::Other, std::swap(), and WrapperFunctionBuffer().

◆ release()

CWrapperFunctionBuffer llvm::orc::shared::WrapperFunctionBuffer::release ( )
inline

Release ownership of the contained CWrapperFunctionBuffer.

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().

◆ size()

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

Returns the size of the data contained in this instance.

Definition at line 101 of file WrapperFunctionUtils.h.

References assert().

Referenced by llvm::orc::shared::WrapperFunction< SPSRetTagT(SPSTagTs...)>::call(), and llvm::orc::SPSCallSerializer< SPSSig >::deserialize().


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