From: Daniel Dunbar Date: Wed, 12 Jan 2011 00:43:47 +0000 (+0000) Subject: Driver: Change -dumpversion to return a GCC compatible answer. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=95a907fc0f2f717dca38a379c1d2353bfea06d4f;p=clang Driver: Change -dumpversion to return a GCC compatible answer. - See comment for why. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123296 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 6f2cfb879a..d588dc3772 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -414,7 +414,13 @@ bool Driver::HandleImmediateArgs(const Compilation &C) { } if (C.getArgs().hasArg(options::OPT_dumpversion)) { - llvm::outs() << CLANG_VERSION_STRING "\n"; + // Since -dumpversion is only implemented for pedantic GCC compatibility, we + // return an answer which matches our definition of __VERSION__. + // + // If we want to return a more correct answer some day, then we should + // introduce a non-pedantically GCC compatible mode to Clang in which we + // provide sensible definitions for -dumpversion, __VERSION__, etc. + llvm::outs() << "4.2.1\n"; return false; }