kastiglione created this revision. kastiglione added reviewers: aprantl, teemperor. Herald added a project: LLDB. Herald added a subscriber: lldb-commits. kastiglione requested review of this revision. Herald added a subscriber: JDevlieghere.
Small cleanup to `lldb_private::GetVersion()`. In particular, the `LLDB_REPOSITORY` is not defined anywhere and so will always be null. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D88939 Files: lldb/source/lldb.cpp Index: lldb/source/lldb.cpp =================================================================== --- lldb/source/lldb.cpp +++ lldb/source/lldb.cpp @@ -25,17 +25,6 @@ #endif } -static const char *GetLLDBRepository() { -#ifdef LLDB_REPOSITORY - return LLDB_REPOSITORY; -#else - return NULL; -#endif -} - -#define QUOTE(str) #str -#define EXPAND_AND_QUOTE(str) QUOTE(str) - const char *lldb_private::GetVersion() { // On platforms other than Darwin, report a version number in the same style // as the clang tool. @@ -44,19 +33,9 @@ g_version_str += "lldb version "; g_version_str += CLANG_VERSION_STRING; - const char *lldb_repo = GetLLDBRepository(); const char *lldb_rev = GetLLDBRevision(); - if (lldb_repo || lldb_rev) { - 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 += lldb_rev; - } - g_version_str += ")"; + if (lldb_rev) { + g_version_str += " (revision " + lldb_rev + ")"; } std::string clang_rev(clang::getClangRevision());
Index: lldb/source/lldb.cpp =================================================================== --- lldb/source/lldb.cpp +++ lldb/source/lldb.cpp @@ -25,17 +25,6 @@ #endif } -static const char *GetLLDBRepository() { -#ifdef LLDB_REPOSITORY - return LLDB_REPOSITORY; -#else - return NULL; -#endif -} - -#define QUOTE(str) #str -#define EXPAND_AND_QUOTE(str) QUOTE(str) - const char *lldb_private::GetVersion() { // On platforms other than Darwin, report a version number in the same style // as the clang tool. @@ -44,19 +33,9 @@ g_version_str += "lldb version "; g_version_str += CLANG_VERSION_STRING; - const char *lldb_repo = GetLLDBRepository(); const char *lldb_rev = GetLLDBRevision(); - if (lldb_repo || lldb_rev) { - 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 += lldb_rev; - } - g_version_str += ")"; + if (lldb_rev) { + g_version_str += " (revision " + lldb_rev + ")"; } std::string clang_rev(clang::getClangRevision());
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits