LLVM  10.0.0svn
Public Member Functions | List of all members
llvm::jitlink::JITLinkContext Class Referenceabstract

Holds context for a single jitLink invocation. More...

#include "llvm/ExecutionEngine/JITLink/JITLink.h"

Inheritance diagram for llvm::jitlink::JITLinkContext:
Inheritance graph
[legend]

Public Member Functions

virtual ~JITLinkContext ()
 Destroy a JITLinkContext. More...
 
virtual JITLinkMemoryManagergetMemoryManager ()=0
 Return the MemoryManager to be used for this link. More...
 
virtual MemoryBufferRef getObjectBuffer () const =0
 Returns a StringRef for the object buffer. More...
 
virtual void notifyFailed (Error Err)=0
 Notify this context that linking failed. More...
 
virtual void lookup (const DenseSet< StringRef > &Symbols, std::unique_ptr< JITLinkAsyncLookupContinuation > LC)=0
 Called by JITLink to resolve external symbols. More...
 
virtual void 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. More...
 
virtual void notifyFinalized (std::unique_ptr< JITLinkMemoryManager::Allocation > A)=0
 Called by JITLink to notify the context that the object has been finalized (i.e. More...
 
virtual bool shouldAddDefaultTargetPasses (const Triple &TT) const
 Called by JITLink prior to linking to determine whether default passes for the target should be added. More...
 
virtual LinkGraphPassFunction getMarkLivePass (const Triple &TT) const
 Returns the mark-live pass to be used for this link. More...
 
virtual Error modifyPassConfig (const Triple &TT, PassConfiguration &Config)
 Called by JITLink to modify the pass pipeline prior to linking. More...
 

Detailed Description

Holds context for a single jitLink invocation.

Definition at line 978 of file JITLink.h.

Constructor & Destructor Documentation

◆ ~JITLinkContext()

llvm::jitlink::JITLinkContext::~JITLinkContext ( )
virtual

Destroy a JITLinkContext.

Definition at line 196 of file JITLink.cpp.

Member Function Documentation

◆ getMarkLivePass()

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

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 in llvm::orc::ObjectLinkingLayerJITLinkContext.

Definition at line 202 of file JITLink.cpp.

◆ getMemoryManager()

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

Return the MemoryManager to be used for this link.

Implemented in llvm::orc::ObjectLinkingLayerJITLinkContext.

◆ getObjectBuffer()

virtual MemoryBufferRef llvm::jitlink::JITLinkContext::getObjectBuffer ( ) const
pure virtual

Returns a StringRef for the object buffer.

This method can not be called once takeObjectBuffer has been called.

Implemented in llvm::orc::ObjectLinkingLayerJITLinkContext.

◆ lookup()

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

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.

Implemented in llvm::orc::ObjectLinkingLayerJITLinkContext.

◆ modifyPassConfig()

Error llvm::jitlink::JITLinkContext::modifyPassConfig ( const Triple TT,
PassConfiguration Config 
)
virtual

Called by JITLink to modify the pass pipeline prior to linking.

The default version performs no modification.

Reimplemented in llvm::orc::ObjectLinkingLayerJITLinkContext.

Definition at line 206 of file JITLink.cpp.

References llvm::Error::success().

◆ notifyFailed()

virtual void llvm::jitlink::JITLinkContext::notifyFailed ( Error  Err)
pure virtual

Notify this context that linking failed.

Called by JITLink if linking cannot be completed.

Implemented in llvm::orc::ObjectLinkingLayerJITLinkContext.

◆ notifyFinalized()

virtual void llvm::jitlink::JITLinkContext::notifyFinalized ( std::unique_ptr< JITLinkMemoryManager::Allocation A)
pure virtual

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.

Implemented in llvm::orc::ObjectLinkingLayerJITLinkContext.

◆ notifyResolved()

virtual void llvm::jitlink::JITLinkContext::notifyResolved ( LinkGraph G)
pure virtual

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.

Implemented in llvm::orc::ObjectLinkingLayerJITLinkContext.

◆ shouldAddDefaultTargetPasses()

bool llvm::jitlink::JITLinkContext::shouldAddDefaultTargetPasses ( const Triple TT) const
virtual

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.

Definition at line 198 of file JITLink.cpp.


The documentation for this class was generated from the following files: