C++-ify parser_state

This mildly C++-ifies parser_state and stap_parse_info -- just enough
to remove some cleanups.

This version includes the changes implemented by Simon.

Regression tested by the buildbot.

gdb/ChangeLog
2017-12-30  Tom Tromey  <tom@tromey.com>
	    Simon Marchi  <simon.marchi@ericsson.com>

	* stap-probe.h (struct stap_parse_info): Add constructor,
	destructor.
	* stap-probe.c (stap_parse_argument): Update.
	* rust-exp.y (rust_lex_tests): Update.
	* parser-defs.h (struct parser_state): Add constructor,
	destructor, release method.
	<expout>: Change type to expression_up.
	(null_post_parser): Change type.
	(initialize_expout, reallocate_expout): Remove.
	* parse.c (parser_state::parser_state): Rename from
	initialize_expout.
	(parser_state::release): Rename from reallocate_expout.
	(write_exp_elt, parse_exp_in_context_1, increase_expout_size):
	Update.
	(null_post_parser): Change type of "exp".
	* dtrace-probe.c (dtrace_probe::build_arg_exprs): Update.
	* ada-lang.c (resolve, resolve_subexp)
	(replace_operator_with_call): Change type of "expp".
	* language.h (struct language_defn) <la_post_parser>: Change type
	of "expp".
This commit is contained in:
Tom Tromey 2017-11-22 21:45:53 -07:00
parent a594729cfb
commit e9d9f57e11
9 changed files with 110 additions and 102 deletions

View file

@ -25,12 +25,12 @@
#include "symtab.h"
#include "common/function-view.h"
#include "expression.h"
/* Forward decls for prototypes. */
struct value;
struct objfile;
struct frame_info;
struct expression;
struct ui_file;
struct value_print_options;
struct type_print_options;
@ -182,7 +182,7 @@ struct language_defn
for releasing its previous contents, if necessary. If
VOID_CONTEXT_P, then no value is expected from the expression. */
void (*la_post_parser) (struct expression ** expp, int void_context_p);
void (*la_post_parser) (expression_up *expp, int void_context_p);
void (*la_printchar) (int ch, struct type *chtype,
struct ui_file * stream);