[multiple changes]
2009-06-22 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Check_Overriding_Indicator): Clean up code, make warning unconditional rather than a style check, because a formal name out of order is suspicious. 2009-06-22 Vincent Celier <celier@adacore.com> * prj-nmsc.adb (Locate_Directory): Indicate the project name when creating a directory automatically. 2009-06-22 Eric Botcazou <ebotcazou@adacore.com> * sem_ch3.adb (Create_Constrained_Components): For a subtype of an untagged derived type, add a hidden component for every constrained discriminant of the parent type to keep record layout consistent. From-SVN: r148792
This commit is contained in:
parent
7cea01df51
commit
c9e7bd8efb
@ -1,3 +1,20 @@
|
||||
2009-06-22 Ed Schonberg <schonberg@adacore.com>
|
||||
|
||||
* sem_ch6.adb (Check_Overriding_Indicator): Clean up code, make warning
|
||||
unconditional rather than a style check, because a formal name out of
|
||||
order is suspicious.
|
||||
|
||||
2009-06-22 Vincent Celier <celier@adacore.com>
|
||||
|
||||
* prj-nmsc.adb (Locate_Directory): Indicate the project name when
|
||||
creating a directory automatically.
|
||||
|
||||
2009-06-22 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* sem_ch3.adb (Create_Constrained_Components): For a subtype of an
|
||||
untagged derived type, add a hidden component for every constrained
|
||||
discriminant of the parent type to keep record layout consistent.
|
||||
|
||||
2009-06-22 Thomas Quinot <quinot@adacore.com>
|
||||
|
||||
* exp_ch3.adb: Minor code reorganization (avoid an unnecessary tree
|
||||
|
@ -6551,7 +6551,8 @@ package body Prj.Nmsc is
|
||||
Write_Str (Create);
|
||||
Write_Str (" directory """);
|
||||
Write_Str (Full_Path_Name.all);
|
||||
Write_Line (""" created");
|
||||
Write_Str (""" created for project ");
|
||||
Write_Line (Get_Name_String (Project.Name));
|
||||
end if;
|
||||
|
||||
exception
|
||||
|
@ -11246,9 +11246,9 @@ package body Sem_Ch3 is
|
||||
and then Is_Completely_Hidden (Old_Compon)
|
||||
then
|
||||
-- This is a shadow discriminant created for a discriminant of
|
||||
-- the parent type that is one of several renamed by the same
|
||||
-- new discriminant. Give the shadow discriminant an internal
|
||||
-- name that cannot conflict with that of visible components.
|
||||
-- the parent type, which needs to be present in the subtype.
|
||||
-- Give the shadow discriminant an internal name that cannot
|
||||
-- conflict with that of visible components.
|
||||
|
||||
Set_Chars (New_Compon, New_Internal_Name ('C'));
|
||||
end if;
|
||||
@ -11351,10 +11351,11 @@ package body Sem_Ch3 is
|
||||
|
||||
-- For an untagged derived subtype, the number of discriminants may
|
||||
-- be smaller than the number of inherited discriminants, because
|
||||
-- several of them may be renamed by a single new discriminant.
|
||||
-- In this case, add the hidden discriminants back into the subtype,
|
||||
-- because otherwise the size of the subtype is computed incorrectly
|
||||
-- in GCC 4.1.
|
||||
-- several of them may be renamed by a single new discriminant or
|
||||
-- constrained. In this case, add the hidden discriminants back into
|
||||
-- the subtype, because they need to be present if the optimizer of
|
||||
-- the GCC 4.x back-end decides to break apart assignments between
|
||||
-- objects using the parent view into member-wise assignments.
|
||||
|
||||
Num_Gird := 0;
|
||||
|
||||
@ -11401,8 +11402,15 @@ package body Sem_Ch3 is
|
||||
-- component for the current old discriminant.
|
||||
|
||||
New_C := Create_Component (Old_Discr);
|
||||
Set_Original_Record_Component (New_C, Old_Discr);
|
||||
Set_Original_Record_Component (New_C, Old_Discr);
|
||||
end if;
|
||||
|
||||
else
|
||||
-- The constraint has eliminated the old discriminant.
|
||||
-- Introduce a shadow component.
|
||||
|
||||
New_C := Create_Component (Old_Discr);
|
||||
Set_Original_Record_Component (New_C, Old_Discr);
|
||||
end if;
|
||||
|
||||
Next_Elmt (Constr);
|
||||
|
@ -4381,8 +4381,7 @@ package body Sem_Ch6 is
|
||||
-- often carry names that reflect the type, and it is not worthwhile
|
||||
-- requiring that their names match.
|
||||
|
||||
if Style_Check
|
||||
and then Present (Overridden_Subp)
|
||||
if Present (Overridden_Subp)
|
||||
and then Nkind (Subp) /= N_Defining_Operator_Symbol
|
||||
then
|
||||
declare
|
||||
@ -4393,6 +4392,14 @@ package body Sem_Ch6 is
|
||||
Form1 := First_Formal (Subp);
|
||||
Form2 := First_Formal (Overridden_Subp);
|
||||
|
||||
-- If the overriding operation is a synchronized operation, skip
|
||||
-- the first parameter of the overridden operation, which is
|
||||
-- implicit in the new one.
|
||||
|
||||
if Is_Concurrent_Type (Scope (Subp)) then
|
||||
Form2 := Next_Formal (Form2);
|
||||
end if;
|
||||
|
||||
if Present (Form1) then
|
||||
Form1 := Next_Formal (Form1);
|
||||
Form2 := Next_Formal (Form2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user