Commit 38d0d6c8 by Hristian Kirtchev Committed by Arnaud Charlet

sem_ch3.adb (Build_Derived_Record_Type): Remove the propagation of all…

sem_ch3.adb (Build_Derived_Record_Type): Remove the propagation of all attributes related to pragma...

2014-10-17  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_ch3.adb (Build_Derived_Record_Type): Remove the propagation
	of all attributes related to pragma Default_Initial_Condition.
	(Build_Derived_Type): Propagation of all attributes related
	to pragma Default_Initial_Condition.
	(Process_Full_View): Account for the case where the full view derives
	from another private type and propagate the attributes related
	to pragma Default_Initial_Condition to the private view.
	(Propagate_Default_Init_Cond_Attributes): New routine.
	* sem_util.adb: Alphabetize various routines.
	(Build_Default_Init_Cond_Call): Use an unchecked type conversion
	when calling the default initial condition procedure of a private type.
	(Build_Default_Init_Cond_Procedure_Declaration): Prevent
	the generation of multiple default initial condition procedures.

From-SVN: r216370
parent 2211a35f
2014-10-17 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch3.adb (Build_Derived_Record_Type): Remove the propagation
of all attributes related to pragma Default_Initial_Condition.
(Build_Derived_Type): Propagation of all attributes related
to pragma Default_Initial_Condition.
(Process_Full_View): Account for the case where the full view derives
from another private type and propagate the attributes related
to pragma Default_Initial_Condition to the private view.
(Propagate_Default_Init_Cond_Attributes): New routine.
* sem_util.adb: Alphabetize various routines.
(Build_Default_Init_Cond_Call): Use an unchecked type conversion
when calling the default initial condition procedure of a private type.
(Build_Default_Init_Cond_Procedure_Declaration): Prevent
the generation of multiple default initial condition procedures.
2014-10-17 Robert Dewar <dewar@adacore.com>
* prj-conf.adb: Revert previous change.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1247,7 +1247,7 @@ package body Sem_Util is
Make_Procedure_Call_Statement (Loc,
Name => New_Occurrence_Of (Proc_Id, Loc),
Parameter_Associations => New_List (
Make_Type_Conversion (Loc,
Make_Unchecked_Type_Conversion (Loc,
Subtype_Mark => New_Occurrence_Of (Formal_Typ, Loc),
Expression => New_Occurrence_Of (Obj_Id, Loc))));
end Build_Default_Init_Cond_Call;
......@@ -1442,6 +1442,13 @@ package body Sem_Util is
pragma Assert (Has_Default_Init_Cond (Typ));
pragma Assert (Present (Prag));
-- Nothing to do if the default initial condition procedure was already
-- built.
if Present (Default_Init_Cond_Procedure (Typ)) then
return;
end if;
Proc_Id :=
Make_Defining_Identifier (Loc,
Chars => New_External_Name (Chars (Typ), "Default_Init_Cond"));
......
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