diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2023-10-13 10:40:12 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-11-07 10:15:03 +0100 |
commit | afb52e6e41383d778c10ea086366980004ed5d6c (patch) | |
tree | f661845d847869c3deb8735e89d8e5aca79a8385 /gcc/ada/sem_ch3.adb | |
parent | f9e0e67b260f55fc05c7ffe01217561ac3f2aef4 (diff) | |
download | gcc-afb52e6e41383d778c10ea086366980004ed5d6c.zip gcc-afb52e6e41383d778c10ea086366980004ed5d6c.tar.gz gcc-afb52e6e41383d778c10ea086366980004ed5d6c.tar.bz2 |
ada: Cleanup more "not Present"
We had a GNATcheck rule that suggests replacing "not Present (...)" with
"No (...)", but it only detected calls with a parameter of type Node_Id.
Now this rules also detects parameters of type Elist_Id.
gcc/ada/
* sem_ch3.adb, sem_ch4.adb, sem_eval.adb: Fix newly detected
violations.
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r-- | gcc/ada/sem_ch3.adb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index e92b46f..c1113e4 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -3385,7 +3385,7 @@ package body Sem_Ch3 is -- case we bypass this. if Ekind (T) /= E_Void then - if not Present (Direct_Primitive_Operations (T)) then + if No (Direct_Primitive_Operations (T)) then if Etype (T) = T then Set_Direct_Primitive_Operations (T, New_Elmt_List); @@ -3397,8 +3397,7 @@ package body Sem_Ch3 is elsif Etype (T) = Base_Type (T) then - if not Present (Direct_Primitive_Operations (Base_Type (T))) - then + if No (Direct_Primitive_Operations (Base_Type (T))) then Set_Direct_Primitive_Operations (Base_Type (T), New_Elmt_List); end if; @@ -3416,7 +3415,7 @@ package body Sem_Ch3 is -- If T already has a Direct_Primitive_Operations list but its -- base type doesn't then set the base type's list to T's list. - elsif not Present (Direct_Primitive_Operations (Base_Type (T))) then + elsif No (Direct_Primitive_Operations (Base_Type (T))) then Set_Direct_Primitive_Operations (Base_Type (T), Direct_Primitive_Operations (T)); end if; @@ -10345,7 +10344,7 @@ package body Sem_Ch3 is -- If not already set, initialize the derived type's list of primitive -- operations to an empty element list. - if not Present (Direct_Primitive_Operations (Derived_Type)) then + if No (Direct_Primitive_Operations (Derived_Type)) then Set_Direct_Primitive_Operations (Derived_Type, New_Elmt_List); -- If Etype of the derived type is the base type (as opposed to @@ -10355,8 +10354,7 @@ package body Sem_Ch3 is -- between the two. if Etype (Derived_Type) = Base_Type (Derived_Type) - and then - not Present (Direct_Primitive_Operations (Etype (Derived_Type))) + and then No (Direct_Primitive_Operations (Etype (Derived_Type))) then Set_Direct_Primitive_Operations (Etype (Derived_Type), |