diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2024-01-31 15:32:22 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2024-05-13 10:03:33 +0200 |
commit | c1ece0ca7d31f191c97ff0bdc72e0f0416e72774 (patch) | |
tree | fe131d002887eb621e930dd226533e75d84175f7 /gcc/ada/contracts.adb | |
parent | b3eef3b124d1eee9cd261fb072d6e1667cd2501a (diff) | |
download | gcc-c1ece0ca7d31f191c97ff0bdc72e0f0416e72774.zip gcc-c1ece0ca7d31f191c97ff0bdc72e0f0416e72774.tar.gz gcc-c1ece0ca7d31f191c97ff0bdc72e0f0416e72774.tar.bz2 |
ada: Remove guards against traversal of empty list of aspects
When iterating over Aspect_Specifications, we can use First/Next
directly even if the Aspect_Specifications returns a No_List or
the list has no items.
Code cleanup.
gcc/ada/
* aspects.adb (Copy_Aspects): Style fix.
* contracts.adb (Analyze_Contracts): Style fix.
(Save_Global_References_In_Contract): Remove extra guards.
* par_sco.adb (Traverse_Aspects): Move guard to the caller and
make it consistent with Save_Global_References_In_Contract.
* sem_ch12.adb (Has_Contracts): Remove extra guards.
* sem_ch3.adb (Delayed_Aspect_Present, Get_Partial_View_Aspect,
Check_Duplicate_Aspects): Likewise.
* sem_disp.adb (Check_Dispatching_Operation): Likewise.
Diffstat (limited to 'gcc/ada/contracts.adb')
-rw-r--r-- | gcc/ada/contracts.adb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb index 97f3873..810b360 100644 --- a/gcc/ada/contracts.adb +++ b/gcc/ada/contracts.adb @@ -512,7 +512,6 @@ package body Contracts is if Present (It) then Validate_Iterable_Aspect (E, It); end if; - if Present (I_Lit) then Validate_Literal_Aspect (E, I_Lit); end if; @@ -4980,9 +4979,7 @@ package body Contracts is Push_Scope (Gen_Id); - if Permits_Aspect_Specifications (Templ) - and then Has_Aspects (Templ) - then + if Permits_Aspect_Specifications (Templ) then Save_Global_References_In_Aspects (Templ); end if; |