aboutsummaryrefslogtreecommitdiff
path: root/gdb/parser-defs.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-01-02 19:12:32 -0700
committerTom Tromey <tom@tromey.com>2019-01-06 09:39:33 -0700
commit02e12e3806bc60f66e3c446c4dfa9c06a400e604 (patch)
tree480e7eca926f9945bcd9d7c199b7df57271ddde1 /gdb/parser-defs.h
parentf097f5ad808bd535236a65077f40e9d082a4ec0b (diff)
downloadgdb-02e12e3806bc60f66e3c446c4dfa9c06a400e604.zip
gdb-02e12e3806bc60f66e3c446c4dfa9c06a400e604.tar.gz
gdb-02e12e3806bc60f66e3c446c4dfa9c06a400e604.tar.bz2
Use std::vector in type stacks
This removes the use of VEC from parse.c and, at the same time, removes some related cleanups from c-exp.y. gdb/ChangeLog 2019-01-06 Tom Tromey <tom@tromey.com> * parser-defs.h (type_ptr): Remove typedef. Don't declare VEC. (union type_stack_elt) <typelist_val>: Now a pointer to std::vector. (type_stack_cleanup): Don't declare. (push_typelist): Update. * parse.c (pop_typelist): Return a std::vector. (push_typelist): Take a std::vector. (follow_types): Update. Do not free args. (type_stack_cleanup): Remove. * c-exp.y (struct c_parse_state): New. (cpstate): New global. (type_aggregate_p, exp, ptr_operator, parameter_typelist) (nonempty_typelist): Update. (func_mod): Create a new vector. (c_parse): Create a c_parse_state. (check_parameter_typelist): Do not delete params. (function_method): Update. Do not delete type_list.
Diffstat (limited to 'gdb/parser-defs.h')
-rw-r--r--gdb/parser-defs.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h
index 195264f..5b38477 100644
--- a/gdb/parser-defs.h
+++ b/gdb/parser-defs.h
@@ -200,9 +200,6 @@ struct objc_class_str
int theclass;
};
-typedef struct type *type_ptr;
-DEF_VEC_P (type_ptr);
-
/* For parsing of complicated types.
An array should be preceded in the list by the size of the array. */
enum type_pieces
@@ -225,7 +222,7 @@ union type_stack_elt
enum type_pieces piece;
int int_val;
struct type_stack *stack_val;
- VEC (type_ptr) *typelist_val;
+ std::vector<struct type *> *typelist_val;
};
/* The type stack is an instance of this structure. */
@@ -303,9 +300,7 @@ extern struct type_stack *append_type_stack (struct type_stack *to,
extern void push_type_stack (struct type_stack *stack);
-extern void type_stack_cleanup (void *arg);
-
-extern void push_typelist (VEC (type_ptr) *typelist);
+extern void push_typelist (std::vector<struct type *> *typelist);
extern int dump_subexp (struct expression *, struct ui_file *, int);