LLVM  10.0.0svn
Classes | Public Types | Public Member Functions | List of all members
llvm::orc::LegacyCompileOnDemandLayer< BaseLayerT, CompileCallbackMgrT, IndirectStubsMgrT > Class Template Reference

Compile-on-demand layer. More...

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

Public Types

using PartitioningFtor = std::function< std::set< Function * >(Function &)>
 Module partitioning functor. More...
 
using IndirectStubsManagerBuilderT = std::function< std::unique_ptr< IndirectStubsMgrT >()>
 Builder for IndirectStubsManagers. More...
 
using SymbolResolverGetter = std::function< std::shared_ptr< SymbolResolver >(VModuleKey K)>
 
using SymbolResolverSetter = std::function< void(VModuleKey K, std::shared_ptr< SymbolResolver > R)>
 

Public Member Functions

 LLVM_ATTRIBUTE_DEPRECATED (LegacyCompileOnDemandLayer(ExecutionSession &ES, BaseLayerT &BaseLayer, SymbolResolverGetter GetSymbolResolver, SymbolResolverSetter SetSymbolResolver, PartitioningFtor Partition, CompileCallbackMgrT &CallbackMgr, IndirectStubsManagerBuilderT CreateIndirectStubsManager, bool CloneStubsIntoPartitions=true), "ORCv1 layers (layers with the 'Legacy' prefix) are deprecated. Please " "use " "the ORCv2 LegacyCompileOnDemandLayer instead")
 Construct a compile-on-demand layer instance. More...
 
 LegacyCompileOnDemandLayer (ORCv1DeprecationAcknowledgement, ExecutionSession &ES, BaseLayerT &BaseLayer, SymbolResolverGetter GetSymbolResolver, SymbolResolverSetter SetSymbolResolver, PartitioningFtor Partition, CompileCallbackMgrT &CallbackMgr, IndirectStubsManagerBuilderT CreateIndirectStubsManager, bool CloneStubsIntoPartitions=true)
 Legacy layer constructor with deprecation acknowledgement. More...
 
 ~LegacyCompileOnDemandLayer ()
 
Error addModule (VModuleKey K, std::unique_ptr< Module > M)
 Add a module to the compile-on-demand layer. More...
 
Error addExtraModule (VModuleKey K, std::unique_ptr< Module > M)
 Add extra modules to an existing logical module. More...
 
Error removeModule (VModuleKey K)
 Remove the module represented by the given key. More...
 
JITSymbol findSymbol (StringRef Name, bool ExportedSymbolsOnly)
 Search for the given named symbol. More...
 
JITSymbol findSymbolIn (VModuleKey K, const std::string &Name, bool ExportedSymbolsOnly)
 Get the address of a symbol provided by this layer, or some layer below this one. More...
 
Error updatePointer (std::string FuncName, JITTargetAddress FnBodyAddr)
 Update the stub for the given function to point at FnBodyAddr. More...
 

Detailed Description

template<typename BaseLayerT, typename CompileCallbackMgrT = JITCompileCallbackManager, typename IndirectStubsMgrT = IndirectStubsManager>
class llvm::orc::LegacyCompileOnDemandLayer< BaseLayerT, CompileCallbackMgrT, IndirectStubsMgrT >

Compile-on-demand layer.

When a module is added to this layer a stub is created for each of its function definitions. The stubs and other global values are immediately added to the layer below. When a stub is called it triggers the extraction of the function body from the original module. The extracted body is then compiled and executed.

Definition at line 147 of file CompileOnDemandLayer.h.

Member Typedef Documentation

◆ IndirectStubsManagerBuilderT

template<typename BaseLayerT , typename CompileCallbackMgrT = JITCompileCallbackManager, typename IndirectStubsMgrT = IndirectStubsManager>
using llvm::orc::LegacyCompileOnDemandLayer< BaseLayerT, CompileCallbackMgrT, IndirectStubsMgrT >::IndirectStubsManagerBuilderT = std::function<std::unique_ptr<IndirectStubsMgrT>()>

Builder for IndirectStubsManagers.

Definition at line 262 of file CompileOnDemandLayer.h.

◆ PartitioningFtor

template<typename BaseLayerT , typename CompileCallbackMgrT = JITCompileCallbackManager, typename IndirectStubsMgrT = IndirectStubsManager>
using llvm::orc::LegacyCompileOnDemandLayer< BaseLayerT, CompileCallbackMgrT, IndirectStubsMgrT >::PartitioningFtor = std::function<std::set<Function*>(Function&)>

Module partitioning functor.

Definition at line 258 of file CompileOnDemandLayer.h.

◆ SymbolResolverGetter

template<typename BaseLayerT , typename CompileCallbackMgrT = JITCompileCallbackManager, typename IndirectStubsMgrT = IndirectStubsManager>
using llvm::orc::LegacyCompileOnDemandLayer< BaseLayerT, CompileCallbackMgrT, IndirectStubsMgrT >::SymbolResolverGetter = std::function<std::shared_ptr<SymbolResolver>(VModuleKey K)>

Definition at line 265 of file CompileOnDemandLayer.h.

◆ SymbolResolverSetter

template<typename BaseLayerT , typename CompileCallbackMgrT = JITCompileCallbackManager, typename IndirectStubsMgrT = IndirectStubsManager>
using llvm::orc::LegacyCompileOnDemandLayer< BaseLayerT, CompileCallbackMgrT, IndirectStubsMgrT >::SymbolResolverSetter = std::function<void(VModuleKey K, std::shared_ptr<SymbolResolver> R)>

Definition at line 268 of file CompileOnDemandLayer.h.

Constructor & Destructor Documentation

◆ LegacyCompileOnDemandLayer()

template<typename BaseLayerT , typename CompileCallbackMgrT = JITCompileCallbackManager, typename IndirectStubsMgrT = IndirectStubsManager>
llvm::orc::LegacyCompileOnDemandLayer< BaseLayerT, CompileCallbackMgrT, IndirectStubsMgrT >::LegacyCompileOnDemandLayer ( ORCv1DeprecationAcknowledgement  ,
ExecutionSession ES,
BaseLayerT &  BaseLayer,
SymbolResolverGetter  GetSymbolResolver,
SymbolResolverSetter  SetSymbolResolver,
PartitioningFtor  Partition,
CompileCallbackMgrT &  CallbackMgr,
IndirectStubsManagerBuilderT  CreateIndirectStubsManager,
bool  CloneStubsIntoPartitions = true 
)
inline

Legacy layer constructor with deprecation acknowledgement.

Definition at line 284 of file CompileOnDemandLayer.h.

◆ ~LegacyCompileOnDemandLayer()

template<typename BaseLayerT , typename CompileCallbackMgrT = JITCompileCallbackManager, typename IndirectStubsMgrT = IndirectStubsManager>
llvm::orc::LegacyCompileOnDemandLayer< BaseLayerT, CompileCallbackMgrT, IndirectStubsMgrT >::~LegacyCompileOnDemandLayer ( )
inline

Definition at line 298 of file CompileOnDemandLayer.h.

References llvm::consumeError().

Member Function Documentation

◆ addExtraModule()

template<typename BaseLayerT , typename CompileCallbackMgrT = JITCompileCallbackManager, typename IndirectStubsMgrT = IndirectStubsManager>
Error llvm::orc::LegacyCompileOnDemandLayer< BaseLayerT, CompileCallbackMgrT, IndirectStubsMgrT >::addExtraModule ( VModuleKey  K,
std::unique_ptr< Module M 
)
inline

Add extra modules to an existing logical module.

Definition at line 317 of file CompileOnDemandLayer.h.

◆ addModule()

template<typename BaseLayerT , typename CompileCallbackMgrT = JITCompileCallbackManager, typename IndirectStubsMgrT = IndirectStubsManager>
Error llvm::orc::LegacyCompileOnDemandLayer< BaseLayerT, CompileCallbackMgrT, IndirectStubsMgrT >::addModule ( VModuleKey  K,
std::unique_ptr< Module M 
)
inline

Add a module to the compile-on-demand layer.

Definition at line 305 of file CompileOnDemandLayer.h.

References assert(), and I.

◆ findSymbol()

template<typename BaseLayerT , typename CompileCallbackMgrT = JITCompileCallbackManager, typename IndirectStubsMgrT = IndirectStubsManager>
JITSymbol llvm::orc::LegacyCompileOnDemandLayer< BaseLayerT, CompileCallbackMgrT, IndirectStubsMgrT >::findSymbol ( StringRef  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 337 of file CompileOnDemandLayer.h.

◆ findSymbolIn()

template<typename BaseLayerT , typename CompileCallbackMgrT = JITCompileCallbackManager, typename IndirectStubsMgrT = IndirectStubsManager>
JITSymbol llvm::orc::LegacyCompileOnDemandLayer< BaseLayerT, CompileCallbackMgrT, IndirectStubsMgrT >::findSymbolIn ( VModuleKey  K,
const std::string &  Name,
bool  ExportedSymbolsOnly 
)
inline

Get the address of a symbol provided by this layer, or some layer below this one.

Definition at line 351 of file CompileOnDemandLayer.h.

References assert().

◆ LLVM_ATTRIBUTE_DEPRECATED()

template<typename BaseLayerT , typename CompileCallbackMgrT = JITCompileCallbackManager, typename IndirectStubsMgrT = IndirectStubsManager>
llvm::orc::LegacyCompileOnDemandLayer< BaseLayerT, CompileCallbackMgrT, IndirectStubsMgrT >::LLVM_ATTRIBUTE_DEPRECATED ( LegacyCompileOnDemandLayer< BaseLayerT, CompileCallbackMgrT, IndirectStubsMgrT >(ExecutionSession &ES, BaseLayerT &BaseLayer, SymbolResolverGetter GetSymbolResolver, SymbolResolverSetter SetSymbolResolver, PartitioningFtor Partition, CompileCallbackMgrT &CallbackMgr, IndirectStubsManagerBuilderT CreateIndirectStubsManager, bool CloneStubsIntoPartitions=true ,
"ORCv1 layers (layers with the 'Legacy' prefix) are deprecated. Please " "use " "the ORCv2 LegacyCompileOnDemandLayer< BaseLayerT, CompileCallbackMgrT, IndirectStubsMgrT > instead"   
)

Construct a compile-on-demand layer instance.

◆ removeModule()

template<typename BaseLayerT , typename CompileCallbackMgrT = JITCompileCallbackManager, typename IndirectStubsMgrT = IndirectStubsManager>
Error llvm::orc::LegacyCompileOnDemandLayer< BaseLayerT, CompileCallbackMgrT, IndirectStubsMgrT >::removeModule ( VModuleKey  K)
inline

Remove the module represented by the given key.

This will remove all modules in the layers below that were derived from the module represented by K.

Definition at line 325 of file CompileOnDemandLayer.h.

References assert(), and I.

◆ updatePointer()

template<typename BaseLayerT , typename CompileCallbackMgrT = JITCompileCallbackManager, typename IndirectStubsMgrT = IndirectStubsManager>
Error llvm::orc::LegacyCompileOnDemandLayer< BaseLayerT, CompileCallbackMgrT, IndirectStubsMgrT >::updatePointer ( std::string  FuncName,
JITTargetAddress  FnBodyAddr 
)
inline

Update the stub for the given function to point at FnBodyAddr.

This can be used to support re-optimization.

Returns
true if the function exists and the stub is updated, false otherwise.

Definition at line 365 of file CompileOnDemandLayer.h.

References llvm::Module::getDataLayout().


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