From 98d630e910c73d163a071753bfc3b9c106cd3715 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 28 Apr 2023 07:56:48 -0600 Subject: [PATCH] Avoid forward declaration in parse.c This minorly rearranges parse.c to avoid the need for a forward declaration. --- gdb/parse.c | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/gdb/parse.c b/gdb/parse.c index a84b4b64fdb..e4678e9c6e8 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -72,12 +72,6 @@ show_parserdebug (struct ui_file *file, int from_tty, } -static expression_up parse_exp_in_context - (const char **, CORE_ADDR, - const struct block *, int, - bool, innermost_block_tracker *, - std::unique_ptr *); - /* Documented at it's declaration. */ void @@ -328,24 +322,6 @@ copy_name (struct stoken token) } -/* Read an expression from the string *STRINGPTR points to, - parse it, and return a pointer to a struct expression that we malloc. - Use block BLOCK as the lexical context for variable names; - if BLOCK is zero, use the block of the selected stack frame. - Meanwhile, advance *STRINGPTR to point after the expression, - at the first nonwhite character that is not part of the expression - (possibly a null character). - - If COMMA is nonzero, stop if a comma is reached. */ - -expression_up -parse_exp_1 (const char **stringptr, CORE_ADDR pc, const struct block *block, - int comma, innermost_block_tracker *tracker) -{ - return parse_exp_in_context (stringptr, pc, block, comma, false, - tracker, nullptr); -} - /* As for parse_exp_1, except that if VOID_CONTEXT_P, then no value is expected from the expression. */ @@ -453,6 +429,24 @@ parse_exp_in_context (const char **stringptr, CORE_ADDR pc, return result; } +/* Read an expression from the string *STRINGPTR points to, + parse it, and return a pointer to a struct expression that we malloc. + Use block BLOCK as the lexical context for variable names; + if BLOCK is zero, use the block of the selected stack frame. + Meanwhile, advance *STRINGPTR to point after the expression, + at the first nonwhite character that is not part of the expression + (possibly a null character). + + If COMMA is nonzero, stop if a comma is reached. */ + +expression_up +parse_exp_1 (const char **stringptr, CORE_ADDR pc, const struct block *block, + int comma, innermost_block_tracker *tracker) +{ + return parse_exp_in_context (stringptr, pc, block, comma, false, + tracker, nullptr); +} + /* Parse STRING as an expression, and complain if this fails to use up all of the contents of STRING. TRACKER, if non-null, will be updated by the parser. VOID_CONTEXT_P should be true to indicate -- 2.30.2