[Lldb-commits] [PATCH] D88939: [lldb] Remove unused code in GetVersion (NFC)
Dave Lee via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Oct 6 19:12:46 PDT 2020
kastiglione updated this revision to Diff 296579.
kastiglione added a comment.
switch NULL to ""
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88939/new/
https://reviews.llvm.org/D88939
Files:
lldb/source/lldb.cpp
Index: lldb/source/lldb.cpp
===================================================================
--- lldb/source/lldb.cpp
+++ lldb/source/lldb.cpp
@@ -21,21 +21,10 @@
#ifdef LLDB_REVISION
return LLDB_REVISION;
#else
- return NULL;
+ return "";
#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 += ")";
+ std::string lldb_rev(GetLLDBRevision());
+ if (!lldb_rev.empty()) {
+ g_version_str += " (revision " + lldb_rev + ")";
}
std::string clang_rev(clang::getClangRevision());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88939.296579.patch
Type: text/x-patch
Size: 1329 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20201007/6c895dca/attachment.bin>
More information about the lldb-commits
mailing list