class ExecutorProcessControl

Declaration

class ExecutorProcessControl { /* full declaration omitted */ };

Description

ExecutorProcessControl supports interaction with a JIT target process.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:38

Member Variables

protected std::shared_ptr<SymbolStringPool> SSP
protected std::unique_ptr<TaskDispatcher> D
protected llvm::orc::ExecutionSession* ES = nullptr
protected llvm::Triple TargetTriple
protected unsigned int PageSize = 0
protected llvm::orc::ExecutorProcessControl::JITDispatchInfo JDI
protected llvm::orc::ExecutorProcessControl::MemoryAccess* MemAccess = nullptr
protected jitlink::JITLinkMemoryManager* MemMgr = nullptr
protected StringMap<llvm::orc::ExecutorAddr> BootstrapSymbols

Method Overview

  • public ExecutorProcessControl(std::shared_ptr<SymbolStringPool> SSP, std::unique_ptr<TaskDispatcher> D)
  • public template <typename SPSSignature, typename... WrapperCallArgTs>llvm::Error callSPSWrapper(llvm::orc::ExecutorAddr WrapperFnAddr, WrapperCallArgTs &&... WrapperCallArgs)
  • public template <typename SPSSignature, typename SendResultT, typename... ArgTs>void callSPSWrapperAsync(llvm::orc::ExecutorAddr WrapperFnAddr, SendResultT && SendResult, const ArgTs &... Args)
  • public template <typename SPSSignature, typename RunPolicyT, typename SendResultT, typename... ArgTs>void callSPSWrapperAsync(RunPolicyT && Runner, llvm::orc::ExecutorAddr WrapperFnAddr, SendResultT && SendResult, const ArgTs &... Args)
  • public shared::WrapperFunctionResult callWrapper(llvm::orc::ExecutorAddr WrapperFnAddr, ArrayRef<char> ArgBuffer)
  • public template <typename FnT>void callWrapperAsync(llvm::orc::ExecutorAddr WrapperFnAddr, FnT && OnComplete, ArrayRef<char> ArgBuffer)
  • public template <typename RunPolicyT, typename FnT>void callWrapperAsync(RunPolicyT && Runner, llvm::orc::ExecutorAddr WrapperFnAddr, FnT && OnComplete, ArrayRef<char> ArgBuffer)
  • public virtual void callWrapperAsync(llvm::orc::ExecutorAddr WrapperFnAddr, llvm::orc::ExecutorProcessControl::IncomingWFRHandler OnComplete, ArrayRef<char> ArgBuffer)
  • public virtual llvm::Error disconnect()
  • public llvm::Error getBootstrapSymbols(ArrayRef<std::pair<ExecutorAddr &, StringRef>> Pairs) const
  • public const StringMap<llvm::orc::ExecutorAddr> & getBootstrapSymbolsMap() const
  • public llvm::orc::TaskDispatcher & getDispatcher()
  • public llvm::orc::ExecutionSession & getExecutionSession()
  • public const llvm::orc::ExecutorProcessControl::JITDispatchInfo & getJITDispatchInfo() const
  • public jitlink::JITLinkMemoryManager & getMemMgr() const
  • public llvm::orc::ExecutorProcessControl::MemoryAccess & getMemoryAccess() const
  • public unsigned int getPageSize() const
  • public std::shared_ptr<SymbolStringPool> getSymbolStringPool() const
  • public const llvm::Triple & getTargetTriple() const
  • public llvm::orc::SymbolStringPtr intern(llvm::StringRef SymName)
  • public virtual Expected<tpctypes::DylibHandle> loadDylib(const char * DylibPath)
  • public virtual Expected<std::vector<tpctypes::LookupResult>> lookupSymbols(ArrayRef<llvm::orc::ExecutorProcessControl::LookupRequest> Request)
  • public virtual Expected<int32_t> runAsMain(llvm::orc::ExecutorAddr MainFnAddr, ArrayRef<std::string> Args)
  • public virtual ~ExecutorProcessControl()

Methods

ExecutorProcessControl(
    std::shared_ptr<SymbolStringPool> SSP,
    std::unique_ptr<TaskDispatcher> D)

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:179

Parameters

std::shared_ptr<SymbolStringPool> SSP
std::unique_ptr<TaskDispatcher> D

template <typename SPSSignature,
          typename... WrapperCallArgTs>
llvm::Error callSPSWrapper(
    llvm::orc::ExecutorAddr WrapperFnAddr,
    WrapperCallArgTs&&... WrapperCallArgs)

Description

Run a wrapper function using SPS to serialize the arguments and deserialize the results. If SPSSignature is a non-void function signature then the second argument (the first in the Args list) should be a reference to a return value.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:342

Templates

SPSSignature
WrapperCallArgTs

Parameters

llvm::orc::ExecutorAddr WrapperFnAddr
WrapperCallArgTs&&... WrapperCallArgs

template <typename SPSSignature,
          typename SendResultT,
          typename... ArgTs>
void callSPSWrapperAsync(
    llvm::orc::ExecutorAddr WrapperFnAddr,
    SendResultT&& SendResult,
    const ArgTs&... Args)

Description

Run a wrapper function using SPS to serialize the arguments and deserialize the results.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:329

Templates

SPSSignature
SendResultT
ArgTs

Parameters

llvm::orc::ExecutorAddr WrapperFnAddr
SendResultT&& SendResult
const ArgTs&... Args

template <typename SPSSignature,
          typename RunPolicyT,
          typename SendResultT,
          typename... ArgTs>
void callSPSWrapperAsync(
    RunPolicyT&& Runner,
    llvm::orc::ExecutorAddr WrapperFnAddr,
    SendResultT&& SendResult,
    const ArgTs&... Args)

Description

Run a wrapper function using SPS to serialize the arguments and deserialize the results.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:314

Templates

SPSSignature
RunPolicyT
SendResultT
ArgTs

Parameters

RunPolicyT&& Runner
llvm::orc::ExecutorAddr WrapperFnAddr
SendResultT&& SendResult
const ArgTs&... Args

shared::WrapperFunctionResult callWrapper(
    llvm::orc::ExecutorAddr WrapperFnAddr,
    ArrayRef<char> ArgBuffer)

Description

Run a wrapper function in the executor. The wrapper function should be callable as: {.cpp}

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:298

Parameters

llvm::orc::ExecutorAddr WrapperFnAddr
ArrayRef<char> ArgBuffer

template <typename FnT>
void callWrapperAsync(
    llvm::orc::ExecutorAddr WrapperFnAddr,
    FnT&& OnComplete,
    ArrayRef<char> ArgBuffer)

Description

Run a wrapper function in the executor. OnComplete will be dispatched as a GenericNamedTask using this instance's TaskDispatch object.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:286

Templates

FnT

Parameters

llvm::orc::ExecutorAddr WrapperFnAddr
FnT&& OnComplete
ArrayRef<char> ArgBuffer

template <typename RunPolicyT, typename FnT>
void callWrapperAsync(
    RunPolicyT&& Runner,
    llvm::orc::ExecutorAddr WrapperFnAddr,
    FnT&& OnComplete,
    ArrayRef<char> ArgBuffer)

Description

Run a wrapper function in the executor using the given Runner to dispatch OnComplete when the result is ready.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:277

Templates

RunPolicyT
FnT

Parameters

RunPolicyT&& Runner
llvm::orc::ExecutorAddr WrapperFnAddr
FnT&& OnComplete
ArrayRef<char> ArgBuffer

virtual void callWrapperAsync(
    llvm::orc::ExecutorAddr WrapperFnAddr,
    llvm::orc::ExecutorProcessControl::
        IncomingWFRHandler OnComplete,
    ArrayRef<char> ArgBuffer)

Description

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: {.cpp}

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:270

Parameters

llvm::orc::ExecutorAddr WrapperFnAddr
llvm::orc::ExecutorProcessControl:: IncomingWFRHandler OnComplete
ArrayRef<char> ArgBuffer

virtual llvm::Error disconnect()

Description

Disconnect from the target process. This should be called after the JIT session is shut down.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:354

llvm::Error getBootstrapSymbols(
    ArrayRef<std::pair<ExecutorAddr&, StringRef>>
        Pairs) const

Description

For each (ExecutorAddr & , StringRef) pair, looks up the string in the bootstrap symbols map and writes its address to the ExecutorAddr if found. If any symbol is not found then the function returns an error.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:229

Parameters

ArrayRef<std::pair<ExecutorAddr&, StringRef>> Pairs

const StringMap<llvm::orc::ExecutorAddr>&
getBootstrapSymbolsMap() const

Description

Returns the bootstrap symbol map.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:222

llvm::orc::TaskDispatcher& getDispatcher()

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:198

llvm::orc::ExecutionSession& getExecutionSession()

Description

Return the ExecutionSession associated with this instance. Not callable until the ExecutionSession has been associated.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:187

const llvm::orc::ExecutorProcessControl::
    JITDispatchInfo&
    getJITDispatchInfo() const

Description

Get the JIT dispatch function and context address for the executor.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:207

jitlink::JITLinkMemoryManager& getMemMgr() const

Description

Return a JITLinkMemoryManager for the target process.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:216

llvm::orc::ExecutorProcessControl::MemoryAccess&
getMemoryAccess() const

Description

Return a MemoryAccess object for the target process.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:210

unsigned int getPageSize() const

Description

Get the page size for the target process.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:204

std::shared_ptr<SymbolStringPool>
getSymbolStringPool() const

Description

Return a shared pointer to the SymbolStringPool for this instance.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:196

const llvm::Triple& getTargetTriple() const

Description

Return the Triple for the target process.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:201

llvm::orc::SymbolStringPtr intern(
    llvm::StringRef SymName)

Description

Intern a symbol name in the SymbolStringPool.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:193

Parameters

llvm::StringRef SymName

virtual Expected<tpctypes::DylibHandle> loadDylib(
    const char* DylibPath)

Description

Load the dynamic library at the given path and return a handle to it. If LibraryPath is null this function will return the global handle for the target process.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:247

Parameters

const char* DylibPath

virtual Expected<
    std::vector<tpctypes::LookupResult>>
lookupSymbols(
    ArrayRef<llvm::orc::ExecutorProcessControl::
                 LookupRequest> Request)

Description

Search for symbols in the target process. The result of the lookup is a 2-dimentional array of target addresses that correspond to the lookup order. If a required symbol is not found then this method will return an error. If a weakly referenced symbol is not found then it be assigned a '0' value.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:256

Parameters

ArrayRef<llvm::orc::ExecutorProcessControl:: LookupRequest> Request

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

Description

Run function with a main-like signature.

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:259

Parameters

llvm::orc::ExecutorAddr MainFnAddr
ArrayRef<std::string> Args

virtual ~ExecutorProcessControl()

Declared at: llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h:183