From 43476f0b1b628352ad8e3064e50128cb3461d3d0 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 24 Mar 2019 21:38:40 -0600 Subject: Move arglist_len et al to parser_state This moves arglist_len, start_arglist, and end_arglist to parser_state. gdb/ChangeLog 2019-04-04 Tom Tromey * parser-defs.h (struct parser_state) : New methods. : New members. (arglist_len, start_arglist, end_arglist): Don't declare. * parse.c (arglist_len, funcall_chain): Remove global. (start_arglist, end_arglist): Remove functions. (parse_exp_in_context): Update. * p-exp.y: Update rules. * m2-exp.y: Update rules. * go-exp.y: Update rules. * f-exp.y: Update rules. * d-exp.y: Update rules. * c-exp.y: Update rules. --- gdb/parse.c | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'gdb/parse.c') diff --git a/gdb/parse.c b/gdb/parse.c index 5692e23..6ee6157 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -67,7 +67,6 @@ const struct exp_descriptor exp_descriptor_standard = /* Global variables declared in parser-defs.h (and commented there). */ innermost_block_tracker innermost_block; -int arglist_len; static struct type_stack type_stack; /* True if parsing an expression to attempt completion. */ @@ -128,33 +127,6 @@ innermost_block_tracker::update (const struct block *b, m_innermost_block = b; } -/* Data structure for saving values of arglist_len for function calls whose - arguments contain other function calls. */ - -static std::vector *funcall_chain; - -/* Begin counting arguments for a function call, - saving the data about any containing call. */ - -void -start_arglist (void) -{ - funcall_chain->push_back (arglist_len); - arglist_len = 0; -} - -/* Return the number of arguments in a function call just terminated, - and restore the data for the containing function call. */ - -int -end_arglist (void) -{ - int val = arglist_len; - arglist_len = funcall_chain->back (); - funcall_chain->pop_back (); - return val; -} - /* See definition in parser-defs.h. */ @@ -1119,10 +1091,6 @@ parse_exp_in_context (const char **stringptr, CORE_ADDR pc, if (*stringptr == 0 || **stringptr == 0) error_no_arg (_("expression to compute")); - std::vector funcalls; - scoped_restore save_funcall_chain = make_scoped_restore (&funcall_chain, - &funcalls); - const struct block *expression_context_block = block; CORE_ADDR expression_context_pc = 0; -- cgit v1.1