[PATCH] Eliminating static destructor for the BitCodeErrorCategory by converting to a ManagedStatic.

Chandler Carruth chandlerc at gmail.com
Fri Sep 19 13:34:49 PDT 2014


Yep.

On Fri, Sep 19, 2014 at 1:23 PM, Chandler Carruth <chandlerc at gmail.com>
wrote:

> Looks good with a small tweak below...
>
> ================
> Comment at: lib/Bitcode/Reader/BitcodeReader.cpp:3508
> @@ -3505,3 +3507,3 @@
>  const std::error_category &llvm::BitcodeErrorCategory() {
> -  static BitcodeErrorCategoryType O;
> -  return O;
> +  static ManagedStatic<BitcodeErrorCategoryType> O;
> +  return *O;
> ----------------
> Since we can't rely on MSVC's thread safe function local statics we have
> to use a ManagedStatic here... but once we do, on non MSVC we pay the
> once-init cost twice.
>
> I would just make these globals (sadly) until we only rely on MSVC
> versions with support for killing managed static entirely.
>
> http://reviews.llvm.org/D5416
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140919/c4cb99b4/attachment.html>


More information about the llvm-commits mailing list