From 8e13160b101177b4d0783934d39aab2e2c7b50d9 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Mon, 10 Jan 2022 14:21:17 +0100 Subject: [Ada] Remove doubly-negated tests for empty lists Replace "not Is_Non_Empty_List (...)" with "Is_Empty_List (...)". Code cleanup; semantics is unaffected. gcc/ada/ * exp_ch5.adb (Update_Choice_Index): Simplify condition. * sem_ch8.adb (Attribute_Renaming): Likewise. --- gcc/ada/exp_ch5.adb | 3 +-- gcc/ada/sem_ch8.adb | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'gcc') diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index b38e3f5..b78c127 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -3563,8 +3563,7 @@ package body Exp_Ch5 is -- is ok here. -- pragma Assert - (not Is_Non_Empty_List - (Component_Associations (Pattern))); + (Is_Empty_List (Component_Associations (Pattern))); declare Agg_Length : constant Node_Id := diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index e575602..c40e124 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -4532,7 +4532,7 @@ package body Sem_Ch8 is -- have at least one formal parameter, with the exceptions of the GNAT -- attribute 'Img, which GNAT treats as renameable. - if not Is_Non_Empty_List (Parameter_Specifications (Spec)) then + if Is_Empty_List (Parameter_Specifications (Spec)) then if Aname /= Name_Img then Error_Msg_N ("subprogram renaming an attribute must have formals", N); -- cgit v1.1