[PATCH] D15784: Enable 2 warnings on MSVC, turn on StringPooling & intrinsic functions

Alexander Riccio via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 15:23:57 PST 2016


ariccio updated this revision to Diff 45606.

http://reviews.llvm.org/D15784

Files:
  C:/LLVM/llvm/cmake/modules/HandleLLVMOptions.cmake

Index: C:/LLVM/llvm/cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- C:/LLVM/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ C:/LLVM/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -363,6 +363,23 @@
 
   append("/Zc:inline" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
 
+  # /Zc:strictStrings is incompatible with VS12's (Visual Studio 2013's)
+  # debug mode headers. Instead of only enabling them in VS2013's debug mode,
+  # we'll just enable them for Visual Studio 2015 (VS 14, MSVC_VERSION 1900)
+  # and up.
+  if (NOT (MSVC_VERSION LESS 1900))
+    # Disable string literal const->non-const type conversion.
+    # "When specified, the compiler requires strict const-qualification
+    # conformance for pointers initialized by using string literals."
+    append("/Zc:strictStrings" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+  endif(NOT (MSVC_VERSION LESS 1900))
+
+  # "Generate Intrinsic Functions".
+  append("/Oi" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+
+  # "Enforce type conversion rules".
+  append("/Zc:rvalueCast" CMAKE_CXX_FLAGS)
+
   if (NOT LLVM_ENABLE_TIMESTAMPS AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
     # clang-cl and cl by default produce non-deterministic binaries because
     # link.exe /incremental requires a timestamp in the .obj file.  clang-cl


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15784.45606.patch
Type: text/x-patch
Size: 1310 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160121/43152abf/attachment.bin>


More information about the llvm-commits mailing list