diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-10-05 20:33:49 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-10-05 20:33:49 +0000 |
commit | b8d1191fdeb4eec9bc5cf9bf4b027add0fb467b3 (patch) | |
tree | af194a61af6a09e6076135b8d39bc755b8126d2f /lib/Driver/Driver.cpp | |
parent | 60b5d8ed5993a2551c60e1b2400c3414a7070687 (diff) |
Provide a common set of routines in Version.h that return Subversion
branch/revision information. Use that information in the driver,
rather than one-off branch/revision computation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83321 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Driver.cpp')
-rw-r--r-- | lib/Driver/Driver.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index fd2eb61f75..ab948552d9 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -410,24 +410,13 @@ void Driver::PrintHelp(bool ShowHidden) const { } void Driver::PrintVersion(const Compilation &C, llvm::raw_ostream &OS) const { - static char buf[] = "$URL$"; - char *zap = strstr(buf, "/lib/Driver"); - if (zap) - *zap = 0; - zap = strstr(buf, "/clang/tools/clang"); - if (zap) - *zap = 0; - const char *vers = buf+6; - // FIXME: Add cmake support and remove #ifdef -#ifdef SVN_REVISION - const char *revision = SVN_REVISION; -#else - const char *revision = ""; -#endif // FIXME: The following handlers should use a callback mechanism, we don't // know what the client would like to do. OS << "clang version " CLANG_VERSION_STRING " (" - << vers << " " << revision << ")" << '\n'; + << getClangSubversionPath(); + if (unsigned Revision = getClangSubversionRevision()) + OS << " " << Revision; + OS << ")" << '\n'; const ToolChain &TC = C.getDefaultToolChain(); OS << "Target: " << TC.getTripleString() << '\n'; |