[01/11] Avoid forward declaration in parse.c

Message ID 20230504-frameless-v1-1-4191201740b0@adacore.com
State New
Headers
Series Fix frame-less expression evaluation in DAP |

Commit Message

Tom Tromey May 4, 2023, 2:21 p.m. UTC
  This minorly rearranges parse.c to avoid the need for a forward
declaration.
---
 gdb/parse.c | 42 ++++++++++++++++++------------------------
 1 file changed, 18 insertions(+), 24 deletions(-)
  

Patch

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<expr_completion_base> *);
-
 /* 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