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) llvm-svn: 198694
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user