summaryrefslogtreecommitdiff
path: root/gdb/ada-exp.y
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-exp.y
parentcd4583499fda437680e974b2729a2873a08f656b (diff)
downloadbinutils-gdb-8b12db26d161d526953ab04ad92d598fd148d0bf.tar.gz
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-exp.y')
-rw-r--r--gdb/ada-exp.y17
1 files changed, 7 insertions, 10 deletions
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index 5b6aca91153..afa085ec50f 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -119,16 +119,13 @@ resolve (operation_up &&op, bool deprocedure_p, struct type *context_type)
{
operation_up result = std::move (op);
ada_resolvable *res = dynamic_cast<ada_resolvable *> (result.get ());
- if (res != nullptr
- && res->resolve (pstate->expout.get (),
- deprocedure_p,
- pstate->parse_completion,
- pstate->block_tracker,
- context_type))
- result
- = make_operation<ada_funcall_operation> (std::move (result),
- std::vector<operation_up> ());
-
+ if (res != nullptr)
+ return res->replace (std::move (result),
+ pstate->expout.get (),
+ deprocedure_p,
+ pstate->parse_completion,
+ pstate->block_tracker,
+ context_type);
return result;
}