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

IR mutating layer. More...

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

Public Types

using ModuleHandleT = typename BaseLayerT::ModuleHandleT
 Handle to a set of added modules. More...
 

Public Member Functions

 IRTransformLayer (BaseLayerT &BaseLayer, TransformFtor Transform=TransformFtor())
 Construct an IRTransformLayer with the given BaseLayer. More...
 
Expected< ModuleHandleTaddModule (std::shared_ptr< Module > M, std::shared_ptr< JITSymbolResolver > Resolver)
 Apply the transform functor to the module, then add the module to the layer below, along with the 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 the context of the module represented by the handle H. More...
 
Error emitAndFinalize (ModuleHandleT H)
 Immediately emit and finalize the module represented by the given handle. More...
 
TransformFtor & getTransform ()
 Access the transform functor directly. More...
 
const TransformFtor & getTransform () const
 Access the mumate functor directly. More...
 

Detailed Description

template<typename BaseLayerT, typename TransformFtor>
class llvm::orc::IRTransformLayer< BaseLayerT, TransformFtor >

IR mutating layer.

This layer applies a user supplied transform to each module that is added, then adds the transformed module to the layer below.

Definition at line 30 of file IRTransformLayer.h.

Member Typedef Documentation

◆ ModuleHandleT

template<typename BaseLayerT , typename TransformFtor >
using llvm::orc::IRTransformLayer< BaseLayerT, TransformFtor >::ModuleHandleT = typename BaseLayerT::ModuleHandleT

Handle to a set of added modules.

Definition at line 34 of file IRTransformLayer.h.

Constructor & Destructor Documentation

◆ IRTransformLayer()

template<typename BaseLayerT , typename TransformFtor >
llvm::orc::IRTransformLayer< BaseLayerT, TransformFtor >::IRTransformLayer ( BaseLayerT &  BaseLayer,
TransformFtor  Transform = TransformFtor() 
)
inline

Construct an IRTransformLayer with the given BaseLayer.

Definition at line 37 of file IRTransformLayer.h.

Member Function Documentation

◆ addModule()

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

Apply the transform functor to the module, then add the module to the layer below, along with the memory manager and symbol resolver.

Returns
A handle for the added modules.

Definition at line 46 of file IRTransformLayer.h.

◆ emitAndFinalize()

template<typename BaseLayerT , typename TransformFtor >
Error llvm::orc::IRTransformLayer< BaseLayerT, TransformFtor >::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 78 of file IRTransformLayer.h.

◆ findSymbol()

template<typename BaseLayerT , typename TransformFtor >
JITSymbol llvm::orc::IRTransformLayer< BaseLayerT, TransformFtor >::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 58 of file IRTransformLayer.h.

◆ findSymbolIn()

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

Get the address of the given symbol in the context of the 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 70 of file IRTransformLayer.h.

◆ getTransform() [1/2]

template<typename BaseLayerT , typename TransformFtor >
TransformFtor& llvm::orc::IRTransformLayer< BaseLayerT, TransformFtor >::getTransform ( )
inline

Access the transform functor directly.

Definition at line 83 of file IRTransformLayer.h.

◆ getTransform() [2/2]

template<typename BaseLayerT , typename TransformFtor >
const TransformFtor& llvm::orc::IRTransformLayer< BaseLayerT, TransformFtor >::getTransform ( ) const
inline

Access the mumate functor directly.

Definition at line 86 of file IRTransformLayer.h.

◆ removeModule()

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

Remove the module associated with the handle H.

Definition at line 52 of file IRTransformLayer.h.


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