This patch passes four additional options to MSVC when building LLVM.
These four options do not generate any new warnings, and slightly improves codegen.
The four options:
- /Zc:strictStrings (Disable string literal type conversion) prevents initializing a non-const char*/wchar_t* with a string literal
- /Zc:rvalueCast (Enforce type conversion rules) prevents nonconformant rvalue/rvalue-reference casting
- /GF (Eliminate Duplicate Strings) pools string literals, which would otherwise waste space
- /Oi (Generate Intrinsic Functions) greenlights the compiler to replace certain function calls with compiler intrinsics, where it's faster to do so.
The first three are straightforward, and I don't expect any controversy.
Generating intrinsic functions may be problematic if LLVM itself needs ANSI floating point conformance (I have no idea)
Is this supported in CMake 2.8.8 (that's our min required version of CMake currently)? Also, is this forwards compatible, or will it only enable strictStrings on MSVC 14 and not later versions? (I don't know CMake well enough to answer either of those questions.)