[1/8] gdb/dwarf: remove unnecessary local variable in dw2_get_file_names_reader

Message ID 20250305050834.2223161-1-simon.marchi@polymtl.ca
State New
Headers
Series [1/8] gdb/dwarf: remove unnecessary local variable in dw2_get_file_names_reader |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply

Commit Message

Simon Marchi March 5, 2025, 5:06 a.m. UTC
  From: Simon Marchi <simon.marchi@efficios.com>

It seems like the lh_cu variable is not necessary, we can just use
this_cu.

Change-Id: Ic2ed6ee82faf1fb5d340cd92dc8ef15434b20cb8
---
 gdb/dwarf2/read.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)


base-commit: aa2cd0e39dc81b28ba7c934faac18bd4d8287450
  

Comments

Tom Tromey March 5, 2025, 3:29 p.m. UTC | #1
>>>>> "Simon" == simon marchi <simon.marchi@polymtl.ca> writes:

Simon> From: Simon Marchi <simon.marchi@efficios.com>
Simon> It seems like the lh_cu variable is not necessary, we can just use
Simon> this_cu.

Thanks.
Approved-By: Tom Tromey <tom@tromey.com>

Tom
  
Simon Marchi March 5, 2025, 5 p.m. UTC | #2
On 3/5/25 10:29 AM, Tom Tromey wrote:
>>>>>> "Simon" == simon marchi <simon.marchi@polymtl.ca> writes:
> 
> Simon> From: Simon Marchi <simon.marchi@efficios.com>
> Simon> It seems like the lh_cu variable is not necessary, we can just use
> Simon> this_cu.
> 
> Thanks.
> Approved-By: Tom Tromey <tom@tromey.com>
> 
> Tom

Thanks for the review, I pushed the series.

Simon
  

Patch

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 6080dca6ea6e..926d377488a7 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -1865,7 +1865,6 @@  dw2_get_file_names_reader (const struct die_reader_specs *reader,
   if (comp_unit_die->tag == DW_TAG_partial_unit)
     return;
 
-  dwarf2_per_cu *lh_cu = this_cu;
   slot = NULL;
 
   line_header_up lh;
@@ -1888,7 +1887,7 @@  dw2_get_file_names_reader (const struct die_reader_specs *reader,
 			     &find_entry, INSERT);
       if (*slot != NULL)
 	{
-	  lh_cu->file_names = (struct quick_file_names *) *slot;
+	  this_cu->file_names = (struct quick_file_names *) *slot;
 	  return;
 	}
 
@@ -1938,7 +1937,7 @@  dw2_get_file_names_reader (const struct die_reader_specs *reader,
 
   qfn->real_names = NULL;
 
-  lh_cu->file_names = qfn;
+  this_cu->file_names = qfn;
 }
 
 /* A helper for the "quick" functions which attempts to read the line