15 #include "llvm/Config/config.h"
39 void (*Deleter)(
void*))
const {
44 if (!
Ptr.load(std::memory_order_relaxed)) {
45 void *Tmp = Creator();
47 Ptr.store(Tmp, std::memory_order_release);
56 "Partially initialized ManagedStatic!?");
69 "Not destroyed in reverse order of construction?");
const ManagedStaticBase * Next
static sys::Mutex * getManagedStaticMutex()
static sys::Mutex * ManagedStaticMutex
SmartMutex< false > Mutex
Mutex - A standard, always enforced mutex.
void call_once(once_flag &flag, Function &&F, Args &&...ArgList)
Execute the function specified as a parameter once.
void(* DeleterFn)(void *)
static void initializeMutex()
void llvm_shutdown()
llvm_shutdown - Deallocate and destroy all ManagedStatic variables.
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
LLVM_DEFINE_ONCE_FLAG(mutex_init_flag)
void RegisterManagedStatic(void *(*creator)(), void(*deleter)(void *)) const
ManagedStaticBase - Common base class for ManagedStatic instances.
static const ManagedStaticBase * StaticList
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())