LLVM  16.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::orc::CompileOnDemandLayer Class Reference

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

Inheritance diagram for llvm::orc::CompileOnDemandLayer:
Inheritance graph
Collaboration diagram for llvm::orc::CompileOnDemandLayer:
Collaboration graph

Public Types

using IndirectStubsManagerBuilder = std::function< std::unique_ptr< IndirectStubsManager >()>
 Builder for IndirectStubsManagers. More...
using GlobalValueSet = std::set< const GlobalValue * >
using PartitionFunction = std::function< Optional< GlobalValueSet >(GlobalValueSet Requested)>
 Partitioning function. More...

Public Member Functions

 CompileOnDemandLayer (ExecutionSession &ES, IRLayer &BaseLayer, LazyCallThroughManager &LCTMgr, IndirectStubsManagerBuilder BuildIndirectStubsManager)
 Construct a CompileOnDemandLayer. More...
void setPartitionFunction (PartitionFunction Partition)
 Sets the partition function. More...
void setImplMap (ImplSymbolMap *Imp)
 Sets the ImplSymbolMap. More...
void emit (std::unique_ptr< MaterializationResponsibility > R, ThreadSafeModule TSM) override
 Emits the given module. More...
- Public Member Functions inherited from llvm::orc::IRLayer
 IRLayer (ExecutionSession &ES, const IRSymbolMapper::ManglingOptions *&MO)
virtual ~IRLayer ()
ExecutionSessiongetExecutionSession ()
 Returns the ExecutionSession for this layer. More...
const IRSymbolMapper::ManglingOptions *& getManglingOptions () const
 Get the mangling options for this layer. More...
void setCloneToNewContextOnEmit (bool CloneToNewContextOnEmit)
 Sets the CloneToNewContextOnEmit flag (false by default). More...
bool getCloneToNewContextOnEmit () const
 Returns the current value of the CloneToNewContextOnEmit flag. More...
virtual Error add (ResourceTrackerSP RT, ThreadSafeModule TSM)
 Add a MaterializatinoUnit representing the given IR to the JITDylib targeted by the given tracker. More...
Error add (JITDylib &JD, ThreadSafeModule TSM)
 Adds a MaterializationUnit representing the given IR to the given JITDylib. More...

Static Public Member Functions

static Optional< GlobalValueSetcompileRequested (GlobalValueSet Requested)
 Off-the-shelf partitioning which compiles all requested symbols (usually a single function at a time). More...
static Optional< GlobalValueSetcompileWholeModule (GlobalValueSet Requested)
 Off-the-shelf partitioning which compiles whole modules whenever any symbol in them is requested. More...


class PartitioningIRMaterializationUnit

Detailed Description

Definition at line 56 of file CompileOnDemandLayer.h.

Member Typedef Documentation

◆ GlobalValueSet

Definition at line 64 of file CompileOnDemandLayer.h.

◆ IndirectStubsManagerBuilder

Builder for IndirectStubsManagers.

Definition at line 62 of file CompileOnDemandLayer.h.

◆ PartitionFunction

Partitioning function.

Definition at line 68 of file CompileOnDemandLayer.h.

Constructor & Destructor Documentation

◆ CompileOnDemandLayer()

llvm::orc::CompileOnDemandLayer::CompileOnDemandLayer ( ExecutionSession ES,
IRLayer BaseLayer,
LazyCallThroughManager LCTMgr,
IndirectStubsManagerBuilder  BuildIndirectStubsManager 

Construct a CompileOnDemandLayer.

Definition at line 115 of file CompileOnDemandLayer.cpp.

Member Function Documentation

◆ compileRequested()

Optional< CompileOnDemandLayer::GlobalValueSet > llvm::orc::CompileOnDemandLayer::compileRequested ( GlobalValueSet  Requested)

Off-the-shelf partitioning which compiles all requested symbols (usually a single function at a time).

Definition at line 106 of file CompileOnDemandLayer.cpp.

References move.

◆ compileWholeModule()

Optional< CompileOnDemandLayer::GlobalValueSet > llvm::orc::CompileOnDemandLayer::compileWholeModule ( GlobalValueSet  Requested)

Off-the-shelf partitioning which compiles whole modules whenever any symbol in them is requested.

Definition at line 111 of file CompileOnDemandLayer.cpp.

References llvm::None.

◆ emit()

void llvm::orc::CompileOnDemandLayer::emit ( std::unique_ptr< MaterializationResponsibility R,
ThreadSafeModule  TSM 

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::orc::IRLayer::getExecutionSession(), M, and llvm::orc::ThreadSafeModule::withModuleDo().

◆ setImplMap()

void llvm::orc::CompileOnDemandLayer::setImplMap ( ImplSymbolMap Imp)

Sets the ImplSymbolMap.

Definition at line 126 of file CompileOnDemandLayer.cpp.

◆ setPartitionFunction()

void llvm::orc::CompileOnDemandLayer::setPartitionFunction ( PartitionFunction  Partition)

Sets the partition function.

Definition at line 122 of file CompileOnDemandLayer.cpp.

References move.

Friends And Related Function Documentation

◆ PartitioningIRMaterializationUnit

friend class PartitioningIRMaterializationUnit

Definition at line 57 of file CompileOnDemandLayer.h.

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