]> granicus.if.org Git - clang/commit
Get default -fms-compatibility-version from cl.exe's version
authorAdrian McCarthy <amccarth@google.com>
Fri, 13 May 2016 23:20:11 +0000 (23:20 +0000)
committerAdrian McCarthy <amccarth@google.com>
Fri, 13 May 2016 23:20:11 +0000 (23:20 +0000)
commitd62f27e8a4d5fb157cfbdbacb77956fb13c8f836
tree981bac236fd3f2f4761c6847ce66a1f7f60d2197
parentcfb1624abace42119f30e04d087d6d969f3e9474
Get default -fms-compatibility-version from cl.exe's version

-fms-compatibility-version was defaulting to 18 (VS 2013), which is a pain if your environment is pointing to version 19 (VS 2015) libraries.

If cl.exe can be found, this patch uses its version number as the default instead. It re-uses the existing code to find the Visual Studio binaries folder and WinAPI methods to check its version. You can still explicitly specify a compatibility version on the command line. If you don't have cl.exe, this should be a no-op and you'll get the old default of 18.

This affected the tests, which assumed that if you didn't specific a version, that it would default to 18, but this won't be true for all machines. So a couple test cases had to be eliminated and a couple others had to be tweaked to allow for various outputs.

Addresses: https://llvm.org/bugs/show_bug.cgi?id=27215

Differential Revision: http://reviews.llvm.org/D20136

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269515 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Driver/ToolChain.h
lib/Driver/MSVCToolChain.cpp
lib/Driver/ToolChains.h
lib/Driver/Tools.cpp
lib/Driver/Tools.h
test/Driver/cl-options.c
test/Driver/msc-version.c
test/Driver/msvc-triple.c
test/Misc/diag-format.c