summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Petrov <dpetrov@accesssoftek.com>2020-05-22 13:10:37 +0300
committerTom Stellard <tstellar@redhat.com>2020-06-23 15:55:12 -0700
commit28a6713e107c9f878cb6c59db8548bb732dcc79d (patch)
tree95a91dd8cd327cd9cabbf991733f0ab56a27ebf1
parent5ccc104c206c02e712dec68cc0daef6379f51861 (diff)
downloadbcm5719-llvm-28a6713e107c9f878cb6c59db8548bb732dcc79d.tar.gz
bcm5719-llvm-28a6713e107c9f878cb6c59db8548bb732dcc79d.zip
[ManagedStatic] Fix build errors with clang-tblgen in Debug mode using MSVC 2019 v16.6
After updating MSVS19 from v16.4 to v16.6 I faced with a build errors compiling in Debug mode. It complains on clang-tblgen.exe and llvm-tblgen.exe cmd line args. VS compiler had a bug. It dynamically creates an object with constexpr ctor in Debug mode. This bug was fixed in VS2019 v16.5. A workaround was implemented for that and everything works until v16.5 comes. The workaround became irrelevant since v16.5 and caused build errors. So I disabled the workaround for VS2019 v16.5 and higher. This relates to http://llvm.org/PR41367. Differential Revision: https://reviews.llvm.org/D80433 (cherry picked from commit 46e5c5fe778b92b2a7e2c2ad3610e1da6794bd5e)
-rw-r--r--llvm/include/llvm/Support/ManagedStatic.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/include/llvm/Support/ManagedStatic.h b/llvm/include/llvm/Support/ManagedStatic.h
index bbd0d04ed04..f2b41422f13 100644
--- a/llvm/include/llvm/Support/ManagedStatic.h
+++ b/llvm/include/llvm/Support/ManagedStatic.h
@@ -40,8 +40,8 @@ template <typename T, size_t N> struct object_deleter<T[N]> {
// constexpr, a dynamic initializer may be emitted depending on optimization
// settings. For the affected versions of MSVC, use the old linker
// initialization pattern of not providing a constructor and leaving the fields
-// uninitialized.
-#if !defined(_MSC_VER) || defined(__clang__)
+// uninitialized. See http://llvm.org/PR41367 for details.
+#if !defined(_MSC_VER) || (_MSC_VER >= 1925) || defined(__clang__)
#define LLVM_USE_CONSTEXPR_CTOR
#endif
OpenPOWER on IntegriCloud