aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_util.ads
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-09-25 10:43:27 +0200
committerMarc Poulhiès <poulhies@adacore.com>2022-11-07 09:36:32 +0100
commit8f077c4d05876bf952c86131e477d21dc5d4492b (patch)
treea0a1ff0b0855c48d0e44929b186cd3e4fc452dcf /gcc/ada/sem_util.ads
parentf073f3355643587073ce224563f509332043c381 (diff)
downloadgcc-8f077c4d05876bf952c86131e477d21dc5d4492b.zip
gcc-8f077c4d05876bf952c86131e477d21dc5d4492b.tar.gz
gcc-8f077c4d05876bf952c86131e477d21dc5d4492b.tar.bz2
ada: Allow reuse of Enclosing_Declaration_Or_Statement by GNATprove
Move routine Enclosing_Declaration_Or_Statement from body of Sem_Res to spec of Sem_Util, so it can be reused. In particular, GNATprove needs this functionality to climb from an arbitrary subexpression with target_name (@) to the enclosing assignment statement. Behaviour of the compiler is unaffected. gcc/ada/ * sem_res.adb (Enclosing_Declaration_Or_Statement): Moved to Sem_Util. * sem_util.ads (Enclosing_Declaration_Or_Statement): Moved from Sem_Res. * sem_util.adb (Enclosing_Declaration_Or_Statement): Likewise.
Diffstat (limited to 'gcc/ada/sem_util.ads')
-rw-r--r--gcc/ada/sem_util.ads4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
index 88bfbfc..5c08cb8 100644
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -809,6 +809,10 @@ package Sem_Util is
-- Returns the declaration node enclosing N (including possibly N itself),
-- if any, or Empty otherwise.
+ function Enclosing_Declaration_Or_Statement (N : Node_Id) return Node_Id;
+ -- Return the nearest enclosing declaration or statement that houses
+ -- arbitrary node N.
+
function Enclosing_Generic_Body (N : Node_Id) return Node_Id;
-- Returns the Node_Id associated with the innermost enclosing generic
-- body, if any. If none, then returns Empty.