diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2016-01-05 14:24:01 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2016-01-05 14:24:01 +0000 |
commit | 2566f4be500e1e14a8dfe1bacb04d92cd83842f2 (patch) | |
tree | 0eb3df20cf8616b0872b53b80037198f93747cec /llvm/cmake/modules | |
parent | 6f38342af139642fadc5d045e4f345c3fda53134 (diff) | |
download | bcm5719-llvm-2566f4be500e1e14a8dfe1bacb04d92cd83842f2.tar.gz bcm5719-llvm-2566f4be500e1e14a8dfe1bacb04d92cd83842f2.zip |
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: 256836
Diffstat (limited to 'llvm/cmake/modules')
-rw-r--r-- | llvm/cmake/modules/HandleLLVMOptions.cmake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake index 4c5ffe2f7b2..f3a316f5782 100644 --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -363,6 +363,17 @@ if( MSVC ) append("/Zc:inline" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + # 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) + + # Generate Intrinsic Functions + append("/Oi" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + + # Enforce type conversion rules + append("/Zc:rvalueCast" CMAKE_CXX_FLAGS) + # Disable sized deallocation if the flag is supported. MSVC fails to compile # the operator new overload in User otherwise. check_c_compiler_flag("/WX /Zc:sizedDealloc-" SUPPORTS_SIZED_DEALLOC) |