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

Eager IR compiling layer. More...

#include <IRCompileLayer.h>

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

Public Types

typedef std::function
< object::OwningBinary
< object::ObjectFile >Module &)> 
CompileFtor
 
typedef ObjSetHandleT ModuleSetHandleT
 Handle to a set of compiled modules. More...
 

Public Member Functions

 IRCompileLayer (BaseLayerT &BaseLayer, CompileFtor Compile)
 Construct an IRCompileLayer with the given BaseLayer, which must implement the ObjectLayer concept. More...
 
void setObjectCache (ObjectCache *NewCache)
 Set an ObjectCache to query before compiling. More...
 
template<typename ModuleSetT , typename MemoryManagerPtrT , typename SymbolResolverPtrT >
ModuleSetHandleT addModuleSet (ModuleSetT Ms, MemoryManagerPtrT MemMgr, SymbolResolverPtrT Resolver)
 Compile each module in the given module set, then add the resulting set of objects to the base layer along with the memory manager and symbol resolver. More...
 
void removeModuleSet (ModuleSetHandleT H)
 Remove the module set associated with the handle H. More...
 
JITSymbol findSymbol (const std::string &Name, bool ExportedSymbolsOnly)
 Search for the given named symbol. More...
 
JITSymbol findSymbolIn (ModuleSetHandleT H, const std::string &Name, bool ExportedSymbolsOnly)
 Get the address of the given symbol in the context of the set of compiled modules represented by the handle H. More...
 
void emitAndFinalize (ModuleSetHandleT H)
 Immediately emit and finalize the moduleOB set represented by the given handle. More...
 

Detailed Description

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

Eager IR compiling layer.

This layer accepts sets of LLVM IR Modules (via addModuleSet). It immediately compiles each IR module to an object file (each IR Module is compiled separately). The resulting set of object files is then added to the layer below, which must implement the object layer concept.

Definition at line 31 of file IRCompileLayer.h.

Member Typedef Documentation

template<typename BaseLayerT>
typedef std::function<object::OwningBinary<object::ObjectFile>Module &)> llvm::orc::IRCompileLayer< BaseLayerT >::CompileFtor

Definition at line 34 of file IRCompileLayer.h.

template<typename BaseLayerT>
typedef ObjSetHandleT llvm::orc::IRCompileLayer< BaseLayerT >::ModuleSetHandleT

Handle to a set of compiled modules.

Definition at line 41 of file IRCompileLayer.h.

Constructor & Destructor Documentation

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

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

Definition at line 45 of file IRCompileLayer.h.

Member Function Documentation

template<typename BaseLayerT>
template<typename ModuleSetT , typename MemoryManagerPtrT , typename SymbolResolverPtrT >
ModuleSetHandleT llvm::orc::IRCompileLayer< BaseLayerT >::addModuleSet ( ModuleSetT  Ms,
MemoryManagerPtrT  MemMgr,
SymbolResolverPtrT  Resolver 
)
inline

Compile each module in the given module set, then add the resulting set of objects to the base layer along with the memory manager and symbol resolver.

Returns
A handle for the added modules.

Definition at line 58 of file IRCompileLayer.h.

template<typename BaseLayerT>
void llvm::orc::IRCompileLayer< BaseLayerT >::emitAndFinalize ( ModuleSetHandleT  H)
inline

Immediately emit and finalize the moduleOB set represented by the given handle.

Parameters
HHandle for module set to emit/finalize.

Definition at line 115 of file IRCompileLayer.h.

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

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

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

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

Parameters
HThe handle for the module set 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 set.

Definition at line 107 of file IRCompileLayer.h.

template<typename BaseLayerT>
void llvm::orc::IRCompileLayer< BaseLayerT >::removeModuleSet ( ModuleSetHandleT  H)
inline

Remove the module set associated with the handle H.

Definition at line 89 of file IRCompileLayer.h.

template<typename BaseLayerT>
void llvm::orc::IRCompileLayer< BaseLayerT >::setObjectCache ( ObjectCache NewCache)
inline

Set an ObjectCache to query before compiling.

Definition at line 49 of file IRCompileLayer.h.

Referenced by llvm::orc::OrcMCJITReplacement::setObjectCache().


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