aboutsummaryrefslogtreecommitdiff
path: root/gdb/parser-defs.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2018-08-28 11:13:26 -0400
committerSimon Marchi <simon.marchi@ericsson.com>2018-08-28 11:13:26 -0400
commit858d8004b05b572c07a414ae3933299976880bab (patch)
tree325d946e8471189c4228eeb2b40e1c5d98e5dc4a /gdb/parser-defs.h
parent416a69af890a34e58c722ae2e6fe218438fcf3b7 (diff)
downloadgdb-858d8004b05b572c07a414ae3933299976880bab.zip
gdb-858d8004b05b572c07a414ae3933299976880bab.tar.gz
gdb-858d8004b05b572c07a414ae3933299976880bab.tar.bz2
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.
Diffstat (limited to 'gdb/parser-defs.h')
-rw-r--r--gdb/parser-defs.h6
1 files changed, 1 insertions, 5 deletions
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<union type_stack_elt> elements;
};
/* Reverse an expression from suffix form (in which it is constructed)