function Gen_Parameters_Profile (E : Entity_Id) return List_Id;
-- Duplicate the parameters profile of the imported C++ constructor
- -- adding an access to the object as an additional parameter.
+ -- adding the "this" pointer to the object as the additional first
+ -- parameter under the usual form _Init : in out Typ.
----------------------------
-- Gen_Parameters_Profile --
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_uInit),
+ In_Present => True,
+ Out_Present => True,
Parameter_Type => New_Occurrence_Of (Typ, Loc)));
if Present (Parameter_Specifications (Parent (E))) then
Found := True;
Loc := Sloc (E);
Parms := Gen_Parameters_Profile (E);
- IP :=
- Make_Defining_Identifier (Loc,
- Chars => Make_Init_Proc_Name (Typ));
+ IP := Make_Defining_Identifier (Loc, Make_Init_Proc_Name (Typ));
-- Case 1: Constructor of untagged type
-- Case 2: Constructor of a tagged type
- -- In this case we generate the IP as a wrapper of the the
- -- C++ constructor because IP must also save copy of the _tag
+ -- In this case we generate the IP routine as a wrapper of the
+ -- C++ constructor because IP must also save a copy of the _tag
-- generated in the C++ side. The copy of the _tag is used by
-- Build_CPP_Init_Procedure to elaborate derivations of C++ types.
-- Generate:
- -- procedure IP (_init : Typ; ...) is
- -- procedure ConstructorP (_init : Typ; ...);
+ -- procedure IP (_init : in out Typ; ...) is
+ -- procedure ConstructorP (_init : in out Typ; ...);
-- pragma Import (ConstructorP);
-- begin
-- ConstructorP (_init, ...);
loop
-- Skip the following assertion with primary tags
-- because Related_Type is not set on primary tag
- -- components
+ -- components.
pragma Assert
(Tag_Comp = First_Tag_Component (Typ)