Go to the documentation of this file.
14 #ifndef LLVM_EXECUTIONENGINE_ORC_OBJECTLINKINGLAYER_H
15 #define LLVM_EXECUTIONENGINE_ORC_OBJECTLINKINGLAYER_H
36 class EHFrameRegistrar;
43 class ObjectLinkingLayerJITLinkContext;
113 std::unique_ptr<jitlink::JITLinkMemoryManager> MemMgr);
122 this->ReturnObjectBuffer =
std::move(ReturnObjectBuffer);
127 std::lock_guard<std::mutex>
Lock(LayerMutex);
144 void emit(std::unique_ptr<MaterializationResponsibility> R,
145 std::unique_ptr<MemoryBuffer>
O)
override;
148 void emit(std::unique_ptr<MaterializationResponsibility> R,
149 std::unique_ptr<jitlink::LinkGraph>
G);
161 this->OverrideObjectFlags = OverrideObjectFlags;
178 this->AutoClaimObjectSymbols = AutoClaimObjectSymbols;
194 mutable std::mutex LayerMutex;
196 std::unique_ptr<jitlink::JITLinkMemoryManager> MemMgrOwnership;
197 bool OverrideObjectFlags =
false;
198 bool AutoClaimObjectSymbols =
false;
201 std::vector<std::unique_ptr<Plugin>> Plugins;
208 std::unique_ptr<jitlink::EHFrameRegistrar> Registrar);
219 std::mutex EHFramePluginMutex;
221 std::unique_ptr<jitlink::EHFrameRegistrar> Registrar;
229 #endif // LLVM_EXECUTIONENGINE_ORC_OBJECTLINKINGLAYER_H
void emit(std::unique_ptr< MaterializationResponsibility > R, std::unique_ptr< MemoryBuffer > O) override
Emit an object file.
Tracks responsibility for materialization, and mediates interactions between MaterializationUnits and...
Error add(JITDylib &JD, std::unique_ptr< jitlink::LinkGraph > G)
Add a LinkGraph to the given JITDylib.
This is an optimization pass for GlobalISel generic memory operations.
Represents a JIT'd dynamic library.
virtual Error notifyFailed(MaterializationResponsibility &MR)=0
EHFrameRegistrationPlugin(ExecutionSession &ES, std::unique_ptr< jitlink::EHFrameRegistrar > Registrar)
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
virtual void notifyMaterializing(MaterializationResponsibility &MR, jitlink::LinkGraph &G, jitlink::JITLinkContext &Ctx, MemoryBufferRef InputObject)
ResourceTrackerSP getDefaultResourceTracker()
Get the default resource tracker for this JITDylib.
virtual Error add(ResourceTrackerSP RT, std::unique_ptr< MemoryBuffer > O, MaterializationUnit::Interface I)
Adds a MaterializationUnit for the object file in the given memory buffer to the JITDylib for the giv...
static ErrorSuccess success()
Create a success value.
Error notifyRemovingResources(ResourceKey K) override
void notifyTransferringResources(ResourceKey DstKey, ResourceKey SrcKey) override
std::function< void(std::unique_ptr< MemoryBuffer >)> ReturnObjectBufferFunction
void modifyPassConfig(MaterializationResponsibility &MR, jitlink::LinkGraph &G, jitlink::PassConfiguration &PassConfig) override
Manages allocations of JIT memory.
~ObjectLinkingLayer()
Destruct an ObjectLinkingLayer.
Error add(ResourceTrackerSP, std::unique_ptr< jitlink::LinkGraph > G)
Add a LinkGraph to the JITDylib targeted by the given tracker.
DenseMap< SymbolStringPtr, JITLinkSymbolSet > SyntheticSymbolDependenciesMap
virtual void modifyPassConfig(MaterializationResponsibility &MR, jitlink::LinkGraph &G, jitlink::PassConfiguration &Config)
virtual Error notifyEmitted(MaterializationResponsibility &MR)
Inheritance utility for extensible RTTI.
Implements a dense probed hash-table based set.
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
virtual void notifyTransferringResources(ResourceKey DstKey, ResourceKey SrcKey)=0
ObjectLinkingLayer(ExecutionSession &ES)
Construct an ObjectLinkingLayer using the ExecutorProcessControl instance's memory manager.
uint8_t IntrusiveRefCntPtr< ResourceTracker > ResourceTrackerSP
print Print MemDeps of function
An LinkGraph pass configuration, consisting of a list of pre-prune, post-prune, and post-fixup passes...
virtual Error notifyRemovingResources(ResourceKey K)=0
Error notifyEmitted(MaterializationResponsibility &MR) override
virtual void notifyLoaded(MaterializationResponsibility &MR)
Holds context for a single jitLink invocation.
An ObjectLayer implementation built on JITLink.
Listens for ResourceTracker operations.
virtual SyntheticSymbolDependenciesMap getSyntheticSymbolDependencies(MaterializationResponsibility &MR)
Return any dependencies that synthetic symbols (e.g.
ObjectLinkingLayer & addPlugin(std::unique_ptr< Plugin > P)
Add a pass-config modifier.
Represents a finalized allocation.
Lightweight error class with error context and mandatory checking.
An ExecutionSession represents a running JIT program.
ObjectLinkingLayer & setAutoClaimResponsibilityForObjectSymbols(bool AutoClaimObjectSymbols)
If set, this ObjectLinkingLayer instance will claim responsibility for any symbols provided by a give...
Error notifyFailed(MaterializationResponsibility &MR) override
void setReturnObjectBuffer(ReturnObjectBufferFunction ReturnObjectBuffer)
Set an object buffer return function.
Plugin instances can be added to the ObjectLinkingLayer to receive callbacks when code is loaded or e...
ObjectLinkingLayer & setOverrideObjectFlagsWithResponsibilityFlags(bool OverrideObjectFlags)
Instructs this ObjectLinkingLayer instance to override the symbol flags found in the AtomGraph with t...