LLVM 20.0.0git
|
IRMaterializationUnit is a convenient base class for MaterializationUnits wrapping LLVM IR. More...
#include "llvm/ExecutionEngine/Orc/Layer.h"
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 ThreadSafeModule & | getModule () 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 SymbolFlagsMap & | getSymbols () const |
Return the set of symbols that this source provides. | |
const SymbolStringPtr & | getInitializerSymbol () 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 |
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.
using llvm::orc::IRMaterializationUnit::SymbolNameToDefinitionMap = std::map<SymbolStringPtr, GlobalValue *> |
llvm::orc::IRMaterializationUnit::IRMaterializationUnit | ( | ExecutionSession & | ES, |
const IRSymbolMapper::ManglingOptions & | MO, | ||
ThreadSafeModule | TSM | ||
) |
Create an IRMaterializationLayer.
Scans the module to build the SymbolFlags and SymbolToDefinition maps.
Definition at line 32 of file Layer.cpp.
References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count(), llvm::JITSymbolFlags::fromGlobalValue(), G, llvm::Module::getDataLayout(), llvm::orc::ThreadSafeModule::getModuleUnlocked(), llvm::orc::getStaticInitGVs(), if(), llvm::orc::MaterializationUnit::InitSymbol, llvm::orc::ExecutionSession::intern(), llvm::JITSymbolFlags::MaterializationSideEffectsOnly, llvm::Comdat::NoDeduplicate, llvm::orc::MaterializationUnit::SymbolFlags, SymbolToDefinition, llvm::JITSymbolFlags::Weak, and llvm::orc::ThreadSafeModule::withModuleDo().
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.
|
inline |
Return a reference to the contained ThreadSafeModule.
Definition at line 53 of file Layer.h.
References TSM.
|
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().
|
protected |
Definition at line 57 of file Layer.h.
Referenced by IRMaterializationUnit().
|
protected |
Definition at line 56 of file Layer.h.
Referenced by getModule(), and getName().