[Ada] Reuse Is_Access_Object_Type where possible
authorPiotr Trojanek <trojanek@adacore.com>
Thu, 22 Oct 2020 11:19:52 +0000 (13:19 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 26 Nov 2020 08:39:43 +0000 (03:39 -0500)
gcc/ada/

* exp_ch7.adb, exp_util.adb, freeze.adb: Rewrite with
Is_Access_Object_Type.

gcc/ada/exp_ch7.adb
gcc/ada/exp_util.adb
gcc/ada/freeze.adb

index 411df73328ee4639008d44b6980dd3e5e35eb14e..55f714c0853fa8650bfecb834aa73426e42579a1 100644 (file)
@@ -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))
index b595de025f5ad1338ffcb9aaef46557b46f4b3ee..5d581108d681a79aff01623cc93a09120435c649 100644 (file)
@@ -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)))
index 24f6c93c06dedc9c2eff6f47208c127b82adc82d..19f43852fe39479e7846bc758cc4cf766275aa8f 100644 (file)
@@ -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