LLVM 20.0.0git
|
An LLVM Module together with a shared ThreadSafeContext. More...
#include "llvm/ExecutionEngine/Orc/ThreadSafeModule.h"
Public Member Functions | |
ThreadSafeModule ()=default | |
Default construct a ThreadSafeModule. | |
ThreadSafeModule (ThreadSafeModule &&Other)=default | |
ThreadSafeModule & | operator= (ThreadSafeModule &&Other) |
ThreadSafeModule (std::unique_ptr< Module > M, std::unique_ptr< LLVMContext > Ctx) | |
Construct a ThreadSafeModule from a unique_ptr<Module> and a unique_ptr<LLVMContext>. | |
ThreadSafeModule (std::unique_ptr< Module > M, ThreadSafeContext TSCtx) | |
Construct a ThreadSafeModule from a unique_ptr<Module> and an existing ThreadSafeContext. | |
~ThreadSafeModule () | |
operator bool () const | |
Boolean conversion: This ThreadSafeModule will evaluate to true if it wraps a non-null module. | |
template<typename Func > | |
decltype(auto) | withModuleDo (Func &&F) |
Locks the associated ThreadSafeContext and calls the given function on the contained Module. | |
template<typename Func > | |
decltype(auto) | withModuleDo (Func &&F) const |
Locks the associated ThreadSafeContext and calls the given function on the contained Module. | |
template<typename Func > | |
decltype(auto) | consumingModuleDo (Func &&F) |
Locks the associated ThreadSafeContext and calls the given function, passing the contained std::unique_ptr<Module>. | |
Module * | getModuleUnlocked () |
Get a raw pointer to the contained module without locking the context. | |
const Module * | getModuleUnlocked () const |
Get a raw pointer to the contained module without locking the context. | |
ThreadSafeContext | getContext () const |
Returns the context for this ThreadSafeModule. | |
An LLVM Module together with a shared ThreadSafeContext.
Definition at line 77 of file ThreadSafeModule.h.
|
default |
Default construct a ThreadSafeModule.
This results in a null module and null context.
|
default |
|
inline |
Construct a ThreadSafeModule from a unique_ptr<Module> and a unique_ptr<LLVMContext>.
This creates a new ThreadSafeContext from the given context.
Definition at line 104 of file ThreadSafeModule.h.
|
inline |
Construct a ThreadSafeModule from a unique_ptr<Module> and an existing ThreadSafeContext.
Definition at line 109 of file ThreadSafeModule.h.
|
inline |
Definition at line 112 of file ThreadSafeModule.h.
References llvm::orc::ThreadSafeContext::getLock().
|
inline |
Locks the associated ThreadSafeContext and calls the given function, passing the contained std::unique_ptr<Module>.
The given function should consume the Module.
Definition at line 150 of file ThreadSafeModule.h.
References F, and llvm::orc::ThreadSafeContext::getLock().
|
inline |
Returns the context for this ThreadSafeModule.
Definition at line 162 of file ThreadSafeModule.h.
Referenced by llvm::orc::IRSpeculationLayer::emit().
|
inline |
Get a raw pointer to the contained module without locking the context.
Definition at line 156 of file ThreadSafeModule.h.
Referenced by llvm::orc::IRMaterializationUnit::IRMaterializationUnit().
Get a raw pointer to the contained module without locking the context.
Definition at line 159 of file ThreadSafeModule.h.
|
inlineexplicit |
Boolean conversion: This ThreadSafeModule will evaluate to true if it wraps a non-null module.
Definition at line 122 of file ThreadSafeModule.h.
References assert(), and llvm::orc::ThreadSafeContext::getContext().
|
inline |
Definition at line 85 of file ThreadSafeModule.h.
References llvm::orc::ThreadSafeContext::getLock(), and llvm::Other.
|
inline |
Locks the associated ThreadSafeContext and calls the given function on the contained Module.
Definition at line 133 of file ThreadSafeModule.h.
References assert(), F, and llvm::orc::ThreadSafeContext::getLock().
Referenced by llvm::orc::LLJIT::addIRModule(), llvm::orc::LLLazyJIT::addLazyIRModule(), llvm::orc::cloneToNewContext(), llvm::orc::IRCompileLayer::emit(), llvm::orc::IRPartitionLayer::emit(), llvm::orc::IRSpeculationLayer::emit(), llvm::orc::IRMaterializationUnit::getName(), llvm::orc::IRMaterializationUnit::IRMaterializationUnit(), and llvm::orc::ReOptimizeLayer::reoptimizeIfCallFrequent().
|
inline |
Locks the associated ThreadSafeContext and calls the given function on the contained Module.
Definition at line 141 of file ThreadSafeModule.h.
References assert(), F, and llvm::orc::ThreadSafeContext::getLock().