Remove cleanups from Rust parser
authorTom Tromey <tom@tromey.com>
Fri, 4 Aug 2017 13:30:26 +0000 (07:30 -0600)
committerTom Tromey <tom@tromey.com>
Sat, 5 Aug 2017 17:14:06 +0000 (11:14 -0600)
commit3232fabd2d0094d74bd942a1f2c5c284b0cd9260
tree27ea0f8ec2445c249c7eeece580a80ee16b90c78
parent55ef6584ca8466e293e9f1b310c0bf44500c11b6
Remove cleanups from Rust parser

This removes the few remaining cleanups in the Rust language code.
The main difficulty here was that the earlier code allocated VEC heads
on an obstack.  The new code instead introduces an object that
allocates and maintains the storage for whatever vectors are needed
during the parse.

Regression tested on the buildbot.

ChangeLog
2017-08-05  Tom Tromey  <tom@tromey.com>

* rust-exp.y (rust_op_ptr, set_field): Remove typedefs.
(rust_op_vector, rust_set_vector): New typedefs.
(current_parser): New global.
(work_obstack): Change to pointer type.  Update all users.
(rust_ast, pstate): Remove globals.
(struct rust_parser): New.
(%union) <params, field_inits>: Change type.
(start, tuple_expr, unit_expr, struct_expr_list, literal)
(field_expr, expr_list, maybe_expr_list, type_list): Update.
(ast_call_ish, ast_path, ast_function_type, ast_tuple_type)
(convert_params_to_types, convert_params_to_expression): Change
type of "params".
(ast_string): Change type of "fields".
(rust_parse): Make a rust_parser.  Remove cleanups.
(rust_lex_tests): Make and install an auto_obstack.
gdb/ChangeLog
gdb/rust-exp.y