LLVM
8.0.1
|
#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
Public Types | |
using | NotifyLoadedFunction = std::function< void(VModuleKey, const object::ObjectFile &Obj, const RuntimeDyld::LoadedObjectInfo &)> |
Functor for receiving object-loaded notifications. More... | |
using | NotifyEmittedFunction = std::function< void(VModuleKey)> |
Functor for receiving finalization notifications. More... | |
using | GetMemoryManagerFunction = std::function< std::unique_ptr< RuntimeDyld::MemoryManager >()> |
Public Member Functions | |
RTDyldObjectLinkingLayer (ExecutionSession &ES, GetMemoryManagerFunction GetMemoryManager, NotifyLoadedFunction NotifyLoaded=NotifyLoadedFunction(), NotifyEmittedFunction NotifyEmitted=NotifyEmittedFunction()) | |
Construct an ObjectLinkingLayer with the given NotifyLoaded, and NotifyEmitted functors. More... | |
void | emit (MaterializationResponsibility R, std::unique_ptr< MemoryBuffer > O) override |
Emit the object. More... | |
RTDyldObjectLinkingLayer & | setProcessAllSections (bool ProcessAllSections) |
Set the 'ProcessAllSections' flag. More... | |
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. More... | |
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. More... | |
Public Member Functions inherited from llvm::orc::ObjectLayer | |
ObjectLayer (ExecutionSession &ES) | |
virtual | ~ObjectLayer () |
ExecutionSession & | getExecutionSession () |
Returns the execution session for this layer. More... | |
virtual Error | add (JITDylib &JD, std::unique_ptr< MemoryBuffer > O, VModuleKey K=VModuleKey()) |
Adds a MaterializationUnit representing the given IR to the given JITDylib. More... | |
Definition at line 39 of file RTDyldObjectLinkingLayer.h.
using llvm::orc::RTDyldObjectLinkingLayer::GetMemoryManagerFunction = std::function<std::unique_ptr<RuntimeDyld::MemoryManager>()> |
Definition at line 50 of file RTDyldObjectLinkingLayer.h.
Functor for receiving finalization notifications.
Definition at line 47 of file RTDyldObjectLinkingLayer.h.
using llvm::orc::RTDyldObjectLinkingLayer::NotifyLoadedFunction = std::function<void(VModuleKey, const object::ObjectFile &Obj, const RuntimeDyld::LoadedObjectInfo &)> |
Functor for receiving object-loaded notifications.
Definition at line 44 of file RTDyldObjectLinkingLayer.h.
llvm::orc::RTDyldObjectLinkingLayer::RTDyldObjectLinkingLayer | ( | ExecutionSession & | ES, |
GetMemoryManagerFunction | GetMemoryManager, | ||
NotifyLoadedFunction | NotifyLoaded = NotifyLoadedFunction() , |
||
NotifyEmittedFunction | NotifyEmitted = NotifyEmittedFunction() |
||
) |
Construct an ObjectLinkingLayer with the given NotifyLoaded, and NotifyEmitted functors.
Definition at line 80 of file RTDyldObjectLinkingLayer.cpp.
|
overridevirtual |
Emit the object.
Implements llvm::orc::ObjectLayer.
Definition at line 87 of file RTDyldObjectLinkingLayer.cpp.
References assert(), llvm::object::ObjectFile::createObjectFile(), llvm::orc::MaterializationResponsibility::failMaterialization(), llvm::orc::ObjectLayer::getExecutionSession(), llvm::orc::MaterializationResponsibility::getVModuleKey(), llvm::jitLinkForORC(), llvm::Lock, llvm::orc::ExecutionSession::reportError(), and llvm::object::BasicSymbolRef::SF_Global.
|
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 100 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 83 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 69 of file RTDyldObjectLinkingLayer.h.