diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2023-12-25 17:35:41 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2024-04-06 20:13:06 +0000 |
| commit | cb14a3fe5122c879eae1fb480ed7ce82a699ddb6 (patch) | |
| tree | b983a613c35ece61d561b5a9ef9cd66419f6c7fb /contrib/llvm-project/clang/lib/Basic/Version.cpp | |
| parent | 3d68ee6cbdb244de9fab1df8a2525d2fa592571e (diff) | |
| parent | 99aabd70801bd4bc72c4942747f6d62c675112f5 (diff) | |
Diffstat (limited to 'contrib/llvm-project/clang/lib/Basic/Version.cpp')
| -rw-r--r-- | contrib/llvm-project/clang/lib/Basic/Version.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/contrib/llvm-project/clang/lib/Basic/Version.cpp b/contrib/llvm-project/clang/lib/Basic/Version.cpp index e205da7adec1..4823f566bd77 100644 --- a/contrib/llvm-project/clang/lib/Basic/Version.cpp +++ b/contrib/llvm-project/clang/lib/Basic/Version.cpp @@ -57,6 +57,14 @@ std::string getLLVMRevision() { #endif } +std::string getClangVendor() { +#ifdef CLANG_VENDOR + return CLANG_VENDOR; +#else + return ""; +#endif +} + std::string getClangFullRepositoryVersion() { std::string buf; llvm::raw_string_ostream OS(buf); @@ -92,10 +100,7 @@ std::string getClangFullVersion() { std::string getClangToolFullVersion(StringRef ToolName) { std::string buf; llvm::raw_string_ostream OS(buf); -#ifdef CLANG_VENDOR - OS << CLANG_VENDOR; -#endif - OS << ToolName << " version " CLANG_VERSION_STRING; + OS << getClangVendor() << ToolName << " version " CLANG_VERSION_STRING; std::string repo = getClangFullRepositoryVersion(); if (!repo.empty()) { @@ -110,10 +115,7 @@ std::string getClangFullCPPVersion() { // 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; + OS << getClangVendor() << "Clang " CLANG_VERSION_STRING; std::string repo = getClangFullRepositoryVersion(); if (!repo.empty()) { |
