LLVM 20.0.0git
Classes | Public Member Functions | List of all members
llvm::orc::ThreadSafeContext Class Reference

An LLVMContext together with an associated mutex that can be used to lock the context to prevent concurrent access by other threads. More...

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

Classes

class  Lock
 

Public Member Functions

 ThreadSafeContext ()=default
 Construct a null context.
 
 ThreadSafeContext (std::unique_ptr< LLVMContext > NewCtx)
 Construct a ThreadSafeContext from the given LLVMContext.
 
LLVMContextgetContext ()
 Returns a pointer to the LLVMContext that was used to construct this instance, or null if the instance was default constructed.
 
const LLVMContextgetContext () const
 Returns a pointer to the LLVMContext that was used to construct this instance, or null if the instance was default constructed.
 
Lock getLock () const
 

Detailed Description

An LLVMContext together with an associated mutex that can be used to lock the context to prevent concurrent access by other threads.

Definition at line 29 of file ThreadSafeModule.h.

Constructor & Destructor Documentation

◆ ThreadSafeContext() [1/2]

llvm::orc::ThreadSafeContext::ThreadSafeContext ( )
default

Construct a null context.

◆ ThreadSafeContext() [2/2]

llvm::orc::ThreadSafeContext::ThreadSafeContext ( std::unique_ptr< LLVMContext NewCtx)
inline

Construct a ThreadSafeContext from the given LLVMContext.

Definition at line 53 of file ThreadSafeModule.h.

References assert().

Member Function Documentation

◆ getContext() [1/2]

LLVMContext * llvm::orc::ThreadSafeContext::getContext ( )
inline

Returns a pointer to the LLVMContext that was used to construct this instance, or null if the instance was default constructed.

Definition at line 61 of file ThreadSafeModule.h.

Referenced by llvm::orc::cloneToNewContext(), llvm::orc::IRSpeculationLayer::emit(), and llvm::orc::ThreadSafeModule::operator bool().

◆ getContext() [2/2]

const LLVMContext * llvm::orc::ThreadSafeContext::getContext ( ) const
inline

Returns a pointer to the LLVMContext that was used to construct this instance, or null if the instance was default constructed.

Definition at line 65 of file ThreadSafeModule.h.

◆ getLock()

Lock llvm::orc::ThreadSafeContext::getLock ( ) const
inline

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