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

Global mapping layer. More...

#include <GlobalMappingLayer.h>

Public Types

typedef
BaseLayerT::ModuleSetHandleT 
ModuleSetHandleT
 Handle to a set of added modules. More...
 

Public Member Functions

 GlobalMappingLayer (BaseLayerT &BaseLayer)
 Construct an GlobalMappingLayer with the given BaseLayer. More...
 
template<typename ModuleSetT , typename MemoryManagerPtrT , typename SymbolResolverPtrT >
ModuleSetHandleT addModuleSet (ModuleSetT Ms, MemoryManagerPtrT MemMgr, SymbolResolverPtrT Resolver)
 Add the given module set to the JIT. More...
 
void removeModuleSet (ModuleSetHandleT H)
 Remove the module set associated with the handle H. More...
 
void setGlobalMapping (const std::string &Name, JITTargetAddress Addr)
 Manually set the address to return for the given symbol. More...
 
void eraseGlobalMapping (const std::string &Name)
 Remove the given symbol from the global mapping. 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 modules represented by the handle H. More...
 
void emitAndFinalize (ModuleSetHandleT H)
 Immediately emit and finalize the module set represented by the given handle. More...
 

Detailed Description

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

Global mapping layer.

This layer overrides the findSymbol method to first search a local symbol table that the client can define. It can be used to inject new symbol mappings into the JIT. Beware, however: symbols within a single IR module or object file will still resolve locally (via RuntimeDyld's symbol table) - such internal references cannot be overriden via this layer.

Definition at line 32 of file GlobalMappingLayer.h.

Member Typedef Documentation

template<typename BaseLayerT >
typedef BaseLayerT::ModuleSetHandleT llvm::orc::GlobalMappingLayer< BaseLayerT >::ModuleSetHandleT

Handle to a set of added modules.

Definition at line 35 of file GlobalMappingLayer.h.

Constructor & Destructor Documentation

template<typename BaseLayerT >
llvm::orc::GlobalMappingLayer< BaseLayerT >::GlobalMappingLayer ( BaseLayerT &  BaseLayer)
inline

Construct an GlobalMappingLayer with the given BaseLayer.

Definition at line 38 of file GlobalMappingLayer.h.

Member Function Documentation

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

Add the given module set to the JIT.

Returns
A handle for the added modules.

Definition at line 44 of file GlobalMappingLayer.h.

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

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

Parameters
HHandle for module set to emit/finalize.

Definition at line 96 of file GlobalMappingLayer.h.

template<typename BaseLayerT >
void llvm::orc::GlobalMappingLayer< BaseLayerT >::eraseGlobalMapping ( const std::string &  Name)
inline

Remove the given symbol from the global mapping.

Definition at line 60 of file GlobalMappingLayer.h.

template<typename BaseLayerT >
JITSymbol llvm::orc::GlobalMappingLayer< BaseLayerT >::findSymbol ( const std::string &  Name,
bool  ExportedSymbolsOnly 
)
inline

Search for the given named symbol.

This method will first search the local symbol table, returning any symbol found there. If the symbol is not found in the local table then this call will be passed through to the base layer.

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 73 of file GlobalMappingLayer.h.

References llvm::JITSymbolFlags::Exported, and I.

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

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

Remove the module set associated with the handle H.

Definition at line 52 of file GlobalMappingLayer.h.

template<typename BaseLayerT >
void llvm::orc::GlobalMappingLayer< BaseLayerT >::setGlobalMapping ( const std::string &  Name,
JITTargetAddress  Addr 
)
inline

Manually set the address to return for the given symbol.

Definition at line 55 of file GlobalMappingLayer.h.


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