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

Eager IR compiling layer. More...

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

Inheritance diagram for llvm::orc::LegacyIRCompileLayer< 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

 LegacyIRCompileLayer (BaseLayerT &BaseLayer, CompileFtor Compile, NotifyCompiledCallback NotifyCompiled=NotifyCompiledCallback())
 Construct an LegacyIRCompileLayer 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::LegacyIRCompileLayer< 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 59 of file IRCompileLayer.h.

Member Typedef Documentation

◆ NotifyCompiledCallback

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

Callback type for notifications when modules are compiled.

Definition at line 63 of file IRCompileLayer.h.

Constructor & Destructor Documentation

◆ LegacyIRCompileLayer()

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

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

Definition at line 67 of file IRCompileLayer.h.

Member Function Documentation

◆ addModule()

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

◆ emitAndFinalize()

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

◆ findSymbol()

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

◆ findSymbolIn()

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

◆ getCompiler()

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

Get a reference to the compiler functor.

Definition at line 74 of file IRCompileLayer.h.

◆ removeModule()

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

Remove the module associated with the VModuleKey K.

Definition at line 92 of file IRCompileLayer.h.

◆ setNotifyCompiled()

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

(Re)set the NotifyCompiled callback.

Definition at line 77 of file IRCompileLayer.h.


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