aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-04-28 07:56:48 -0600
committerTom Tromey <tromey@adacore.com>2023-05-23 13:57:53 -0600
commit98d630e910c73d163a071753bfc3b9c106cd3715 (patch)
tree6bce01c6e314878a815c615f7dd37239ecede309
parenta0b70d996c326eb754bd9ed202b24921ca0b42b9 (diff)
downloadbinutils-98d630e910c73d163a071753bfc3b9c106cd3715.zip
binutils-98d630e910c73d163a071753bfc3b9c106cd3715.tar.gz
binutils-98d630e910c73d163a071753bfc3b9c106cd3715.tar.bz2
Avoid forward declaration in parse.c
This minorly rearranges parse.c to avoid the need for a forward declaration.
-rw-r--r--gdb/parse.c42
1 files changed, 18 insertions, 24 deletions
diff --git a/gdb/parse.c b/gdb/parse.c
index a84b4b6..e4678e9 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