[llvm] r256315 - win: Pass /W4 in front of all the -wd flags.

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 22 18:38:31 PST 2015


Author: nico
Date: Tue Dec 22 20:38:31 2015
New Revision: 256315

URL: http://llvm.org/viewvc/llvm-project?rev=256315&view=rev
Log:
win: Pass /W4 in front of all the -wd flags.

This should fix many many -Wunused-parameter warnings in self-host builds on
Windows after r255382.  cl.exe doesn't care about the order of /W4 and
/wd flags, but clang-cl currently does (just like -Wno-foo -Wall order
matters for clang).  We might want to change how clang-cl behaves in
the future, but until then this change makes self-host builds much more
silent.

Modified:
    llvm/trunk/cmake/modules/HandleLLVMOptions.cmake

Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=256315&r1=256314&r2=256315&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Tue Dec 22 20:38:31 2015
@@ -338,7 +338,10 @@ if( MSVC )
 
   # Enable warnings
   if (LLVM_ENABLE_WARNINGS)
-    append("/W4" msvc_warning_flags)
+    # Put /W4 in front of all the -we flags. cl.exe doesn't care, but for
+    # clang-cl having /W4 after the -we flags will re-enable the warnings
+    # disabled by -we.
+    set(msvc_warning_flags "/W4 ${msvc_warning_flags}")
     # CMake appends /W3 by default, and having /W3 followed by /W4 will result in 
     # cl : Command line warning D9025 : overriding '/W3' with '/W4'.  Since this is
     # a command line warning and not a compiler warning, it cannot be suppressed except




More information about the llvm-commits mailing list