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

Object mutating layer. More...

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

Public Types

using ObjHandleT = typename BaseLayerT::ObjHandleT
 Handle to a set of added objects. More...
 

Public Member Functions

 ObjectTransformLayer (BaseLayerT &BaseLayer, TransformFtor Transform=TransformFtor())
 Construct an ObjectTransformLayer with the given BaseLayer. More...
 
template<typename ObjectPtr >
Expected< ObjHandleTaddObject (ObjectPtr Obj, std::shared_ptr< JITSymbolResolver > Resolver)
 Apply the transform functor to each object in the object set, then add the resulting set of objects to the base layer, along with the memory manager and symbol resolver. More...
 
Error removeObject (ObjHandleT H)
 Remove the object set associated with the handle H. More...
 
JITSymbol findSymbol (const std::string &Name, bool ExportedSymbolsOnly)
 Search for the given named symbol. More...
 
JITSymbol findSymbolIn (ObjHandleT H, const std::string &Name, bool ExportedSymbolsOnly)
 Get the address of the given symbol in the context of the set of objects represented by the handle H. More...
 
Error emitAndFinalize (ObjHandleT H)
 Immediately emit and finalize the object set represented by the given handle. More...
 
void mapSectionAddress (ObjHandleT H, const void *LocalAddress, JITTargetAddress TargetAddr)
 Map section addresses for the objects associated with the handle H. 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::ObjectTransformLayer< BaseLayerT, TransformFtor >

Object mutating layer.

This layer accepts sets of ObjectFiles (via addObject). It immediately applies the user supplied functor to each object, then adds the set of transformed objects to the layer below.

Definition at line 31 of file ObjectTransformLayer.h.

Member Typedef Documentation

◆ ObjHandleT

template<typename BaseLayerT , typename TransformFtor >
using llvm::orc::ObjectTransformLayer< BaseLayerT, TransformFtor >::ObjHandleT = typename BaseLayerT::ObjHandleT

Handle to a set of added objects.

Definition at line 34 of file ObjectTransformLayer.h.

Constructor & Destructor Documentation

◆ ObjectTransformLayer()

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

Construct an ObjectTransformLayer with the given BaseLayer.

Definition at line 37 of file ObjectTransformLayer.h.

Member Function Documentation

◆ addObject()

template<typename BaseLayerT , typename TransformFtor >
template<typename ObjectPtr >
Expected<ObjHandleT> llvm::orc::ObjectTransformLayer< BaseLayerT, TransformFtor >::addObject ( ObjectPtr  Obj,
std::shared_ptr< JITSymbolResolver Resolver 
)
inline

Apply the transform functor to each object in the object 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 objects.

Definition at line 47 of file ObjectTransformLayer.h.

◆ emitAndFinalize()

template<typename BaseLayerT , typename TransformFtor >
Error llvm::orc::ObjectTransformLayer< BaseLayerT, TransformFtor >::emitAndFinalize ( ObjHandleT  H)
inline

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

Parameters
HHandle for object set to emit/finalize.

Definition at line 79 of file ObjectTransformLayer.h.

◆ findSymbol()

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

◆ findSymbolIn()

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

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

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

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

Definition at line 71 of file ObjectTransformLayer.h.

◆ getTransform() [1/2]

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

Access the transform functor directly.

Definition at line 90 of file ObjectTransformLayer.h.

◆ getTransform() [2/2]

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

Access the mumate functor directly.

Definition at line 93 of file ObjectTransformLayer.h.

◆ mapSectionAddress()

template<typename BaseLayerT , typename TransformFtor >
void llvm::orc::ObjectTransformLayer< BaseLayerT, TransformFtor >::mapSectionAddress ( ObjHandleT  H,
const void *  LocalAddress,
JITTargetAddress  TargetAddr 
)
inline

Map section addresses for the objects associated with the handle H.

Definition at line 84 of file ObjectTransformLayer.h.

◆ removeObject()

template<typename BaseLayerT , typename TransformFtor >
Error llvm::orc::ObjectTransformLayer< BaseLayerT, TransformFtor >::removeObject ( ObjHandleT  H)
inline

Remove the object set associated with the handle H.

Definition at line 53 of file ObjectTransformLayer.h.


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