LLVM  13.0.0git
Public Member Functions | Static Public Member Functions | List of all members
llvm::orc::SelfTargetProcessControl Class Reference

A TargetProcessControl implementation targeting the current process. More...

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

Inheritance diagram for llvm::orc::SelfTargetProcessControl:
Inheritance graph
[legend]
Collaboration diagram for llvm::orc::SelfTargetProcessControl:
Collaboration graph
[legend]

Public Member Functions

 SelfTargetProcessControl (std::shared_ptr< SymbolStringPool > SSP, Triple TargetTriple, unsigned PageSize, std::unique_ptr< jitlink::JITLinkMemoryManager > MemMgr)
 
Expected< tpctypes::DylibHandleloadDylib (const char *DylibPath) override
 Load the dynamic library at the given path and return a handle to it. More...
 
Expected< std::vector< tpctypes::LookupResult > > lookupSymbols (ArrayRef< LookupRequest > Request) override
 Search for symbols in the target process. More...
 
Expected< int32_t > runAsMain (JITTargetAddress MainFnAddr, ArrayRef< std::string > Args) override
 Run function with a main-like signature. More...
 
Expected< tpctypes::WrapperFunctionResultrunWrapper (JITTargetAddress WrapperFnAddr, ArrayRef< uint8_t > ArgBuffer) override
 Run a wrapper function with signature: More...
 
Error disconnect () override
 Disconnect from the target process. More...
 
- Public Member Functions inherited from llvm::orc::TargetProcessControl
virtual ~TargetProcessControl ()
 
SymbolStringPtr intern (StringRef SymName)
 Intern a symbol name in the SymbolStringPool. More...
 
std::shared_ptr< SymbolStringPoolgetSymbolStringPool () const
 Return a shared pointer to the SymbolStringPool for this instance. More...
 
const TriplegetTargetTriple () const
 Return the Triple for the target process. More...
 
unsigned getPageSize () const
 Get the page size for the target process. More...
 
MemoryAccessgetMemoryAccess () const
 Return a MemoryAccess object for the target process. More...
 
jitlink::JITLinkMemoryManagergetMemMgr () const
 Return a JITLinkMemoryManager for the target process. More...
 

Static Public Member Functions

static Expected< std::unique_ptr< SelfTargetProcessControl > > Create (std::shared_ptr< SymbolStringPool > SSP, std::unique_ptr< jitlink::JITLinkMemoryManager > MemMgr=nullptr)
 Create a SelfTargetProcessControl with the given memory manager. More...
 

Additional Inherited Members

- Protected Member Functions inherited from llvm::orc::TargetProcessControl
 TargetProcessControl (std::shared_ptr< SymbolStringPool > SSP)
 
- Protected Attributes inherited from llvm::orc::TargetProcessControl
std::shared_ptr< SymbolStringPoolSSP
 
Triple TargetTriple
 
unsigned PageSize = 0
 
MemoryAccessMemAccess = nullptr
 
jitlink::JITLinkMemoryManagerMemMgr = nullptr
 

Detailed Description

A TargetProcessControl implementation targeting the current process.

Definition at line 166 of file TargetProcessControl.h.

Constructor & Destructor Documentation

◆ SelfTargetProcessControl()

llvm::orc::SelfTargetProcessControl::SelfTargetProcessControl ( std::shared_ptr< SymbolStringPool SSP,
Triple  TargetTriple,
unsigned  PageSize,
std::unique_ptr< jitlink::JITLinkMemoryManager MemMgr 
)

Member Function Documentation

◆ Create()

Expected< std::unique_ptr< SelfTargetProcessControl > > llvm::orc::SelfTargetProcessControl::Create ( std::shared_ptr< SymbolStringPool SSP,
std::unique_ptr< jitlink::JITLinkMemoryManager MemMgr = nullptr 
)
static

◆ disconnect()

Error llvm::orc::SelfTargetProcessControl::disconnect ( )
overridevirtual

Disconnect from the target process.

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

Implements llvm::orc::TargetProcessControl.

Definition at line 114 of file TargetProcessControl.cpp.

References llvm::Error::success().

◆ loadDylib()

Expected< tpctypes::DylibHandle > llvm::orc::SelfTargetProcessControl::loadDylib ( const char *  DylibPath)
overridevirtual

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.

Implements llvm::orc::TargetProcessControl.

Definition at line 57 of file TargetProcessControl.cpp.

References llvm::sys::DynamicLibrary::getPermanentLibrary(), llvm::inconvertibleErrorCode(), move, and llvm::pointerToJITTargetAddress().

◆ lookupSymbols()

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

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 in the result. that correspond to the lookup order.

Implements llvm::orc::TargetProcessControl.

Definition at line 68 of file TargetProcessControl.cpp.

References Addr, llvm::any_of(), assert(), DL, move, llvm::pointerToJITTargetAddress(), and llvm::orc::RequiredSymbol.

◆ runAsMain()

Expected< int32_t > llvm::orc::SelfTargetProcessControl::runAsMain ( JITTargetAddress  MainFnAddr,
ArrayRef< std::string >  Args 
)
overridevirtual

Run function with a main-like signature.

Implements llvm::orc::TargetProcessControl.

Definition at line 99 of file TargetProcessControl.cpp.

References llvm::AMDGPU::HSAMD::Kernel::Key::Args, int, and llvm::orc::runAsMain().

◆ runWrapper()

Expected< tpctypes::WrapperFunctionResult > llvm::orc::SelfTargetProcessControl::runWrapper ( JITTargetAddress  WrapperFnAddr,
ArrayRef< uint8_t >  ArgBuffer 
)
overridevirtual

Run a wrapper function with signature:

CWrapperFunctionResult fn(uint8_t *Data, uint64_t Size);

{.cpp}

Implements llvm::orc::TargetProcessControl.

Definition at line 106 of file TargetProcessControl.cpp.

References llvm::Data, llvm::ArrayRef< T >::data(), llvm::Check::Size, and llvm::ArrayRef< T >::size().


The documentation for this class was generated from the following files:
llvm::Check::Size
@ Size
Definition: FileCheck.h:73