Use new+delete for struct expression
authorTom Tromey <tom@tromey.com>
Wed, 2 Dec 2020 00:22:05 +0000 (17:22 -0700)
committerTom Tromey <tom@tromey.com>
Wed, 2 Dec 2020 00:22:05 +0000 (17:22 -0700)
commit77bf7e991150d3fac70294910c027c43ae5789b6
tree058346ea2f9e4daafe97d4d1784aaabca585b216
parente89b3d52936a0492f2886c2a1fc53dd87aaf94a3
Use new+delete for struct expression

In another series I'm working on, it is necessary to manage
"struct expression" with new and delete.  Because the patch is
straightforward and could be extracted, I've done so here.

gdb/ChangeLog
2020-12-01  Tom Tromey  <tom@tromey.com>

* parse.c (expr_builder::expr_builder): Initialize expout.
(expr_builder::release): Use expression::resize.
(expression::expression, expression::~expression)
(expression::resize): New methods.
(write_exp_elt): Use expression::resize.
(prefixify_expression): Update.
(increase_expout_size): Use expression::resize.
* expression.h (struct expression): Add constructor, destructor.
<resize>: New method.
(expression_up): Change type.
gdb/ChangeLog
gdb/expression.h
gdb/parse.c