]> granicus.if.org Git - clang/commit
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)
commitb8ba60b467de4b88950884676bd3b1635fac936e
treed7783d77e41d8c19a2b1605b95df739e54bb6ba0
parenta7c5ec1c87bda9a98af5a168933be2dd6c56503f
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211420 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Basic/Targets.cpp
lib/Frontend/CompilerInvocation.cpp
lib/Frontend/TextDiagnostic.cpp
test/Driver/msc-version.c [new file with mode: 0644]