]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Simplify code for private types with unknown discriminants
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 5 Mar 2024 12:06:18 +0000 (13:06 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 17 May 2024 08:21:00 +0000 (10:21 +0200)
commit8e4069566e5ce4f2d936635187fd90c300e475e9
tree66a7f4c9e77da2f21516614be504f9d72dd04778
parent4b5eeb74a20028e493b520887cc9fd97d6fc0f3d
ada: Simplify code for private types with unknown discriminants

Private type entities have Is_Constrained set when they have no
discriminants and no unknown discriminants; it is now set slightly
later, but simpler (this change could only affect Process_Discriminants,
but this flag should not be needed there).

Also, we now reuse this flag to detect private types with discriminants.

Code cleanup; behavior is unaffected.

gcc/ada/

* sem_ch7.adb (New_Private_Type): Simplify setting of
Is_Constrained flag.
* sem_prag.adb (Is_Unconstrained_Or_Tagged_Item): Simplify
detection of private types with no discriminant.
gcc/ada/sem_ch7.adb
gcc/ada/sem_prag.adb