Driver: Handle -dumpversion, this is used by some configuration
scripts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68418 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index 74c4b07..68ff8bc 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -312,6 +312,8 @@
#endif
// FIXME: The following handlers should use a callback mechanism, we
// don't know what the client would like to do.
+
+ // FIXME: Do not hardcode clang version.
llvm::errs() << "clang version 1.0 (" << vers << " " << revision << ")" << "\n";
const ToolChain &TC = C.getDefaultToolChain();
@@ -323,6 +325,12 @@
// place, but we don't expect inconsistencies w.r.t. that to matter
// in practice.
+ if (C.getArgs().hasArg(options::OPT_dumpversion)) {
+ // FIXME: Do not hardcode clang version.
+ llvm::outs() << "1.0\n";
+ return false;
+ }
+
if (C.getArgs().hasArg(options::OPT__help)) {
PrintHelp();
return false;