annotate gcc/ada/exp_strm.ads @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ------------------------------------------------------------------------------
kono
parents:
diff changeset
2 -- --
kono
parents:
diff changeset
3 -- GNAT COMPILER COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- E X P _ S T R M --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
9 -- Copyright (C) 1992-2018, Free Software Foundation, Inc. --
111
kono
parents:
diff changeset
10 -- --
kono
parents:
diff changeset
11 -- GNAT is free software; you can redistribute it and/or modify it under --
kono
parents:
diff changeset
12 -- terms of the GNU General Public License as published by the Free Soft- --
kono
parents:
diff changeset
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
kono
parents:
diff changeset
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
kono
parents:
diff changeset
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
kono
parents:
diff changeset
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
kono
parents:
diff changeset
17 -- for more details. You should have received a copy of the GNU General --
kono
parents:
diff changeset
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
kono
parents:
diff changeset
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
kono
parents:
diff changeset
20 -- --
kono
parents:
diff changeset
21 -- GNAT was originally developed by the GNAT team at New York University. --
kono
parents:
diff changeset
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
kono
parents:
diff changeset
23 -- --
kono
parents:
diff changeset
24 ------------------------------------------------------------------------------
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 -- Routines to build stream subprograms for composite types
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 with Exp_Tss; use Exp_Tss;
kono
parents:
diff changeset
29 with Types; use Types;
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 package Exp_Strm is
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 function Build_Elementary_Input_Call (N : Node_Id) return Node_Id;
kono
parents:
diff changeset
34 -- Build call to Read attribute function for elementary type. Also used
kono
parents:
diff changeset
35 -- for Input attributes for elementary types with an appropriate extra
kono
parents:
diff changeset
36 -- assignment statement. N is the attribute reference node.
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 function Build_Elementary_Write_Call (N : Node_Id) return Node_Id;
kono
parents:
diff changeset
39 -- Build call to Write attribute function for elementary type. Also used
kono
parents:
diff changeset
40 -- for Output attributes for elementary types (since the effect of the
kono
parents:
diff changeset
41 -- two attributes is identical for elementary types). N is the attribute
kono
parents:
diff changeset
42 -- reference node.
kono
parents:
diff changeset
43
kono
parents:
diff changeset
44 function Build_Stream_Attr_Profile
kono
parents:
diff changeset
45 (Loc : Source_Ptr;
kono
parents:
diff changeset
46 Typ : Entity_Id;
kono
parents:
diff changeset
47 Nam : TSS_Name_Type) return List_Id;
kono
parents:
diff changeset
48 -- Builds the parameter profile for the stream attribute identified by
kono
parents:
diff changeset
49 -- the given name. This is used for the tagged case to build the spec
kono
parents:
diff changeset
50 -- for the primitive operation.
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 -- The following routines build procedures and functions for stream
kono
parents:
diff changeset
53 -- attributes applied to composite types. For each of these routines,
kono
parents:
diff changeset
54 -- Loc is used to provide the location for the constructed subprogram
kono
parents:
diff changeset
55 -- declaration. Typ is the base type to which the subprogram applies
kono
parents:
diff changeset
56 -- (i.e. the base type of the stream attribute prefix). The returned
kono
parents:
diff changeset
57 -- results are the declaration and name (entity) of the subprogram.
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 procedure Build_Array_Input_Function
kono
parents:
diff changeset
60 (Loc : Source_Ptr;
kono
parents:
diff changeset
61 Typ : Entity_Id;
kono
parents:
diff changeset
62 Decl : out Node_Id;
kono
parents:
diff changeset
63 Fnam : out Entity_Id);
kono
parents:
diff changeset
64 -- Build function for Input attribute for array type
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 procedure Build_Array_Output_Procedure
kono
parents:
diff changeset
67 (Loc : Source_Ptr;
kono
parents:
diff changeset
68 Typ : Entity_Id;
kono
parents:
diff changeset
69 Decl : out Node_Id;
kono
parents:
diff changeset
70 Pnam : out Entity_Id);
kono
parents:
diff changeset
71 -- Build procedure for Output attribute for array type
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 procedure Build_Array_Read_Procedure
kono
parents:
diff changeset
74 (Nod : Node_Id;
kono
parents:
diff changeset
75 Typ : Entity_Id;
kono
parents:
diff changeset
76 Decl : out Node_Id;
kono
parents:
diff changeset
77 Pnam : out Entity_Id);
kono
parents:
diff changeset
78 -- Build procedure for Read attribute for array type. Nod provides the
kono
parents:
diff changeset
79 -- Sloc value for generated code.
kono
parents:
diff changeset
80
kono
parents:
diff changeset
81 procedure Build_Array_Write_Procedure
kono
parents:
diff changeset
82 (Nod : Node_Id;
kono
parents:
diff changeset
83 Typ : Entity_Id;
kono
parents:
diff changeset
84 Decl : out Node_Id;
kono
parents:
diff changeset
85 Pnam : out Entity_Id);
kono
parents:
diff changeset
86 -- Build procedure for Write attribute for array type. Nod provides the
kono
parents:
diff changeset
87 -- Sloc value for generated code.
kono
parents:
diff changeset
88
kono
parents:
diff changeset
89 procedure Build_Mutable_Record_Read_Procedure
kono
parents:
diff changeset
90 (Loc : Source_Ptr;
kono
parents:
diff changeset
91 Typ : Entity_Id;
kono
parents:
diff changeset
92 Decl : out Node_Id;
kono
parents:
diff changeset
93 Pnam : out Entity_Id);
kono
parents:
diff changeset
94 -- Build procedure to Read a record with default discriminants.
kono
parents:
diff changeset
95 -- Discriminants must be read explicitly (RM 13.13.2(9)) in the
kono
parents:
diff changeset
96 -- same manner as is done for 'Input.
kono
parents:
diff changeset
97
kono
parents:
diff changeset
98 procedure Build_Mutable_Record_Write_Procedure
kono
parents:
diff changeset
99 (Loc : Source_Ptr;
kono
parents:
diff changeset
100 Typ : Entity_Id;
kono
parents:
diff changeset
101 Decl : out Node_Id;
kono
parents:
diff changeset
102 Pnam : out Entity_Id);
kono
parents:
diff changeset
103 -- Build procedure to write a record with default discriminants.
kono
parents:
diff changeset
104 -- Discriminants must be written explicitly (RM 13.13.2(9)) in
kono
parents:
diff changeset
105 -- the same manner as is done for 'Output.
kono
parents:
diff changeset
106
kono
parents:
diff changeset
107 procedure Build_Record_Or_Elementary_Input_Function
kono
parents:
diff changeset
108 (Loc : Source_Ptr;
kono
parents:
diff changeset
109 Typ : Entity_Id;
kono
parents:
diff changeset
110 Decl : out Node_Id;
kono
parents:
diff changeset
111 Fnam : out Entity_Id;
kono
parents:
diff changeset
112 Use_Underlying : Boolean := True);
kono
parents:
diff changeset
113 -- Build function for Input attribute for record type or for an elementary
kono
parents:
diff changeset
114 -- type (the latter is used only in the case where a user-defined Read
kono
parents:
diff changeset
115 -- routine is defined, since, in other cases, Input calls the appropriate
kono
parents:
diff changeset
116 -- runtime library routine directly). The flag Use_Underlying controls
kono
parents:
diff changeset
117 -- whether the base type or the underlying type of the base type of Typ is
kono
parents:
diff changeset
118 -- used during construction.
kono
parents:
diff changeset
119
kono
parents:
diff changeset
120 procedure Build_Record_Or_Elementary_Output_Procedure
kono
parents:
diff changeset
121 (Loc : Source_Ptr;
kono
parents:
diff changeset
122 Typ : Entity_Id;
kono
parents:
diff changeset
123 Decl : out Node_Id;
kono
parents:
diff changeset
124 Pnam : out Entity_Id);
kono
parents:
diff changeset
125 -- Build procedure for Output attribute for record type or for an
kono
parents:
diff changeset
126 -- elementary type (the latter is used only in the case where a
kono
parents:
diff changeset
127 -- user defined Write routine is defined, since in other cases,
kono
parents:
diff changeset
128 -- Output calls the appropriate runtime library routine directly.
kono
parents:
diff changeset
129
kono
parents:
diff changeset
130 procedure Build_Record_Read_Procedure
kono
parents:
diff changeset
131 (Loc : Source_Ptr;
kono
parents:
diff changeset
132 Typ : Entity_Id;
kono
parents:
diff changeset
133 Decl : out Node_Id;
kono
parents:
diff changeset
134 Pnam : out Entity_Id);
kono
parents:
diff changeset
135 -- Build procedure for Read attribute for record type
kono
parents:
diff changeset
136
kono
parents:
diff changeset
137 procedure Build_Record_Write_Procedure
kono
parents:
diff changeset
138 (Loc : Source_Ptr;
kono
parents:
diff changeset
139 Typ : Entity_Id;
kono
parents:
diff changeset
140 Decl : out Node_Id;
kono
parents:
diff changeset
141 Pnam : out Entity_Id);
kono
parents:
diff changeset
142 -- Build procedure for Write attribute for record type
kono
parents:
diff changeset
143
kono
parents:
diff changeset
144 procedure Build_Stream_Procedure
kono
parents:
diff changeset
145 (Loc : Source_Ptr;
kono
parents:
diff changeset
146 Typ : Entity_Id;
kono
parents:
diff changeset
147 Decl : out Node_Id;
kono
parents:
diff changeset
148 Pnam : Entity_Id;
kono
parents:
diff changeset
149 Stms : List_Id;
kono
parents:
diff changeset
150 Outp : Boolean);
kono
parents:
diff changeset
151 -- Called to build an array or record stream procedure. The first three
kono
parents:
diff changeset
152 -- arguments are the same as Build_Record_Or_Elementary_Output_Procedure.
kono
parents:
diff changeset
153 -- Stms is the list of statements for the body (the declaration list is
kono
parents:
diff changeset
154 -- always null), and Pnam is the name of the constructed procedure.
kono
parents:
diff changeset
155 -- Used by Exp_Dist to generate stream-oriented attributes for RACWs.
kono
parents:
diff changeset
156
kono
parents:
diff changeset
157 end Exp_Strm;