ada: Avoid repeated iteration over private protected components
authorPiotr Trojanek <trojanek@adacore.com>
Thu, 1 Sep 2022 08:19:09 +0000 (10:19 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 4 Nov 2022 13:47:29 +0000 (14:47 +0100)
commit5f780a2d02d0b7c92a75ce1f749ffcc15b90fa32
tree4f343220baceab180386719954b7f3fbf0cd5e89
parentcb3c260460073bed267fae3ee970947a24858211
ada: Avoid repeated iteration over private protected components

The First_Entity/Next_Entity chain includes private entities, so there
it no need to iterate starting both from First_Entity and
First_Private_Entity.

Code cleanup related to improved detection of references to
uninitialized objects; behavior is unaffected.

gcc/ada/

* sem_util.adb
(Check_Components): Iterate using
First/Next_Component_Or_Discriminant.
(Has_Preelaborable_Initialization): Avoid repeated iteration with
calls to Check_Components with First_Entity and
First_Private_Entity.
(Is_Independent_Object_Entity): Tune indentation.
gcc/ada/sem_util.adb