1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

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
This commit is contained in:
Aaron Ballman 2016-01-05 14:24:01 +00:00
parent fea8e6c4f8
commit a446e7a779

View File

@ -363,6 +363,17 @@ if( MSVC )
append("/Zc:inline" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) 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 # Disable sized deallocation if the flag is supported. MSVC fails to compile
# the operator new overload in User otherwise. # the operator new overload in User otherwise.
check_c_compiler_flag("/WX /Zc:sizedDealloc-" SUPPORTS_SIZED_DEALLOC) check_c_compiler_flag("/WX /Zc:sizedDealloc-" SUPPORTS_SIZED_DEALLOC)