Simplify calls to Is_Access_Type followed by Is_Access_Subprogram_Type
with Is_Access_Object_Type, which does exactly the same.

Cleanup related to support for access-to-subprogram in flow analysis of
GNATprove; semantics unaffected.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

        * exp_ch7.adb, exp_util.adb, freeze.adb: Rewrite with
        Is_Access_Object_Type.
diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb
--- a/gcc/ada/exp_ch7.adb
+++ b/gcc/ada/exp_ch7.adb
@@ -2416,8 +2416,7 @@ package body Exp_Ch7 is
                if Is_Ignored_Ghost_Entity (Typ) then
                   null;
 
-               elsif (Is_Access_Type (Typ)
-                        and then not Is_Access_Subprogram_Type (Typ)
+               elsif (Is_Access_Object_Type (Typ)
                         and then Needs_Finalization
                                    (Available_View (Designated_Type (Typ))))
                       or else (Is_Type (Typ) and then Needs_Finalization (Typ))


diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -12401,8 +12401,7 @@ package body Exp_Util is
             if Is_Ignored_Ghost_Entity (Typ) then
                null;
 
-            elsif ((Is_Access_Type (Typ)
-                      and then not Is_Access_Subprogram_Type (Typ)
+            elsif ((Is_Access_Object_Type (Typ)
                       and then Needs_Finalization
                                  (Available_View (Designated_Type (Typ))))
                     or else (Is_Type (Typ) and then Needs_Finalization (Typ)))


diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -6391,8 +6391,7 @@ package body Freeze is
          --  to subprogram and to internal types generated for 'Access
          --  references.
 
-         elsif Is_Access_Type (E)
-           and then not Is_Access_Subprogram_Type (E)
+         elsif Is_Access_Object_Type (E)
            and then Ekind (E) /= E_Access_Attribute_Type
          then
             --  If a pragma Default_Storage_Pool applies, and this type has no


Reply via email to