[Ada] Fix bugs in Value_Size clauses and refactor
authorBob Duff <duff@adacore.com>
Wed, 19 May 2021 15:37:47 +0000 (11:37 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 7 Jul 2021 16:23:15 +0000 (16:23 +0000)
commita547eea2669af282dfca4f3c38362f109b285308
tree5cc8c1078625afb15eaebc43737cdb63f4c7bfee
parent2d71668e64c4b20aec823dbe5a1feb6338d527a2
[Ada] Fix bugs in Value_Size clauses and refactor

gcc/ada/

* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Combine
processing of Size and Value_Size clauses. Ensure that
Value_Size is treated the same as Size, in the cases where both
are allowed (i.e. the prefix denotes a first subtype).  Misc
cleanup.
* einfo-utils.adb (Init_Size): Add assertions.
(Size_Clause): Return a Value_Size clause if present, instead of
just looking for a Size clause.
* einfo.ads (Has_Size_Clause, Size_Clause): Change documentation
to include Value_Size.
* sem_ch13.ads, layout.ads, layout.adb: Comment modifications.
gcc/ada/einfo-utils.adb
gcc/ada/einfo.ads
gcc/ada/layout.adb
gcc/ada/layout.ads
gcc/ada/sem_ch13.adb
gcc/ada/sem_ch13.ads