diff options
author | Bob Duff <duff@adacore.com> | 2021-05-19 11:37:47 -0400 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-07-07 16:23:15 +0000 |
commit | a547eea2669af282dfca4f3c38362f109b285308 (patch) | |
tree | 5cc8c1078625afb15eaebc43737cdb63f4c7bfee /gcc/ada/sem_ch13.ads | |
parent | 2d71668e64c4b20aec823dbe5a1feb6338d527a2 (diff) | |
download | gcc-a547eea2669af282dfca4f3c38362f109b285308.zip gcc-a547eea2669af282dfca4f3c38362f109b285308.tar.gz gcc-a547eea2669af282dfca4f3c38362f109b285308.tar.bz2 |
[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.
Diffstat (limited to 'gcc/ada/sem_ch13.ads')
-rw-r--r-- | gcc/ada/sem_ch13.ads | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gcc/ada/sem_ch13.ads b/gcc/ada/sem_ch13.ads index 7579812..3b21484 100644 --- a/gcc/ada/sem_ch13.ads +++ b/gcc/ada/sem_ch13.ads @@ -115,17 +115,17 @@ package Sem_Ch13 is Siz : Uint; Biased : out Boolean); -- Called when size Siz is specified for subtype T. This subprogram checks - -- that the size is appropriate, posting errors on node N as required. - -- This check is effective for elementary types and bit-packed arrays. - -- For other non-elementary types, a check is only made if an explicit - -- size has been given for the type (and the specified size must match). - -- The parameter Biased is set False if the size specified did not require - -- the use of biased representation, and True if biased representation - -- was required to meet the size requirement. Note that Biased is only - -- set if the type is not currently biased, but biasing it is the only - -- way to meet the requirement. If the type is currently biased, then - -- this biased size is used in the initial check, and Biased is False. - -- For a Component_Size clause, T is the component type. + -- that the size is appropriate, posting errors on node N as required. This + -- check is effective for elementary types and bit-packed arrays. For + -- composite types, a check is only made if an explicit size has been given + -- for the type (and the specified size must match). The parameter Biased + -- is set False if the size specified did not require the use of biased + -- representation, and True if biased representation was required to meet + -- the size requirement. Note that Biased is only set if the type is not + -- currently biased, but biasing it is the only way to meet the + -- requirement. If the type is currently biased, then this biased size is + -- used in the initial check, and Biased is False. For a Component_Size + -- clause, T is the component type. function Has_Compatible_Representation (Target_Type, Operand_Type : Entity_Id) return Boolean; |