annotate gcc/ada/tbuild.ads @ 138:fc828634a951

merge
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 08 Nov 2018 14:17:14 +0900
parents 84e7813d76e9
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 -- T B U I L D --
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 -- This package contains various utility procedures to assist in building
kono
parents:
diff changeset
27 -- specific types of tree nodes.
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 with Namet; use Namet;
kono
parents:
diff changeset
30 with Sinfo; use Sinfo;
kono
parents:
diff changeset
31 with Types; use Types;
kono
parents:
diff changeset
32 with Uintp; use Uintp;
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 package Tbuild is
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 function Checks_Off (N : Node_Id) return Node_Id;
kono
parents:
diff changeset
37 pragma Inline (Checks_Off);
kono
parents:
diff changeset
38 -- Returns an N_Unchecked_Expression node whose expression is the given
kono
parents:
diff changeset
39 -- argument. The results is a subexpression identical to the argument,
kono
parents:
diff changeset
40 -- except that it will be analyzed and resolved with checks off.
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 function Convert_To (Typ : Entity_Id; Expr : Node_Id) return Node_Id;
kono
parents:
diff changeset
43 -- Returns an expression that represents the result of a checked convert
kono
parents:
diff changeset
44 -- of expression Exp to type T. If the base type of Exp is T, then no
kono
parents:
diff changeset
45 -- conversion is required, and Exp is returned unchanged. Otherwise an
kono
parents:
diff changeset
46 -- N_Type_Conversion node is constructed to convert the expression.
kono
parents:
diff changeset
47 -- If an N_Type_Conversion node is required, Relocate_Node is used on
kono
parents:
diff changeset
48 -- Exp. This means that it is safe to replace a node by a Convert_To
kono
parents:
diff changeset
49 -- of itself to some other type.
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 procedure Convert_To_And_Rewrite (Typ : Entity_Id; Expr : Node_Id);
kono
parents:
diff changeset
52 pragma Inline (Convert_To_And_Rewrite);
kono
parents:
diff changeset
53 -- Like the function, except that there is an extra step of calling
kono
parents:
diff changeset
54 -- Rewrite on the Expr node and replacing it with the converted result.
kono
parents:
diff changeset
55 -- As noted above, this is safe, because Relocate_Node is called.
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 procedure Discard_Node (N : Node_Or_Entity_Id);
kono
parents:
diff changeset
58 pragma Inline (Discard_Node);
kono
parents:
diff changeset
59 -- This is a dummy procedure that simply returns and does nothing. It is
kono
parents:
diff changeset
60 -- used when a function returning a Node_Id value is called for its side
kono
parents:
diff changeset
61 -- effect (e.g. a call to Make to construct a node) but the Node_Id value
kono
parents:
diff changeset
62 -- is not required.
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 procedure Discard_List (L : List_Id);
kono
parents:
diff changeset
65 pragma Inline (Discard_List);
kono
parents:
diff changeset
66 -- This is a dummy procedure that simply returns and does nothing. It is
kono
parents:
diff changeset
67 -- used when a function returning a Node_Id value is called for its side
kono
parents:
diff changeset
68 -- effect (e.g. a call to the parser to parse a list of compilation
kono
parents:
diff changeset
69 -- units), but the List_Id value is not required.
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 function Make_Byte_Aligned_Attribute_Reference
kono
parents:
diff changeset
72 (Sloc : Source_Ptr;
kono
parents:
diff changeset
73 Prefix : Node_Id;
kono
parents:
diff changeset
74 Attribute_Name : Name_Id) return Node_Id;
kono
parents:
diff changeset
75 pragma Inline (Make_Byte_Aligned_Attribute_Reference);
kono
parents:
diff changeset
76 -- Like the standard Make_Attribute_Reference but the special flag
kono
parents:
diff changeset
77 -- Must_Be_Byte_Aligned is set in the attribute reference node. The
kono
parents:
diff changeset
78 -- Attribute_Name must be Name_Address or Name_Unrestricted_Access.
kono
parents:
diff changeset
79
kono
parents:
diff changeset
80 function Make_DT_Access
kono
parents:
diff changeset
81 (Loc : Source_Ptr; Rec : Node_Id; Typ : Entity_Id) return Node_Id;
kono
parents:
diff changeset
82 -- Create an access to the Dispatch Table by using the Tag field of a
kono
parents:
diff changeset
83 -- tagged record : Acc_Dt (Rec.tag).all
kono
parents:
diff changeset
84
kono
parents:
diff changeset
85 function Make_Float_Literal
kono
parents:
diff changeset
86 (Loc : Source_Ptr;
kono
parents:
diff changeset
87 Radix : Uint;
kono
parents:
diff changeset
88 Significand : Uint;
kono
parents:
diff changeset
89 Exponent : Uint) return Node_Id;
kono
parents:
diff changeset
90 -- Create a real literal for the floating point expression value
kono
parents:
diff changeset
91 -- Significand * Radix ** Exponent. Radix must be greater than 1.
kono
parents:
diff changeset
92
kono
parents:
diff changeset
93 function Make_Implicit_Exception_Handler
kono
parents:
diff changeset
94 (Sloc : Source_Ptr;
kono
parents:
diff changeset
95 Choice_Parameter : Node_Id := Empty;
kono
parents:
diff changeset
96 Exception_Choices : List_Id;
kono
parents:
diff changeset
97 Statements : List_Id) return Node_Id;
kono
parents:
diff changeset
98 pragma Inline (Make_Implicit_Exception_Handler);
kono
parents:
diff changeset
99 -- This is just like Make_Exception_Handler, except that it also sets the
kono
parents:
diff changeset
100 -- Local_Raise_Statements field to No_Elist, ensuring that it is properly
kono
parents:
diff changeset
101 -- initialized. This should always be used when creating implicit exception
kono
parents:
diff changeset
102 -- handlers during expansion (i.e. handlers that do not correspond to user
kono
parents:
diff changeset
103 -- source program exception handlers).
kono
parents:
diff changeset
104
kono
parents:
diff changeset
105 function Make_Implicit_If_Statement
kono
parents:
diff changeset
106 (Node : Node_Id;
kono
parents:
diff changeset
107 Condition : Node_Id;
kono
parents:
diff changeset
108 Then_Statements : List_Id;
kono
parents:
diff changeset
109 Elsif_Parts : List_Id := No_List;
kono
parents:
diff changeset
110 Else_Statements : List_Id := No_List) return Node_Id;
kono
parents:
diff changeset
111 pragma Inline (Make_Implicit_If_Statement);
kono
parents:
diff changeset
112 -- This function makes an N_If_Statement node whose fields are filled
kono
parents:
diff changeset
113 -- in with the indicated values (see Sinfo), and whose Sloc field is
kono
parents:
diff changeset
114 -- is set to Sloc (Node). The effect is identical to calling function
kono
parents:
diff changeset
115 -- Nmake.Make_If_Statement except that there is a check for restriction
kono
parents:
diff changeset
116 -- No_Implicit_Conditionals, and if this restriction is being violated,
kono
parents:
diff changeset
117 -- an error message is posted on Node.
kono
parents:
diff changeset
118
kono
parents:
diff changeset
119 function Make_Implicit_Label_Declaration
kono
parents:
diff changeset
120 (Loc : Source_Ptr;
kono
parents:
diff changeset
121 Defining_Identifier : Node_Id;
kono
parents:
diff changeset
122 Label_Construct : Node_Id) return Node_Id;
kono
parents:
diff changeset
123 -- Used to construct an implicit label declaration node, including setting
kono
parents:
diff changeset
124 -- the proper Label_Construct field (since Label_Construct is a semantic
kono
parents:
diff changeset
125 -- field, the normal call to Make_Implicit_Label_Declaration does not
kono
parents:
diff changeset
126 -- set this field).
kono
parents:
diff changeset
127
kono
parents:
diff changeset
128 function Make_Implicit_Loop_Statement
kono
parents:
diff changeset
129 (Node : Node_Id;
kono
parents:
diff changeset
130 Statements : List_Id;
kono
parents:
diff changeset
131 Identifier : Node_Id := Empty;
kono
parents:
diff changeset
132 Iteration_Scheme : Node_Id := Empty;
kono
parents:
diff changeset
133 Has_Created_Identifier : Boolean := False;
kono
parents:
diff changeset
134 End_Label : Node_Id := Empty) return Node_Id;
kono
parents:
diff changeset
135 -- This function makes an N_Loop_Statement node whose fields are filled
kono
parents:
diff changeset
136 -- in with the indicated values (see Sinfo), and whose Sloc field is
kono
parents:
diff changeset
137 -- is set to Sloc (Node). The effect is identical to calling function
kono
parents:
diff changeset
138 -- Nmake.Make_Loop_Statement except that there is a check for restrictions
kono
parents:
diff changeset
139 -- No_Implicit_Loops and No_Implicit_Conditionals (the first applying in
kono
parents:
diff changeset
140 -- all cases, and the second only for while loops), and if one of these
kono
parents:
diff changeset
141 -- restrictions is being violated, an error message is posted on Node.
kono
parents:
diff changeset
142
kono
parents:
diff changeset
143 function Make_Integer_Literal
kono
parents:
diff changeset
144 (Loc : Source_Ptr;
kono
parents:
diff changeset
145 Intval : Int) return Node_Id;
kono
parents:
diff changeset
146 pragma Inline (Make_Integer_Literal);
kono
parents:
diff changeset
147 -- A convenient form of Make_Integer_Literal taking Int instead of Uint
kono
parents:
diff changeset
148
kono
parents:
diff changeset
149 function Make_Linker_Section_Pragma
kono
parents:
diff changeset
150 (Ent : Entity_Id;
kono
parents:
diff changeset
151 Loc : Source_Ptr;
kono
parents:
diff changeset
152 Sec : String) return Node_Id;
kono
parents:
diff changeset
153 -- Construct a Linker_Section pragma for entity Ent, using string Sec as
kono
parents:
diff changeset
154 -- the section name. Loc is the Sloc value to use in building the pragma.
kono
parents:
diff changeset
155
kono
parents:
diff changeset
156 function Make_Pragma
kono
parents:
diff changeset
157 (Sloc : Source_Ptr;
kono
parents:
diff changeset
158 Chars : Name_Id;
kono
parents:
diff changeset
159 Pragma_Argument_Associations : List_Id := No_List) return Node_Id;
kono
parents:
diff changeset
160 -- A convenient form of Make_Pragma not requiring a Pragma_Identifier
kono
parents:
diff changeset
161 -- argument (this argument is built from the value given for Chars).
kono
parents:
diff changeset
162
kono
parents:
diff changeset
163 function Make_Raise_Constraint_Error
kono
parents:
diff changeset
164 (Sloc : Source_Ptr;
kono
parents:
diff changeset
165 Condition : Node_Id := Empty;
kono
parents:
diff changeset
166 Reason : RT_Exception_Code) return Node_Id;
kono
parents:
diff changeset
167 pragma Inline (Make_Raise_Constraint_Error);
kono
parents:
diff changeset
168 -- A convenient form of Make_Raise_Constraint_Error where the Reason
kono
parents:
diff changeset
169 -- is given simply as an enumeration value, rather than a Uint code.
kono
parents:
diff changeset
170
kono
parents:
diff changeset
171 function Make_Raise_Program_Error
kono
parents:
diff changeset
172 (Sloc : Source_Ptr;
kono
parents:
diff changeset
173 Condition : Node_Id := Empty;
kono
parents:
diff changeset
174 Reason : RT_Exception_Code) return Node_Id;
kono
parents:
diff changeset
175 pragma Inline (Make_Raise_Program_Error);
kono
parents:
diff changeset
176 -- A convenient form of Make_Raise_Program_Error where the Reason
kono
parents:
diff changeset
177 -- is given simply as an enumeration value, rather than a Uint code.
kono
parents:
diff changeset
178
kono
parents:
diff changeset
179 function Make_Raise_Storage_Error
kono
parents:
diff changeset
180 (Sloc : Source_Ptr;
kono
parents:
diff changeset
181 Condition : Node_Id := Empty;
kono
parents:
diff changeset
182 Reason : RT_Exception_Code) return Node_Id;
kono
parents:
diff changeset
183 pragma Inline (Make_Raise_Storage_Error);
kono
parents:
diff changeset
184 -- A convenient form of Make_Raise_Storage_Error where the Reason is given
kono
parents:
diff changeset
185 -- simply as an enumeration value, rather than a Uint code.
kono
parents:
diff changeset
186
kono
parents:
diff changeset
187 function Make_String_Literal
kono
parents:
diff changeset
188 (Sloc : Source_Ptr;
kono
parents:
diff changeset
189 Strval : String) return Node_Id;
kono
parents:
diff changeset
190 -- A convenient form of Make_String_Literal, where the string value is
kono
parents:
diff changeset
191 -- given as a normal string instead of a String_Id value.
kono
parents:
diff changeset
192
kono
parents:
diff changeset
193 function Make_Temporary
kono
parents:
diff changeset
194 (Loc : Source_Ptr;
kono
parents:
diff changeset
195 Id : Character;
kono
parents:
diff changeset
196 Related_Node : Node_Id := Empty) return Entity_Id;
kono
parents:
diff changeset
197 -- This function should be used for all cases where a defining identifier
kono
parents:
diff changeset
198 -- is to be built with a name to be obtained by New_Internal_Name (here Id
kono
parents:
diff changeset
199 -- is the character passed as the argument to New_Internal_Name). Loc is
kono
parents:
diff changeset
200 -- the location for the Sloc value of the resulting Entity. Note that this
kono
parents:
diff changeset
201 -- can be used for all kinds of temporary defining identifiers used in
kono
parents:
diff changeset
202 -- expansion (objects, subtypes, functions etc).
kono
parents:
diff changeset
203 --
kono
parents:
diff changeset
204 -- Related_Node is used when the defining identifier is for an object that
kono
parents:
diff changeset
205 -- captures the value of an expression (e.g. an aggregate). It should be
kono
parents:
diff changeset
206 -- set whenever possible to point to the expression that is being captured.
kono
parents:
diff changeset
207 -- This is provided to get better error messages, e.g. from CodePeer.
kono
parents:
diff changeset
208
kono
parents:
diff changeset
209 function Make_Unsuppress_Block
kono
parents:
diff changeset
210 (Loc : Source_Ptr;
kono
parents:
diff changeset
211 Check : Name_Id;
kono
parents:
diff changeset
212 Stmts : List_Id) return Node_Id;
kono
parents:
diff changeset
213 -- Build a block with a pragma Suppress on 'Check'. Stmts is the statements
kono
parents:
diff changeset
214 -- list that needs protection against the check
kono
parents:
diff changeset
215
kono
parents:
diff changeset
216 function New_Constraint_Error (Loc : Source_Ptr) return Node_Id;
kono
parents:
diff changeset
217 -- This function builds a tree corresponding to the Ada statement
kono
parents:
diff changeset
218 -- "raise Constraint_Error" and returns the root of this tree,
kono
parents:
diff changeset
219 -- the N_Raise_Statement node.
kono
parents:
diff changeset
220
kono
parents:
diff changeset
221 function New_Op_Node
kono
parents:
diff changeset
222 (New_Node_Kind : Node_Kind;
kono
parents:
diff changeset
223 New_Sloc : Source_Ptr) return Node_Id;
kono
parents:
diff changeset
224 -- Create node using New_Node and, if its kind is in N_Op, set its Chars
kono
parents:
diff changeset
225 -- field accordingly.
kono
parents:
diff changeset
226
kono
parents:
diff changeset
227 function New_External_Name
kono
parents:
diff changeset
228 (Related_Id : Name_Id;
kono
parents:
diff changeset
229 Suffix : Character := ' ';
kono
parents:
diff changeset
230 Suffix_Index : Int := 0;
kono
parents:
diff changeset
231 Prefix : Character := ' ') return Name_Id;
kono
parents:
diff changeset
232 function New_External_Name
kono
parents:
diff changeset
233 (Related_Id : Name_Id;
kono
parents:
diff changeset
234 Suffix : String;
kono
parents:
diff changeset
235 Suffix_Index : Int := 0;
kono
parents:
diff changeset
236 Prefix : Character := ' ') return Name_Id;
kono
parents:
diff changeset
237 -- Builds a new entry in the names table of the form:
kono
parents:
diff changeset
238 --
kono
parents:
diff changeset
239 -- [Prefix &] Related_Id [& Suffix] [& Suffix_Index]
kono
parents:
diff changeset
240 --
kono
parents:
diff changeset
241 -- Prefix is prepended only if Prefix is non-blank (in which case it
kono
parents:
diff changeset
242 -- must be an upper case letter other than O,Q,U,W (which are used for
kono
parents:
diff changeset
243 -- identifier encoding, see Namet), or an underscore, and T is reserved for
kono
parents:
diff changeset
244 -- use by implicit types, and X is reserved for use by debug type encoding
kono
parents:
diff changeset
245 -- (see package Exp_Dbug). Note: the reason that Prefix is last is that it
kono
parents:
diff changeset
246 -- is almost always omitted. The notable case of Prefix being non-null is
kono
parents:
diff changeset
247 -- when it is 'T' for an implicit type.
kono
parents:
diff changeset
248
kono
parents:
diff changeset
249 -- Suffix_Index'Image is appended only if the value of Suffix_Index is
kono
parents:
diff changeset
250 -- positive, or if Suffix_Index is negative 1, then a unique serialized
kono
parents:
diff changeset
251 -- suffix is added. If Suffix_Index is zero, then no index is appended.
kono
parents:
diff changeset
252
kono
parents:
diff changeset
253 -- Suffix is also a single upper case letter other than O,Q,U,W,X (T is
kono
parents:
diff changeset
254 -- allowed in this context), or a string of such upper case letters. In
kono
parents:
diff changeset
255 -- the case of a string, an initial underscore may be given.
kono
parents:
diff changeset
256 --
kono
parents:
diff changeset
257 -- The constructed name is stored using Name_Find so that it can be located
kono
parents:
diff changeset
258 -- using a subsequent Name_Find operation (i.e. it is properly hashed into
kono
parents:
diff changeset
259 -- the names table). The upper case letter given as the Suffix argument
kono
parents:
diff changeset
260 -- ensures that the name does not clash with any Ada identifier name. These
kono
parents:
diff changeset
261 -- generated names are permitted, but not required, to be made public by
kono
parents:
diff changeset
262 -- setting the flag Is_Public in the associated entity.
kono
parents:
diff changeset
263 --
kono
parents:
diff changeset
264 -- Note: it is dubious to make them public if they have serial numbers,
kono
parents:
diff changeset
265 -- since we are counting on the serial numbers being the same for the
kono
parents:
diff changeset
266 -- clients with'ing a package and the actual compilation of the package
kono
parents:
diff changeset
267 -- with full expansion. This is a dubious assumption ???
kono
parents:
diff changeset
268
kono
parents:
diff changeset
269 function New_External_Name
kono
parents:
diff changeset
270 (Suffix : Character;
kono
parents:
diff changeset
271 Suffix_Index : Nat) return Name_Id;
kono
parents:
diff changeset
272 -- Builds a new entry in the names table of the form
kono
parents:
diff changeset
273 -- Suffix & Suffix_Index'Image
kono
parents:
diff changeset
274 -- where Suffix is a single upper case letter other than O,Q,U,W,X and is
kono
parents:
diff changeset
275 -- a required parameter (T is permitted). The constructed name is stored
kono
parents:
diff changeset
276 -- using Name_Find so that it can be located using a subsequent Name_Find
kono
parents:
diff changeset
277 -- operation (i.e. it is properly hashed into the names table). The upper
kono
parents:
diff changeset
278 -- case letter given as the Suffix argument ensures that the name does
kono
parents:
diff changeset
279 -- not clash with any Ada identifier name. These generated names are
kono
parents:
diff changeset
280 -- permitted, but not required, to be made public by setting the flag
kono
parents:
diff changeset
281 -- Is_Public in the associated entity.
kono
parents:
diff changeset
282 --
kono
parents:
diff changeset
283 -- Note: it is dubious to make these public since they have serial numbers,
kono
parents:
diff changeset
284 -- which means we are counting on the serial numbers being the same for the
kono
parents:
diff changeset
285 -- clients with'ing a package and the actual compilation of the package
kono
parents:
diff changeset
286 -- with full expansion. This is a dubious assumption ???
kono
parents:
diff changeset
287
kono
parents:
diff changeset
288 function New_Internal_Name (Id_Char : Character) return Name_Id;
kono
parents:
diff changeset
289 -- Id_Char is an upper case letter other than O,Q,U,W (which are reserved
kono
parents:
diff changeset
290 -- for identifier encoding (see Namet package for details) and X which is
kono
parents:
diff changeset
291 -- used for debug encoding (see Exp_Dbug). The letter T is permitted, but
kono
parents:
diff changeset
292 -- is reserved by convention for the case of internally generated types.
kono
parents:
diff changeset
293 -- The result of the call is a new generated unique name of the form XyyyU
kono
parents:
diff changeset
294 -- where X is Id_Char, yyy is a unique serial number, and U is either a
kono
parents:
diff changeset
295 -- lower case s or b indicating if the current unit is a spec or a body.
kono
parents:
diff changeset
296 --
kono
parents:
diff changeset
297 -- The name is entered into the names table using Name_Enter rather than
kono
parents:
diff changeset
298 -- Name_Find, because there can never be a need to locate the entry using
kono
parents:
diff changeset
299 -- the Name_Find procedure later on. Names created by New_Internal_Name
kono
parents:
diff changeset
300 -- are guaranteed to be consistent from one compilation to another (i.e.
kono
parents:
diff changeset
301 -- if the identical unit is compiled with a semantically consistent set
kono
parents:
diff changeset
302 -- of sources, the numbers will be consistent). This means that it is fine
kono
parents:
diff changeset
303 -- to use these as public symbols.
kono
parents:
diff changeset
304 --
kono
parents:
diff changeset
305 -- Note: Nearly all uses of this function are via calls to Make_Temporary,
kono
parents:
diff changeset
306 -- but there are just a few cases where it is called directly.
kono
parents:
diff changeset
307 --
kono
parents:
diff changeset
308 -- Note: despite the guarantee of consistency stated above, it is dubious
kono
parents:
diff changeset
309 -- to make these public since they have serial numbers, which means we are
kono
parents:
diff changeset
310 -- counting on the serial numbers being the same for the clients with'ing
kono
parents:
diff changeset
311 -- a package and the actual compilation of the package with full expansion.
kono
parents:
diff changeset
312 -- This is a dubious assumption ???
kono
parents:
diff changeset
313
kono
parents:
diff changeset
314 function New_Occurrence_Of
kono
parents:
diff changeset
315 (Def_Id : Entity_Id;
kono
parents:
diff changeset
316 Loc : Source_Ptr) return Node_Id;
kono
parents:
diff changeset
317 -- New_Occurrence_Of creates an N_Identifier node which is an occurrence
kono
parents:
diff changeset
318 -- of the defining identifier which is passed as its argument. The Entity
kono
parents:
diff changeset
319 -- and Etype of the result are set from the given defining identifier as
kono
parents:
diff changeset
320 -- follows: Entity is simply a copy of Def_Id. Etype is a copy of Def_Id
kono
parents:
diff changeset
321 -- for types, and a copy of the Etype of Def_Id for other entities. Note
kono
parents:
diff changeset
322 -- that Is_Static_Expression is set if this call creates an occurrence of
kono
parents:
diff changeset
323 -- an enumeration literal.
kono
parents:
diff changeset
324
kono
parents:
diff changeset
325 function New_Suffixed_Name
kono
parents:
diff changeset
326 (Related_Id : Name_Id;
kono
parents:
diff changeset
327 Suffix : String) return Name_Id;
kono
parents:
diff changeset
328 -- This function is used to create special suffixed names used by the
kono
parents:
diff changeset
329 -- debugger. Suffix is a string of upper case letters, used to construct
kono
parents:
diff changeset
330 -- the required name. For instance, the special type used to record the
kono
parents:
diff changeset
331 -- fixed-point small is called typ_SMALL where typ is the name of the
kono
parents:
diff changeset
332 -- fixed-point type (as passed in Related_Id), and Suffix is "SMALL".
kono
parents:
diff changeset
333
kono
parents:
diff changeset
334 function OK_Convert_To (Typ : Entity_Id; Expr : Node_Id) return Node_Id;
kono
parents:
diff changeset
335 -- Like Convert_To, except that a conversion node is always generated, and
kono
parents:
diff changeset
336 -- the Conversion_OK flag is set on this conversion node.
kono
parents:
diff changeset
337
kono
parents:
diff changeset
338 function Unchecked_Convert_To
kono
parents:
diff changeset
339 (Typ : Entity_Id;
kono
parents:
diff changeset
340 Expr : Node_Id) return Node_Id;
kono
parents:
diff changeset
341 -- Like Convert_To, but if a conversion is actually needed, constructs an
kono
parents:
diff changeset
342 -- N_Unchecked_Type_Conversion node to do the required conversion.
kono
parents:
diff changeset
343
kono
parents:
diff changeset
344 -------------------------------------
kono
parents:
diff changeset
345 -- Subprograms for Use by Gnat1drv --
kono
parents:
diff changeset
346 -------------------------------------
kono
parents:
diff changeset
347
kono
parents:
diff changeset
348 function Make_Id (Str : Text_Buffer) return Node_Id;
kono
parents:
diff changeset
349 function Make_SC (Pre, Sel : Node_Id) return Node_Id;
kono
parents:
diff changeset
350 procedure Set_NOD (Unit : Node_Id);
kono
parents:
diff changeset
351 procedure Set_NSA (Asp : Name_Id; OK : out Boolean);
kono
parents:
diff changeset
352 procedure Set_NUA (Attr : Name_Id; OK : out Boolean);
kono
parents:
diff changeset
353 procedure Set_NUP (Prag : Name_Id; OK : out Boolean);
kono
parents:
diff changeset
354 -- Subprograms for call to Get_Target_Parameters in Gnat1drv, see spec
kono
parents:
diff changeset
355 -- of package Targparm for full description of these four subprograms.
kono
parents:
diff changeset
356 -- These have to be declared at the top level of a package (accessibility
kono
parents:
diff changeset
357 -- issues), and Gnat1drv is a procedure, so they can't go there.
kono
parents:
diff changeset
358
kono
parents:
diff changeset
359 end Tbuild;