diff options
author | dim <dim@FreeBSD.org> | 2011-05-02 19:39:53 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-05-02 19:39:53 +0000 |
commit | 110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab (patch) | |
tree | 64a10f4c4154739d4a8191d7e1b52ce497f4ebd6 /lib/Basic/Version.cpp | |
parent | a0fb00f9837bd0d2e5948f16f6a6b82a7a628f51 (diff) | |
download | FreeBSD-src-110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab.zip FreeBSD-src-110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab.tar.gz |
Vendor import of clang trunk r130700:
http://llvm.org/svn/llvm-project/cfe/trunk@130700
Diffstat (limited to 'lib/Basic/Version.cpp')
-rw-r--r-- | lib/Basic/Version.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/Basic/Version.cpp b/lib/Basic/Version.cpp index 6573eb9..8f71352 100644 --- a/lib/Basic/Version.cpp +++ b/lib/Basic/Version.cpp @@ -17,11 +17,12 @@ #include <cstring> #include <cstdlib> -using namespace std; - namespace clang { std::string getClangRepositoryPath() { +#if defined(CLANG_REPOSITORY_STRING) + return CLANG_REPOSITORY_STRING; +#else #ifdef SVN_REPOSITORY llvm::StringRef URL(SVN_REPOSITORY); #else @@ -45,6 +46,7 @@ std::string getClangRepositoryPath() { URL = URL.substr(Start + 4); return URL; +#endif } std::string getClangRevision() { @@ -87,4 +89,17 @@ std::string getClangFullVersion() { return OS.str(); } +std::string getClangFullCPPVersion() { + // The version string we report in __VERSION__ is just a compacted version of + // the one we report on the command line. + std::string buf; + llvm::raw_string_ostream OS(buf); +#ifdef CLANG_VENDOR + OS << CLANG_VENDOR; +#endif + OS << "Clang " CLANG_VERSION_STRING " (" + << getClangFullRepositoryVersion() << ')'; + return OS.str(); +} + } // end namespace clang |