[llvm] 1e417ba - Revert "MSVC Buggy version detection: turn pre-processor error into CMake configuration time check"

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 30 15:39:00 PST 2020


Author: Mehdi Amini
Date: 2020-01-30T23:38:36Z
New Revision: 1e417ba2d4d27a604d87462ff2d9e97ea9c5e770

URL: https://github.com/llvm/llvm-project/commit/1e417ba2d4d27a604d87462ff2d9e97ea9c5e770
DIFF: https://github.com/llvm/llvm-project/commit/1e417ba2d4d27a604d87462ff2d9e97ea9c5e770.diff

LOG: Revert "MSVC Buggy version detection: turn pre-processor error into CMake configuration time check"

This reverts commit b4fac782462c26baa94798e5fdb58e6810bd336b.
It broke the MSVC bot

Added: 
    

Modified: 
    llvm/cmake/modules/CheckCompilerVersion.cmake
    llvm/include/llvm/Support/Compiler.h

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/CheckCompilerVersion.cmake b/llvm/cmake/modules/CheckCompilerVersion.cmake
index 0dc9c24ffe49..ad70d85dc6a7 100644
--- a/llvm/cmake/modules/CheckCompilerVersion.cmake
+++ b/llvm/cmake/modules/CheckCompilerVersion.cmake
@@ -50,20 +50,6 @@ check_compiler_version("Clang" "Clang" ${CLANG_MIN} ${CLANG_SOFT_ERROR})
 check_compiler_version("AppleClang" "Apple Clang" ${APPLECLANG_MIN} ${APPLECLANG_SOFT_ERROR})
 check_compiler_version("MSVC" "Visual Studio" ${MSVC_MIN} ${MSVC_SOFT_ERROR})
 
-# See https://developercommunity.visualstudio.com/content/problem/845933/miscompile-boolean-condition-deduced-to-be-always.html
-# and thread "[llvm-dev] Longstanding failing tests - clang-tidy, MachO, Polly"
-# on llvm-dev Jan 21-23 2020.
-if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND
-    19.24 VERSION_LESS_EQUAL CMAKE_CXX_COMPILER_VERSION AND
-    CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.25)
-  if(LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN)
-    message(WARNING "Host Visual Studio version 16.4 is known to miscompile part of LLVM")
-  else()
-    message(FATAL_ERROR "Host Visual Studio version 16.4 is known to miscompile part of LLVM, please use clang-cl or upgrade to 16.5 or above (use -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON to ignore)")
-  endif()
-endif()
-
-
 if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
   if (CMAKE_CXX_SIMULATE_ID MATCHES "MSVC")
     if (CMAKE_CXX_SIMULATE_VERSION VERSION_LESS MSVC_MIN)

diff  --git a/llvm/include/llvm/Support/Compiler.h b/llvm/include/llvm/Support/Compiler.h
index 34d8ed8baf2d..de1f0e3c8e49 100644
--- a/llvm/include/llvm/Support/Compiler.h
+++ b/llvm/include/llvm/Support/Compiler.h
@@ -24,6 +24,13 @@
 
 #if defined(_MSC_VER)
 #include <sal.h>
+
+#if _MSC_VER == 1924 && !defined(__clang__)
+// See https://developercommunity.visualstudio.com/content/problem/845933/miscompile-boolean-condition-deduced-to-be-always.html
+// and thread "[llvm-dev] Longstanding failing tests - clang-tidy, MachO, Polly"
+// on llvm-dev Jan 21-23 2020.
+#error "MSVC 19.24 (Visual Studio 2019 version 16.4) is known to miscompile LLVM. Please upgrade to version 16.5+ or use clang-cl."
+#endif
 #endif
 
 #ifndef __has_feature


        


More information about the llvm-commits mailing list