[Ada] Reuse Is_Object where possible
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 3 Apr 2020 15:23:03 +0000 (17:23 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 16 Jun 2020 13:07:17 +0000 (09:07 -0400)
2020-06-16  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* einfo.adb, exp_spark.adb, exp_util.adb, sem_eval.adb: Replace
"Ekind ... in Object_Kind" with "Is_Object (...)".

gcc/ada/einfo.adb
gcc/ada/exp_spark.adb
gcc/ada/exp_util.adb
gcc/ada/sem_eval.adb

index 4b66431..cf3ba20 100644 (file)
@@ -997,7 +997,7 @@ package body Einfo is
 
    function Current_Value (Id : E) return N is
    begin
-      pragma Assert (Ekind (Id) in Object_Kind);
+      pragma Assert (Is_Object (Id));
       return Node9 (Id);
    end Current_Value;
 
index b8b303c..207bb06 100644 (file)
@@ -434,7 +434,7 @@ package body Exp_SPARK is
    begin
       --  Replace a reference to a renaming with the actual renamed object
 
-      if Ekind (Obj_Id) in Object_Kind then
+      if Is_Object (Obj_Id) then
          Ren := Renamed_Object (Obj_Id);
 
          if Present (Ren) then
index d48db56..537f0fc 100644 (file)
@@ -6396,7 +6396,7 @@ package body Exp_Util is
 
       --  Immediate return, nothing doing, if this is not an object
 
-      if Ekind (Ent) not in Object_Kind then
+      if not Is_Object (Ent) then
          return;
       end if;
 
index 74eebb8..077e59d 100644 (file)
@@ -1001,7 +1001,7 @@ package body Sem_Eval is
                     (Is_Known_Valid (Entity (Opnd))
                       or else Ekind (Entity (Opnd)) = E_In_Parameter
                       or else
-                        (Ekind (Entity (Opnd)) in Object_Kind
+                        (Is_Object (Entity (Opnd))
                           and then Present (Current_Value (Entity (Opnd))))))
            or else Is_OK_Static_Expression (Opnd);
       end Is_Known_Valid_Operand;