]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/dwarf: remove unnecessary compunit_symtab_set_p check in dw2_do_instantiate_symtab
authorSimon Marchi <simon.marchi@polymtl.ca>
Sat, 21 Feb 2026 20:07:26 +0000 (15:07 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Tue, 10 Mar 2026 17:35:22 +0000 (13:35 -0400)
dw2_do_instantiate_symtab is called by dw2_instantiate_symtab, only if
per_cu does not have a matching compunit_symtab yet.
dw2_do_instantiate_symtab therefore does not need this
compunit_symtab_set_p itself.

Change-Id: Ie665980bb65016b56206c4aac36f4c2fc13c61de
Approved-By: Tom Tromey <tom@tromey.com>
gdb/dwarf2/read.c

index 79464269c1bea08b8da26d44ee7ab1541e608738..f478f0d2cce663417de1a29fc65b00b3c9b845da 100644 (file)
@@ -1599,26 +1599,23 @@ dw2_do_instantiate_symtab (dwarf2_per_cu *per_cu,
        with the dwarf queue empty.  */
     dwarf2_queue_guard q_guard (per_objfile);
 
-    if (!per_objfile->compunit_symtab_set_p (per_cu))
-      {
-       queue_comp_unit (per_cu, per_objfile);
-       dwarf2_cu *cu = per_objfile->get_cu (per_cu);
-
-       if (cu == nullptr)
-         cu = load_cu (per_cu, per_objfile, skip_partial);
-
-       /* If we just loaded a CU from a DWO, and we're working with an index
-          that may badly handle TUs, load all the TUs in that DWO as well.
-          http://sourceware.org/bugzilla/show_bug.cgi?id=15021  */
-       if (!per_cu->is_debug_types ()
-           && cu != NULL
-           && cu->dwo_unit != NULL
-           && per_objfile->per_bfd->index_table != NULL
-           && !per_objfile->per_bfd->index_table->version_check ()
-           /* DWP files aren't supported yet.  */
-           && per_objfile->per_bfd->dwp_file == nullptr)
-         queue_and_load_all_dwo_tus (cu);
-      }
+    queue_comp_unit (per_cu, per_objfile);
+    dwarf2_cu *cu = per_objfile->get_cu (per_cu);
+
+    if (cu == nullptr)
+      cu = load_cu (per_cu, per_objfile, skip_partial);
+
+    /* If we just loaded a CU from a DWO, and we're working with an index
+       that may badly handle TUs, load all the TUs in that DWO as well.
+       http://sourceware.org/bugzilla/show_bug.cgi?id=15021  */
+    if (!per_cu->is_debug_types ()
+       && cu != nullptr
+       && cu->dwo_unit != nullptr
+       && per_objfile->per_bfd->index_table != nullptr
+       && !per_objfile->per_bfd->index_table->version_check ()
+       /* DWP files aren't supported yet.  */
+       && per_objfile->per_bfd->dwp_file == nullptr)
+      queue_and_load_all_dwo_tus (cu);
 
     process_queue (per_objfile);
   }