[PATCH] D20136: Get default -fms-compatibility-version from cl.exe's version

Adrian McCarthy via cfe-commits cfe-commits at lists.llvm.org
Tue May 10 14:39:28 PDT 2016


amccarth created this revision.
amccarth added a reviewer: rnk.
amccarth added a subscriber: cfe-commits.

`-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

http://reviews.llvm.org/D20136

Files:
  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
  tools/driver/driver.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20136.56819.patch
Type: text/x-patch
Size: 8300 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160510/a5a7445d/attachment-0001.bin>


More information about the cfe-commits mailing list