Driver: enhance MSC version compatibility
authorSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 20 Jun 2014 22:58:35 +0000 (22:58 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 20 Jun 2014 22:58:35 +0000 (22:58 +0000)
commit9d45e77dca6d6442bb4d3e9d5df18f2ad5228892
tree683d0f9e6bc353e8736815e2f3edc167ebf24906
parent73e1804c212c1a11af4462a8ee06b417963e36b1
Driver: enhance MSC version compatibility

The version information for Visual Studio is spread over multiple variables.
The newer Windows SDK has started making use of some of the extended versioning
variables that were previously undefined.  Enhance our compatibility definitions
for these cases.

_MSC_VER is defined to be the Major * 100 + Minor.  _MSC_FULL_VER is defined to
be Major * 10000000 + Minor * 100000 + Build.  And _MSC_BUILD is the build
revision of the compiler.

Extend the -fmsc-version option in a compatible manner.  If the value is the
previous form of MMmm, then we assume that the build number is 0.  Otherwise, a
specific build number may be passed by using the form MMmmbbbbb.  Due to
bitwidth limitations of the option, it is currently not possible to define a
revision value.

The version information can be passed as either the decimal encoded value
(_MSC_FULL_VER or _MSC_VER) or as a dot-delimited value.

The change to the TextDiagnostic is to deal with the updated encoding of the
version information.

llvm-svn: 211420
clang/lib/Basic/Targets.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/lib/Frontend/TextDiagnostic.cpp
clang/test/Driver/msc-version.c [new file with mode: 0644]