LLVM 20.0.0git
|
#include "llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h"
Public Types | |
using | IndirectStubsManagerBuilder = std::function< std::unique_ptr< IndirectStubsManager >()> |
Builder for IndirectStubsManagers. | |
using | GlobalValueSet = std::set< const GlobalValue * > |
using | PartitionFunction = std::function< std::optional< GlobalValueSet >(GlobalValueSet Requested)> |
Partitioning function. | |
Public Member Functions | |
CompileOnDemandLayer (ExecutionSession &ES, IRLayer &BaseLayer, LazyCallThroughManager &LCTMgr, IndirectStubsManagerBuilder BuildIndirectStubsManager) | |
Construct a CompileOnDemandLayer. | |
void | setPartitionFunction (PartitionFunction Partition) |
Sets the partition function. | |
void | setImplMap (ImplSymbolMap *Imp) |
Sets the ImplSymbolMap. | |
void | emit (std::unique_ptr< MaterializationResponsibility > R, ThreadSafeModule TSM) override |
Emits the given module. | |
Public Member Functions inherited from llvm::orc::IRLayer | |
IRLayer (ExecutionSession &ES, const IRSymbolMapper::ManglingOptions *&MO) | |
virtual | ~IRLayer () |
ExecutionSession & | getExecutionSession () |
Returns the ExecutionSession for this layer. | |
const IRSymbolMapper::ManglingOptions *& | getManglingOptions () const |
Get the mangling options for this layer. | |
void | setCloneToNewContextOnEmit (bool CloneToNewContextOnEmit) |
Sets the CloneToNewContextOnEmit flag (false by default). | |
bool | getCloneToNewContextOnEmit () const |
Returns the current value of the CloneToNewContextOnEmit flag. | |
virtual Error | add (ResourceTrackerSP RT, ThreadSafeModule TSM) |
Add a MaterializatinoUnit representing the given IR to the JITDylib targeted by the given tracker. | |
Error | add (JITDylib &JD, ThreadSafeModule TSM) |
Adds a MaterializationUnit representing the given IR to the given JITDylib. | |
virtual void | emit (std::unique_ptr< MaterializationResponsibility > R, ThreadSafeModule TSM)=0 |
Emit should materialize the given IR. | |
Static Public Member Functions | |
static std::optional< GlobalValueSet > | compileRequested (GlobalValueSet Requested) |
Off-the-shelf partitioning which compiles all requested symbols (usually a single function at a time). | |
static std::optional< GlobalValueSet > | compileWholeModule (GlobalValueSet Requested) |
Off-the-shelf partitioning which compiles whole modules whenever any symbol in them is requested. | |
Friends | |
class | PartitioningIRMaterializationUnit |
Definition at line 55 of file CompileOnDemandLayer.h.
using llvm::orc::CompileOnDemandLayer::GlobalValueSet = std::set<const GlobalValue *> |
Definition at line 63 of file CompileOnDemandLayer.h.
using llvm::orc::CompileOnDemandLayer::IndirectStubsManagerBuilder = std::function<std::unique_ptr<IndirectStubsManager>()> |
Builder for IndirectStubsManagers.
Definition at line 60 of file CompileOnDemandLayer.h.
using llvm::orc::CompileOnDemandLayer::PartitionFunction = std::function<std::optional<GlobalValueSet>(GlobalValueSet Requested)> |
Partitioning function.
Definition at line 66 of file CompileOnDemandLayer.h.
llvm::orc::CompileOnDemandLayer::CompileOnDemandLayer | ( | ExecutionSession & | ES, |
IRLayer & | BaseLayer, | ||
LazyCallThroughManager & | LCTMgr, | ||
IndirectStubsManagerBuilder | BuildIndirectStubsManager | ||
) |
Construct a CompileOnDemandLayer.
Definition at line 115 of file CompileOnDemandLayer.cpp.
|
static |
Off-the-shelf partitioning which compiles all requested symbols (usually a single function at a time).
Definition at line 106 of file CompileOnDemandLayer.cpp.
|
static |
Off-the-shelf partitioning which compiles whole modules whenever any symbol in them is requested.
Definition at line 111 of file CompileOnDemandLayer.cpp.
|
overridevirtual |
Emits the given module.
This should not be called by clients: it will be called by the JIT when a definition added via the add method is requested.
Implements llvm::orc::IRLayer.
Definition at line 129 of file CompileOnDemandLayer.cpp.
References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::empty(), llvm::orc::IRLayer::getExecutionSession(), llvm::orc::IRLayer::getManglingOptions(), llvm::orc::lazyReexports(), llvm::orc::MatchAllSymbols, Name, llvm::orc::reexports(), llvm::orc::ExecutionSession::reportError(), and llvm::orc::ThreadSafeModule::withModuleDo().
void llvm::orc::CompileOnDemandLayer::setImplMap | ( | ImplSymbolMap * | Imp | ) |
Sets the ImplSymbolMap.
Definition at line 126 of file CompileOnDemandLayer.cpp.
void llvm::orc::CompileOnDemandLayer::setPartitionFunction | ( | PartitionFunction | Partition | ) |
Sets the partition function.
Definition at line 122 of file CompileOnDemandLayer.cpp.
|
friend |
Definition at line 56 of file CompileOnDemandLayer.h.