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

via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 18 11:39:20 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Alex Langford (bulbazord)

<details>
<summary>Changes</summary>

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<Disassembler>,
   // 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

``````````

</details>


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


More information about the lldb-commits mailing list