LLVM 20.0.0git
Public Member Functions | List of all members
llvm::orc::UnsupportedExecutorProcessControl Class Reference

A ExecutorProcessControl instance that asserts if any of its methods are used. More...

#include "llvm/ExecutionEngine/Orc/ExecutorProcessControl.h"

Inheritance diagram for llvm::orc::UnsupportedExecutorProcessControl:
Inheritance graph
[legend]

Public Member Functions

 UnsupportedExecutorProcessControl (std::shared_ptr< SymbolStringPool > SSP=nullptr, std::unique_ptr< TaskDispatcher > D=nullptr, const std::string &TT="", unsigned PageSize=0)
 
Expected< int32_t > runAsMain (ExecutorAddr MainFnAddr, ArrayRef< std::string > Args) override
 Run function with a main-like signature.
 
Expected< int32_t > runAsVoidFunction (ExecutorAddr VoidFnAddr) override
 Run function with a int (*)(void) signature.
 
Expected< int32_t > runAsIntFunction (ExecutorAddr IntFnAddr, int Arg) override
 Run function with a int (*)(int) signature.
 
void callWrapperAsync (ExecutorAddr WrapperFnAddr, IncomingWFRHandler OnComplete, ArrayRef< char > ArgBuffer) override
 Run a wrapper function in the executor.
 
Error disconnect () override
 Disconnect from the target process.
 
- Public Member Functions inherited from llvm::orc::ExecutorProcessControl
 ExecutorProcessControl (std::shared_ptr< SymbolStringPool > SSP, std::unique_ptr< TaskDispatcher > D)
 
virtual ~ExecutorProcessControl ()
 
ExecutionSessiongetExecutionSession ()
 Return the ExecutionSession associated with this instance.
 
SymbolStringPtr intern (StringRef SymName)
 Intern a symbol name in the SymbolStringPool.
 
std::shared_ptr< SymbolStringPoolgetSymbolStringPool () const
 Return a shared pointer to the SymbolStringPool for this instance.
 
TaskDispatchergetDispatcher ()
 
const TriplegetTargetTriple () const
 Return the Triple for the target process.
 
unsigned getPageSize () const
 Get the page size for the target process.
 
const JITDispatchInfogetJITDispatchInfo () const
 Get the JIT dispatch function and context address for the executor.
 
MemoryAccessgetMemoryAccess () const
 Return a MemoryAccess object for the target process.
 
jitlink::JITLinkMemoryManagergetMemMgr () const
 Return a JITLinkMemoryManager for the target process.
 
DylibManagergetDylibMgr () const
 Return the DylibManager for the target process.
 
const StringMap< std::vector< char > > & getBootstrapMap () const
 Returns the bootstrap map.
 
template<typename T , typename SPSTagT >
Error getBootstrapMapValue (StringRef Key, std::optional< T > &Val) const
 Look up and SPS-deserialize a bootstrap map value.
 
const StringMap< ExecutorAddr > & getBootstrapSymbolsMap () const
 Returns the bootstrap symbol map.
 
Error getBootstrapSymbols (ArrayRef< std::pair< ExecutorAddr &, StringRef > > Pairs) const
 For each (ExecutorAddr&, StringRef) pair, looks up the string in the bootstrap symbols map and writes its address to the ExecutorAddr if found.
 
virtual Expected< int32_t > runAsMain (ExecutorAddr MainFnAddr, ArrayRef< std::string > Args)=0
 Run function with a main-like signature.
 
virtual Expected< int32_t > runAsVoidFunction (ExecutorAddr VoidFnAddr)=0
 Run function with a int (*)(void) signature.
 
virtual Expected< int32_t > runAsIntFunction (ExecutorAddr IntFnAddr, int Arg)=0
 Run function with a int (*)(int) signature.
 
virtual void callWrapperAsync (ExecutorAddr WrapperFnAddr, IncomingWFRHandler OnComplete, ArrayRef< char > ArgBuffer)=0
 Run a wrapper function in the executor.
 
template<typename RunPolicyT , typename FnT >
void callWrapperAsync (RunPolicyT &&Runner, ExecutorAddr WrapperFnAddr, FnT &&OnComplete, ArrayRef< char > ArgBuffer)
 Run a wrapper function in the executor using the given Runner to dispatch OnComplete when the result is ready.
 
template<typename FnT >
void callWrapperAsync (ExecutorAddr WrapperFnAddr, FnT &&OnComplete, ArrayRef< char > ArgBuffer)
 Run a wrapper function in the executor.
 
shared::WrapperFunctionResult callWrapper (ExecutorAddr WrapperFnAddr, ArrayRef< char > ArgBuffer)
 Run a wrapper function in the executor.
 
template<typename SPSSignature , typename RunPolicyT , typename SendResultT , typename... ArgTs>
void callSPSWrapperAsync (RunPolicyT &&Runner, ExecutorAddr WrapperFnAddr, SendResultT &&SendResult, const ArgTs &...Args)
 Run a wrapper function using SPS to serialize the arguments and deserialize the results.
 
template<typename SPSSignature , typename SendResultT , typename... ArgTs>
void callSPSWrapperAsync (ExecutorAddr WrapperFnAddr, SendResultT &&SendResult, const ArgTs &...Args)
 Run a wrapper function using SPS to serialize the arguments and deserialize the results.
 
template<typename SPSSignature , typename... WrapperCallArgTs>
Error callSPSWrapper (ExecutorAddr WrapperFnAddr, WrapperCallArgTs &&...WrapperCallArgs)
 Run a wrapper function using SPS to serialize the arguments and deserialize the results.
 
virtual Error disconnect ()=0
 Disconnect from the target process.
 

Additional Inherited Members

- Protected Attributes inherited from llvm::orc::ExecutorProcessControl
std::shared_ptr< SymbolStringPoolSSP
 
std::unique_ptr< TaskDispatcherD
 
ExecutionSessionES = nullptr
 
Triple TargetTriple
 
unsigned PageSize = 0
 
JITDispatchInfo JDI
 
MemoryAccessMemAccess = nullptr
 
jitlink::JITLinkMemoryManagerMemMgr = nullptr
 
DylibManagerDylibMgr = nullptr
 
StringMap< std::vector< char > > BootstrapMap
 
StringMap< ExecutorAddrBootstrapSymbols
 

Detailed Description

A ExecutorProcessControl instance that asserts if any of its methods are used.

Suitable for use is unit tests, and by ORC clients who haven't moved to ExecutorProcessControl-based APIs yet.

Definition at line 428 of file ExecutorProcessControl.h.

Constructor & Destructor Documentation

◆ UnsupportedExecutorProcessControl()

llvm::orc::UnsupportedExecutorProcessControl::UnsupportedExecutorProcessControl ( std::shared_ptr< SymbolStringPool SSP = nullptr,
std::unique_ptr< TaskDispatcher D = nullptr,
const std::string &  TT = "",
unsigned  PageSize = 0 
)
inline

Member Function Documentation

◆ callWrapperAsync()

void llvm::orc::UnsupportedExecutorProcessControl::callWrapperAsync ( ExecutorAddr  WrapperFnAddr,
IncomingWFRHandler  OnComplete,
ArrayRef< char ArgBuffer 
)
inlineoverridevirtual

Run a wrapper function in the executor.

The given WFRHandler will be called on the result when it is returned.

The wrapper function should be callable as:

CWrapperFunctionResult fn(uint8_t *Data, uint64_t Size);
uint64_t Size

{.cpp}

Implements llvm::orc::ExecutorProcessControl.

Definition at line 457 of file ExecutorProcessControl.h.

References llvm_unreachable.

◆ disconnect()

Error llvm::orc::UnsupportedExecutorProcessControl::disconnect ( )
inlineoverridevirtual

Disconnect from the target process.

This should be called after the JIT session is shut down.

Implements llvm::orc::ExecutorProcessControl.

Definition at line 463 of file ExecutorProcessControl.h.

References llvm::Error::success().

◆ runAsIntFunction()

Expected< int32_t > llvm::orc::UnsupportedExecutorProcessControl::runAsIntFunction ( ExecutorAddr  IntFnAddr,
int  Arg 
)
inlineoverridevirtual

Run function with a int (*)(int) signature.

Implements llvm::orc::ExecutorProcessControl.

Definition at line 453 of file ExecutorProcessControl.h.

References llvm_unreachable.

◆ runAsMain()

Expected< int32_t > llvm::orc::UnsupportedExecutorProcessControl::runAsMain ( ExecutorAddr  MainFnAddr,
ArrayRef< std::string >  Args 
)
inlineoverridevirtual

Run function with a main-like signature.

Implements llvm::orc::ExecutorProcessControl.

Definition at line 444 of file ExecutorProcessControl.h.

References llvm_unreachable.

◆ runAsVoidFunction()

Expected< int32_t > llvm::orc::UnsupportedExecutorProcessControl::runAsVoidFunction ( ExecutorAddr  VoidFnAddr)
inlineoverridevirtual

Run function with a int (*)(void) signature.

Implements llvm::orc::ExecutorProcessControl.

Definition at line 449 of file ExecutorProcessControl.h.

References llvm_unreachable.


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