15 #include "clang/Config/config.h" 16 #include "llvm/Support/raw_ostream.h" 20 #ifdef HAVE_VCS_VERSION_INC 21 #include "VCSVersion.inc" 27 #if defined(CLANG_REPOSITORY_STRING) 28 return CLANG_REPOSITORY_STRING;
30 #ifdef CLANG_REPOSITORY 31 StringRef URL(CLANG_REPOSITORY);
38 StringRef SVNRepository(
"$URL$");
40 URL = SVNRepository.slice(SVNRepository.find(
':'),
41 SVNRepository.find(
"/lib/Basic"));
45 URL = URL.slice(0, URL.find(
"/src/tools/clang"));
48 size_t Start = URL.find(
"cfe/");
49 if (Start != StringRef::npos)
50 URL = URL.substr(Start + 4);
57 #ifdef LLVM_REPOSITORY 58 StringRef URL(LLVM_REPOSITORY);
66 size_t Start = URL.find(
"llvm/");
67 if (Start != StringRef::npos)
68 URL = URL.substr(Start);
75 return CLANG_REVISION;
91 llvm::raw_string_ostream OS(buf);
94 if (!Path.empty() || !Revision.empty()) {
98 if (!Revision.empty()) {
107 if (!LLVMRev.empty() && LLVMRev != Revision) {
110 if (!LLVMRepo.empty())
111 OS << LLVMRepo <<
' ';
112 OS << LLVMRev <<
')';
123 llvm::raw_string_ostream OS(buf);
127 OS << ToolName <<
" version " CLANG_VERSION_STRING
" " 137 llvm::raw_string_ostream OS(buf);
std::string getClangFullVersion()
Retrieves a string representing the complete clang version, which includes the clang version number...
std::string getClangRepositoryPath()
Retrieves the repository path (e.g., Subversion path) that identifies the particular Clang branch...
std::string getLLVMRevision()
Retrieves the repository revision number (or identifier) from which LLVM was built.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
std::string getClangRevision()
Retrieves the repository revision number (or identifier) from which this Clang was built...
Defines version macros and version-related utility functions for Clang.
std::string getLLVMRepositoryPath()
Retrieves the repository path from which LLVM was built.
std::string getClangFullRepositoryVersion()
Retrieves the full repository version that is an amalgamation of the information in getClangRepositor...
Dataflow Directional Tag Classes.
std::string getClangFullCPPVersion()
Retrieves a string representing the complete clang version suitable for use in the CPP VERSION macro...
std::string getClangToolFullVersion(llvm::StringRef ToolName)
Like getClangFullVersion(), but with a custom tool name.