Lazily constructed global destroyed explicitly by llvm_shutdown().

Synopsis

Declared in <llvm/Support/ManagedStatic.h>

template<
    class C,
    class Creator = object_creator<C>,
    class Deleter = object_deleter<C>>
class ManagedStatic
    : public ManagedStaticBase

Description

This transparently changes the behavior of global statics to be lazily constructed on demand (good for reducing startup times of dynamic libraries that link in LLVM components) and for making destruction be explicit through the llvm_shutdown() function call.

Base Classes

Name

Description

ManagedStaticBase

ManagedStaticBase ‐ Common base class for ManagedStatic instances.

Member Functions

Name

Description

claim

Take ownership of the instance and leave this ManagedStatic uninitialized.

destroy

Destroy the managed object and unregister this ManagedStatic.

isConstructed

isConstructed ‐ Return true if this object has not been created yet.

operator*

Access the managed object, constructing it on first use.

operator‐>

Access the managed object through a pointer, constructing it on first use.

Protected Member Functions

Name

Description

RegisterManagedStatic

Register this ManagedStatic for construction and later destruction.

Protected Data Members

Name

Description

DeleterFn

Function used to destroy the object pointed to by Ptr.

Next

Next ManagedStatic in the global destruction list.

Ptr

Pointer to the lazily constructed object, or null if not yet created.

Created with MrDocs