[llvm] b8c39e9 - Fix compiling with clang-cl inside a Visual Studio 2019 16.4 command prompt.

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 12:03:51 PST 2020


Author: Alexandre Ganea
Date: 2020-01-28T14:57:57-05:00
New Revision: b8c39e94626597912783d2077244158a4d5f27b8

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

LOG: Fix compiling with clang-cl inside a Visual Studio 2019 16.4 command prompt.

This was introduced by 0d17410e919124b3a9194b9bdbe2ce39dd779941 and was preventing from compiling with clang-cl on Windows.
The problem was that clang-cl detects the triple from the current env vars (was x86_64-pc-windows-msvc19.24.28315 for me, as I happen to always run inside a VS2019 cmd prompt).

Added: 
    

Modified: 
    llvm/include/llvm/Support/Compiler.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/Compiler.h b/llvm/include/llvm/Support/Compiler.h
index a583b2d547ad..de1f0e3c8e49 100644
--- a/llvm/include/llvm/Support/Compiler.h
+++ b/llvm/include/llvm/Support/Compiler.h
@@ -25,11 +25,11 @@
 #if defined(_MSC_VER)
 #include <sal.h>
 
-#if _MSC_VER == 1924
+#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 version of MSVC is known to miscompile LLVM."
+#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
 


        


More information about the llvm-commits mailing list