Author: Jordan Rupprecht Date: 2020-02-20T10:07:50-08:00 New Revision: 0ffa6e1a7e1c5de36276375486f49277c6f95d0e
URL: https://github.com/llvm/llvm-project/commit/0ffa6e1a7e1c5de36276375486f49277c6f95d0e DIFF: https://github.com/llvm/llvm-project/commit/0ffa6e1a7e1c5de36276375486f49277c6f95d0e.diff LOG: [lldb] Fix version string when using LLDB_REVISION but not LLDB_REPOSITORY Summary: lldb's format string (line one) is: `lldb version $clang_version ($lldb_repo revision $lldb_revision)` When only using $lldb_revision and not $lldb_repo, this might look like: `lldb version 11 ( revision 12345)` which looks pretty ugly. Aside: I'm not sure we really need all the different versions since we've moved to the monorepo layout -- I don't think anyone is using different llvm/clang/lldb revisions, are they? We could likely tidy this up further if we knew how people consumed the output of lldb --version. Reviewers: labath, JDevlieghere, friss Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D74859 Added: Modified: lldb/source/lldb.cpp Removed: ################################################################################ diff --git a/lldb/source/lldb.cpp b/lldb/source/lldb.cpp index 885c62021286..6d4ed66074dc 100644 --- a/lldb/source/lldb.cpp +++ b/lldb/source/lldb.cpp @@ -50,8 +50,10 @@ const char *lldb_private::GetVersion() { g_version_str += " ("; if (lldb_repo) g_version_str += lldb_repo; + if (lldb_repo && lldb_rev) + g_version_str += " "; if (lldb_rev) { - g_version_str += " revision "; + g_version_str += "revision "; g_version_str += lldb_rev; } g_version_str += ")"; _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits