]> granicus.if.org Git - clang/commitdiff
Horrible hack for systems that use -dumpversion with clang to expect versions
authorEric Christopher <echristo@apple.com>
Fri, 17 Dec 2010 19:13:21 +0000 (19:13 +0000)
committerEric Christopher <echristo@apple.com>
Fri, 17 Dec 2010 19:13:21 +0000 (19:13 +0000)
that match gcc versions. Eew.

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

include/clang/Basic/Version.h
lib/Driver/Driver.cpp

index ede68ed50d526f8d24decbcab28182a0c180671c..05eff650723eaee74596d17c3aa1655feaaf59a5 100644 (file)
   CLANG_MAKE_VERSION_STRING(CLANG_VERSION_MAJOR,CLANG_VERSION_MINOR)
 #endif
 
+/// \brief A horrible hack to work around projects that depend upon gcc
+/// compatible compilers having versions that resemble gcc.
+#define GCC_COMPAT_VERSION_STRING CLANG_MAKE_VERSION_STRING(4,2)
+
 namespace clang {
   /// \brief Retrieves the repository path (e.g., Subversion path) that 
   /// identifies the particular Clang branch, tag, or trunk from which this
index a3b7167c8b08684a86779f80096e3336140ae244..621ce8dd580a9d351c73a5fa33076fb38727c813 100644 (file)
@@ -417,8 +417,11 @@ bool Driver::HandleImmediateArgs(const Compilation &C) {
     return false;
   }
 
+  // This is a horrible hack. Some projects depend on gcc-like versions
+  // coming out of gcc -dumpversion to determine if the gcc compatible
+  // compiler has a correct version. Ideally we'd fix all of those projects.
   if (C.getArgs().hasArg(options::OPT_dumpversion)) {
-    llvm::outs() << CLANG_VERSION_STRING "\n";
+    llvm::outs() << GCC_COMPAT_VERSION_STRING "\n";
     return false;
   }