From 5af3a22afe8f26c15b7ba798b6c16027baac8b8d Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Thu, 22 Oct 2020 13:19:52 +0200 Subject: [PATCH] [Ada] Reuse Is_Access_Object_Type where possible gcc/ada/ * exp_ch7.adb, exp_util.adb, freeze.adb: Rewrite with Is_Access_Object_Type. --- gcc/ada/exp_ch7.adb | 3 +-- gcc/ada/exp_util.adb | 3 +-- gcc/ada/freeze.adb | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 411df73328e..55f714c0853 100644 --- 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 index b595de025f5..5d581108d68 100644 --- 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 index 24f6c93c06d..19f43852fe3 100644 --- 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 -- 2.30.2