From a1447c2a842b4954ed57d0b17f43959003dedd01 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Fri, 3 Apr 2020 17:23:03 +0200 Subject: [PATCH] [Ada] Reuse Is_Object where possible 2020-06-16 Piotr Trojanek 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 | 2 +- gcc/ada/exp_spark.adb | 2 +- gcc/ada/exp_util.adb | 2 +- gcc/ada/sem_eval.adb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb index 4b664316ace..cf3ba2049c3 100644 --- a/gcc/ada/einfo.adb +++ b/gcc/ada/einfo.adb @@ -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; diff --git a/gcc/ada/exp_spark.adb b/gcc/ada/exp_spark.adb index b8b303c1f3a..207bb06d4ac 100644 --- a/gcc/ada/exp_spark.adb +++ b/gcc/ada/exp_spark.adb @@ -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 diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index d48db565b07..537f0fc2490 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -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; diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb index 74eebb80e58..077e59d099f 100644 --- a/gcc/ada/sem_eval.adb +++ b/gcc/ada/sem_eval.adb @@ -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; -- 2.30.2