summaryrefslogtreecommitdiffstats
path: root/lib/Basic/Version.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2014-01-07 16:27:35 +0000
committerNico Weber <nicolasweber@gmx.de>2014-01-07 16:27:35 +0000
commitefa9e1670271c5ad2dcda3fae875e251ab732e42 (patch)
treeed3f9484cd19a0a06501643c561c8e83671e048c /lib/Basic/Version.cpp
parent470dad7e65fa42c3082428b92f122953dfd14c74 (diff)
Shorten the output of `clang-format --version`, include revision number.
Before: $ clang-format --version LLVM (http://llvm.org/): LLVM version 3.5svn Optimized build with assertions. Built Jan 3 2014 (14:28:46). Default target: x86_64-apple-darwin13.0.0 Host CPU: core-avx-i Now: $ bin/clang-format --version clang-format version 3.5 (198452) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198694 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/Version.cpp')
-rw-r--r--lib/Basic/Version.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Basic/Version.cpp b/lib/Basic/Version.cpp
index 88b827de29..bad53b1ca7 100644
--- a/lib/Basic/Version.cpp
+++ b/lib/Basic/Version.cpp
@@ -116,12 +116,16 @@ std::string getClangFullRepositoryVersion() {
}
std::string getClangFullVersion() {
+ return getClangToolFullVersion("clang");
+}
+
+std::string getClangToolFullVersion(StringRef ToolName) {
std::string buf;
llvm::raw_string_ostream OS(buf);
#ifdef CLANG_VENDOR
OS << CLANG_VENDOR;
#endif
- OS << "clang version " CLANG_VERSION_STRING " "
+ OS << ToolName << " version " CLANG_VERSION_STRING " "
<< getClangFullRepositoryVersion();
// If vendor supplied, include the base LLVM version as well.