16 #include "clang/Config/config.h"
17 #include "llvm/Support/raw_ostream.h"
21 #ifdef HAVE_SVN_VERSION_INC
22 # include "SVNVersion.inc"
28 #if defined(CLANG_REPOSITORY_STRING)
29 return CLANG_REPOSITORY_STRING;
32 StringRef URL(SVN_REPOSITORY);
39 StringRef SVNRepository(
"$URL: http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_370/rc4/lib/Basic/Version.cpp $");
41 URL = SVNRepository.slice(SVNRepository.find(
':'),
42 SVNRepository.find(
"/lib/Basic"));
46 URL = URL.slice(0, URL.find(
"/src/tools/clang"));
49 size_t Start = URL.find(
"cfe/");
50 if (Start != StringRef::npos)
51 URL = URL.substr(Start + 4);
58 #ifdef LLVM_REPOSITORY
59 StringRef URL(LLVM_REPOSITORY);
67 size_t Start = URL.find(
"llvm/");
68 if (Start != StringRef::npos)
69 URL = URL.substr(Start);
92 llvm::raw_string_ostream OS(buf);
95 if (!Path.empty() || !Revision.empty()) {
99 if (!Revision.empty()) {
108 if (!LLVMRev.empty() && LLVMRev != Revision) {
111 if (!LLVMRepo.empty())
112 OS << LLVMRepo <<
' ';
113 OS << LLVMRev <<
')';
124 llvm::raw_string_ostream OS(buf);
133 OS <<
" (based on " << BACKEND_PACKAGE_STRING <<
")";
143 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 identifer) 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 identifer) 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...
std::string getClangFullCPPVersion()
Retrieves a string representing the complete clang version suitable for use in the CPP VERSION macro...
#define CLANG_VERSION_STRING
A string that describes the Clang version number, e.g., "1.0".
std::string getClangToolFullVersion(llvm::StringRef ToolName)
Like getClangFullVersion(), but with a custom tool name.