15 #include "llvm/Config/config.h" 36 void (*Deleter)(
void*))
const {
41 if (!
Ptr.load(std::memory_order_relaxed)) {
42 void *Tmp = Creator();
44 Ptr.store(Tmp, std::memory_order_release);
53 "Partially initialized ManagedStatic!?");
65 assert(StaticList ==
this &&
66 "Not destroyed in reverse order of construction?");
This class represents lattice values for constants.
const ManagedStaticBase * Next
static sys::Mutex * getManagedStaticMutex()
static sys::Mutex * ManagedStaticMutex
SmartMutex< false > Mutex
Mutex - A standard, always enforced mutex.
static llvm::once_flag mutex_init_flag
static void initializeMutex()
void(* DeleterFn)(void *)
void llvm_shutdown()
llvm_shutdown - Deallocate and destroy all ManagedStatic variables.
void call_once(once_flag &flag, Function &&F, Args &&... ArgList)
Execute the function specified as a parameter once.
Instances of this class acquire a given Mutex Lock when constructed and hold that lock until destruct...
bool llvm_is_multithreaded()
Returns true if LLVM is compiled with support for multi-threading, and false otherwise.
std::atomic< void * > Ptr
ManagedStaticBase - Common base class for ManagedStatic instances.
static const ManagedStaticBase * StaticList
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void RegisterManagedStatic(void *(*creator)(), void(*deleter)(void *)) const