[Lldb-commits] [lldb] [lldb] Remove some unused code in SymbolFileDWARF::ResolveFunction (PR #123206)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 16 06:31:18 PST 2025


https://github.com/labath created https://github.com/llvm/llvm-project/pull/123206

The purpose of this originally was to check for DWARF which refers to garbage-collected functions (by checking whether we're able to get a good address out of the function). The address check has been removed in https://reviews.llvm.org/D112310, so the code computing it is not doing anything.

>From 86e3b05f407d17bfad85c2c519feae7b28c75ed7 Mon Sep 17 00:00:00 2001
From: Pavel Labath <pavel at labath.sk>
Date: Thu, 16 Jan 2025 15:27:42 +0100
Subject: [PATCH] [lldb] Remove some unused code in
 SymbolFileDWARF::ResolveFunction

The purpose of this originally was to check for DWARF which refers to
garbage-collected functions (by checking whether we're able to get a
good address out of the function). The address check has been removed in
https://reviews.llvm.org/D112310, so the code computing it is
not doing anything.
---
 lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 2f451d173c4dd0..092e4d229d8d41 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2455,18 +2455,12 @@ bool SymbolFileDWARF::ResolveFunction(const DWARFDIE &orig_die,
   }
   assert(die && die.Tag() == DW_TAG_subprogram);
   if (GetFunction(die, sc)) {
-    Address addr;
     // Parse all blocks if needed
     if (inlined_die) {
       Block &function_block = sc.function->GetBlock(true);
       sc.block = function_block.FindBlockByID(inlined_die.GetID());
       if (sc.block == nullptr)
         sc.block = function_block.FindBlockByID(inlined_die.GetOffset());
-      if (sc.block == nullptr || !sc.block->GetStartAddress(addr))
-        addr.Clear();
-    } else {
-      sc.block = nullptr;
-      addr = sc.function->GetAddressRange().GetBaseAddress();
     }
 
     sc_list.Append(sc);



More information about the lldb-commits mailing list