[Lldb-commits] [lldb] [lldb][nfc] Remove unused member Disassembler::m_base_addr (PR #89289)

2024-04-18 Thread Alex Langford via lldb-commits

https://github.com/bulbazord created 
https://github.com/llvm/llvm-project/pull/89289

This member variable is completely unused. I also don't think it makes a ton of 
sense since (1) The "base address" can be obtained from the first Instruction 
in its InstructionList, and (2) InstructionLists may not be a series of 
contiguous instructions (even though they are most of the time).

>From 821713962ebe64cf72dea81a443c6e30ef52abaf Mon Sep 17 00:00:00 2001
From: Alex Langford 
Date: Thu, 18 Apr 2024 11:35:21 -0700
Subject: [PATCH] [lldb][nfc] Remove unused member Disassembler::m_base_addr

This member variable is completely unused. I also don't think it makes a
ton of sense since (1) The "base address" can be obtained from the first
Instruction in its InstructionList, and (2) InstructionLists may not be
a series of contiguous instructions (even though they are most of the
time).
---
 lldb/include/lldb/Core/Disassembler.h | 1 -
 lldb/source/Core/Disassembler.cpp | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/lldb/include/lldb/Core/Disassembler.h 
b/lldb/include/lldb/Core/Disassembler.h
index e037a49f152c74..21969aed03c209 100644
--- a/lldb/include/lldb/Core/Disassembler.h
+++ b/lldb/include/lldb/Core/Disassembler.h
@@ -547,7 +547,6 @@ class Disassembler : public 
std::enable_shared_from_this,
   // Classes that inherit from Disassembler can see and modify these
   ArchSpec m_arch;
   InstructionList m_instruction_list;
-  lldb::addr_t m_base_addr;
   std::string m_flavor;
 
 private:
diff --git a/lldb/source/Core/Disassembler.cpp 
b/lldb/source/Core/Disassembler.cpp
index e31746fa0b8b9d..9286f62058bc8d 100644
--- a/lldb/source/Core/Disassembler.cpp
+++ b/lldb/source/Core/Disassembler.cpp
@@ -1117,8 +1117,7 @@ size_t Disassembler::ParseInstructions(Target &target, 
Address start,
 
 // Disassembler copy constructor
 Disassembler::Disassembler(const ArchSpec &arch, const char *flavor)
-: m_arch(arch), m_instruction_list(), m_base_addr(LLDB_INVALID_ADDRESS),
-  m_flavor() {
+: m_arch(arch), m_instruction_list(), m_flavor() {
   if (flavor == nullptr)
 m_flavor.assign("default");
   else

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][nfc] Remove unused member Disassembler::m_base_addr (PR #89289)

2024-04-18 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Alex Langford (bulbazord)


Changes

This member variable is completely unused. I also don't think it makes a ton of 
sense since (1) The "base address" can be obtained from the first Instruction 
in its InstructionList, and (2) InstructionLists may not be a series of 
contiguous instructions (even though they are most of the time).

---
Full diff: https://github.com/llvm/llvm-project/pull/89289.diff


2 Files Affected:

- (modified) lldb/include/lldb/Core/Disassembler.h (-1) 
- (modified) lldb/source/Core/Disassembler.cpp (+1-2) 


``diff
diff --git a/lldb/include/lldb/Core/Disassembler.h 
b/lldb/include/lldb/Core/Disassembler.h
index e037a49f152c74..21969aed03c209 100644
--- a/lldb/include/lldb/Core/Disassembler.h
+++ b/lldb/include/lldb/Core/Disassembler.h
@@ -547,7 +547,6 @@ class Disassembler : public 
std::enable_shared_from_this,
   // Classes that inherit from Disassembler can see and modify these
   ArchSpec m_arch;
   InstructionList m_instruction_list;
-  lldb::addr_t m_base_addr;
   std::string m_flavor;
 
 private:
diff --git a/lldb/source/Core/Disassembler.cpp 
b/lldb/source/Core/Disassembler.cpp
index e31746fa0b8b9d..9286f62058bc8d 100644
--- a/lldb/source/Core/Disassembler.cpp
+++ b/lldb/source/Core/Disassembler.cpp
@@ -1117,8 +1117,7 @@ size_t Disassembler::ParseInstructions(Target &target, 
Address start,
 
 // Disassembler copy constructor
 Disassembler::Disassembler(const ArchSpec &arch, const char *flavor)
-: m_arch(arch), m_instruction_list(), m_base_addr(LLDB_INVALID_ADDRESS),
-  m_flavor() {
+: m_arch(arch), m_instruction_list(), m_flavor() {
   if (flavor == nullptr)
 m_flavor.assign("default");
   else

``




https://github.com/llvm/llvm-project/pull/89289
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][nfc] Remove unused member Disassembler::m_base_addr (PR #89289)

2024-04-18 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere approved this pull request.


https://github.com/llvm/llvm-project/pull/89289
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits