[llvm] r357685 - Revert rL357655 and rL357656 from llvm/trunk:

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 4 04:12:30 PDT 2019


Author: rksimon
Date: Thu Apr  4 04:12:30 2019
New Revision: 357685

URL: http://llvm.org/viewvc/llvm-project?rev=357685&view=rev
Log:
Revert rL357655 and rL357656 from llvm/trunk:
Fix minor innaccuracy in previous comment on ManagedStaticBase
........
Make ManagedStatic constexpr constructible

Apparently it needs member initializers so that it can be constructed in
a constexpr context. I explained my investigation of this in PR41367.
........
Causes vs2017 debug llvm-tblgen to fail with "Unknown command line argument" errors - similar to the vs2019 error discussed on PR41367 without the patch....

Modified:
    llvm/trunk/include/llvm/Support/ManagedStatic.h

Modified: llvm/trunk/include/llvm/Support/ManagedStatic.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ManagedStatic.h?rev=357685&r1=357684&r2=357685&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/ManagedStatic.h (original)
+++ llvm/trunk/include/llvm/Support/ManagedStatic.h Thu Apr  4 04:12:30 2019
@@ -37,18 +37,13 @@ class ManagedStaticBase {
 protected:
   // This should only be used as a static variable, which guarantees that this
   // will be zero initialized.
-  mutable std::atomic<void *> Ptr{nullptr};
-  mutable void (*DeleterFn)(void *) = nullptr;
-  mutable const ManagedStaticBase *Next = nullptr;
+  mutable std::atomic<void *> Ptr;
+  mutable void (*DeleterFn)(void*);
+  mutable const ManagedStaticBase *Next;
 
   void RegisterManagedStatic(void *(*creator)(), void (*deleter)(void*)) const;
 
 public:
-  /// ManagedStaticBase must be constexpr constructed so that they can be
-  /// accessed during dynamic initilization of other global variables, such as
-  /// cl::opt command line flags.
-  constexpr ManagedStaticBase() = default;
-
   /// isConstructed - Return true if this object has not been created yet.
   bool isConstructed() const { return Ptr != nullptr; }
 




More information about the llvm-commits mailing list