summaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-06-23 17:36:36 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-06-23 17:36:36 +0000
commita91f0e5edcd60f82eec602740b2c0f449ee5facd (patch)
tree2017c18f74168a78fc01b8e438da8c0852aed8d1 /lib/Frontend/CompilerInvocation.cpp
parent9784b810524025a48f1c49cc3bc634ebf0e9a663 (diff)
downloadclang-a91f0e5edcd60f82eec602740b2c0f449ee5facd.tar.gz
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! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211506 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--lib/Frontend/CompilerInvocation.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index 9174e4fb70..71138861d0 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -1223,7 +1223,11 @@ static unsigned parseMSCVersion(ArgList &Args, DiagnosticsEngine &Diags) {
<< 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