class JITLinkContext

Declaration

class JITLinkContext { /* full declaration omitted */ };

Description

Holds context for a single jitLink invocation.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:1678

Member Variables

private const llvm::jitlink::JITLinkDylib* JD = nullptr

Method Overview

  • public JITLinkContext(const llvm::jitlink::JITLinkDylib * JD)
  • public const llvm::jitlink::JITLinkDylib * getJITLinkDylib() const
  • public virtual llvm::jitlink::LinkGraphPassFunction getMarkLivePass(const llvm::Triple & TT) const
  • public virtual llvm::jitlink::JITLinkMemoryManager & getMemoryManager()
  • public virtual void lookup(const llvm::jitlink::JITLinkContext::LookupMap & Symbols, std::unique_ptr<JITLinkAsyncLookupContinuation> LC)
  • public virtual llvm::Error modifyPassConfig(llvm::jitlink::LinkGraph & G, llvm::jitlink::PassConfiguration & Config)
  • public virtual void notifyFailed(llvm::Error Err)
  • public virtual void notifyFinalized(JITLinkMemoryManager::FinalizedAlloc Alloc)
  • public virtual llvm::Error notifyResolved(llvm::jitlink::LinkGraph & G)
  • public virtual bool shouldAddDefaultTargetPasses(const llvm::Triple & TT) const
  • public virtual ~JITLinkContext()

Methods

JITLinkContext(
    const llvm::jitlink::JITLinkDylib* JD)

Description

Create a JITLinkContext.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:1683

Parameters

const llvm::jitlink::JITLinkDylib* JD

const llvm::jitlink::JITLinkDylib*
getJITLinkDylib() const

Description

Return the JITLinkDylib that this link is targeting, if any.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:1689

virtual llvm::jitlink::LinkGraphPassFunction
getMarkLivePass(const llvm::Triple& TT) const

Description

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.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:1732

Parameters

const llvm::Triple& TT

virtual llvm::jitlink::JITLinkMemoryManager&
getMemoryManager()

Description

Return the MemoryManager to be used for this link.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:1692

virtual void lookup(
    const llvm::jitlink::JITLinkContext::
        LookupMap& Symbols,
    std::unique_ptr<
        JITLinkAsyncLookupContinuation> LC)

Description

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.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:1701

Parameters

const llvm::jitlink::JITLinkContext::LookupMap& Symbols
std::unique_ptr<JITLinkAsyncLookupContinuation> LC

virtual llvm::Error modifyPassConfig(
    llvm::jitlink::LinkGraph& G,
    llvm::jitlink::PassConfiguration& Config)

Description

Called by JITLink to modify the pass pipeline prior to linking. The default version performs no modification.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:1736

Parameters

llvm::jitlink::LinkGraph& G
llvm::jitlink::PassConfiguration& Config

virtual void notifyFailed(llvm::Error Err)

Description

Notify this context that linking failed. Called by JITLink if linking cannot be completed.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:1696

Parameters

llvm::Error Err

virtual void notifyFinalized(
    JITLinkMemoryManager::FinalizedAlloc Alloc)

Description

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.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:1718

Parameters

JITLinkMemoryManager::FinalizedAlloc Alloc

virtual llvm::Error notifyResolved(
    llvm::jitlink::LinkGraph& G)

Description

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.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:1712

Parameters

llvm::jitlink::LinkGraph& G

virtual bool shouldAddDefaultTargetPasses(
    const llvm::Triple& TT) const

Description

Called by JITLink prior to linking to determine whether default passes for the target should be added. The default implementation returns true. If subclasses override this method to return false for any target then they are required to fully configure the pass pipeline for that target.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:1724

Parameters

const llvm::Triple& TT

virtual ~JITLinkContext()

Description

Destroy a JITLinkContext.

Declared at: llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h:1686