LLVM  8.0.1
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]
Collaboration diagram for llvm::orc::IRMaterializationUnit:
Collaboration graph
[legend]

Public Types

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

Public Member Functions

 IRMaterializationUnit (ExecutionSession &ES, ThreadSafeModule TSM, VModuleKey K)
 Create an IRMaterializationLayer. More...
 
 IRMaterializationUnit (ThreadSafeModule TSM, VModuleKey K, SymbolFlagsMap SymbolFlags, SymbolNameToDefinitionMap SymbolToDefinition)
 Create an IRMaterializationLayer from a module, and pre-existing SymbolFlags and SymbolToDefinition maps. More...
 
StringRef getName () const override
 Return the ModuleIdentifier as the name for this MaterializationUnit. More...
 
const ThreadSafeModulegetModule () const
 
- Public Member Functions inherited from llvm::orc::MaterializationUnit
 MaterializationUnit (SymbolFlagsMap InitalSymbolFlags, VModuleKey K)
 
virtual ~MaterializationUnit ()
 
const SymbolFlagsMapgetSymbols () const
 Return the set of symbols that this source provides. More...
 
void doMaterialize (JITDylib &JD)
 Called by materialization dispatchers (see ExecutionSession::DispatchMaterializationFunction) to trigger materialization of this MaterializationUnit. More...
 
void doDiscard (const JITDylib &JD, const SymbolStringPtr &Name)
 Called by JITDylibs to notify MaterializationUnits that the given symbol has been overridden. More...
 

Protected Attributes

ThreadSafeModule TSM
 
SymbolNameToDefinitionMap SymbolToDefinition
 
- Protected Attributes inherited from llvm::orc::MaterializationUnit
SymbolFlagsMap SymbolFlags
 
VModuleKey K
 

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 67 of file Layer.h.

Member Typedef Documentation

◆ SymbolNameToDefinitionMap

Definition at line 69 of file Layer.h.

Constructor & Destructor Documentation

◆ IRMaterializationUnit() [1/2]

llvm::orc::IRMaterializationUnit::IRMaterializationUnit ( ExecutionSession ES,
ThreadSafeModule  TSM,
VModuleKey  K 
)

Create an IRMaterializationLayer.

Scans the module to build the SymbolFlags and SymbolToDefinition maps.

Definition at line 27 of file Layer.cpp.

References assert(), llvm::JITSymbolFlags::fromGlobalValue(), G, llvm::Module::getDataLayout(), llvm::orc::ThreadSafeModule::getModule(), llvm::Module::global_values(), llvm::orc::MaterializationUnit::SymbolFlags, and SymbolToDefinition.

◆ IRMaterializationUnit() [2/2]

llvm::orc::IRMaterializationUnit::IRMaterializationUnit ( ThreadSafeModule  TSM,
VModuleKey  K,
SymbolFlagsMap  SymbolFlags,
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 44 of file Layer.cpp.

Member Function Documentation

◆ getModule()

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

Definition at line 88 of file Layer.h.

◆ getName()

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

Member Data Documentation

◆ SymbolToDefinition

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

◆ TSM

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

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