]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Remove guards against traversal of empty list of aspects
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 31 Jan 2024 14:32:22 +0000 (15:32 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 13 May 2024 08:03:33 +0000 (10:03 +0200)
commitc1ece0ca7d31f191c97ff0bdc72e0f0416e72774
treefe131d002887eb621e930dd226533e75d84175f7
parentb3eef3b124d1eee9cd261fb072d6e1667cd2501a
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.
gcc/ada/aspects.adb
gcc/ada/contracts.adb
gcc/ada/par_sco.adb
gcc/ada/sem_ch12.adb
gcc/ada/sem_ch3.adb
gcc/ada/sem_disp.adb