LLVM  6.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 ModuleHandleT = typename BaseLayerT::ObjHandleT
 Handle to a compiled module. More...
 

Public Member Functions

 IRCompileLayer (BaseLayerT &BaseLayer, CompileFtor Compile)
 Construct an IRCompileLayer with the given BaseLayer, which must implement the ObjectLayer concept. More...
 
CompileFtor & getCompiler ()
 Get a reference to the compiler functor. More...
 
Expected< ModuleHandleTaddModule (std::shared_ptr< Module > M, std::shared_ptr< JITSymbolResolver > Resolver)
 Compile the module, and add the resulting object to the base layer along with the given memory manager and symbol resolver. More...
 
Error removeModule (ModuleHandleT H)
 Remove the module associated with the handle H. 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 compiled module 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, 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 35 of file IRCompileLayer.h.

Member Typedef Documentation

◆ ModuleHandleT

template<typename BaseLayerT, typename CompileFtor>
using llvm::orc::IRCompileLayer< BaseLayerT, CompileFtor >::ModuleHandleT = typename BaseLayerT::ObjHandleT

Handle to a compiled module.

Definition at line 39 of file IRCompileLayer.h.

Constructor & Destructor Documentation

◆ IRCompileLayer()

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

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

Definition at line 43 of file IRCompileLayer.h.

Member Function Documentation

◆ addModule()

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

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

Returns
A handle for the added module.

Definition at line 54 of file IRCompileLayer.h.

◆ emitAndFinalize()

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

◆ findSymbolIn()

template<typename BaseLayerT, typename CompileFtor>
JITSymbol llvm::orc::IRCompileLayer< BaseLayerT, CompileFtor >::findSymbolIn ( ModuleHandleT  H,
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
HThe handle 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 82 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 47 of file IRCompileLayer.h.

◆ removeModule()

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

Remove the module associated with the handle H.

Definition at line 62 of file IRCompileLayer.h.


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