LLVM  8.0.0svn
Public Types | Public Member Functions | List of all members
llvm::orc::IRCompileLayer< BaseLayerT, CompileFtor > Class Template Reference

Eager IR compiling layer. More...

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

Inheritance diagram for llvm::orc::IRCompileLayer< BaseLayerT, CompileFtor >:
Inheritance graph
[legend]

Public Types

using NotifyCompiledCallback = std::function< void(VModuleKey K, std::unique_ptr< Module >)>
 Callback type for notifications when modules are compiled. More...
 

Public Member Functions

 IRCompileLayer (BaseLayerT &BaseLayer, CompileFtor Compile, NotifyCompiledCallback NotifyCompiled=NotifyCompiledCallback())
 Construct an IRCompileLayer with the given BaseLayer, which must implement the ObjectLayer concept. More...
 
CompileFtor & getCompiler ()
 Get a reference to the compiler functor. More...
 
void setNotifyCompiled (NotifyCompiledCallback NotifyCompiled)
 (Re)set the NotifyCompiled callback. More...
 
Error addModule (VModuleKey K, std::unique_ptr< Module > M)
 Compile the module, and add the resulting object to the base layer along with the given memory manager and symbol resolver. More...
 
Error removeModule (VModuleKey K)
 Remove the module associated with the VModuleKey K. More...
 
JITSymbol findSymbol (const std::string &Name, bool ExportedSymbolsOnly)
 Search for the given named symbol. More...
 
JITSymbol findSymbolIn (VModuleKey K, const std::string &Name, bool ExportedSymbolsOnly)
 Get the address of the given symbol in compiled module represented by the handle H. More...
 
Error emitAndFinalize (VModuleKey K)
 Immediately emit and finalize the module represented by the given handle. More...
 

Detailed Description

template<typename BaseLayerT, typename CompileFtor>
class llvm::orc::IRCompileLayer< BaseLayerT, CompileFtor >

Eager IR compiling layer.

This layer immediately compiles each IR module added via addModule to an object file and adds this module file to the layer below, which must implement the object layer concept.

Definition at line 60 of file IRCompileLayer.h.

Member Typedef Documentation

◆ NotifyCompiledCallback

template<typename BaseLayerT, typename CompileFtor>
using llvm::orc::IRCompileLayer< BaseLayerT, CompileFtor >::NotifyCompiledCallback = std::function<void(VModuleKey K, std::unique_ptr<Module>)>

Callback type for notifications when modules are compiled.

Definition at line 64 of file IRCompileLayer.h.

Constructor & Destructor Documentation

◆ IRCompileLayer()

template<typename BaseLayerT, typename CompileFtor>
llvm::orc::IRCompileLayer< BaseLayerT, CompileFtor >::IRCompileLayer ( BaseLayerT &  BaseLayer,
CompileFtor  Compile,
NotifyCompiledCallback  NotifyCompiled = NotifyCompiledCallback() 
)
inline

Construct an IRCompileLayer with the given BaseLayer, which must implement the ObjectLayer concept.

Definition at line 68 of file IRCompileLayer.h.

Member Function Documentation

◆ addModule()

template<typename BaseLayerT, typename CompileFtor>
Error llvm::orc::IRCompileLayer< BaseLayerT, CompileFtor >::addModule ( VModuleKey  K,
std::unique_ptr< Module M 
)
inline

Compile the module, and add the resulting object to the base layer along with the given memory manager and symbol resolver.

Definition at line 84 of file IRCompileLayer.h.

◆ emitAndFinalize()

template<typename BaseLayerT, typename CompileFtor>
Error llvm::orc::IRCompileLayer< BaseLayerT, CompileFtor >::emitAndFinalize ( VModuleKey  K)
inline

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

Parameters
KThe VModuleKey for the module to emit/finalize.

Definition at line 119 of file IRCompileLayer.h.

◆ findSymbol()

template<typename BaseLayerT, typename CompileFtor>
JITSymbol llvm::orc::IRCompileLayer< BaseLayerT, CompileFtor >::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 99 of file IRCompileLayer.h.

◆ findSymbolIn()

template<typename BaseLayerT, typename CompileFtor>
JITSymbol llvm::orc::IRCompileLayer< BaseLayerT, CompileFtor >::findSymbolIn ( VModuleKey  K,
const std::string &  Name,
bool  ExportedSymbolsOnly 
)
inline

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

This call is forwarded to the base layer's implementation.

Parameters
KThe VModuleKey for the module to search in.
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 is found in the given module.

Definition at line 111 of file IRCompileLayer.h.

◆ getCompiler()

template<typename BaseLayerT, typename CompileFtor>
CompileFtor& llvm::orc::IRCompileLayer< BaseLayerT, CompileFtor >::getCompiler ( )
inline

Get a reference to the compiler functor.

Definition at line 75 of file IRCompileLayer.h.

◆ removeModule()

template<typename BaseLayerT, typename CompileFtor>
Error llvm::orc::IRCompileLayer< BaseLayerT, CompileFtor >::removeModule ( VModuleKey  K)
inline

Remove the module associated with the VModuleKey K.

Definition at line 93 of file IRCompileLayer.h.

◆ setNotifyCompiled()

template<typename BaseLayerT, typename CompileFtor>
void llvm::orc::IRCompileLayer< BaseLayerT, CompileFtor >::setNotifyCompiled ( NotifyCompiledCallback  NotifyCompiled)
inline

(Re)set the NotifyCompiled callback.

Definition at line 78 of file IRCompileLayer.h.


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