aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2021-07-01 11:15:41 -0600
committerTom Tromey <tromey@adacore.com>2021-08-02 10:11:22 -0600
commit8b12db26d161d526953ab04ad92d598fd148d0bf (patch)
treeee45b36636816b1bc09518ca86d9fa16291fe15d /gdb/ada-lang.c
parentcd4583499fda437680e974b2729a2873a08f656b (diff)
downloadgdb-8b12db26d161d526953ab04ad92d598fd148d0bf.zip
gdb-8b12db26d161d526953ab04ad92d598fd148d0bf.tar.gz
gdb-8b12db26d161d526953ab04ad92d598fd148d0bf.tar.bz2
Refactor Ada resolution
In a subsequent patch, it will be convenient if an Ada expression operation can supply its own replacement object. This patch refactors Ada expression resolution to make this possible.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index f45384a..a435543 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -10097,6 +10097,23 @@ ada_binop_exp (struct type *expect_type,
namespace expr
{
+/* See ada-exp.h. */
+
+operation_up
+ada_resolvable::replace (operation_up &&owner,
+ struct expression *exp,
+ bool deprocedure_p,
+ bool parse_completion,
+ innermost_block_tracker *tracker,
+ struct type *context_type)
+{
+ if (resolve (exp, deprocedure_p, parse_completion, tracker, context_type))
+ return (make_operation<ada_funcall_operation>
+ (std::move (owner),
+ std::vector<operation_up> ()));
+ return std::move (owner);
+}
+
value *
ada_wrapped_operation::evaluate (struct type *expect_type,
struct expression *exp,