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

Public Types

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

Public Member Functions

 IRMaterializationUnit (ExecutionSession &ES, std::unique_ptr< Module > M)
 Create an IRMaterializationLayer. More...
 
 IRMaterializationUnit (std::unique_ptr< Module > M, SymbolFlagsMap SymbolFlags, SymbolNameToDefinitionMap SymbolToDefinition)
 Create an IRMaterializationLayer from a module, and pre-existing SymbolFlags and SymbolToDefinition maps. More...
 
- Public Member Functions inherited from llvm::orc::MaterializationUnit
 MaterializationUnit (SymbolFlagsMap InitalSymbolFlags)
 
virtual ~MaterializationUnit ()
 
const SymbolFlagsMap & getSymbols () const
 Return the set of symbols that this source provides. More...
 
void doMaterialize (VSO &V)
 Called by materialization dispatchers (see ExecutionSession::DispatchMaterializationFunction) to trigger materialization of this MaterializationUnit. More...
 
void doDiscard (const VSO &V, SymbolStringPtr Name)
 Called by VSOs to notify MaterializationUnits that the given symbol has been overridden. More...
 

Protected Attributes

std::unique_ptr< Module > M
 
SymbolNameToDefinitionMap SymbolToDefinition
 
- Protected Attributes inherited from llvm::orc::MaterializationUnit
SymbolFlagsMap SymbolFlags
 

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

Member Typedef Documentation

◆ SymbolNameToDefinitionMap

Definition at line 49 of file Layer.h.

Constructor & Destructor Documentation

◆ IRMaterializationUnit() [1/2]

llvm::orc::IRMaterializationUnit::IRMaterializationUnit ( ExecutionSession &  ES,
std::unique_ptr< Module >  M 
)

Create an IRMaterializationLayer.

Scans the module to build the SymbolFlags and SymbolToDefinition maps.

Definition at line 25 of file Layer.cpp.

References llvm::JITSymbolFlags::fromGlobalValue(), G, Mangle, llvm::orc::MaterializationUnit::SymbolFlags, and SymbolToDefinition.

◆ IRMaterializationUnit() [2/2]

llvm::orc::IRMaterializationUnit::IRMaterializationUnit ( std::unique_ptr< Module >  M,
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 40 of file Layer.cpp.

References assert(), llvm::GlobalValue::AvailableExternallyLinkage, I, and SymbolToDefinition.

Member Data Documentation

◆ M

std::unique_ptr<Module> llvm::orc::IRMaterializationUnit::M
protected

◆ SymbolToDefinition

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

Definition at line 65 of file Layer.h.

Referenced by IRMaterializationUnit().


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