LLVM 19.0.0git
Classes | Public Member Functions | Static Public Attributes | Protected Attributes | Friends | List of all members
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/Core.h"

Inheritance diagram for llvm::orc::MaterializationUnit:
Inheritance graph
[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 693 of file Core.h.

Constructor & Destructor Documentation

◆ MaterializationUnit()

llvm::orc::MaterializationUnit::MaterializationUnit ( Interface  I)
inline

Definition at line 713 of file Core.h.

◆ ~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 736 of file Core.h.

References llvm::dbgs(), DEBUG_WITH_TYPE, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::erase(), getName(), InitSymbol, Name, and SymbolFlags.

◆ getInitializerSymbol()

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

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

Definition at line 726 of file Core.h.

References InitSymbol.

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

◆ getName()

virtual StringRef llvm::orc::MaterializationUnit::getName ( ) const
pure virtual

◆ getSymbols()

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

Return the set of symbols that this source provides.

Definition at line 723 of file Core.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::SimpleMachOHeaderMU, llvm::orc::SectCreateMaterializationUnit, and LLVMOrcLazyCallThroughManagerRef::OrcCAPIMaterializationUnit.

Friends And Related Function Documentation

◆ ExecutionSession

friend class ExecutionSession
friend

Definition at line 694 of file Core.h.

◆ JITDylib

friend class JITDylib
friend

Definition at line 695 of file Core.h.

Member Data Documentation

◆ ID

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

Definition at line 698 of file Core.h.

◆ InitSymbol

SymbolStringPtr llvm::orc::MaterializationUnit::InitSymbol
protected

◆ SymbolFlags

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

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