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
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index fd2eb61..ab94855 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -410,24 +410,13 @@
}
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';