sylvestre.ledru created this revision. sylvestre.ledru added reviewers: thakis, hans. Herald added a project: clang.
Reported here: https://bugs.llvm.org/show_bug.cgi?id=38998#c15 Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D83386 Files: clang/lib/Basic/Version.cpp Index: clang/lib/Basic/Version.cpp =================================================================== --- clang/lib/Basic/Version.cpp +++ clang/lib/Basic/Version.cpp @@ -97,8 +97,12 @@ #ifdef CLANG_VENDOR OS << CLANG_VENDOR; #endif - OS << ToolName << " version " CLANG_VERSION_STRING " " - << getClangFullRepositoryVersion(); + OS << ToolName << " version " CLANG_VERSION_STRING; + + std::string repo = getClangFullRepositoryVersion(); + if (!repo.empty()) { + OS << " " << repo; + } return OS.str(); } @@ -111,7 +115,13 @@ #ifdef CLANG_VENDOR OS << CLANG_VENDOR; #endif - OS << "Clang " CLANG_VERSION_STRING " " << getClangFullRepositoryVersion(); + OS << "Clang " CLANG_VERSION_STRING; + + std::string repo = getClangFullRepositoryVersion(); + if (!repo.empty()) { + OS << " " << repo; + } + return OS.str(); }
Index: clang/lib/Basic/Version.cpp =================================================================== --- clang/lib/Basic/Version.cpp +++ clang/lib/Basic/Version.cpp @@ -97,8 +97,12 @@ #ifdef CLANG_VENDOR OS << CLANG_VENDOR; #endif - OS << ToolName << " version " CLANG_VERSION_STRING " " - << getClangFullRepositoryVersion(); + OS << ToolName << " version " CLANG_VERSION_STRING; + + std::string repo = getClangFullRepositoryVersion(); + if (!repo.empty()) { + OS << " " << repo; + } return OS.str(); } @@ -111,7 +115,13 @@ #ifdef CLANG_VENDOR OS << CLANG_VENDOR; #endif - OS << "Clang " CLANG_VERSION_STRING " " << getClangFullRepositoryVersion(); + OS << "Clang " CLANG_VERSION_STRING; + + std::string repo = getClangFullRepositoryVersion(); + if (!repo.empty()) { + OS << " " << repo; + } + return OS.str(); }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits