Driver: correct behaviour of -fmsc-version=MAJOR
Ensure that we properly handle the case where just the major version component
is provided by the user.
Thanks to Alp Toker for pointing out that this was not handled correctly!
llvm-svn: 211506
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 9174e4f..7113886 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1223,7 +1223,11 @@
<< Arg->getAsString(Args) << Value;
return 0;
}
- return (Version < 100000) ? Version * 100000 : Version;
+ if (Version < 100)
+ Version = Version * 100; // major -> major.minor
+ if (Version < 100000)
+ Version = Version * 100000; // major.minor -> major.minor.build
+ return Version;
}
// parse the dot-delimited component version