1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
10 -- Copyright (C) 1992-1999 Free Software Foundation, Inc. --
12 -- GNAT is free software; you can redistribute it and/or modify it under --
13 -- terms of the GNU General Public License as published by the Free Soft- --
14 -- ware Foundation; either version 2, or (at your option) any later ver- --
15 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
18 -- for more details. You should have received a copy of the GNU General --
19 -- Public License distributed with GNAT; see file COPYING. If not, write --
20 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
21 -- MA 02111-1307, USA. --
23 -- GNAT was originally developed by the GNAT team at New York University. --
24 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
26 ------------------------------------------------------------------------------
28 -- Routines to build stream subprograms for composite types
30 with Types; use Types;
34 function Build_Elementary_Input_Call (N : Node_Id) return Node_Id;
35 -- Build call to Read attribute function for elementary type. Also used
36 -- for Input attributes for elementary types with an appropriate extra
37 -- assignment statement. N is the attribute reference node.
39 function Build_Elementary_Write_Call (N : Node_Id) return Node_Id;
40 -- Build call to Write attribute function for elementary type. Also used
41 -- for Output attributes for elementary types (since the effect of the
42 -- two attributes is identical for elementary types). N is the attribute
45 function Build_Stream_Attr_Profile
50 -- Builds the parameter profile for the stream attribute identified by
51 -- the given name (which is the underscore version, e.g. Name_uWrite to
52 -- identify the Write attribute). This is used for the tagged case to
53 -- build the spec for the primitive operation.
55 -- The following routines build procedures and functions for stream
56 -- attributes applied to composite types. For each of these routines,
57 -- Loc is used to provide the location for the constructed subprogram
58 -- declaration. Typ is the base type to which the subprogram applies
59 -- (i.e. the base type of the stream attribute prefix). The returned
60 -- results are the declaration and name (entity) of the subprogram.
62 procedure Build_Array_Input_Function
66 Fnam : out Entity_Id);
67 -- Build function for Input attribute for array type
69 procedure Build_Array_Output_Procedure
73 Pnam : out Entity_Id);
74 -- Build procedure for Output attribute for array type
76 procedure Build_Array_Read_Procedure
80 Pnam : out Entity_Id);
81 -- Build procedure for Read attribute for array type. Nod provides the
82 -- Sloc value for generated code.
84 procedure Build_Array_Write_Procedure
88 Pnam : out Entity_Id);
89 -- Build procedure for Write attribute for array type. Nod provides the
90 -- Sloc value for generated code.
92 procedure Build_Mutable_Record_Read_Procedure
96 Pnam : out Entity_Id);
97 -- Build procedure to Read a record with default discriminants.
98 -- Discriminants must be read explicitly (RM 13.13.2(9)) in the
99 -- same manner as is done for 'Input.
101 procedure Build_Mutable_Record_Write_Procedure
105 Pnam : out Entity_Id);
106 -- Build procedure to write a record with default discriminants.
107 -- Discriminants must be written explicitly (RM 13.13.2(9)) in
108 -- the same manner as is done for 'Output.
110 procedure Build_Record_Or_Elementary_Input_Function
114 Fnam : out Entity_Id);
115 -- Build function for Input attribute for record type or for an
116 -- elementary type (the latter is used only in the case where a
117 -- user defined Read routine is defined, since in other cases,
118 -- Input calls the appropriate runtime library routine directly.
120 procedure Build_Record_Or_Elementary_Output_Procedure
124 Pnam : out Entity_Id);
125 -- Build procedure for Output attribute for record type or for an
126 -- elementary type (the latter is used only in the case where a
127 -- user defined Write routine is defined, since in other cases,
128 -- Output calls the appropriate runtime library routine directly.
130 procedure Build_Record_Read_Procedure
134 Pnam : out Entity_Id);
135 -- Build procedure for Read attribute for record type
137 procedure Build_Record_Write_Procedure
141 Pnam : out Entity_Id);
142 -- Build procedure for Write attribute for record type