LLVM 20.0.0git
|
Public Member Functions | |
JITLinkCtx (LinkGraphLinkingLayer &Layer, std::unique_ptr< MaterializationResponsibility > MR, std::unique_ptr< MemoryBuffer > ObjBuffer) | |
~JITLinkCtx () | |
JITLinkMemoryManager & | getMemoryManager () override |
Return the MemoryManager to be used for this link. | |
void | notifyMaterializing (LinkGraph &G) |
void | notifyFailed (Error Err) override |
Notify this context that linking failed. | |
void | lookup (const LookupMap &Symbols, std::unique_ptr< JITLinkAsyncLookupContinuation > LC) override |
Called by JITLink to resolve external symbols. | |
Error | notifyResolved (LinkGraph &G) override |
Called by JITLink once all defined symbols in the graph have been assigned their final memory locations in the target process. | |
void | notifyFinalized (JITLinkMemoryManager::FinalizedAlloc A) override |
Called by JITLink to notify the context that the object has been finalized (i.e. | |
LinkGraphPassFunction | getMarkLivePass (const Triple &TT) const override |
Returns the mark-live pass to be used for this link. | |
Error | modifyPassConfig (LinkGraph &LG, PassConfiguration &Config) override |
Called by JITLink to modify the pass pipeline prior to linking. | |
void | notifyLoaded () |
Error | notifyEmitted (jitlink::JITLinkMemoryManager::FinalizedAlloc FA) |
Public Member Functions inherited from llvm::jitlink::JITLinkContext | |
JITLinkContext (const JITLinkDylib *JD) | |
Create a JITLinkContext. | |
virtual | ~JITLinkContext () |
Destroy a JITLinkContext. | |
const JITLinkDylib * | getJITLinkDylib () const |
Return the JITLinkDylib that this link is targeting, if any. | |
virtual JITLinkMemoryManager & | getMemoryManager ()=0 |
Return the MemoryManager to be used for this link. | |
virtual void | notifyFailed (Error Err)=0 |
Notify this context that linking failed. | |
virtual void | lookup (const LookupMap &Symbols, std::unique_ptr< JITLinkAsyncLookupContinuation > LC)=0 |
Called by JITLink to resolve external symbols. | |
virtual Error | notifyResolved (LinkGraph &G)=0 |
Called by JITLink once all defined symbols in the graph have been assigned their final memory locations in the target process. | |
virtual void | notifyFinalized (JITLinkMemoryManager::FinalizedAlloc Alloc)=0 |
Called by JITLink to notify the context that the object has been finalized (i.e. | |
virtual bool | shouldAddDefaultTargetPasses (const Triple &TT) const |
Called by JITLink prior to linking to determine whether default passes for the target should be added. | |
virtual LinkGraphPassFunction | getMarkLivePass (const Triple &TT) const |
Returns the mark-live pass to be used for this link. | |
virtual Error | modifyPassConfig (LinkGraph &G, PassConfiguration &Config) |
Called by JITLink to modify the pass pipeline prior to linking. | |
Additional Inherited Members | |
Public Types inherited from llvm::jitlink::JITLinkContext | |
using | LookupMap = DenseMap< orc::SymbolStringPtr, SymbolLookupFlags > |
Definition at line 47 of file LinkGraphLinkingLayer.cpp.
|
inline |
Definition at line 49 of file LinkGraphLinkingLayer.cpp.
|
inline |
Definition at line 58 of file LinkGraphLinkingLayer.cpp.
References llvm::orc::LinkGraphLinkingLayer::ReturnObjectBuffer.
|
inlineoverridevirtual |
Returns the mark-live pass to be used for this link.
If no pass is returned (the default) then the target-specific linker implementation will choose a conservative default (usually marking all symbols live). This function is only called if shouldAddDefaultTargetPasses returns true, otherwise the JITContext is responsible for adding a mark-live pass in modifyPassConfig.
Reimplemented from llvm::jitlink::JITLinkContext.
Definition at line 228 of file LinkGraphLinkingLayer.cpp.
References G.
|
inlineoverridevirtual |
Return the MemoryManager to be used for this link.
Implements llvm::jitlink::JITLinkContext.
Definition at line 65 of file LinkGraphLinkingLayer.cpp.
|
inlineoverridevirtual |
Called by JITLink to resolve external symbols.
This method is passed a lookup continutation which it must call with a result to continue the linking process.
Implements llvm::jitlink::JITLinkContext.
Definition at line 81 of file LinkGraphLinkingLayer.cpp.
References llvm::orc::SymbolLookupSet::add(), llvm::orc::LinkGraphLayer::getExecutionSession(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::lookup(), llvm::jitlink::RequiredSymbol, llvm::orc::RequiredSymbol, llvm::orc::Resolved, llvm::orc::Result, llvm::orc::Static, llvm::jitlink::WeaklyReferencedSymbol, and llvm::orc::WeaklyReferencedSymbol.
|
inlineoverridevirtual |
Called by JITLink to modify the pass pipeline prior to linking.
The default version performs no modification.
Reimplemented from llvm::jitlink::JITLinkContext.
Definition at line 232 of file LinkGraphLinkingLayer.cpp.
References Config, G, P, and llvm::Error::success().
|
inline |
Definition at line 253 of file LinkGraphLinkingLayer.cpp.
References llvm::jitlink::JITLinkMemoryManager::deallocate(), llvm::joinErrors(), P, and llvm::Error::success().
Referenced by notifyFinalized().
|
inlineoverridevirtual |
Notify this context that linking failed.
Called by JITLink if linking cannot be completed.
Implements llvm::jitlink::JITLinkContext.
Definition at line 74 of file LinkGraphLinkingLayer.cpp.
References llvm::orc::LinkGraphLayer::getExecutionSession(), llvm::joinErrors(), P, and llvm::orc::ExecutionSession::reportError().
|
inlineoverridevirtual |
Called by JITLink to notify the context that the object has been finalized (i.e.
emitted to memory and memory permissions set). If all of this objects dependencies have also been finalized then the code is ready to run.
Implements llvm::jitlink::JITLinkContext.
Definition at line 215 of file LinkGraphLinkingLayer.cpp.
References A, llvm::orc::LinkGraphLayer::getExecutionSession(), notifyEmitted(), and llvm::orc::ExecutionSession::reportError().
|
inline |
Definition at line 248 of file LinkGraphLinkingLayer.cpp.
References P.
Referenced by notifyResolved().
|
inline |
Definition at line 67 of file LinkGraphLinkingLayer.cpp.
|
inlineoverridevirtual |
Called by JITLink once all defined symbols in the graph have been assigned their final memory locations in the target process.
At this point the LinkGraph can be inspected to build a symbol table, however the block content will not generally have been copied to the target location yet.
If the client detects an error in the LinkGraph state (e.g. unexpected or missing symbols) they may return an error here. The error will be propagated to notifyFailed and the linker will bail out.
Implements llvm::jitlink::JITLinkContext.
Definition at line 127 of file LinkGraphLinkingLayer.cpp.
References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::empty(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), G, llvm::orc::LinkGraphLayer::getExecutionSession(), llvm::orc::LinkGraphLayer::getJITSymbolFlagsForSymbol(), llvm::jitlink::Symbol::getName(), llvm::jitlink::Symbol::getScope(), llvm::orc::ExecutionSession::getSymbolStringPool(), I, notifyLoaded(), Ptr, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::size(), llvm::Error::success(), and Sym.