Implement struct type_stack with a vector
authorSimon Marchi <simon.marchi@ericsson.com>
Tue, 28 Aug 2018 15:13:26 +0000 (11:13 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Tue, 28 Aug 2018 15:13:26 +0000 (11:13 -0400)
commit858d8004b05b572c07a414ae3933299976880bab
tree325d946e8471189c4228eeb2b40e1c5d98e5dc4a
parent416a69af890a34e58c722ae2e6fe218438fcf3b7
Implement struct type_stack with a vector

This patch changes the home-made stack implementation with a vector,
which makes it a bit more concise and readable.

Regtested on the buildbot.

gdb/ChangeLog:

* parser-defs.h (struct type_stack) <elements>: Change type to
std::vector<union type_stack_elt>.
<depth, size>: Remove.
* parse.c (parse_exp_in_context_1): Adjust.
(type_stack_reserve): Remove.
(check_type_stack_depth): Remove.
(insert_into_type_stack): Adjust to std::vector.
(insert_type): Likewise.
(push_type): Likewise.
(push_type_int): Likewise.
(insert_type_address_space): Likewise.
(pop_type): Likewise.
(pop_type_int): Likewise.
(pop_typelist): Likewise.
(pop_type_stack): Likewise.
(append_type_stack): Likewise.
(push_type_stack): Likewise.
(get_type_stack): Likewise.
(type_stack_cleanup): Likewise.
(push_typelist): Likewise.
(follow_types): Likewise.
(_initialize_parse): Likewise.
gdb/ChangeLog
gdb/parse.c
gdb/parser-defs.h