summaryrefslogtreecommitdiff
path: root/gdb/ada-exp.h
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.h
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.h')
-rw-r--r--gdb/ada-exp.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/ada-exp.h b/gdb/ada-exp.h
index 598dc7072ad..e600ec224e5 100644
--- a/gdb/ada-exp.h
+++ b/gdb/ada-exp.h
@@ -95,6 +95,24 @@ struct ada_resolvable
bool parse_completion,
innermost_block_tracker *tracker,
struct type *context_type) = 0;
+
+ /* Possibly replace this object with some other expression object.
+ This is like 'resolve', but can return a replacement.
+
+ The default implementation calls 'resolve' and wraps this object
+ in a function call if that call returns true. OWNER is a
+ reference to the unique pointer that owns the 'this'; it can be
+ 'move'd from to construct the replacement.
+
+ This should either return a new object, or OWNER -- never
+ nullptr. */
+
+ virtual operation_up replace (operation_up &&owner,
+ struct expression *exp,
+ bool deprocedure_p,
+ bool parse_completion,
+ innermost_block_tracker *tracker,
+ struct type *context_type);
};
/* In Ada, some generic operations must be wrapped with a handler that