From a9bbcfa130ef44e092c855d7b2f02f687483bf75 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sat, 4 Apr 2009 05:17:38 +0000 Subject: Driver: Handle -dumpversion, this is used by some configuration scripts. llvm-svn: 68418 --- clang/lib/Driver/Driver.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'clang/lib/Driver/Driver.cpp') diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 74c4b07975d..68ff8bc8b0c 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -312,6 +312,8 @@ void Driver::PrintVersion(const Compilation &C) const { #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 @@ bool Driver::HandleImmediateArgs(const Compilation &C) { // 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; -- cgit v1.2.3