-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[lldb] Remove unused local variables (NFC) #140989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kazutakahirata
merged 1 commit into
llvm:main
from
kazutakahirata:cleanup_20250521_unused_local_lldb
May 22, 2025
Merged
[lldb] Remove unused local variables (NFC) #140989
kazutakahirata
merged 1 commit into
llvm:main
from
kazutakahirata:cleanup_20250521_unused_local_lldb
May 22, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-lldb Author: Kazu Hirata (kazutakahirata) ChangesFull diff: https://github.com/llvm/llvm-project/pull/140989.diff 5 Files Affected:
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 9d5e0f886a4a5..3950454b7c90e 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -6649,7 +6649,6 @@ CreateAllImageInfosPayload(const lldb::ProcessSP &process_sp,
offset_t current_string_offset = start_of_filenames;
offset_t current_segaddrs_offset = start_of_seg_vmaddrs;
- std::vector<struct image_entry> image_entries;
for (size_t i = 0; i < modules_count; i++) {
ModuleSP module_sp = modules.GetModuleAtIndex(i);
diff --git a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
index 39584bad2d745..6037c8d2514b8 100644
--- a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
+++ b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
@@ -658,7 +658,6 @@ bool ProcessMachCore::DoUpdateThreadList(ThreadList &old_thread_list,
ObjectFile *core_objfile = m_core_module_sp->GetObjectFile();
if (core_objfile) {
- std::set<lldb::tid_t> used_tids;
const uint32_t num_threads = core_objfile->GetNumThreadContexts();
std::vector<lldb::tid_t> tids;
if (core_objfile->GetCorefileThreadExtraInfos(tids)) {
diff --git a/lldb/source/Target/DynamicRegisterInfo.cpp b/lldb/source/Target/DynamicRegisterInfo.cpp
index b964dc5877a97..e3a055fa1ce32 100644
--- a/lldb/source/Target/DynamicRegisterInfo.cpp
+++ b/lldb/source/Target/DynamicRegisterInfo.cpp
@@ -245,8 +245,6 @@ DynamicRegisterInfo::SetRegisterInfo(const StructuredData::Dictionary &dict,
// 'encoding':'uint' , 'format':'hex' , 'set': 0, 'ehframe' : 2,
// 'dwarf' : 2, 'generic':'arg4', 'alt-name':'arg4', },
RegisterInfo reg_info;
- std::vector<uint32_t> value_regs;
- std::vector<uint32_t> invalidate_regs;
memset(®_info, 0, sizeof(reg_info));
llvm::StringRef name_val;
diff --git a/lldb/source/Target/Statistics.cpp b/lldb/source/Target/Statistics.cpp
index 499d1333c3d93..4cfd0629ea271 100644
--- a/lldb/source/Target/Statistics.cpp
+++ b/lldb/source/Target/Statistics.cpp
@@ -309,7 +309,6 @@ llvm::json::Value DebuggerStats::ReportStatistics(
uint32_t debug_index_saved = 0;
uint64_t debug_info_size = 0;
- std::vector<ModuleStats> modules;
std::lock_guard<std::recursive_mutex> guard(
Module::GetAllocationModuleCollectionMutex());
const uint64_t num_modules = target != nullptr
diff --git a/lldb/unittests/Utility/DataEncoderTest.cpp b/lldb/unittests/Utility/DataEncoderTest.cpp
index 5f5ff37bced1a..8d502f0f80b57 100644
--- a/lldb/unittests/Utility/DataEncoderTest.cpp
+++ b/lldb/unittests/Utility/DataEncoderTest.cpp
@@ -41,7 +41,6 @@ TEST(DataEncoderTest, PutU8) {
TEST(DataEncoderTest, AppendUnsignedLittle) {
const uint32_t addr_size = 4;
- std::vector<uint8_t> expected;
DataEncoder encoder(lldb::eByteOrderLittle, addr_size);
encoder.AppendU8(0x11);
ASSERT_EQ(encoder.GetData(), ArrayRef<uint8_t>({0x11}));
@@ -59,7 +58,6 @@ TEST(DataEncoderTest, AppendUnsignedLittle) {
TEST(DataEncoderTest, AppendUnsignedBig) {
const uint32_t addr_size = 4;
- std::vector<uint8_t> expected;
DataEncoder encoder(lldb::eByteOrderBig, addr_size);
encoder.AppendU8(0x11);
ASSERT_EQ(encoder.GetData(), ArrayRef<uint8_t>({0x11}));
@@ -76,7 +74,6 @@ TEST(DataEncoderTest, AppendUnsignedBig) {
TEST(DataEncoderTest, AppendAddress4Little) {
const uint32_t addr_size = 4;
- std::vector<uint8_t> expected;
DataEncoder encoder(lldb::eByteOrderLittle, addr_size);
encoder.AppendAddress(0x11223344);
ASSERT_EQ(encoder.GetData(), ArrayRef<uint8_t>({0x44, 0x33, 0x22, 0x11}));
@@ -87,7 +84,6 @@ TEST(DataEncoderTest, AppendAddress4Little) {
TEST(DataEncoderTest, AppendAddress4Big) {
const uint32_t addr_size = 4;
- std::vector<uint8_t> expected;
DataEncoder encoder(lldb::eByteOrderBig, addr_size);
encoder.AppendAddress(0x11223344);
ASSERT_EQ(encoder.GetData(), ArrayRef<uint8_t>({0x11, 0x22, 0x33, 0x44}));
@@ -98,7 +94,6 @@ TEST(DataEncoderTest, AppendAddress4Big) {
TEST(DataEncoderTest, AppendAddress8Little) {
const uint32_t addr_size = 8;
- std::vector<uint8_t> expected;
DataEncoder encoder(lldb::eByteOrderLittle, addr_size);
encoder.AppendAddress(0x11223344);
ASSERT_EQ(encoder.GetData(),
@@ -111,7 +106,6 @@ TEST(DataEncoderTest, AppendAddress8Little) {
TEST(DataEncoderTest, AppendAddress8Big) {
const uint32_t addr_size = 8;
- std::vector<uint8_t> expected;
DataEncoder encoder(lldb::eByteOrderBig, addr_size);
encoder.AppendAddress(0x11223344);
ASSERT_EQ(encoder.GetData(),
@@ -124,7 +118,6 @@ TEST(DataEncoderTest, AppendAddress8Big) {
TEST(DataEncoderTest, AppendData) {
const uint32_t addr_size = 4;
- std::vector<uint8_t> expected;
DataEncoder encoder(lldb::eByteOrderBig, addr_size);
// Make sure default constructed StringRef appends nothing
encoder.AppendData(StringRef());
@@ -139,7 +132,6 @@ TEST(DataEncoderTest, AppendData) {
TEST(DataEncoderTest, AppendCString) {
const uint32_t addr_size = 4;
- std::vector<uint8_t> expected;
DataEncoder encoder(lldb::eByteOrderBig, addr_size);
// Make sure default constructed StringRef appends nothing
encoder.AppendCString(StringRef());
|
shiltian
approved these changes
May 22, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.