From 858d8004b05b572c07a414ae3933299976880bab Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 28 Aug 2018 11:13:26 -0400 Subject: 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) : Change type to std::vector. : 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/parser-defs.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'gdb/parser-defs.h') diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h index c67b8d56..242409c 100644 --- a/gdb/parser-defs.h +++ b/gdb/parser-defs.h @@ -233,11 +233,7 @@ union type_stack_elt struct type_stack { /* Elements on the stack. */ - union type_stack_elt *elements; - /* Current stack depth. */ - int depth; - /* Allocated size of stack. */ - int size; + std::vector elements; }; /* Reverse an expression from suffix form (in which it is constructed) -- cgit v1.1