* [RFA] Remove a VEC from dwarf2read.c
@ 2018-06-08 4:52 Tom Tromey
2018-06-09 12:07 ` Simon Marchi
0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2018-06-08 4:52 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey
This removes a VEC from dwarf2read.c, replacing it with a std::vector.
Tested by the buildbot.
gdb/ChangeLog
2018-06-07 Tom Tromey <tom@tromey.com>
* dwarf2read.c (process_cu_includes): Update.
(process_full_comp_unit): Update.
* dwarf2read.h (struct dwarf2_per_objfile) <just_read_cus>: Now a
std::vector.
---
gdb/ChangeLog | 7 +++++++
gdb/dwarf2read.c | 12 +++---------
gdb/dwarf2read.h | 2 +-
3 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 1cabfbb0d45..7f1857930b1 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -10217,19 +10217,13 @@ compute_compunit_symtab_includes (struct dwarf2_per_cu_data *per_cu)
static void
process_cu_includes (struct dwarf2_per_objfile *dwarf2_per_objfile)
{
- int ix;
- struct dwarf2_per_cu_data *iter;
-
- for (ix = 0;
- VEC_iterate (dwarf2_per_cu_ptr, dwarf2_per_objfile->just_read_cus,
- ix, iter);
- ++ix)
+ for (struct dwarf2_per_cu_data *iter : dwarf2_per_objfile->just_read_cus)
{
if (! iter->is_debug_types)
compute_compunit_symtab_includes (iter);
}
- VEC_free (dwarf2_per_cu_ptr, dwarf2_per_objfile->just_read_cus);
+ dwarf2_per_objfile->just_read_cus.clear ();
}
/* Generate full symbol information for PER_CU, whose DIEs have
@@ -10337,7 +10331,7 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu,
}
/* Push it for inclusion processing later. */
- VEC_safe_push (dwarf2_per_cu_ptr, dwarf2_per_objfile->just_read_cus, per_cu);
+ dwarf2_per_objfile->just_read_cus.push_back (per_cu);
}
/* Generate full symbol information for type unit PER_CU, whose DIEs have
diff --git a/gdb/dwarf2read.h b/gdb/dwarf2read.h
index fbac7171deb..74335d77db0 100644
--- a/gdb/dwarf2read.h
+++ b/gdb/dwarf2read.h
@@ -233,7 +233,7 @@ public:
htab_t die_type_hash {};
/* The CUs we recently read. */
- VEC (dwarf2_per_cu_ptr) *just_read_cus = NULL;
+ std::vector<dwarf2_per_cu_data *> just_read_cus;
/* Table containing line_header indexed by offset and offset_in_dwz. */
htab_t line_header_hash {};
--
2.13.6
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RFA] Remove a VEC from dwarf2read.c
2018-06-08 4:52 [RFA] Remove a VEC from dwarf2read.c Tom Tromey
@ 2018-06-09 12:07 ` Simon Marchi
0 siblings, 0 replies; 2+ messages in thread
From: Simon Marchi @ 2018-06-09 12:07 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
On 2018-06-08 00:52, Tom Tromey wrote:
> This removes a VEC from dwarf2read.c, replacing it with a std::vector.
>
> Tested by the buildbot.
LGTM.
Simon
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-06-09 12:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-08 4:52 [RFA] Remove a VEC from dwarf2read.c Tom Tromey
2018-06-09 12:07 ` Simon Marchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).