diff --git a/llvm/docs/ProgrammersManual.rst b/llvm/docs/ProgrammersManual.rst --- a/llvm/docs/ProgrammersManual.rst +++ b/llvm/docs/ProgrammersManual.rst @@ -3051,17 +3051,6 @@ When you are done using the LLVM APIs, you should call ``llvm_shutdown()`` to deallocate memory used for internal structures. -.. _managedstatic: - -Lazy Initialization with ``ManagedStatic`` ------------------------------------------- - -``ManagedStatic`` is a utility class in LLVM used to implement static -initialization of static resources, such as the global type tables. In a -single-threaded environment, it implements a simple lazy initialization scheme. -When LLVM is compiled with support for multi-threading, however, it uses -double-checked locking to implement thread-safe lazy initialization. - .. _llvmcontext: Achieving Isolation with ``LLVMContext`` diff --git a/llvm/include/llvm/Support/ManagedStatic.h b/llvm/include/llvm/Support/ManagedStatic.h --- a/llvm/include/llvm/Support/ManagedStatic.h +++ b/llvm/include/llvm/Support/ManagedStatic.h @@ -80,7 +80,9 @@ /// template , class Deleter = object_deleter> -class ManagedStatic : public ManagedStaticBase { +class [[deprecated("ManagedStatic is deprecated and will be removed; use " + "function scope static variables in a getter function " + "instead")]] ManagedStatic : public ManagedStaticBase { public: // Accessors. C &operator*() {