Make dwarf_expr_piece::pieces an std::vector
authorSimon Marchi <simon.marchi@ericsson.com>
Thu, 14 Sep 2017 13:57:01 +0000 (15:57 +0200)
committerSimon Marchi <simon.marchi@ericsson.com>
Thu, 14 Sep 2017 13:57:01 +0000 (15:57 +0200)
commit1e467161932b6385b51d0bd365a91cf205b399b9
tree5863f70edf852de7f805628f810cc7d63ea77bf7
parent4d465c689a8fb27212ef358d0aee89d60dee69a6
Make dwarf_expr_piece::pieces an std::vector

Change the manually managed array dwarf_expr_piece::piece with an
std::vector.  After passing the pieces array to allocate_piece_closure,
dwarf2_evaluate_loc_desc_full doesn't need that data anymore.  We can
therefore move the content of the vector to avoid copying it.

Reg-tested on the buildbot.

gdb/ChangeLog:

* dwarf2expr.h (struct dwarf_expr_piece): Move up.
(struct dwarf_expr_context) <n_pieces>: Remove.
<pieces>: Change type to std::vector.
* dwarf2expr.c (dwarf_expr_context::dwarf_expr_context): Adjust.
(dwarf_expr_context::~dwarf_expr_context): Don't manually free
pieces.
(dwarf_expr_context::add_piece): Adjust.
* dwarf2loc.c (struct piece_closure): Initialize fields.
<n_pieces>: Remove.
<pieces>: Change type to std::vector.
(allocate_piece_closure): Adjust, change parameter to
std::vector rvalue and std::move it to piece_closure.
(rw_pieced_value): Adjust.
(check_pieced_synthetic_pointer): Adjust.
(indirect_synthetic_pointer): Adjust.
(coerce_pieced_ref): Adjust.
(free_pieced_value_closure):  Adjust.  Use delete to free
piece_closure.
(dwarf2_evaluate_loc_desc_full): Adjust.  std::move ctx.pieces
to allocate_piece_closure.
(dwarf2_loc_desc_get_symbol_read_needs): Adjust.
gdb/ChangeLog
gdb/dwarf2expr.c
gdb/dwarf2expr.h
gdb/dwarf2loc.c
This page took 0.026265 seconds and 4 git commands to generate.