Use std::vector for ui_out::levels
authorSimon Marchi <simon.marchi@polymtl.ca>
Thu, 1 Dec 2016 02:42:47 +0000 (21:42 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Thu, 1 Dec 2016 02:43:04 +0000 (21:43 -0500)
commit56df3084847984aeddd8c24ca997242ec8c5a369
tree35ba4095310505c94a28f5dbd7f32a9c57912ec0
parent5486f16481dffa1c1a0d1fd9e38b97e3678078ed
Use std::vector for ui_out::levels

Convert the levels field of struct ui_out to be a vector of unique_ptr
to ui_out_level.  This way, the ownership of the ui_out_level objects by
the ui_out instance is clear.

gdb/ChangeLog:

* ui-out.c (ui_out_level_p): Remove typedef.
(DEF_VEC_P (ui_out_level_p)): Remove definition.
(struct ui_out) <levels>: Change type to vector of unique_ptr of
ui_out_level.
(current_level): Update.
(push_level): Update.
(pop_level): Update, don't manually delete the ui_out_level
instance.
(ui_out_new): Update.
gdb/ChangeLog
gdb/ui-out.c