Driver: Handle -dumpversion, this is used by some configuration

scripts.

llvm-svn: 68418
This commit is contained in:
Daniel Dunbar 2009-04-04 05:17:38 +00:00
parent f89733cfb8
commit a9bbcfa130
2 changed files with 9 additions and 1 deletions

View File

@ -384,7 +384,7 @@ OPTION("-dead_strip", dead__strip, Flag, INVALID, INVALID, "", 0, 0, 0)
OPTION("-dependency-file", dependency_file, Separate, INVALID, INVALID, "", 0, 0, 0)
OPTION("-dumpmachine", dumpmachine, Flag, INVALID, INVALID, "u", 0, 0, 0)
OPTION("-dumpspecs", dumpspecs, Flag, INVALID, INVALID, "u", 0, 0, 0)
OPTION("-dumpversion", dumpversion, Flag, INVALID, INVALID, "u", 0, 0, 0)
OPTION("-dumpversion", dumpversion, Flag, INVALID, INVALID, "", 0, 0, 0)
OPTION("-dylib_file", dylib__file, Separate, INVALID, INVALID, "", 0, 0, 0)
OPTION("-dylinker_install_name", dylinker__install__name, JoinedOrSeparate, INVALID, INVALID, "", 0, 0, 0)
OPTION("-dylinker", dylinker, Flag, INVALID, INVALID, "", 0, 0, 0)

View File

@ -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;