Skip to content

[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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 0 additions & 2 deletions lldb/source/Target/DynamicRegisterInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(&reg_info, 0, sizeof(reg_info));

llvm::StringRef name_val;
Expand Down
1 change: 0 additions & 1 deletion lldb/source/Target/Statistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions lldb/unittests/Utility/DataEncoderTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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}));
Expand All @@ -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}));
Expand All @@ -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}));
Expand All @@ -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}));
Expand All @@ -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(),
Expand All @@ -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(),
Expand All @@ -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());
Expand All @@ -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());
Expand Down
Loading