diff options
author | Tom Tromey <tom@tromey.com> | 2019-03-24 21:38:40 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-04-04 19:55:11 -0600 |
commit | 43476f0b1b628352ad8e3064e50128cb3461d3d0 (patch) | |
tree | 5d836e9a33199397d2aeba188216a6478688ca94 /gdb/c-exp.y | |
parent | 5776fca307b8af3d852525b77e9b917a9aa97370 (diff) | |
download | gdb-43476f0b1b628352ad8e3064e50128cb3461d3d0.zip gdb-43476f0b1b628352ad8e3064e50128cb3461d3d0.tar.gz gdb-43476f0b1b628352ad8e3064e50128cb3461d3d0.tar.bz2 |
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 <tom@tromey.com>
* parser-defs.h (struct parser_state) <start_arglist,
end_arglist>: New methods.
<arglist_len, m_funcall_chain>: 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.
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r-- | gdb/c-exp.y | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y index c85bb31..cab5cd5 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -534,11 +534,11 @@ msgarg : name ':' exp exp : exp '(' /* This is to save the value of arglist_len being accumulated by an outer function call. */ - { start_arglist (); } + { pstate->start_arglist (); } arglist ')' %prec ARROW { write_exp_elt_opcode (pstate, OP_FUNCALL); write_exp_elt_longcst (pstate, - (LONGEST) end_arglist ()); + pstate->end_arglist ()); write_exp_elt_opcode (pstate, OP_FUNCALL); } ; @@ -546,10 +546,10 @@ exp : exp '(' "func()::static_var" further below, which uses function_method_void. */ exp : exp '(' ')' %prec ARROW - { start_arglist (); + { pstate->start_arglist (); write_exp_elt_opcode (pstate, OP_FUNCALL); write_exp_elt_longcst (pstate, - (LONGEST) end_arglist ()); + pstate->end_arglist ()); write_exp_elt_opcode (pstate, OP_FUNCALL); } ; @@ -569,30 +569,30 @@ exp : UNKNOWN_CPP_NAME '(' /* This is to save the value of arglist_len being accumulated by an outer function call. */ - start_arglist (); + pstate->start_arglist (); } arglist ')' %prec ARROW { write_exp_elt_opcode (pstate, OP_FUNCALL); write_exp_elt_longcst (pstate, - (LONGEST) end_arglist ()); + pstate->end_arglist ()); write_exp_elt_opcode (pstate, OP_FUNCALL); } ; lcurly : '{' - { start_arglist (); } + { pstate->start_arglist (); } ; arglist : ; arglist : exp - { arglist_len = 1; } + { pstate->arglist_len = 1; } ; arglist : arglist ',' exp %prec ABOVE_COMMA - { arglist_len++; } + { pstate->arglist_len++; } ; function_method: exp '(' parameter_typelist ')' const_or_volatile @@ -645,7 +645,7 @@ exp : function_method_void_or_typelist COLONCOLON name ; rcurly : '}' - { $$ = end_arglist () - 1; } + { $$ = pstate->end_arglist () - 1; } ; exp : lcurly arglist rcurly %prec ARROW { write_exp_elt_opcode (pstate, OP_ARRAY); |