[Ada] Use Is_Incomplete_Type instead of a low-level Ekind test
authorPiotr Trojanek <trojanek@adacore.com>
Thu, 16 Jan 2020 17:56:38 +0000 (18:56 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 5 Jun 2020 12:17:48 +0000 (08:17 -0400)
2020-06-05  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* exp_ch3.adb, sem_ch8.adb, sem_util.adb: Use Is_Incomplete_Type
to make the code easier to read.

gcc/ada/exp_ch3.adb
gcc/ada/sem_ch8.adb
gcc/ada/sem_util.adb

index 8d1b2e13a727ba56d35182c1160db7d7d95d329b..1b1448c6d388effcd9dc74e61694e3d6602f9fb7 100644 (file)
@@ -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);
index 41e28502088756274539807f6574f2c52686400b..36c952081719fce3f0494d79c6ad721c3d3793ef 100644 (file)
@@ -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
index 788704ae23b35462051c938af6cc9bc75a5957a9..16a60448f9e2cd2e18375f23d04d932a6ddccb76 100644 (file)
@@ -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;