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

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 4 09:54:22 PDT 2019


Thanks, I just upgraded, and I checked GCC 5.1 on godbolt but of course I
should have tested VS 2017. Although, I probably would not have tested a
debug build.

On Thu, Apr 4, 2019 at 4:10 AM Simon Pilgrim via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> 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; }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190404/2be0f07f/attachment.html>


More information about the llvm-commits mailing list