|
LLVM
10.0.0
|
An ObjectLayer implementation built on JITLink. More...
#include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
Classes | |
| class | Plugin |
| Plugin instances can be added to the ObjectLinkingLayer to receive callbacks when code is loaded or emitted, and when JITLink is being configured. More... | |
Public Types | |
| using | ReturnObjectBufferFunction = std::function< void(std::unique_ptr< MemoryBuffer >)> |
Public Member Functions | |
| ObjectLinkingLayer (ExecutionSession &ES, std::unique_ptr< jitlink::JITLinkMemoryManager > MemMgr) | |
| Construct an ObjectLinkingLayer with the given NotifyLoaded, and NotifyEmitted functors. More... | |
| ~ObjectLinkingLayer () | |
| Destruct an ObjectLinkingLayer. More... | |
| void | setReturnObjectBuffer (ReturnObjectBufferFunction ReturnObjectBuffer) |
| Set an object buffer return function. More... | |
| ObjectLinkingLayer & | addPlugin (std::unique_ptr< Plugin > P) |
| Add a pass-config modifier. More... | |
| void | emit (MaterializationResponsibility R, std::unique_ptr< MemoryBuffer > O) override |
| Emit the object. More... | |
| ObjectLinkingLayer & | setOverrideObjectFlagsWithResponsibilityFlags (bool OverrideObjectFlags) |
| Instructs this ObjectLinkingLayer instance to override the symbol flags found in the AtomGraph with the flags supplied by the MaterializationResponsibility instance. More... | |
| ObjectLinkingLayer & | setAutoClaimResponsibilityForObjectSymbols (bool AutoClaimObjectSymbols) |
| If set, this ObjectLinkingLayer 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... | |
Friends | |
| class | ObjectLinkingLayerJITLinkContext |
An ObjectLayer implementation built on JITLink.
Clients can use this class to add relocatable object files to an ExecutionSession, and it typically serves as the base layer (underneath a compiling layer like IRCompileLayer) for the rest of the JIT.
Definition at line 53 of file ObjectLinkingLayer.h.
| using llvm::orc::ObjectLinkingLayer::ReturnObjectBufferFunction = std::function<void(std::unique_ptr<MemoryBuffer>)> |
Definition at line 77 of file ObjectLinkingLayer.h.
| llvm::orc::ObjectLinkingLayer::ObjectLinkingLayer | ( | ExecutionSession & | ES, |
| std::unique_ptr< jitlink::JITLinkMemoryManager > | MemMgr | ||
| ) |
Construct an ObjectLinkingLayer with the given NotifyLoaded, and NotifyEmitted functors.
Definition at line 331 of file ObjectLinkingLayer.cpp.
| llvm::orc::ObjectLinkingLayer::~ObjectLinkingLayer | ( | ) |
Destruct an ObjectLinkingLayer.
Definition at line 335 of file ObjectLinkingLayer.cpp.
|
inline |
Add a pass-config modifier.
Definition at line 95 of file ObjectLinkingLayer.h.
References llvm::Lock, llvm::RISCVFenceField::O, and Plugins.
|
overridevirtual |
Emit the object.
Implements llvm::orc::ObjectLayer.
Definition at line 340 of file ObjectLinkingLayer.cpp.
References assert(), llvm::jitlink::jitLink(), P, and llvm::TT.
|
inline |
If set, this ObjectLinkingLayer 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 131 of file ObjectLinkingLayer.h.
References llvm::TT.
|
inline |
Instructs this ObjectLinkingLayer instance to override the symbol flags found in the AtomGraph 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 114 of file ObjectLinkingLayer.h.
|
inline |
Set an object buffer return function.
By default object buffers are deleted once the JIT has linked them. If a return function is set then it will be called to transfer ownership of the buffer instead.
Definition at line 90 of file ObjectLinkingLayer.h.
|
friend |
Definition at line 54 of file ObjectLinkingLayer.h.
1.8.13