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 | 1b7035da6f79e1eed8fad4d38151c9a00cc716f1 (patch) | |
tree | d48d31b25ddec35af9d9c1594b1df193091203fc /clang/lib/Driver/Driver.cpp | |
parent | 7550a6c186b1ea1df9f618de187fcfc9603862f1 (diff) | |
download | bcm5719-llvm-1b7035da6f79e1eed8fad4d38151c9a00cc716f1.tar.gz bcm5719-llvm-1b7035da6f79e1eed8fad4d38151c9a00cc716f1.zip |
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.
llvm-svn: 83321
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index fd2eb61f75b..ab948552d92 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/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'; |