[PATCH] D27477: Refactor how the MSVC toolchain searches for a compatibility version.

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 09:01:02 PST 2016


rnk added a comment.

Can you update the commit message to outline the new algorithm? I think it's the same, except on all platforms, -fmsc-version and -fms-compatibility version are considered. Only with the MSVC toolchain do we go to the triple step, then the exe, then default to 18 with -fms-extensions. I guess this lets people compile code for Linux while pretending to be MSVC.



================
Comment at: lib/Driver/MSVCToolChain.cpp:476
 
+VersionTuple MSVCToolChain::separateMSVCFullVersion() const {
+  unsigned Major, Minor, Micro;
----------------
This function isn't doing the separation. Whatever code does the repeated mod 100 division is the separation code. This is more `getMSVCVersionFromTriple`.


================
Comment at: lib/Driver/ToolChain.cpp:725
+
+static VersionTuple getMSCompatibilityVersion(unsigned Version) {
+  if (Version < 100)
----------------
This thing is `separateMSVCFullVersion`.


https://reviews.llvm.org/D27477





More information about the llvm-commits mailing list