From: Tom de Vries Date: Fri, 15 Jul 2022 10:28:46 +0000 (+0200) Subject: [gdb/symtab] Use deque instead of queue for per_objfile->queue X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ce66f579aac7337e99098ad92b0c87975add048;p=thirdparty%2Fbinutils-gdb.git [gdb/symtab] Use deque instead of queue for per_objfile->queue Allows us to access all elements at once. --- diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 017711df2b4..e9e98b3000c 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -7486,7 +7486,7 @@ queue_comp_unit (dwarf2_per_cu_data *per_cu, per_cu->queued = 1; gdb_assert (per_objfile->queue.has_value ()); - per_objfile->queue->emplace (per_cu, per_objfile, pretend_language); + per_objfile->queue->emplace_back (per_cu, per_objfile, pretend_language); } /* If PER_CU is not yet expanded of queued for expansion, add it to the queue. @@ -7617,7 +7617,7 @@ process_queue (dwarf2_per_objfile *per_objfile) } per_cu->queued = 0; - per_objfile->queue->pop (); + per_objfile->queue->pop_front (); } dwarf_read_debug_printf ("Done expanding symtabs of %s.", diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h index c2f86a9d367..3a3ff6cce94 100644 --- a/gdb/dwarf2/read.h +++ b/gdb/dwarf2/read.h @@ -20,7 +20,7 @@ #ifndef DWARF2READ_H #define DWARF2READ_H -#include +#include #include #include "dwarf2/comp-unit-head.h" #include "dwarf2/cooked-index.h" @@ -658,7 +658,7 @@ struct dwarf2_per_objfile dwarf2_cu *sym_cu = nullptr; /* CUs that are queued to be read. */ - gdb::optional> queue; + gdb::optional> queue; private: /* Hold the corresponding compunit_symtab for each CU or TU. This