Commit 52b70b1b by Thomas Quinot Committed by Arnaud Charlet

sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order): Split original Ada 95 part…

sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order): Split original Ada 95 part off into new subprogram below.

2017-01-23  Thomas Quinot  <quinot@adacore.com>

	* sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order):
	Split original Ada 95 part off into new subprogram
	below. Call that subprogram (instead of proceeding with
	AI95-0133 behaviour) if debug switch -gnatd.p is in use.
	(Adjust_Record_For_Reverse_Bit_Order_Ada_95): ... new subprogram
	* debug.adb Document new switch -gnatd.p
	* freeze.adb (Freeze_Entity.Freeze_Record_Type): Do not adjust
	record for reverse bit order if an error has already been posted
	on the record type.  This avoids generating extraneous "info:"
	messages for illegal code.

From-SVN: r244786
parent 2a02fa98
2017-01-23 Thomas Quinot <quinot@adacore.com>
* sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order):
Split original Ada 95 part off into new subprogram
below. Call that subprogram (instead of proceeding with
AI95-0133 behaviour) if debug switch -gnatd.p is in use.
(Adjust_Record_For_Reverse_Bit_Order_Ada_95): ... new subprogram
* debug.adb Document new switch -gnatd.p
* freeze.adb (Freeze_Entity.Freeze_Record_Type): Do not adjust
record for reverse bit order if an error has already been posted
on the record type. This avoids generating extraneous "info:"
messages for illegal code.
2017-01-23 Justin Squirek <squirek@adacore.com>
* sem_ch3.adb (Analyze_Declarations): Correct comments
......
......@@ -106,7 +106,7 @@ package body Debug is
-- d.m For -gnatl, print full source only for main unit
-- d.n Print source file names
-- d.o Conservative elaboration order for indirect calls
-- d.p
-- d.p Use original Ada 95 semantics for Bit_Order (disable AI95-0133)
-- d.q
-- d.r Enable OK_To_Reorder_Components in non-variant records
-- d.s
......@@ -558,6 +558,10 @@ package body Debug is
-- d.o Conservative elaboration order for indirect calls. This causes
-- P'Access to be treated as a call in more cases.
-- d.p In Ada 95 (or 83) mode, use original Ada 95 behaviour for the
-- interpretation of component clauses crossing byte boundaries when
-- using the non-default bit order (i.e. ignore AI95-0133).
-- d.r Forces the flag OK_To_Reorder_Components to be set in all record
-- base types that have no discriminants.
......
......@@ -4262,10 +4262,14 @@ package body Freeze is
("\??since no component clauses were specified", ADC);
-- Here is where we do the processing to adjust component clauses
-- for reversed bit order, when not using reverse SSO.
-- for reversed bit order, when not using reverse SSO. If an error
-- has been reported on Rec already (such as SSO incompatible with
-- bit order), don't bother adjusting as this may generate extra
-- noise.
elsif Reverse_Bit_Order (Rec)
and then not Reverse_Storage_Order (Rec)
and then not Error_Posted (Rec)
then
Adjust_Record_For_Reverse_Bit_Order (Rec);
......
......@@ -50,8 +50,9 @@ package Sem_Ch13 is
procedure Adjust_Record_For_Reverse_Bit_Order (R : Entity_Id);
-- Called from Freeze where R is a record entity for which reverse bit
-- order is specified and there is at least one component clause. Adjusts
-- component positions according to either Ada 95 or Ada 2005 (AI-133).
-- order is specified and there is at least one component clause. Note:
-- component positions are normally adjusted as per AI95-0133, unless
-- -gnatd.p is used to restore original Ada 95 mode.
procedure Check_Record_Representation_Clause (N : Node_Id);
-- This procedure completes the analysis of a record representation clause
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment