[PATCH] D129130: ManagedStatic: mark as deprecated, about to be removed

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 5 02:19:39 PDT 2022


nhaehnle created this revision.
nhaehnle added reviewers: efriedma, lattner.
Herald added a project: All.
nhaehnle requested review of this revision.
Herald added a project: LLVM.

This is separate from outright removal so that downstreams that track
the main branch closely can get a small grace period.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D129130

Files:
  llvm/docs/ProgrammersManual.rst
  llvm/include/llvm/Support/ManagedStatic.h


Index: llvm/include/llvm/Support/ManagedStatic.h
===================================================================
--- llvm/include/llvm/Support/ManagedStatic.h
+++ llvm/include/llvm/Support/ManagedStatic.h
@@ -80,7 +80,9 @@
 ///
 template <class C, class Creator = object_creator<C>,
           class Deleter = object_deleter<C>>
-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*() {
Index: llvm/docs/ProgrammersManual.rst
===================================================================
--- llvm/docs/ProgrammersManual.rst
+++ 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``


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129130.442232.patch
Type: text/x-patch
Size: 1536 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220705/ce3ddaa7/attachment.bin>


More information about the llvm-commits mailing list