end if;
end Build_And_Insert_Type_Attr_Subp;
+ -- Two instances, used for doing what the instance names suggest.
+
+ procedure Build_And_Insert_Record_Or_Elementary_Input_Func is
+ new Build_And_Insert_Type_Attr_Subp
+ (Build_Record_Or_Elementary_Input_Function);
+
+ procedure Build_And_Insert_Record_Or_Elementary_Output_Proc is
+ new Build_And_Insert_Type_Attr_Subp
+ (Build_Record_Or_Elementary_Output_Procedure);
+
----------------------
-- Get_Integer_Type --
----------------------
-- since in this case we are required to call this routine.
if Present (Find_Inherited_TSS (P_Type, TSS_Stream_Read)) then
- Build_Record_Or_Elementary_Input_Function
- (P_Type, Decl, Fname);
- Insert_Action (N, Decl);
+ Build_And_Insert_Record_Or_Elementary_Input_Func
+ (Typ => Base_Type (U_Type),
+ Decl => Decl,
+ Subp => Fname,
+ Attr_Ref => N);
-- For normal cases, we call the I_xxx routine directly
-- first named subtype is unconstrained? Shouldn't we be
-- passing in the first named subtype of the type?
- declare
- procedure Build_And_Insert_Record_Input_Func is
- new Build_And_Insert_Type_Attr_Subp
- (Build_Record_Or_Elementary_Input_Function);
- begin
- Build_And_Insert_Record_Input_Func
- (Typ => U_Type,
- Decl => Decl,
- Subp => Fname,
- Attr_Ref => N);
- end;
+ Build_And_Insert_Record_Or_Elementary_Input_Func
+ (Typ => Underlying_Type (First_Subtype (P_Type)),
+ Decl => Decl,
+ Subp => Fname,
+ Attr_Ref => N);
if Nkind (Parent (N)) = N_Object_Declaration
and then Is_Record_Type (U_Type)
-- since in this case we are required to call this routine.
if Present (Find_Inherited_TSS (P_Type, TSS_Stream_Write)) then
- Build_Record_Or_Elementary_Output_Procedure
- (P_Type, Decl, Pname);
- Insert_Action (N, Decl);
+ Build_And_Insert_Record_Or_Elementary_Output_Proc
+ (Typ => Base_Type (U_Type),
+ Decl => Decl,
+ Subp => Pname,
+ Attr_Ref => N);
-- For normal cases, we call the W_xxx routine directly
return;
end if;
- declare
- procedure Build_And_Insert_Record_Output_Proc is
- new Build_And_Insert_Type_Attr_Subp
- (Build_Record_Or_Elementary_Output_Procedure);
- begin
- Build_And_Insert_Record_Output_Proc
- (Typ => Base_Type (U_Type),
- Decl => Decl,
- Subp => Pname,
- Attr_Ref => N);
- end;
+ Build_And_Insert_Record_Or_Elementary_Output_Proc
+ (Typ => Underlying_Type (First_Subtype (P_Type)),
+ Decl => Decl,
+ Subp => Pname,
+ Attr_Ref => N);
end if;
if not Is_Tagged_Type (U_Type) then