LLVM 20.0.0git
Public Types | Public Member Functions | Protected Attributes | List of all members
llvm::orc::IRMaterializationUnit Class Reference

IRMaterializationUnit is a convenient base class for MaterializationUnits wrapping LLVM IR. More...

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

Inheritance diagram for llvm::orc::IRMaterializationUnit:
Inheritance graph
[legend]

Public Types

using SymbolNameToDefinitionMap = std::map< SymbolStringPtr, GlobalValue * >
 

Public Member Functions

 IRMaterializationUnit (ExecutionSession &ES, const IRSymbolMapper::ManglingOptions &MO, ThreadSafeModule TSM)
 Create an IRMaterializationLayer.
 
 IRMaterializationUnit (ThreadSafeModule TSM, Interface I, SymbolNameToDefinitionMap SymbolToDefinition)
 Create an IRMaterializationLayer from a module, and pre-existing SymbolFlags and SymbolToDefinition maps.
 
StringRef getName () const override
 Return the ModuleIdentifier as the name for this MaterializationUnit.
 
const ThreadSafeModulegetModule () const
 Return a reference to the contained ThreadSafeModule.
 
- Public Member Functions inherited from llvm::orc::MaterializationUnit
 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.
 

Protected Attributes

ThreadSafeModule TSM
 
SymbolNameToDefinitionMap SymbolToDefinition
 
- Protected Attributes inherited from llvm::orc::MaterializationUnit
SymbolFlagsMap SymbolFlags
 
SymbolStringPtr InitSymbol
 

Additional Inherited Members

- Static Public Attributes inherited from llvm::orc::MaterializationUnit
static char ID
 

Detailed Description

IRMaterializationUnit is a convenient base class for MaterializationUnits wrapping LLVM IR.

Represents materialization responsibility for all symbols in the given module. If symbols are overridden by other definitions, then their linkage is changed to available-externally.

Definition at line 31 of file Layer.h.

Member Typedef Documentation

◆ SymbolNameToDefinitionMap

Definition at line 33 of file Layer.h.

Constructor & Destructor Documentation

◆ IRMaterializationUnit() [1/2]

llvm::orc::IRMaterializationUnit::IRMaterializationUnit ( ExecutionSession ES,
const IRSymbolMapper::ManglingOptions MO,
ThreadSafeModule  TSM 
)

◆ IRMaterializationUnit() [2/2]

llvm::orc::IRMaterializationUnit::IRMaterializationUnit ( ThreadSafeModule  TSM,
Interface  I,
SymbolNameToDefinitionMap  SymbolToDefinition 
)

Create an IRMaterializationLayer from a module, and pre-existing SymbolFlags and SymbolToDefinition maps.

The maps must provide entries for each definition in M. This constructor is useful for delegating work from one IRMaterializationUnit to another.

Definition at line 102 of file Layer.cpp.

Member Function Documentation

◆ getModule()

const ThreadSafeModule & llvm::orc::IRMaterializationUnit::getModule ( ) const
inline

Return a reference to the contained ThreadSafeModule.

Definition at line 53 of file Layer.h.

References TSM.

◆ getName()

StringRef llvm::orc::IRMaterializationUnit::getName ( ) const
overridevirtual

Return the ModuleIdentifier as the name for this MaterializationUnit.

Implements llvm::orc::MaterializationUnit.

Definition at line 108 of file Layer.cpp.

References TSM, and llvm::orc::ThreadSafeModule::withModuleDo().

Member Data Documentation

◆ SymbolToDefinition

SymbolNameToDefinitionMap llvm::orc::IRMaterializationUnit::SymbolToDefinition
protected

Definition at line 57 of file Layer.h.

Referenced by IRMaterializationUnit().

◆ TSM

ThreadSafeModule llvm::orc::IRMaterializationUnit::TSM
protected

Definition at line 56 of file Layer.h.

Referenced by getModule(), and getName().


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