]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Refine types for an accessibility-checking routine
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 1 Feb 2023 20:47:32 +0000 (21:47 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 26 May 2023 07:29:15 +0000 (09:29 +0200)
Code cleanup related to work on expression functions for GNATprove
(which require accessibility checks even when they are not expanded
and thus have no explicit return statements).

gcc/ada/

* accessibility.adb
(Is_Formal_Of_Current_Function): This routine expects an entity
reference and not the entity itself, so its parameter is a Node_Id
and not an Entity_Id.

gcc/ada/accessibility.adb

index c65c26d8875662699e1d29cf75350cd1b2c1f794..bc897d1ef18c2efdec094923c9ca2bc1ead41cfa 100644 (file)
@@ -1153,7 +1153,7 @@ package body Accessibility is
       --  Obtain the first selector or choice from a given association
 
       function Is_Formal_Of_Current_Function
-        (Assoc_Expr : Entity_Id) return Boolean;
+        (Assoc_Expr : Node_Id) return Boolean;
       --  Predicate to test if a given expression associated with a
       --  discriminant is a formal parameter to the function in which the
       --  return construct we checking applies to.
@@ -1180,7 +1180,7 @@ package body Accessibility is
       -----------------------------------
 
       function Is_Formal_Of_Current_Function
-        (Assoc_Expr : Entity_Id) return Boolean is
+        (Assoc_Expr : Node_Id) return Boolean is
       begin
          return Is_Entity_Name (Assoc_Expr)
                   and then Enclosing_Subprogram