LLVM  6.0.0svn
Classes | Public Types | Public Member Functions | List of all members
llvm::orc::LazyEmittingLayer< BaseLayerT > Class Template Reference

Lazy-emitting IR layer. More...

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

Inheritance diagram for llvm::orc::LazyEmittingLayer< BaseLayerT >:
Inheritance graph
[legend]

Public Types

using BaseLayerHandleT = typename BaseLayerT::ModuleHandleT
 
using ModuleHandleT = typename ModuleListT::iterator
 Handle to a loaded module. More...
 

Public Member Functions

 LazyEmittingLayer (BaseLayerT &BaseLayer)
 Construct a lazy emitting layer. More...
 
Expected< ModuleHandleTaddModule (std::shared_ptr< Module > M, std::shared_ptr< JITSymbolResolver > Resolver)
 Add the given module to the lazy emitting layer. More...
 
Error removeModule (ModuleHandleT H)
 Remove the module represented by the given handle. More...
 
JITSymbol findSymbol (const std::string &Name, bool ExportedSymbolsOnly)
 Search for the given named symbol. More...
 
JITSymbol findSymbolIn (ModuleHandleT H, const std::string &Name, bool ExportedSymbolsOnly)
 Get the address of the given symbol in the context of the of compiled modules represented by the handle H. More...
 
Error emitAndFinalize (ModuleHandleT H)
 Immediately emit and finalize the module represented by the given handle. More...
 

Detailed Description

template<typename BaseLayerT>
class llvm::orc::LazyEmittingLayer< BaseLayerT >

Lazy-emitting IR layer.

This layer accepts LLVM IR Modules (via addModule), but does not immediately emit them the layer below. Instead, emissing to the base layer is deferred until the first time the client requests the address (via JITSymbol::getAddress) for a symbol contained in this layer.

Definition at line 41 of file LazyEmittingLayer.h.

Member Typedef Documentation

◆ BaseLayerHandleT

template<typename BaseLayerT>
using llvm::orc::LazyEmittingLayer< BaseLayerT >::BaseLayerHandleT = typename BaseLayerT::ModuleHandleT

Definition at line 44 of file LazyEmittingLayer.h.

◆ ModuleHandleT

template<typename BaseLayerT>
using llvm::orc::LazyEmittingLayer< BaseLayerT >::ModuleHandleT = typename ModuleListT::iterator

Handle to a loaded module.

Definition at line 209 of file LazyEmittingLayer.h.

Constructor & Destructor Documentation

◆ LazyEmittingLayer()

template<typename BaseLayerT>
llvm::orc::LazyEmittingLayer< BaseLayerT >::LazyEmittingLayer ( BaseLayerT &  BaseLayer)
inline

Construct a lazy emitting layer.

Definition at line 212 of file LazyEmittingLayer.h.

Member Function Documentation

◆ addModule()

template<typename BaseLayerT>
Expected<ModuleHandleT> llvm::orc::LazyEmittingLayer< BaseLayerT >::addModule ( std::shared_ptr< Module M,
std::shared_ptr< JITSymbolResolver Resolver 
)
inline

Add the given module to the lazy emitting layer.

Definition at line 216 of file LazyEmittingLayer.h.

◆ emitAndFinalize()

template<typename BaseLayerT>
Error llvm::orc::LazyEmittingLayer< BaseLayerT >::emitAndFinalize ( ModuleHandleT  H)
inline

Immediately emit and finalize the module represented by the given handle.

Parameters
HHandle for module to emit/finalize.

Definition at line 264 of file LazyEmittingLayer.h.

◆ findSymbol()

template<typename BaseLayerT>
JITSymbol llvm::orc::LazyEmittingLayer< BaseLayerT >::findSymbol ( const std::string &  Name,
bool  ExportedSymbolsOnly 
)
inline

Search for the given named symbol.

Parameters
NameThe name of the symbol to search for.
ExportedSymbolsOnlyIf true, search only for exported symbols.
Returns
A handle for the given named symbol, if it exists.

Definition at line 238 of file LazyEmittingLayer.h.

◆ findSymbolIn()

template<typename BaseLayerT>
JITSymbol llvm::orc::LazyEmittingLayer< BaseLayerT >::findSymbolIn ( ModuleHandleT  H,
const std::string &  Name,
bool  ExportedSymbolsOnly 
)
inline

Get the address of the given symbol in the context of the of compiled modules represented by the handle H.

Definition at line 256 of file LazyEmittingLayer.h.

◆ removeModule()

template<typename BaseLayerT>
Error llvm::orc::LazyEmittingLayer< BaseLayerT >::removeModule ( ModuleHandleT  H)
inline

Remove the module represented by the given handle.

This method will free the memory associated with the given module, both in this layer, and the base layer.

Definition at line 228 of file LazyEmittingLayer.h.


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