aboutsummaryrefslogtreecommitdiff
path: root/gdb/parse.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-03-24 08:40:32 -0600
committerTom Tromey <tom@tromey.com>2019-04-04 19:55:10 -0600
commit1201a264c8fd227737342345ab54e938295188b6 (patch)
tree7c419bb8e09f1875dedd813e7859edaa18aa6a34 /gdb/parse.c
parente3980ce2a9bf19ade17fdd9817765f2d1e17a0d8 (diff)
downloadfsf-binutils-gdb-1201a264c8fd227737342345ab54e938295188b6.zip
fsf-binutils-gdb-1201a264c8fd227737342345ab54e938295188b6.tar.gz
fsf-binutils-gdb-1201a264c8fd227737342345ab54e938295188b6.tar.bz2
Remove parser_state "initial_size" parameter
All the real (not test) uses of parser_state pass 10 as the "initial_size" parameter, and it seems to me that there's no real reason to require callers to set this. This patch removes this parameter. gdb/ChangeLog 2019-04-04 Tom Tromey <tom@tromey.com> * dtrace-probe.c (dtrace_probe::build_arg_exprs): Update. * stap-probe.c (stap_parse_argument): Update. * stap-probe.h (struct stap_parse_info) <stap_parse_info>: Remove initial_size parameter. * rust-exp.y (rust_lex_tests): Update. * parse.c (parser_state): Update. (parse_exp_in_context): Update. * parser-defs.h (struct parser_state) <parser_state>: Remove "initial_size" parameter.
Diffstat (limited to 'gdb/parse.c')
-rw-r--r--gdb/parse.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gdb/parse.c b/gdb/parse.c
index 6716597..69c63da 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -165,10 +165,9 @@ end_arglist (void)
/* See definition in parser-defs.h. */
-parser_state::parser_state (size_t initial_size,
- const struct language_defn *lang,
+parser_state::parser_state (const struct language_defn *lang,
struct gdbarch *gdbarch)
- : expout_size (initial_size),
+ : expout_size (10),
expout (XNEWVAR (expression,
(sizeof (expression)
+ EXP_ELEM_TO_BYTES (expout_size)))),
@@ -1190,7 +1189,7 @@ parse_exp_in_context (const char **stringptr, CORE_ADDR pc,
and others called from *.y) ensure CURRENT_LANGUAGE gets restored
to the value matching SELECTED_FRAME as set by get_current_arch. */
- parser_state ps (10, lang, get_current_arch ());
+ parser_state ps (lang, get_current_arch ());
scoped_restore_current_language lang_saver;
set_language (lang->la_language);