LLVM 22.0.0git
llvm::orc::MaterializationUnit Class Referenceabstract

A MaterializationUnit represents a set of symbol definitions that can be materialized as a group, or individually discarded (when overriding definitions are encountered). More...

#include "llvm/ExecutionEngine/Orc/MaterializationUnit.h"

Inheritance diagram for llvm::orc::MaterializationUnit:
[legend]

Classes

struct  Interface

Public Member Functions

 MaterializationUnit (Interface I)
virtual ~MaterializationUnit ()=default
virtual StringRef getName () const =0
 Return the name of this materialization unit.
const SymbolFlagsMapgetSymbols () const
 Return the set of symbols that this source provides.
const SymbolStringPtrgetInitializerSymbol () const
 Returns the initialization symbol for this MaterializationUnit (if any).
virtual void materialize (std::unique_ptr< MaterializationResponsibility > R)=0
 Implementations of this method should materialize all symbols in the materialzation unit, except for those that have been previously discarded.
void doDiscard (const JITDylib &JD, const SymbolStringPtr &Name)
 Called by JITDylibs to notify MaterializationUnits that the given symbol has been overridden.

Static Public Attributes

static char ID

Protected Attributes

SymbolFlagsMap SymbolFlags
SymbolStringPtr InitSymbol

Friends

class ExecutionSession
class JITDylib

Detailed Description

A MaterializationUnit represents a set of symbol definitions that can be materialized as a group, or individually discarded (when overriding definitions are encountered).

MaterializationUnits are used when providing lazy definitions of symbols to JITDylibs. The JITDylib will call materialize when the address of a symbol is requested via the lookup method. The JITDylib will call discard if a stronger definition is added or already present.

Definition at line 33 of file MaterializationUnit.h.

Constructor & Destructor Documentation

◆ MaterializationUnit()

◆ ~MaterializationUnit()

virtual llvm::orc::MaterializationUnit::~MaterializationUnit ( )
virtualdefault

Member Function Documentation

◆ doDiscard()

void llvm::orc::MaterializationUnit::doDiscard ( const JITDylib & JD,
const SymbolStringPtr & Name )
inline

Called by JITDylibs to notify MaterializationUnits that the given symbol has been overridden.

Definition at line 76 of file MaterializationUnit.h.

References llvm::dbgs(), DEBUG_WITH_TYPE, getName(), InitSymbol, JITDylib, and SymbolFlags.

◆ getInitializerSymbol()

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

Returns the initialization symbol for this MaterializationUnit (if any).

Definition at line 66 of file MaterializationUnit.h.

References InitSymbol.

Referenced by llvm::orc::COFFPlatform::notifyAdding(), llvm::orc::ELFNixPlatform::notifyAdding(), and llvm::orc::MachOPlatform::notifyAdding().

◆ getName()

◆ getSymbols()

const SymbolFlagsMap & llvm::orc::MaterializationUnit::getSymbols ( ) const
inline

Return the set of symbols that this source provides.

Definition at line 63 of file MaterializationUnit.h.

References SymbolFlags.

Referenced by llvm::orc::operator<<().

◆ materialize()

virtual void llvm::orc::MaterializationUnit::materialize ( std::unique_ptr< MaterializationResponsibility > R)
pure virtual

Implementations of this method should materialize all symbols in the materialzation unit, except for those that have been previously discarded.

Implemented in llvm::orc::LinkGraphMaterializationUnit, llvm::orc::RedirectableMaterializationUnit, llvm::orc::SectCreateMaterializationUnit, llvm::orc::SimpleMachOHeaderMU, and LLVMOrcLazyCallThroughManagerRef::OrcCAPIMaterializationUnit.

◆ ExecutionSession

friend class ExecutionSession
friend

◆ JITDylib

Member Data Documentation

◆ ID

char llvm::orc::MaterializationUnit::ID
static

Definition at line 38 of file MaterializationUnit.h.

◆ InitSymbol

◆ SymbolFlags

SymbolFlagsMap llvm::orc::MaterializationUnit::SymbolFlags
protected

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