1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
11 -- Copyright (C) 1992-1999 Free Software Foundation, Inc. --
13 -- GNAT is free software; you can redistribute it and/or modify it under --
14 -- terms of the GNU General Public License as published by the Free Soft- --
15 -- ware Foundation; either version 2, or (at your option) any later ver- --
16 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
19 -- for more details. You should have received a copy of the GNU General --
20 -- Public License distributed with GNAT; see file COPYING. If not, write --
21 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
22 -- MA 02111-1307, USA. --
24 -- GNAT was originally developed by the GNAT team at New York University. --
25 -- Extensive contributions were provided by Ada Core Technologies Inc. --
27 ------------------------------------------------------------------------------
29 -- Routines to build stream subprograms for composite types
31 with Types
; use Types
;
35 function Build_Elementary_Input_Call
(N
: Node_Id
) return Node_Id
;
36 -- Build call to Read attribute function for elementary type. Also used
37 -- for Input attributes for elementary types with an appropriate extra
38 -- assignment statement. N is the attribute reference node.
40 function Build_Elementary_Write_Call
(N
: Node_Id
) return Node_Id
;
41 -- Build call to Write attribute function for elementary type. Also used
42 -- for Output attributes for elementary types (since the effect of the
43 -- two attributes is identical for elementary types). N is the attribute
46 function Build_Stream_Attr_Profile
51 -- Builds the parameter profile for the stream attribute identified by
52 -- the given name (which is the underscore version, e.g. Name_uWrite to
53 -- identify the Write attribute). This is used for the tagged case to
54 -- build the spec for the primitive operation.
56 -- The following routines build procedures and functions for stream
57 -- attributes applied to composite types. For each of these routines,
58 -- Loc is used to provide the location for the constructed subprogram
59 -- declaration. Typ is the base type to which the subprogram applies
60 -- (i.e. the base type of the stream attribute prefix). The returned
61 -- results are the declaration and name (entity) of the subprogram.
63 procedure Build_Array_Input_Function
67 Fnam
: out Entity_Id
);
68 -- Build function for Input attribute for array type
70 procedure Build_Array_Output_Procedure
74 Pnam
: out Entity_Id
);
75 -- Build procedure for Output attribute for array type
77 procedure Build_Array_Read_Procedure
81 Pnam
: out Entity_Id
);
82 -- Build procedure for Read attribute for array type. Nod provides the
83 -- Sloc value for generated code.
85 procedure Build_Array_Write_Procedure
89 Pnam
: out Entity_Id
);
90 -- Build procedure for Write attribute for array type. Nod provides the
91 -- Sloc value for generated code.
93 procedure Build_Mutable_Record_Read_Procedure
97 Pnam
: out Entity_Id
);
98 -- Build procedure to Read a record with default discriminants.
99 -- Discriminants must be read explicitly (RM 13.13.2(9)) in the
100 -- same manner as is done for 'Input.
102 procedure Build_Mutable_Record_Write_Procedure
106 Pnam
: out Entity_Id
);
107 -- Build procedure to write a record with default discriminants.
108 -- Discriminants must be written explicitly (RM 13.13.2(9)) in
109 -- the same manner as is done for 'Output.
111 procedure Build_Record_Or_Elementary_Input_Function
115 Fnam
: out Entity_Id
);
116 -- Build function for Input attribute for record type or for an
117 -- elementary type (the latter is used only in the case where a
118 -- user defined Read routine is defined, since in other cases,
119 -- Input calls the appropriate runtime library routine directly.
121 procedure Build_Record_Or_Elementary_Output_Procedure
125 Pnam
: out Entity_Id
);
126 -- Build procedure for Output attribute for record type or for an
127 -- elementary type (the latter is used only in the case where a
128 -- user defined Write routine is defined, since in other cases,
129 -- Output calls the appropriate runtime library routine directly.
131 procedure Build_Record_Read_Procedure
135 Pnam
: out Entity_Id
);
136 -- Build procedure for Read attribute for record type
138 procedure Build_Record_Write_Procedure
142 Pnam
: out Entity_Id
);
143 -- Build procedure for Write attribute for record type