LLVM 20.0.0git
|
#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
Public Types | |
using | NotifyLoadedFunction = std::function< void(MaterializationResponsibility &R, const object::ObjectFile &Obj, const RuntimeDyld::LoadedObjectInfo &)> |
Functor for receiving object-loaded notifications. | |
using | NotifyEmittedFunction = std::function< void(MaterializationResponsibility &R, std::unique_ptr< MemoryBuffer >)> |
Functor for receiving finalization notifications. | |
using | GetMemoryManagerFunction = unique_function< std::unique_ptr< RuntimeDyld::MemoryManager >()> |
Public Member Functions | |
RTDyldObjectLinkingLayer (ExecutionSession &ES, GetMemoryManagerFunction GetMemoryManager) | |
Construct an ObjectLinkingLayer with the given NotifyLoaded, and NotifyEmitted functors. | |
~RTDyldObjectLinkingLayer () | |
void | emit (std::unique_ptr< MaterializationResponsibility > R, std::unique_ptr< MemoryBuffer > O) override |
Emit the object. | |
RTDyldObjectLinkingLayer & | setNotifyLoaded (NotifyLoadedFunction NotifyLoaded) |
Set the NotifyLoaded callback. | |
RTDyldObjectLinkingLayer & | setNotifyEmitted (NotifyEmittedFunction NotifyEmitted) |
Set the NotifyEmitted callback. | |
RTDyldObjectLinkingLayer & | setProcessAllSections (bool ProcessAllSections) |
Set the 'ProcessAllSections' flag. | |
RTDyldObjectLinkingLayer & | setOverrideObjectFlagsWithResponsibilityFlags (bool OverrideObjectFlags) |
Instructs this RTDyldLinkingLayer2 instance to override the symbol flags returned by RuntimeDyld for any given object file with the flags supplied by the MaterializationResponsibility instance. | |
RTDyldObjectLinkingLayer & | setAutoClaimResponsibilityForObjectSymbols (bool AutoClaimObjectSymbols) |
If set, this RTDyldObjectLinkingLayer instance will claim responsibility for any symbols provided by a given object file that were not already in the MaterializationResponsibility instance. | |
void | registerJITEventListener (JITEventListener &L) |
Register a JITEventListener. | |
void | unregisterJITEventListener (JITEventListener &L) |
Unregister a JITEventListener. | |
Public Member Functions inherited from llvm::RTTIExtends< RTDyldObjectLinkingLayer, ObjectLayer > | |
const void * | dynamicClassID () const override |
bool | isA () const |
Check whether this instance is a subclass of QueryT. | |
bool | isA (const void *const ClassID) const override |
Static Public Attributes | |
static char | ID |
Additional Inherited Members | |
Static Public Member Functions inherited from llvm::RTTIExtends< RTDyldObjectLinkingLayer, ObjectLayer > | |
static const void * | classID () |
static bool | classof (const T *R) |
Definition at line 36 of file RTDyldObjectLinkingLayer.h.
using llvm::orc::RTDyldObjectLinkingLayer::GetMemoryManagerFunction = unique_function<std::unique_ptr<RuntimeDyld::MemoryManager>()> |
Definition at line 51 of file RTDyldObjectLinkingLayer.h.
using llvm::orc::RTDyldObjectLinkingLayer::NotifyEmittedFunction = std::function<void( MaterializationResponsibility &R, std::unique_ptr<MemoryBuffer>)> |
Functor for receiving finalization notifications.
Definition at line 48 of file RTDyldObjectLinkingLayer.h.
using llvm::orc::RTDyldObjectLinkingLayer::NotifyLoadedFunction = std::function<void( MaterializationResponsibility &R, const object::ObjectFile &Obj, const RuntimeDyld::LoadedObjectInfo &)> |
Functor for receiving object-loaded notifications.
Definition at line 43 of file RTDyldObjectLinkingLayer.h.
llvm::orc::RTDyldObjectLinkingLayer::RTDyldObjectLinkingLayer | ( | ExecutionSession & | ES, |
GetMemoryManagerFunction | GetMemoryManager | ||
) |
Construct an ObjectLinkingLayer with the given NotifyLoaded, and NotifyEmitted functors.
Definition at line 84 of file RTDyldObjectLinkingLayer.cpp.
References llvm::orc::ExecutionSession::registerResourceManager().
llvm::orc::RTDyldObjectLinkingLayer::~RTDyldObjectLinkingLayer | ( | ) |
Definition at line 90 of file RTDyldObjectLinkingLayer.cpp.
References assert(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::empty().
|
override |
Emit the object.
Definition at line 94 of file RTDyldObjectLinkingLayer.cpp.
References assert(), llvm::object::ObjectFile::createObjectFile(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::empty(), llvm::JITSymbolFlags::fromObjectSymbol(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert(), llvm::jitLinkForORC(), llvm::object::BasicSymbolRef::SF_Global, llvm::object::BasicSymbolRef::SF_Weak, llvm::object::SymbolRef::ST_File, Sym, and llvm::Expected< T >::takeError().
void llvm::orc::RTDyldObjectLinkingLayer::registerJITEventListener | ( | JITEventListener & | L | ) |
Definition at line 213 of file RTDyldObjectLinkingLayer.cpp.
References assert(), and llvm::is_contained().
|
inline |
If set, this RTDyldObjectLinkingLayer instance will claim responsibility for any symbols provided by a given object file that were not already in the MaterializationResponsibility instance.
Setting this flag allows higher-level program representations (e.g. LLVM IR) to be added based on only a subset of the symbols they provide, without having to write intervening layers to scan and add the additional symbols. This trades diagnostic quality for convenience however: If all symbols are enumerated up-front then clashes can be detected and reported early (and usually deterministically). If this option is set, clashes for the additional symbols may not be detected until late, and detection may depend on the flow of control through JIT'd code. Use with care.
Definition at line 115 of file RTDyldObjectLinkingLayer.h.
|
inline |
Set the NotifyEmitted callback.
Definition at line 73 of file RTDyldObjectLinkingLayer.h.
|
inline |
Set the NotifyLoaded callback.
Definition at line 66 of file RTDyldObjectLinkingLayer.h.
|
inline |
Instructs this RTDyldLinkingLayer2 instance to override the symbol flags returned by RuntimeDyld for any given object file with the flags supplied by the MaterializationResponsibility instance.
This is a workaround to support symbol visibility in COFF, which does not use the libObject's SF_Exported flag. Use only when generating / adding COFF object files.
FIXME: We should be able to remove this if/when COFF properly tracks exported symbols.
Definition at line 98 of file RTDyldObjectLinkingLayer.h.
|
inline |
Set the 'ProcessAllSections' flag.
If set to true, all sections in each object file will be allocated using the memory manager, rather than just the sections required for execution.
This is kludgy, and may be removed in the future.
Definition at line 84 of file RTDyldObjectLinkingLayer.h.
void llvm::orc::RTDyldObjectLinkingLayer::unregisterJITEventListener | ( | JITEventListener & | L | ) |
Unregister a JITEventListener.
Definition at line 220 of file RTDyldObjectLinkingLayer.cpp.
References assert(), llvm::find(), and I.
|
static |
Definition at line 40 of file RTDyldObjectLinkingLayer.h.