From: Piotr Trojanek Date: Thu, 16 Jan 2020 17:56:38 +0000 (+0100) Subject: [Ada] Use Is_Incomplete_Type instead of a low-level Ekind test X-Git-Tag: upstream/12.2.0~15966 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2db2527a8dc7e2d2da8893a339ec863b72079bb4;p=platform%2Fupstream%2Fgcc.git [Ada] Use Is_Incomplete_Type instead of a low-level Ekind test 2020-06-05 Piotr Trojanek gcc/ada/ * exp_ch3.adb, sem_ch8.adb, sem_util.adb: Use Is_Incomplete_Type to make the code easier to read. --- diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 8d1b2e1..1b1448c 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -5524,7 +5524,7 @@ package body Exp_Ch3 is -- limited-with'ed package, we need to use the nonlimited view in -- case it has tasks. - if Ekind (Desig_Typ) in Incomplete_Kind + if Is_Incomplete_Type (Desig_Typ) and then Present (Non_Limited_View (Desig_Typ)) then Desig_Typ := Non_Limited_View (Desig_Typ); diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 41e2850..36c9520 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -8021,7 +8021,7 @@ package body Sem_Ch8 is -- limited-with clauses if From_Limited_With (T_Name) - and then Ekind (T_Name) in Incomplete_Kind + and then Is_Incomplete_Type (T_Name) and then Present (Non_Limited_View (T_Name)) and then Is_Interface (Non_Limited_View (T_Name)) then diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 788704a..16a6044 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -13126,7 +13126,7 @@ package body Sem_Util is Ent : Entity_Id := First_Entity (Limited_View (Scope (Typ))); begin while Present (Ent) loop - if Ekind (Ent) in Incomplete_Kind + if Is_Incomplete_Type (Ent) and then Non_Limited_View (Ent) = Typ then return Ent;