LLVM: llvm::orc::MaterializationResponsibility Class Reference (original) (raw)

Tracks responsibility for materialization, and mediates interactions between MaterializationUnits and JDs. More...

#include "[llvm/ExecutionEngine/Orc/Core.h](llvm%5F2ExecutionEngine%5F2Orc%5F2Core%5F8h%5Fsource.html)"

Public Member Functions
MaterializationResponsibility (MaterializationResponsibility &&)=delete
MaterializationResponsibility & operator= (MaterializationResponsibility &&)=delete
~MaterializationResponsibility ()
Destruct a MaterializationResponsibility instance.
const ResourceTrackerSP & getResourceTracker () const
Return the ResourceTracker associated with this instance.
template
Error withResourceKeyDo (Func &&F) const
Runs the given callback under the session lock, passing in the associated ResourceKey.
JITDylib & getTargetJITDylib () const
Returns the target JITDylib that these symbols are being materialized into.
ExecutionSession & getExecutionSession () const
Returns the ExecutionSession for this instance.
const SymbolFlagsMap & getSymbols () const
Returns the symbol flags map for this responsibility instance.
const SymbolStringPtr & getInitializerSymbol () const
Returns the initialization pseudo-symbol, if any.
SymbolNameSet getRequestedSymbols () const
Returns the names of any symbols covered by this MaterializationResponsibility object that have queries pending.
Error notifyResolved (const SymbolMap &Symbols)
Notifies the target JITDylib that the given symbols have been resolved.
Error notifyEmitted (ArrayRef< SymbolDependenceGroup > DepGroups)
Notifies the target JITDylib (and any pending queries on that JITDylib) that all symbols covered by this MaterializationResponsibility instance have been emitted.
Error defineMaterializing (SymbolFlagsMap SymbolFlags)
Attempt to claim responsibility for new definitions.
void failMaterialization ()
Notify all not-yet-emitted covered by this MaterializationResponsibility instance that an error has occurred.
Error replace (std::unique_ptr< MaterializationUnit > MU)
Transfers responsibility to the given MaterializationUnit for all symbols defined by that MaterializationUnit.
Expected< std::unique_ptr< MaterializationResponsibility > > delegate (const SymbolNameSet &Symbols)
Delegates responsibility for the given symbols to the returned materialization responsibility.
Friends
class ExecutionSession
class JITDylib

Tracks responsibility for materialization, and mediates interactions between MaterializationUnits and JDs.

An instance of this class is passed to MaterializationUnits when their materialize method is called. It allows MaterializationUnits to resolve and emit symbols, or abandon materialization by notifying any unmaterialized symbols of an error.

Definition at line 580 of file Core.h.

~MaterializationResponsibility()

llvm::orc::MaterializationResponsibility::~MaterializationResponsibility ( ) inline

defineMaterializing()

Error llvm::orc::MaterializationResponsibility::defineMaterializing ( SymbolFlagsMap SymbolFlags) inline

Attempt to claim responsibility for new definitions.

This method can be used to claim responsibility for symbols that are added to a materialization unit during the compilation process (e.g. literal pool symbols). Symbol linkage rules are the same as for symbols that are defined up front: duplicate strong definitions will result in errors. Duplicate weak definitions will be discarded (in which case they will not be added to this responsibility instance).

This method can be used by materialization units that want to add additional symbols at materialization time (e.g. stubs, compile callbacks, metadata).

Definition at line 1996 of file Core.h.

References getExecutionSession().

delegate()

Delegates responsibility for the given symbols to the returned materialization responsibility.

Useful for breaking up work between threads, or different kinds of materialization processes.

Definition at line 2012 of file Core.h.

References getExecutionSession().

failMaterialization()

void llvm::orc::MaterializationResponsibility::failMaterialization ( ) inline

getExecutionSession()

ExecutionSession & llvm::orc::MaterializationResponsibility::getExecutionSession ( ) const inline

getInitializerSymbol()

const SymbolStringPtr & llvm::orc::MaterializationResponsibility::getInitializerSymbol ( ) const inline

getRequestedSymbols()

SymbolNameSet llvm::orc::MaterializationResponsibility::getRequestedSymbols ( ) const inline

getResourceTracker()

getSymbols()

Returns the symbol flags map for this responsibility instance.

Note: The returned flags may have transient flags (Lazy, Materializing) set. These should be stripped with JITSymbolFlags::stripTransientFlags before using.

Definition at line 614 of file Core.h.

getTargetJITDylib()

JITDylib & llvm::orc::MaterializationResponsibility::getTargetJITDylib ( ) const inline

Returns the target JITDylib that these symbols are being materialized into.

Definition at line 605 of file Core.h.

References JITDylib.

notifyEmitted()

Notifies the target JITDylib (and any pending queries on that JITDylib) that all symbols covered by this MaterializationResponsibility instance have been emitted.

The DepGroups array describes the dependencies of symbols being emitted on symbols that are outside this MaterializationResponsibility object. Each group consists of a pair of a set of symbols and a SymbolDependenceMap that describes the dependencies for the symbols in the first set. The elements of DepGroups must be non-overlapping (no symbol should appear in more than one of hte symbol sets), but do not have to be exhaustive. Any symbol in this MaterializationResponsibility object that is not covered by an entry will be treated as having no dependencies.

This method will return an error if any symbols being resolved have been moved to the error state due to the failure of a dependency. If this method returns an error then clients should log it and call failMaterialize. If no dependencies have been registered for the symbols covered by this MaterializationResponsibility then this method is guaranteed to return Error::success() and can be wrapped with cantFail.

Definition at line 1991 of file Core.h.

References getExecutionSession().

notifyResolved()

Error llvm::orc::MaterializationResponsibility::notifyResolved ( const SymbolMap & Symbols) inline

Notifies the target JITDylib that the given symbols have been resolved.

This will update the given symbols' addresses in the JITDylib, and notify any pending queries on the given symbols of their resolution. The given symbols must be ones covered by this MaterializationResponsibility instance. Individual calls to this method may resolve a subset of the symbols, but all symbols must have been resolved prior to calling emit.

This method will return an error if any symbols being resolved have been moved to the error state due to the failure of a dependency. If this method returns an error then clients should log it and call failMaterialize. If no dependencies have been registered for the symbols covered by this MaterializationResponsibility then this method is guaranteed to return Error::success() and can be wrapped with cantFail.

Definition at line 1986 of file Core.h.

References getExecutionSession().

operator=()

replace()

Transfers responsibility to the given MaterializationUnit for all symbols defined by that MaterializationUnit.

This allows materializers to break up work based on run-time information (e.g. by introspecting which symbols have actually been looked up and materializing only those).

Definition at line 2006 of file Core.h.

References getExecutionSession().

withResourceKeyDo()

template

Error llvm::orc::MaterializationResponsibility::withResourceKeyDo ( Func && F) const inline

ExecutionSession

JITDylib


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