summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2016-01-25 14:17:39 +0000
committerAaron Ballman <aaron@aaronballman.com>2016-01-25 14:17:39 +0000
commitce625e86088c682d2ffbf51bf175101058249a24 (patch)
tree1273b3833ecc04aae005b2155dd185c1ceea0893
parent19670d479a38eef650c46d52cadb82a21f160086 (diff)
downloadbcm5719-llvm-ce625e86088c682d2ffbf51bf175101058249a24.tar.gz
bcm5719-llvm-ce625e86088c682d2ffbf51bf175101058249a24.zip
Reapplying r256836 with a fix for MSVC 14 support.
Enable more strict standards conformance in MSVC for rvalue casting and string literal type conversion to non-const types. Also enables generation of intrinsics for more functions. Patch by Alexander Riccio llvm-svn: 258687
-rw-r--r--llvm/cmake/modules/HandleLLVMOptions.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index cfa2a552fce..9b6a590920e 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -371,6 +371,23 @@ if( MSVC )
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
OpenPOWER on IntegriCloud