summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Targets.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-06-20 22:58:35 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-06-20 22:58:35 +0000
commit9d45e77dca6d6442bb4d3e9d5df18f2ad5228892 (patch)
tree683d0f9e6bc353e8736815e2f3edc167ebf24906 /clang/lib/Basic/Targets.cpp
parent73e1804c212c1a11af4462a8ee06b417963e36b1 (diff)
downloadbcm5719-llvm-9d45e77dca6d6442bb4d3e9d5df18f2ad5228892.tar.gz
bcm5719-llvm-9d45e77dca6d6442bb4d3e9d5df18f2ad5228892.zip
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
Diffstat (limited to 'clang/lib/Basic/Targets.cpp')
-rw-r--r--clang/lib/Basic/Targets.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index ae3e486d278..4fdbc244771 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -587,8 +587,12 @@ protected:
if (Opts.POSIXThreads)
Builder.defineMacro("_MT");
- if (Opts.MSCVersion != 0)
- Builder.defineMacro("_MSC_VER", Twine(Opts.MSCVersion));
+ if (Opts.MSCVersion != 0) {
+ Builder.defineMacro("_MSC_VER", Twine(Opts.MSCVersion / 100000));
+ Builder.defineMacro("_MSC_FULL_VER", Twine(Opts.MSCVersion));
+ // FIXME We cannot encode the revision information into 32-bits
+ Builder.defineMacro("_MSC_BUILD", Twine(1));
+ }
if (Opts.MicrosoftExt) {
Builder.defineMacro("_MSC_EXTENSIONS");
OpenPOWER on IntegriCloud