diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-06-23 17:36:36 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-06-23 17:36:36 +0000 |
commit | f7062b23137f3fda28c6edbfbe1b3668af00b0c2 (patch) | |
tree | 4dadedbe720bbb7189eaccd6028f433479a66f44 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | dd6ab8221e2bde33647e4d4f72233a24c2d55681 (diff) | |
download | llvm-f7062b23137f3fda28c6edbfbe1b3668af00b0c2.zip llvm-f7062b23137f3fda28c6edbfbe1b3668af00b0c2.tar.gz llvm-f7062b23137f3fda28c6edbfbe1b3668af00b0c2.tar.bz2 |
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
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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 @@ 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 |