jrtc27 added a comment. The commit message is poor, because the problem is not the use of static globals, it's the use of globals that have constructors. Moving them to be static function-scoped variables doesn't change the fact that they still have static duration; you change the scope of them but not their storage. Implementations can defer their initialisation until the first time the function is called, but do not have to. Clang, GCC and MSVC all do in fact perform lazy initialisation (with all the overhead that comes with to make it thread-safe and exception-safe) so maybe this is fine in practice. Is there precedent for this?
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128726/new/ https://reviews.llvm.org/D128726 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits