]> granicus.if.org Git - clang/commitdiff
Driver: Change -dumpversion to return a GCC compatible answer.
authorDaniel Dunbar <daniel@zuster.org>
Wed, 12 Jan 2011 00:43:47 +0000 (00:43 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 12 Jan 2011 00:43:47 +0000 (00:43 +0000)
 - See comment for why.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123296 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Driver.cpp

index 6f2cfb879a47113516ab16f2ffc36e3666544a2d..d588dc37726269d11d7f6a6f6adf4f32157f5940 100644 (file)
@@ -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;
   }