Skip to content

[lldb] Remove some unused code in SymbolFileDWARF::ResolveFunction #123206

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 1 commit into from
Jan 30, 2025

Conversation

labath
Copy link
Collaborator

@labath labath commented Jan 16, 2025

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.

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.
@labath labath requested a review from clayborg January 16, 2025 14:31
@labath labath requested a review from JDevlieghere as a code owner January 16, 2025 14:31
@llvmbot llvmbot added the lldb label Jan 16, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 16, 2025

@llvm/pr-subscribers-lldb

Author: Pavel Labath (labath)

Changes

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.


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

1 Files Affected:

  • (modified) lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (-6)
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);

@labath
Copy link
Collaborator Author

labath commented Jan 29, 2025

ping

Copy link
Collaborator

@clayborg clayborg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want to add a [NFC] to the title as well?

@labath
Copy link
Collaborator Author

labath commented Jan 30, 2025

I tend to ignore those because people have very different definitions of NFC, but yeah, I guess this would fit most definitions.

@labath labath merged commit 3cf56b5 into llvm:main Jan 30, 2025
9 checks passed
@labath labath deleted the block branch January 30, 2025 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants