Add hppa-openbsd target
[official-gcc.git] / gcc / ada / einfo.adb
blob511008c6beae4ed91e341eb272c956b1e8a09cb2
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- E I N F O --
6 -- --
7 -- B o d y --
8 -- --
9 -- --
10 -- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
11 -- --
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. --
22 -- --
23 -- As a special exception, if other files instantiate generics from this --
24 -- unit, or you link this unit with other files to produce an executable, --
25 -- this unit does not by itself cause the resulting executable to be --
26 -- covered by the GNU General Public License. This exception does not --
27 -- however invalidate any other reasons why the executable file might be --
28 -- covered by the GNU Public License. --
29 -- --
30 -- GNAT was originally developed by the GNAT team at New York University. --
31 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
32 -- --
33 ------------------------------------------------------------------------------
35 pragma Style_Checks (All_Checks);
36 -- Turn off subprogram ordering, not used for this unit
38 with Atree; use Atree;
39 with Namet; use Namet;
40 with Nlists; use Nlists;
41 with Sinfo; use Sinfo;
42 with Stand; use Stand;
43 with Output; use Output;
45 package body Einfo is
47 use Atree.Unchecked_Access;
48 -- This is one of the packages that is allowed direct untyped access to
49 -- the fields in a node, since it provides the next level abstraction
50 -- which incorporates appropriate checks.
52 ----------------------------------------------
53 -- Usage of Fields in Defining Entity Nodes --
54 ----------------------------------------------
56 -- Four of these fields are defined in Sinfo, since they in are the
57 -- base part of the node. The access routines for these fields and
58 -- the corresponding set procedures are defined in Sinfo. These fields
59 -- are present in all entities. Note that Homonym is also in the base
60 -- part of the node, but has access routines that are more properly
61 -- part of Einfo, which is why they are defined here.
63 -- Chars Name1
64 -- Next_Entity Node2
65 -- Scope Node3
66 -- Etype Node5
68 -- Remaining fields are present only in extended nodes (i.e. entities)
70 -- The following fields are present in all entities
72 -- Homonym Node4
73 -- First_Rep_Item Node6
74 -- Freeze_Node Node7
76 -- The usage of each field (and the entity kinds to which it applies)
77 -- depends on the particular field (see Einfo spec for details).
79 -- Associated_Node_For_Itype Node8
80 -- Dependent_Instances Elist8
81 -- Hiding_Loop_Variable Node8
82 -- Mechanism Uint8 (but returns Mechanism_Type)
83 -- Normalized_First_Bit Uint8
85 -- Class_Wide_Type Node9
86 -- Normalized_Position Uint9
87 -- Size_Check_Code Node9
88 -- Renaming_Map Uint9
90 -- Discriminal_Link Node10
91 -- Handler_Records List10
92 -- Normalized_Position_Max Uint10
93 -- Referenced_Object Node10
95 -- Component_Bit_Offset Uint11
96 -- Full_View Node11
97 -- Entry_Component Node11
98 -- Enumeration_Pos Uint11
99 -- Protected_Body_Subprogram Node11
100 -- Block_Node Node11
102 -- Barrier_Function Node12
103 -- Enumeration_Rep Uint12
104 -- Esize Uint12
105 -- Next_Inlined_Subprogram Node12
107 -- Corresponding_Equality Node13
108 -- Component_Clause Node13
109 -- Debug_Renaming_Link Node13
110 -- Elaboration_Entity Node13
111 -- Extra_Accessibility Node13
112 -- RM_Size Uint13
114 -- Alignment Uint14
115 -- First_Optional_Parameter Node14
116 -- Shadow_Entities List14
118 -- Discriminant_Number Uint15
119 -- DT_Position Uint15
120 -- DT_Entry_Count Uint15
121 -- Entry_Bodies_Array Node15
122 -- Entry_Parameters_Type Node15
123 -- Extra_Formal Node15
124 -- Lit_Indexes Node15
125 -- Primitive_Operations Elist15
126 -- Related_Instance Node15
127 -- Scale_Value Uint15
128 -- Storage_Size_Variable Node15
129 -- String_Literal_Low_Bound Node15
130 -- Shared_Var_Read_Proc Node15
132 -- Access_Disp_Table Node16
133 -- Cloned_Subtype Node16
134 -- DTC_Entity Node16
135 -- Entry_Formal Node16
136 -- First_Private_Entity Node16
137 -- Lit_Strings Node16
138 -- String_Literal_Length Uint16
139 -- Unset_Reference Node16
141 -- Actual_Subtype Node17
142 -- Digits_Value Uint17
143 -- Discriminal Node17
144 -- First_Entity Node17
145 -- First_Index Node17
146 -- First_Literal Node17
147 -- Master_Id Node17
148 -- Modulus Uint17
149 -- Object_Ref Node17
150 -- Prival Node17
152 -- Alias Node18
153 -- Corresponding_Concurrent_Type Node18
154 -- Corresponding_Record_Type Node18
155 -- Delta_Value Ureal18
156 -- Enclosing_Scope Node18
157 -- Equivalent_Type Node18
158 -- Private_Dependents Elist18
159 -- Renamed_Entity Node18
160 -- Renamed_Object Node18
162 -- Body_Entity Node19
163 -- Corresponding_Discriminant Node19
164 -- Finalization_Chain_Entity Node19
165 -- Parent_Subtype Node19
166 -- Related_Array_Object Node19
167 -- Spec_Entity Node19
168 -- Underlying_Full_View Node19
170 -- Component_Type Node20
171 -- Default_Value Node20
172 -- Directly_Designated_Type Node20
173 -- Discriminant_Checking_Func Node20
174 -- Discriminant_Default_Value Node20
175 -- Last_Entity Node20
176 -- Register_Exception_Call Node20
177 -- Scalar_Range Node20
179 -- Accept_Address Elist21
180 -- Default_Expr_Function Node21
181 -- Discriminant_Constraint Elist21
182 -- Interface_Name Node21
183 -- Original_Array_Type Node21
184 -- Small_Value Ureal21
186 -- Associated_Storage_Pool Node22
187 -- Component_Size Uint22
188 -- Corresponding_Remote_Type Node22
189 -- Enumeration_Rep_Expr Node22
190 -- Exception_Code Uint22
191 -- Original_Record_Component Node22
192 -- Private_View Node22
193 -- Protected_Formal Node22
194 -- Scope_Depth_Value Uint22
195 -- Shared_Var_Assign_Proc Node22
197 -- Associated_Final_Chain Node23
198 -- CR_Discriminant Node23
199 -- Girder_Constraint Elist23
200 -- Entry_Cancel_Parameter Node23
201 -- Extra_Constrained Node23
202 -- Generic_Renamings Elist23
203 -- Inner_Instances Elist23
204 -- Enum_Pos_To_Rep Node23
205 -- Packed_Array_Type Node23
206 -- Privals_Chain Elist23
207 -- Protected_Operation Node23
209 ---------------------------------------------
210 -- Usage of Flags in Defining Entity Nodes --
211 ---------------------------------------------
213 -- All flags are unique, there is no overlaying, so each flag is physically
214 -- present in every entity. However, for many of the flags, it only makes
215 -- sense for them to be set true for certain subsets of entity kinds. See
216 -- the spec of Einfo for further details.
218 -- Note: Flag1-Flag3 are absent from this list, since these flag positions
219 -- are used for the flags Analyzed, Comes_From_Source, and Error_Posted,
220 -- which are common to all nodes, including entity nodes.
222 -- Is_Frozen Flag4
223 -- Has_Discriminants Flag5
224 -- Is_Dispatching_Operation Flag6
225 -- Is_Immediately_Visible Flag7
226 -- In_Use Flag8
227 -- Is_Potentially_Use_Visible Flag9
228 -- Is_Public Flag10
229 -- Is_Inlined Flag11
230 -- Is_Constrained Flag12
231 -- Is_Generic_Type Flag13
232 -- Depends_On_Private Flag14
233 -- Is_Aliased Flag15
234 -- Is_Volatile Flag16
235 -- Is_Internal Flag17
236 -- Has_Delayed_Freeze Flag18
237 -- Is_Abstract Flag19
238 -- Is_Concurrent_Record_Type Flag20
239 -- Has_Master_Entity Flag21
240 -- Needs_No_Actuals Flag22
241 -- Has_Storage_Size_Clause Flag23
242 -- Is_Imported Flag24
243 -- Is_Limited_Record Flag25
244 -- Has_Completion Flag26
245 -- Has_Pragma_Controlled Flag27
246 -- Is_Statically_Allocated Flag28
247 -- Has_Size_Clause Flag29
248 -- Has_Task Flag30
249 -- Suppress_Access_Checks Flag31
250 -- Suppress_Accessibility_Checks Flag32
251 -- Suppress_Discriminant_Checks Flag33
252 -- Suppress_Division_Checks Flag34
253 -- Suppress_Elaboration_Checks Flag35
254 -- Suppress_Index_Checks Flag36
255 -- Suppress_Length_Checks Flag37
256 -- Suppress_Overflow_Checks Flag38
257 -- Suppress_Range_Checks Flag39
258 -- Suppress_Storage_Checks Flag40
259 -- Suppress_Tag_Checks Flag41
260 -- Is_Controlled Flag42
261 -- Has_Controlled_Component Flag43
262 -- Is_Pure Flag44
263 -- In_Private_Part Flag45
264 -- Has_Alignment_Clause Flag46
265 -- Has_Exit Flag47
266 -- In_Package_Body Flag48
267 -- Reachable Flag49
268 -- Delay_Subprogram_Descriptors Flag50
269 -- Is_Packed Flag51
270 -- Is_Entry_Formal Flag52
271 -- Is_Private_Descendant Flag53
272 -- Return_Present Flag54
273 -- Is_Tagged_Type Flag55
274 -- Has_Homonym Flag56
275 -- Is_Hidden Flag57
276 -- Non_Binary_Modulus Flag58
277 -- Is_Preelaborated Flag59
278 -- Is_Shared_Passive Flag60
279 -- Is_Remote_Types Flag61
280 -- Is_Remote_Call_Interface Flag62
281 -- Is_Character_Type Flag63
282 -- Is_Intrinsic_Subprogram Flag64
283 -- Has_Record_Rep_Clause Flag65
284 -- Has_Enumeration_Rep_Clause Flag66
285 -- Has_Small_Clause Flag67
286 -- Has_Component_Size_Clause Flag68
287 -- Is_Access_Constant Flag69
288 -- Is_First_Subtype Flag70
289 -- Has_Completion_In_Body Flag71
290 -- Has_Unknown_Discriminants Flag72
291 -- Is_Child_Unit Flag73
292 -- Is_CPP_Class Flag74
293 -- Has_Non_Standard_Rep Flag75
294 -- Is_Constructor Flag76
295 -- Is_Destructor Flag77
296 -- Is_Tag Flag78
297 -- Has_All_Calls_Remote Flag79
298 -- Is_Constr_Subt_For_U_Nominal Flag80
299 -- Is_Asynchronous Flag81
300 -- Has_Gigi_Rep_Item Flag82
301 -- Has_Machine_Radix_Clause Flag83
302 -- Machine_Radix_10 Flag84
303 -- Is_Atomic Flag85
304 -- Has_Atomic_Components Flag86
305 -- Has_Volatile_Components Flag87
306 -- Discard_Names Flag88
307 -- Is_Interrupt_Handler Flag89
308 -- Returns_By_Ref Flag90
309 -- Is_Itype Flag91
310 -- Size_Known_At_Compile_Time Flag92
311 -- Has_Subprogram_Descriptor Flag93
312 -- Is_Generic_Actual_Type Flag94
313 -- Uses_Sec_Stack Flag95
314 -- Warnings_Off Flag96
315 -- Is_Controlling_Formal Flag97
316 -- Has_Controlling_Result Flag98
317 -- Is_Exported Flag99
318 -- Has_Specified_Layout Flag100
319 -- Has_Nested_Block_With_Handler Flag101
320 -- Is_Called Flag102
321 -- Is_Completely_Hidden Flag103
322 -- Address_Taken Flag104
323 -- Suppress_Init_Proc Flag105
324 -- Is_Limited_Composite Flag106
325 -- Is_Private_Composite Flag107
326 -- Default_Expressions_Processed Flag108
327 -- Is_Non_Static_Subtype Flag109
328 -- Has_External_Tag_Rep_Clause Flag110
329 -- Is_Formal_Subprogram Flag111
330 -- Is_Renaming_Of_Object Flag112
331 -- No_Return Flag113
332 -- Delay_Cleanups Flag114
333 -- Not_Source_Assigned Flag115
334 -- Is_Visible_Child_Unit Flag116
335 -- Is_Unchecked_Union Flag117
336 -- Is_For_Access_Subtype Flag118
337 -- Has_Convention_Pragma Flag119
338 -- Has_Primitive_Operations Flag120
339 -- Has_Pragma_Pack Flag121
340 -- Is_Bit_Packed_Array Flag122
341 -- Has_Unchecked_Union Flag123
342 -- Is_Eliminated Flag124
343 -- C_Pass_By_Copy Flag125
344 -- Is_Instantiated Flag126
345 -- Is_Valued_Procedure Flag127
346 -- (used for Component_Alignment) Flag128
347 -- (used for Component_Alignment) Flag129
348 -- Is_Generic_Instance Flag130
349 -- No_Pool_Assigned Flag131
350 -- Is_AST_Entry Flag132
351 -- Is_VMS_Exception Flag133
352 -- Is_Optional_Parameter Flag134
353 -- Has_Aliased_Components Flag135
354 -- Is_Machine_Code_Subprogram Flag137
355 -- Is_Packed_Array_Type Flag138
356 -- Has_Biased_Representation Flag139
357 -- Has_Complex_Representation Flag140
358 -- Is_Constr_Subt_For_UN_Aliased Flag141
359 -- Has_Missing_Return Flag142
360 -- Has_Recursive_Call Flag143
361 -- Is_Unsigned_Type Flag144
362 -- Strict_Alignment Flag145
363 -- Elaborate_All_Desirable Flag146
364 -- Needs_Debug_Info Flag147
365 -- Suppress_Elaboration_Warnings Flag148
366 -- Is_Compilation_Unit Flag149
367 -- Has_Pragma_Elaborate_Body Flag150
368 -- Vax_Float Flag151
369 -- Entry_Accepted Flag152
370 -- Is_Psected Flag153
371 -- Has_Per_Object_Constraint Flag154
372 -- Has_Private_Declaration Flag155
373 -- Referenced Flag156
374 -- Has_Pragma_Inline Flag157
375 -- Finalize_Storage_Only Flag158
376 -- From_With_Type Flag159
377 -- Is_Package_Body_Entity Flag160
378 -- Has_Qualified_Name Flag161
379 -- Nonzero_Is_True Flag162
380 -- Is_True_Constant Flag163
381 -- Reverse_Bit_Order Flag164
382 -- Suppress_Style_Checks Flag165
383 -- Debug_Info_Off Flag166
384 -- Sec_Stack_Needed_For_Return Flag167
385 -- Materialize_Entity Flag168
386 -- Function_Returns_With_DSP Flag169
387 -- Is_Known_Valid Flag170
388 -- Is_Hidden_Open_Scope Flag171
389 -- Has_Object_Size_Clause Flag172
390 -- Has_Fully_Qualified_Name Flag173
391 -- Elaboration_Entity_Required Flag174
392 -- Has_Forward_Instantiation Flag175
393 -- Is_Discrim_SO_Function Flag176
394 -- Size_Depends_On_Discriminant Flag177
395 -- Is_Null_Init_Proc Flag178
396 -- Has_Pragma_Pure_Function Flag179
397 -- Has_Pragma_Unreferenced Flag180
399 -- (unused) Flag181
400 -- (unused) Flag182
401 -- (unused) Flag183
403 --------------------------------
404 -- Attribute Access Functions --
405 --------------------------------
407 function Accept_Address (Id : E) return L is
408 begin
409 return Elist21 (Id);
410 end Accept_Address;
412 function Access_Disp_Table (Id : E) return E is
413 begin
414 pragma Assert (Is_Tagged_Type (Id));
415 return Node16 (Implementation_Base_Type (Id));
416 end Access_Disp_Table;
418 function Actual_Subtype (Id : E) return E is
419 begin
420 pragma Assert
421 (Ekind (Id) = E_Constant
422 or else Ekind (Id) = E_Variable
423 or else Ekind (Id) = E_Generic_In_Out_Parameter
424 or else Ekind (Id) in E_In_Parameter .. E_In_Out_Parameter);
425 return Node17 (Id);
426 end Actual_Subtype;
428 function Address_Taken (Id : E) return B is
429 begin
430 return Flag104 (Id);
431 end Address_Taken;
433 function Alias (Id : E) return E is
434 begin
435 pragma Assert
436 (Is_Overloadable (Id) or else Ekind (Id) = E_Subprogram_Type);
437 return Node18 (Id);
438 end Alias;
440 function Alignment (Id : E) return U is
441 begin
442 return Uint14 (Id);
443 end Alignment;
445 function Associated_Final_Chain (Id : E) return E is
446 begin
447 pragma Assert (Is_Access_Type (Id));
448 return Node23 (Id);
449 end Associated_Final_Chain;
451 function Associated_Formal_Package (Id : E) return E is
452 begin
453 pragma Assert (Ekind (Id) = E_Package);
454 return Node12 (Id);
455 end Associated_Formal_Package;
457 function Associated_Node_For_Itype (Id : E) return N is
458 begin
459 return Node8 (Id);
460 end Associated_Node_For_Itype;
462 function Associated_Storage_Pool (Id : E) return E is
463 begin
464 pragma Assert (Is_Access_Type (Id));
465 return Node22 (Root_Type (Id));
466 end Associated_Storage_Pool;
468 function Barrier_Function (Id : E) return N is
469 begin
470 pragma Assert (Is_Entry (Id));
471 return Node12 (Id);
472 end Barrier_Function;
474 function Block_Node (Id : E) return N is
475 begin
476 pragma Assert (Ekind (Id) = E_Block);
477 return Node11 (Id);
478 end Block_Node;
480 function Body_Entity (Id : E) return E is
481 begin
482 pragma Assert
483 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
484 return Node19 (Id);
485 end Body_Entity;
487 function C_Pass_By_Copy (Id : E) return B is
488 begin
489 pragma Assert (Is_Record_Type (Id));
490 return Flag125 (Implementation_Base_Type (Id));
491 end C_Pass_By_Copy;
493 function Class_Wide_Type (Id : E) return E is
494 begin
495 pragma Assert (Is_Type (Id));
496 return Node9 (Id);
497 end Class_Wide_Type;
499 function Cloned_Subtype (Id : E) return E is
500 begin
501 pragma Assert
502 (Ekind (Id) = E_Record_Subtype
503 or else Ekind (Id) = E_Class_Wide_Subtype);
504 return Node16 (Id);
505 end Cloned_Subtype;
507 function Component_Bit_Offset (Id : E) return U is
508 begin
509 pragma Assert
510 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
511 return Uint11 (Id);
512 end Component_Bit_Offset;
514 function Component_Clause (Id : E) return N is
515 begin
516 pragma Assert
517 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
518 return Node13 (Id);
519 end Component_Clause;
521 function Component_Size (Id : E) return U is
522 begin
523 pragma Assert (Is_Array_Type (Id));
524 return Uint22 (Implementation_Base_Type (Id));
525 end Component_Size;
527 function Component_Type (Id : E) return E is
528 begin
529 return Node20 (Implementation_Base_Type (Id));
530 end Component_Type;
532 function Corresponding_Concurrent_Type (Id : E) return E is
533 begin
534 pragma Assert (Ekind (Id) = E_Record_Type);
535 return Node18 (Id);
536 end Corresponding_Concurrent_Type;
538 function Corresponding_Discriminant (Id : E) return E is
539 begin
540 pragma Assert (Ekind (Id) = E_Discriminant);
541 return Node19 (Id);
542 end Corresponding_Discriminant;
544 function Corresponding_Equality (Id : E) return E is
545 begin
546 pragma Assert
547 (Ekind (Id) = E_Function
548 and then not Comes_From_Source (Id)
549 and then Chars (Id) = Name_Op_Ne);
550 return Node13 (Id);
551 end Corresponding_Equality;
553 function Corresponding_Record_Type (Id : E) return E is
554 begin
555 pragma Assert (Is_Concurrent_Type (Id));
556 return Node18 (Id);
557 end Corresponding_Record_Type;
559 function Corresponding_Remote_Type (Id : E) return E is
560 begin
561 return Node22 (Id);
562 end Corresponding_Remote_Type;
564 function CR_Discriminant (Id : E) return E is
565 begin
566 return Node23 (Id);
567 end CR_Discriminant;
569 function Debug_Info_Off (Id : E) return B is
570 begin
571 return Flag166 (Id);
572 end Debug_Info_Off;
574 function Debug_Renaming_Link (Id : E) return E is
575 begin
576 return Node13 (Id);
577 end Debug_Renaming_Link;
579 function Default_Expr_Function (Id : E) return E is
580 begin
581 pragma Assert (Is_Formal (Id));
582 return Node21 (Id);
583 end Default_Expr_Function;
585 function Default_Expressions_Processed (Id : E) return B is
586 begin
587 return Flag108 (Id);
588 end Default_Expressions_Processed;
590 function Default_Value (Id : E) return N is
591 begin
592 pragma Assert (Is_Formal (Id));
593 return Node20 (Id);
594 end Default_Value;
596 function Delay_Cleanups (Id : E) return B is
597 begin
598 return Flag114 (Id);
599 end Delay_Cleanups;
601 function Delay_Subprogram_Descriptors (Id : E) return B is
602 begin
603 return Flag50 (Id);
604 end Delay_Subprogram_Descriptors;
606 function Delta_Value (Id : E) return R is
607 begin
608 pragma Assert (Is_Fixed_Point_Type (Id));
609 return Ureal18 (Id);
610 end Delta_Value;
612 function Dependent_Instances (Id : E) return L is
613 begin
614 pragma Assert (Is_Generic_Instance (Id));
615 return Elist8 (Id);
616 end Dependent_Instances;
618 function Depends_On_Private (Id : E) return B is
619 begin
620 pragma Assert (Nkind (Id) in N_Entity);
621 return Flag14 (Id);
622 end Depends_On_Private;
624 function Digits_Value (Id : E) return U is
625 begin
626 pragma Assert
627 (Is_Floating_Point_Type (Id)
628 or else Is_Decimal_Fixed_Point_Type (Id));
629 return Uint17 (Id);
630 end Digits_Value;
632 function Directly_Designated_Type (Id : E) return E is
633 begin
634 return Node20 (Id);
635 end Directly_Designated_Type;
637 function Discard_Names (Id : E) return B is
638 begin
639 return Flag88 (Id);
640 end Discard_Names;
642 function Discriminal (Id : E) return E is
643 begin
644 pragma Assert (Ekind (Id) = E_Discriminant);
645 return Node17 (Id);
646 end Discriminal;
648 function Discriminal_Link (Id : E) return N is
649 begin
650 return Node10 (Id);
651 end Discriminal_Link;
653 function Discriminant_Checking_Func (Id : E) return E is
654 begin
655 pragma Assert (Ekind (Id) = E_Component);
656 return Node20 (Id);
657 end Discriminant_Checking_Func;
659 function Discriminant_Constraint (Id : E) return L is
660 begin
661 pragma Assert (Is_Composite_Type (Id) and then Has_Discriminants (Id));
662 return Elist21 (Id);
663 end Discriminant_Constraint;
665 function Discriminant_Default_Value (Id : E) return N is
666 begin
667 pragma Assert (Ekind (Id) = E_Discriminant);
668 return Node20 (Id);
669 end Discriminant_Default_Value;
671 function Discriminant_Number (Id : E) return U is
672 begin
673 pragma Assert (Ekind (Id) = E_Discriminant);
674 return Uint15 (Id);
675 end Discriminant_Number;
677 function DT_Entry_Count (Id : E) return U is
678 begin
679 pragma Assert (Ekind (Id) = E_Component and then Is_Tag (Id));
680 return Uint15 (Id);
681 end DT_Entry_Count;
683 function DT_Position (Id : E) return U is
684 begin
685 pragma Assert
686 ((Ekind (Id) = E_Function
687 or else Ekind (Id) = E_Procedure)
688 and then Present (DTC_Entity (Id)));
689 return Uint15 (Id);
690 end DT_Position;
692 function DTC_Entity (Id : E) return E is
693 begin
694 pragma Assert
695 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
696 return Node16 (Id);
697 end DTC_Entity;
699 function Elaborate_All_Desirable (Id : E) return B is
700 begin
701 return Flag146 (Id);
702 end Elaborate_All_Desirable;
704 function Elaboration_Entity (Id : E) return E is
705 begin
706 pragma Assert
707 (Is_Subprogram (Id)
708 or else
709 Ekind (Id) = E_Package
710 or else
711 Is_Generic_Unit (Id));
712 return Node13 (Id);
713 end Elaboration_Entity;
715 function Elaboration_Entity_Required (Id : E) return B is
716 begin
717 pragma Assert
718 (Is_Subprogram (Id)
719 or else
720 Ekind (Id) = E_Package
721 or else
722 Is_Generic_Unit (Id));
723 return Flag174 (Id);
724 end Elaboration_Entity_Required;
726 function Enclosing_Scope (Id : E) return E is
727 begin
728 return Node18 (Id);
729 end Enclosing_Scope;
731 function Entry_Accepted (Id : E) return B is
732 begin
733 pragma Assert (Is_Entry (Id));
734 return Flag152 (Id);
735 end Entry_Accepted;
737 function Entry_Bodies_Array (Id : E) return E is
738 begin
739 return Node15 (Id);
740 end Entry_Bodies_Array;
742 function Entry_Cancel_Parameter (Id : E) return E is
743 begin
744 return Node23 (Id);
745 end Entry_Cancel_Parameter;
747 function Entry_Component (Id : E) return E is
748 begin
749 return Node11 (Id);
750 end Entry_Component;
752 function Entry_Formal (Id : E) return E is
753 begin
754 return Node16 (Id);
755 end Entry_Formal;
757 function Entry_Index_Constant (Id : E) return N is
758 begin
759 pragma Assert (Ekind (Id) = E_Entry_Index_Parameter);
760 return Node18 (Id);
761 end Entry_Index_Constant;
763 function Entry_Parameters_Type (Id : E) return E is
764 begin
765 return Node15 (Id);
766 end Entry_Parameters_Type;
768 function Enum_Pos_To_Rep (Id : E) return E is
769 begin
770 pragma Assert (Ekind (Id) = E_Enumeration_Type);
771 return Node23 (Id);
772 end Enum_Pos_To_Rep;
774 function Enumeration_Pos (Id : E) return Uint is
775 begin
776 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
777 return Uint11 (Id);
778 end Enumeration_Pos;
780 function Enumeration_Rep (Id : E) return U is
781 begin
782 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
783 return Uint12 (Id);
784 end Enumeration_Rep;
786 function Enumeration_Rep_Expr (Id : E) return N is
787 begin
788 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
789 return Node22 (Id);
790 end Enumeration_Rep_Expr;
792 function Equivalent_Type (Id : E) return E is
793 begin
794 pragma Assert
795 (Ekind (Id) = E_Class_Wide_Subtype or else
796 Ekind (Id) = E_Access_Protected_Subprogram_Type or else
797 Ekind (Id) = E_Access_Subprogram_Type or else
798 Ekind (Id) = E_Exception_Type);
799 return Node18 (Id);
800 end Equivalent_Type;
802 function Esize (Id : E) return Uint is
803 begin
804 return Uint12 (Id);
805 end Esize;
807 function Exception_Code (Id : E) return Uint is
808 begin
809 pragma Assert (Ekind (Id) = E_Exception);
810 return Uint22 (Id);
811 end Exception_Code;
813 function Extra_Accessibility (Id : E) return E is
814 begin
815 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
816 return Node13 (Id);
817 end Extra_Accessibility;
819 function Extra_Constrained (Id : E) return E is
820 begin
821 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
822 return Node23 (Id);
823 end Extra_Constrained;
825 function Extra_Formal (Id : E) return E is
826 begin
827 return Node15 (Id);
828 end Extra_Formal;
830 function Finalization_Chain_Entity (Id : E) return E is
831 begin
832 return Node19 (Id);
833 end Finalization_Chain_Entity;
835 function Finalize_Storage_Only (Id : E) return B is
836 begin
837 pragma Assert (Is_Type (Id));
838 return Flag158 (Base_Type (Id));
839 end Finalize_Storage_Only;
841 function First_Entity (Id : E) return E is
842 begin
843 return Node17 (Id);
844 end First_Entity;
846 function First_Index (Id : E) return N is
847 begin
848 return Node17 (Id);
849 end First_Index;
851 function First_Literal (Id : E) return E is
852 begin
853 return Node17 (Id);
854 end First_Literal;
856 function First_Optional_Parameter (Id : E) return E is
857 begin
858 pragma Assert
859 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
860 return Node14 (Id);
861 end First_Optional_Parameter;
863 function First_Private_Entity (Id : E) return E is
864 begin
865 return Node16 (Id);
866 end First_Private_Entity;
868 function First_Rep_Item (Id : E) return E is
869 begin
870 return Node6 (Id);
871 end First_Rep_Item;
873 function Freeze_Node (Id : E) return N is
874 begin
875 return Node7 (Id);
876 end Freeze_Node;
878 function From_With_Type (Id : E) return B is
879 begin
880 return Flag159 (Id);
881 end From_With_Type;
883 function Full_View (Id : E) return E is
884 begin
885 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Constant);
886 return Node11 (Id);
887 end Full_View;
889 function Function_Returns_With_DSP (Id : E) return B is
890 begin
891 pragma Assert
892 (Is_Subprogram (Id) or else Ekind (Id) = E_Subprogram_Type);
893 return Flag169 (Id);
894 end Function_Returns_With_DSP;
896 function Generic_Renamings (Id : E) return L is
897 begin
898 return Elist23 (Id);
899 end Generic_Renamings;
901 function Girder_Constraint (Id : E) return L is
902 begin
903 pragma Assert
904 (Is_Composite_Type (Id) and then not Is_Array_Type (Id));
905 return Elist23 (Id);
906 end Girder_Constraint;
908 function Handler_Records (Id : E) return S is
909 begin
910 return List10 (Id);
911 end Handler_Records;
913 function Has_Aliased_Components (Id : E) return B is
914 begin
915 return Flag135 (Implementation_Base_Type (Id));
916 end Has_Aliased_Components;
918 function Has_Alignment_Clause (Id : E) return B is
919 begin
920 return Flag46 (Id);
921 end Has_Alignment_Clause;
923 function Has_All_Calls_Remote (Id : E) return B is
924 begin
925 return Flag79 (Id);
926 end Has_All_Calls_Remote;
928 function Has_Atomic_Components (Id : E) return B is
929 begin
930 return Flag86 (Implementation_Base_Type (Id));
931 end Has_Atomic_Components;
933 function Has_Biased_Representation (Id : E) return B is
934 begin
935 return Flag139 (Id);
936 end Has_Biased_Representation;
938 function Has_Completion (Id : E) return B is
939 begin
940 return Flag26 (Id);
941 end Has_Completion;
943 function Has_Completion_In_Body (Id : E) return B is
944 begin
945 pragma Assert (Is_Type (Id));
946 return Flag71 (Id);
947 end Has_Completion_In_Body;
949 function Has_Complex_Representation (Id : E) return B is
950 begin
951 pragma Assert (Is_Type (Id));
952 return Flag140 (Implementation_Base_Type (Id));
953 end Has_Complex_Representation;
955 function Has_Component_Size_Clause (Id : E) return B is
956 begin
957 pragma Assert (Is_Array_Type (Id));
958 return Flag68 (Implementation_Base_Type (Id));
959 end Has_Component_Size_Clause;
961 function Has_Controlled_Component (Id : E) return B is
962 begin
963 return Flag43 (Base_Type (Id));
964 end Has_Controlled_Component;
966 function Has_Controlling_Result (Id : E) return B is
967 begin
968 return Flag98 (Id);
969 end Has_Controlling_Result;
971 function Has_Convention_Pragma (Id : E) return B is
972 begin
973 return Flag119 (Id);
974 end Has_Convention_Pragma;
976 function Has_Delayed_Freeze (Id : E) return B is
977 begin
978 pragma Assert (Nkind (Id) in N_Entity);
979 return Flag18 (Id);
980 end Has_Delayed_Freeze;
982 function Has_Discriminants (Id : E) return B is
983 begin
984 pragma Assert (Nkind (Id) in N_Entity);
985 return Flag5 (Id);
986 end Has_Discriminants;
988 function Has_Enumeration_Rep_Clause (Id : E) return B is
989 begin
990 pragma Assert (Is_Enumeration_Type (Id));
991 return Flag66 (Id);
992 end Has_Enumeration_Rep_Clause;
994 function Has_Exit (Id : E) return B is
995 begin
996 return Flag47 (Id);
997 end Has_Exit;
999 function Has_External_Tag_Rep_Clause (Id : E) return B is
1000 begin
1001 pragma Assert (Is_Tagged_Type (Id));
1002 return Flag110 (Id);
1003 end Has_External_Tag_Rep_Clause;
1005 function Has_Forward_Instantiation (Id : E) return B is
1006 begin
1007 return Flag175 (Id);
1008 end Has_Forward_Instantiation;
1010 function Has_Fully_Qualified_Name (Id : E) return B is
1011 begin
1012 return Flag173 (Id);
1013 end Has_Fully_Qualified_Name;
1015 function Has_Gigi_Rep_Item (Id : E) return B is
1016 begin
1017 return Flag82 (Id);
1018 end Has_Gigi_Rep_Item;
1020 function Has_Homonym (Id : E) return B is
1021 begin
1022 return Flag56 (Id);
1023 end Has_Homonym;
1025 function Has_Machine_Radix_Clause (Id : E) return B is
1026 begin
1027 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
1028 return Flag83 (Id);
1029 end Has_Machine_Radix_Clause;
1031 function Has_Master_Entity (Id : E) return B is
1032 begin
1033 return Flag21 (Id);
1034 end Has_Master_Entity;
1036 function Has_Missing_Return (Id : E) return B is
1037 begin
1038 pragma Assert
1039 (Ekind (Id) = E_Function or else Ekind (Id) = E_Generic_Function);
1040 return Flag142 (Id);
1041 end Has_Missing_Return;
1043 function Has_Nested_Block_With_Handler (Id : E) return B is
1044 begin
1045 return Flag101 (Id);
1046 end Has_Nested_Block_With_Handler;
1048 function Has_Non_Standard_Rep (Id : E) return B is
1049 begin
1050 return Flag75 (Implementation_Base_Type (Id));
1051 end Has_Non_Standard_Rep;
1053 function Has_Object_Size_Clause (Id : E) return B is
1054 begin
1055 pragma Assert (Is_Type (Id));
1056 return Flag172 (Id);
1057 end Has_Object_Size_Clause;
1059 function Has_Per_Object_Constraint (Id : E) return B is
1060 begin
1061 return Flag154 (Id);
1062 end Has_Per_Object_Constraint;
1064 function Has_Pragma_Controlled (Id : E) return B is
1065 begin
1066 pragma Assert (Is_Access_Type (Id));
1067 return Flag27 (Implementation_Base_Type (Id));
1068 end Has_Pragma_Controlled;
1070 function Has_Pragma_Elaborate_Body (Id : E) return B is
1071 begin
1072 return Flag150 (Id);
1073 end Has_Pragma_Elaborate_Body;
1075 function Has_Pragma_Inline (Id : E) return B is
1076 begin
1077 return Flag157 (Id);
1078 end Has_Pragma_Inline;
1080 function Has_Pragma_Pack (Id : E) return B is
1081 begin
1082 pragma Assert (Is_Record_Type (Id) or else Is_Array_Type (Id));
1083 return Flag121 (Implementation_Base_Type (Id));
1084 end Has_Pragma_Pack;
1086 function Has_Pragma_Pure_Function (Id : E) return B is
1087 begin
1088 pragma Assert (Is_Subprogram (Id));
1089 return Flag179 (Id);
1090 end Has_Pragma_Pure_Function;
1092 function Has_Pragma_Unreferenced (Id : E) return B is
1093 begin
1094 return Flag180 (Id);
1095 end Has_Pragma_Unreferenced;
1097 function Has_Primitive_Operations (Id : E) return B is
1098 begin
1099 pragma Assert (Is_Type (Id));
1100 return Flag120 (Base_Type (Id));
1101 end Has_Primitive_Operations;
1103 function Has_Private_Declaration (Id : E) return B is
1104 begin
1105 return Flag155 (Id);
1106 end Has_Private_Declaration;
1108 function Has_Qualified_Name (Id : E) return B is
1109 begin
1110 return Flag161 (Id);
1111 end Has_Qualified_Name;
1113 function Has_Record_Rep_Clause (Id : E) return B is
1114 begin
1115 pragma Assert (Is_Record_Type (Id));
1116 return Flag65 (Implementation_Base_Type (Id));
1117 end Has_Record_Rep_Clause;
1119 function Has_Recursive_Call (Id : E) return B is
1120 begin
1121 pragma Assert (Is_Subprogram (Id));
1122 return Flag143 (Id);
1123 end Has_Recursive_Call;
1125 function Has_Size_Clause (Id : E) return B is
1126 begin
1127 return Flag29 (Id);
1128 end Has_Size_Clause;
1130 function Has_Small_Clause (Id : E) return B is
1131 begin
1132 return Flag67 (Id);
1133 end Has_Small_Clause;
1135 function Has_Specified_Layout (Id : E) return B is
1136 begin
1137 pragma Assert (Is_Type (Id));
1138 return Flag100 (Implementation_Base_Type (Id));
1139 end Has_Specified_Layout;
1141 function Has_Storage_Size_Clause (Id : E) return B is
1142 begin
1143 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
1144 return Flag23 (Implementation_Base_Type (Id));
1145 end Has_Storage_Size_Clause;
1147 function Has_Subprogram_Descriptor (Id : E) return B is
1148 begin
1149 return Flag93 (Id);
1150 end Has_Subprogram_Descriptor;
1152 function Has_Task (Id : E) return B is
1153 begin
1154 return Flag30 (Base_Type (Id));
1155 end Has_Task;
1157 function Has_Unchecked_Union (Id : E) return B is
1158 begin
1159 return Flag123 (Base_Type (Id));
1160 end Has_Unchecked_Union;
1162 function Has_Unknown_Discriminants (Id : E) return B is
1163 begin
1164 pragma Assert (Is_Type (Id));
1165 return Flag72 (Id);
1166 end Has_Unknown_Discriminants;
1168 function Has_Volatile_Components (Id : E) return B is
1169 begin
1170 return Flag87 (Implementation_Base_Type (Id));
1171 end Has_Volatile_Components;
1173 function Hiding_Loop_Variable (Id : E) return E is
1174 begin
1175 pragma Assert (Ekind (Id) = E_Variable);
1176 return Node8 (Id);
1177 end Hiding_Loop_Variable;
1179 function Homonym (Id : E) return E is
1180 begin
1181 return Node4 (Id);
1182 end Homonym;
1184 function In_Package_Body (Id : E) return B is
1185 begin
1186 return Flag48 (Id);
1187 end In_Package_Body;
1189 function In_Private_Part (Id : E) return B is
1190 begin
1191 return Flag45 (Id);
1192 end In_Private_Part;
1194 function In_Use (Id : E) return B is
1195 begin
1196 pragma Assert (Nkind (Id) in N_Entity);
1197 return Flag8 (Id);
1198 end In_Use;
1200 function Inner_Instances (Id : E) return L is
1201 begin
1202 return Elist23 (Id);
1203 end Inner_Instances;
1205 function Interface_Name (Id : E) return N is
1206 begin
1207 return Node21 (Id);
1208 end Interface_Name;
1210 function Is_Abstract (Id : E) return B is
1211 begin
1212 return Flag19 (Id);
1213 end Is_Abstract;
1215 function Is_Access_Constant (Id : E) return B is
1216 begin
1217 pragma Assert (Is_Access_Type (Id));
1218 return Flag69 (Id);
1219 end Is_Access_Constant;
1221 function Is_Aliased (Id : E) return B is
1222 begin
1223 pragma Assert (Nkind (Id) in N_Entity);
1224 return Flag15 (Id);
1225 end Is_Aliased;
1227 function Is_AST_Entry (Id : E) return B is
1228 begin
1229 pragma Assert (Is_Entry (Id));
1230 return Flag132 (Id);
1231 end Is_AST_Entry;
1233 function Is_Asynchronous (Id : E) return B is
1234 begin
1235 pragma Assert
1236 (Ekind (Id) = E_Procedure or else Is_Type (Id));
1237 return Flag81 (Id);
1238 end Is_Asynchronous;
1240 function Is_Atomic (Id : E) return B is
1241 begin
1242 return Flag85 (Id);
1243 end Is_Atomic;
1245 function Is_Bit_Packed_Array (Id : E) return B is
1246 begin
1247 return Flag122 (Implementation_Base_Type (Id));
1248 end Is_Bit_Packed_Array;
1250 function Is_Called (Id : E) return B is
1251 begin
1252 pragma Assert
1253 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Function);
1254 return Flag102 (Id);
1255 end Is_Called;
1257 function Is_Character_Type (Id : E) return B is
1258 begin
1259 return Flag63 (Id);
1260 end Is_Character_Type;
1262 function Is_Child_Unit (Id : E) return B is
1263 begin
1264 return Flag73 (Id);
1265 end Is_Child_Unit;
1267 function Is_Compilation_Unit (Id : E) return B is
1268 begin
1269 return Flag149 (Id);
1270 end Is_Compilation_Unit;
1272 function Is_Completely_Hidden (Id : E) return B is
1273 begin
1274 pragma Assert (Ekind (Id) = E_Discriminant);
1275 return Flag103 (Id);
1276 end Is_Completely_Hidden;
1278 function Is_Constr_Subt_For_U_Nominal (Id : E) return B is
1279 begin
1280 return Flag80 (Id);
1281 end Is_Constr_Subt_For_U_Nominal;
1283 function Is_Constr_Subt_For_UN_Aliased (Id : E) return B is
1284 begin
1285 return Flag141 (Id);
1286 end Is_Constr_Subt_For_UN_Aliased;
1288 function Is_Constrained (Id : E) return B is
1289 begin
1290 pragma Assert (Nkind (Id) in N_Entity);
1291 return Flag12 (Id);
1292 end Is_Constrained;
1294 function Is_Constructor (Id : E) return B is
1295 begin
1296 return Flag76 (Id);
1297 end Is_Constructor;
1299 function Is_Controlled (Id : E) return B is
1300 begin
1301 return Flag42 (Base_Type (Id));
1302 end Is_Controlled;
1304 function Is_Controlling_Formal (Id : E) return B is
1305 begin
1306 pragma Assert (Is_Formal (Id));
1307 return Flag97 (Id);
1308 end Is_Controlling_Formal;
1310 function Is_CPP_Class (Id : E) return B is
1311 begin
1312 return Flag74 (Id);
1313 end Is_CPP_Class;
1315 function Is_Destructor (Id : E) return B is
1316 begin
1317 return Flag77 (Id);
1318 end Is_Destructor;
1320 function Is_Discrim_SO_Function (Id : E) return B is
1321 begin
1322 return Flag176 (Id);
1323 end Is_Discrim_SO_Function;
1325 function Is_Dispatching_Operation (Id : E) return B is
1326 begin
1327 pragma Assert (Nkind (Id) in N_Entity);
1328 return Flag6 (Id);
1329 end Is_Dispatching_Operation;
1331 function Is_Eliminated (Id : E) return B is
1332 begin
1333 return Flag124 (Id);
1334 end Is_Eliminated;
1336 function Is_Entry_Formal (Id : E) return B is
1337 begin
1338 return Flag52 (Id);
1339 end Is_Entry_Formal;
1341 function Is_Exported (Id : E) return B is
1342 begin
1343 return Flag99 (Id);
1344 end Is_Exported;
1346 function Is_First_Subtype (Id : E) return B is
1347 begin
1348 return Flag70 (Id);
1349 end Is_First_Subtype;
1351 function Is_For_Access_Subtype (Id : E) return B is
1352 begin
1353 pragma Assert
1354 (Ekind (Id) = E_Record_Subtype
1355 or else
1356 Ekind (Id) = E_Private_Subtype);
1357 return Flag118 (Id);
1358 end Is_For_Access_Subtype;
1360 function Is_Formal_Subprogram (Id : E) return B is
1361 begin
1362 return Flag111 (Id);
1363 end Is_Formal_Subprogram;
1365 function Is_Frozen (Id : E) return B is
1366 begin
1367 return Flag4 (Id);
1368 end Is_Frozen;
1370 function Is_Generic_Actual_Type (Id : E) return B is
1371 begin
1372 pragma Assert (Is_Type (Id));
1373 return Flag94 (Id);
1374 end Is_Generic_Actual_Type;
1376 function Is_Generic_Instance (Id : E) return B is
1377 begin
1378 return Flag130 (Id);
1379 end Is_Generic_Instance;
1381 function Is_Generic_Type (Id : E) return B is
1382 begin
1383 pragma Assert (Nkind (Id) in N_Entity);
1384 return Flag13 (Id);
1385 end Is_Generic_Type;
1387 function Is_Hidden (Id : E) return B is
1388 begin
1389 return Flag57 (Id);
1390 end Is_Hidden;
1392 function Is_Hidden_Open_Scope (Id : E) return B is
1393 begin
1394 return Flag171 (Id);
1395 end Is_Hidden_Open_Scope;
1397 function Is_Immediately_Visible (Id : E) return B is
1398 begin
1399 pragma Assert (Nkind (Id) in N_Entity);
1400 return Flag7 (Id);
1401 end Is_Immediately_Visible;
1403 function Is_Imported (Id : E) return B is
1404 begin
1405 return Flag24 (Id);
1406 end Is_Imported;
1408 function Is_Inlined (Id : E) return B is
1409 begin
1410 return Flag11 (Id);
1411 end Is_Inlined;
1413 function Is_Instantiated (Id : E) return B is
1414 begin
1415 return Flag126 (Id);
1416 end Is_Instantiated;
1418 function Is_Internal (Id : E) return B is
1419 begin
1420 pragma Assert (Nkind (Id) in N_Entity);
1421 return Flag17 (Id);
1422 end Is_Internal;
1424 function Is_Interrupt_Handler (Id : E) return B is
1425 begin
1426 pragma Assert (Nkind (Id) in N_Entity);
1427 return Flag89 (Id);
1428 end Is_Interrupt_Handler;
1430 function Is_Intrinsic_Subprogram (Id : E) return B is
1431 begin
1432 return Flag64 (Id);
1433 end Is_Intrinsic_Subprogram;
1435 function Is_Itype (Id : E) return B is
1436 begin
1437 return Flag91 (Id);
1438 end Is_Itype;
1440 function Is_Known_Valid (Id : E) return B is
1441 begin
1442 return Flag170 (Id);
1443 end Is_Known_Valid;
1445 function Is_Limited_Composite (Id : E) return B is
1446 begin
1447 return Flag106 (Id);
1448 end Is_Limited_Composite;
1450 function Is_Limited_Record (Id : E) return B is
1451 begin
1452 return Flag25 (Id);
1453 end Is_Limited_Record;
1455 function Is_Machine_Code_Subprogram (Id : E) return B is
1456 begin
1457 pragma Assert (Is_Subprogram (Id));
1458 return Flag137 (Id);
1459 end Is_Machine_Code_Subprogram;
1461 function Is_Non_Static_Subtype (Id : E) return B is
1462 begin
1463 pragma Assert (Is_Type (Id));
1464 return Flag109 (Id);
1465 end Is_Non_Static_Subtype;
1467 function Is_Null_Init_Proc (Id : E) return B is
1468 begin
1469 pragma Assert (Ekind (Id) = E_Procedure);
1470 return Flag178 (Id);
1471 end Is_Null_Init_Proc;
1473 function Is_Optional_Parameter (Id : E) return B is
1474 begin
1475 pragma Assert (Is_Formal (Id));
1476 return Flag134 (Id);
1477 end Is_Optional_Parameter;
1479 function Is_Package_Body_Entity (Id : E) return B is
1480 begin
1481 return Flag160 (Id);
1482 end Is_Package_Body_Entity;
1484 function Is_Packed (Id : E) return B is
1485 begin
1486 return Flag51 (Implementation_Base_Type (Id));
1487 end Is_Packed;
1489 function Is_Packed_Array_Type (Id : E) return B is
1490 begin
1491 return Flag138 (Id);
1492 end Is_Packed_Array_Type;
1494 function Is_Potentially_Use_Visible (Id : E) return B is
1495 begin
1496 pragma Assert (Nkind (Id) in N_Entity);
1497 return Flag9 (Id);
1498 end Is_Potentially_Use_Visible;
1500 function Is_Preelaborated (Id : E) return B is
1501 begin
1502 return Flag59 (Id);
1503 end Is_Preelaborated;
1505 function Is_Private_Composite (Id : E) return B is
1506 begin
1507 pragma Assert (Is_Type (Id));
1508 return Flag107 (Id);
1509 end Is_Private_Composite;
1511 function Is_Private_Descendant (Id : E) return B is
1512 begin
1513 return Flag53 (Id);
1514 end Is_Private_Descendant;
1516 function Is_Psected (Id : E) return B is
1517 begin
1518 return Flag153 (Id);
1519 end Is_Psected;
1521 function Is_Public (Id : E) return B is
1522 begin
1523 pragma Assert (Nkind (Id) in N_Entity);
1524 return Flag10 (Id);
1525 end Is_Public;
1527 function Is_Pure (Id : E) return B is
1528 begin
1529 return Flag44 (Id);
1530 end Is_Pure;
1532 function Is_Remote_Call_Interface (Id : E) return B is
1533 begin
1534 return Flag62 (Id);
1535 end Is_Remote_Call_Interface;
1537 function Is_Remote_Types (Id : E) return B is
1538 begin
1539 return Flag61 (Id);
1540 end Is_Remote_Types;
1542 function Is_Renaming_Of_Object (Id : E) return B is
1543 begin
1544 return Flag112 (Id);
1545 end Is_Renaming_Of_Object;
1547 function Is_Shared_Passive (Id : E) return B is
1548 begin
1549 return Flag60 (Id);
1550 end Is_Shared_Passive;
1552 function Is_Statically_Allocated (Id : E) return B is
1553 begin
1554 return Flag28 (Id);
1555 end Is_Statically_Allocated;
1557 function Is_Tag (Id : E) return B is
1558 begin
1559 pragma Assert (Nkind (Id) in N_Entity);
1560 return Flag78 (Id);
1561 end Is_Tag;
1563 function Is_Tagged_Type (Id : E) return B is
1564 begin
1565 return Flag55 (Id);
1566 end Is_Tagged_Type;
1568 function Is_True_Constant (Id : E) return B is
1569 begin
1570 return Flag163 (Id);
1571 end Is_True_Constant;
1573 function Is_Unchecked_Union (Id : E) return B is
1574 begin
1575 return Flag117 (Id);
1576 end Is_Unchecked_Union;
1578 function Is_Unsigned_Type (Id : E) return B is
1579 begin
1580 pragma Assert (Is_Type (Id));
1581 return Flag144 (Id);
1582 end Is_Unsigned_Type;
1584 function Is_Valued_Procedure (Id : E) return B is
1585 begin
1586 pragma Assert (Ekind (Id) = E_Procedure);
1587 return Flag127 (Id);
1588 end Is_Valued_Procedure;
1590 function Is_Visible_Child_Unit (Id : E) return B is
1591 begin
1592 pragma Assert (Is_Child_Unit (Id));
1593 return Flag116 (Id);
1594 end Is_Visible_Child_Unit;
1596 function Is_VMS_Exception (Id : E) return B is
1597 begin
1598 return Flag133 (Id);
1599 end Is_VMS_Exception;
1601 function Is_Volatile (Id : E) return B is
1602 begin
1603 pragma Assert (Nkind (Id) in N_Entity);
1604 return Flag16 (Id);
1605 end Is_Volatile;
1607 function Last_Entity (Id : E) return E is
1608 begin
1609 return Node20 (Id);
1610 end Last_Entity;
1612 function Lit_Indexes (Id : E) return E is
1613 begin
1614 pragma Assert (Is_Enumeration_Type (Id));
1615 return Node15 (Id);
1616 end Lit_Indexes;
1618 function Lit_Strings (Id : E) return E is
1619 begin
1620 pragma Assert (Is_Enumeration_Type (Id));
1621 return Node16 (Id);
1622 end Lit_Strings;
1624 function Machine_Radix_10 (Id : E) return B is
1625 begin
1626 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
1627 return Flag84 (Id);
1628 end Machine_Radix_10;
1630 function Master_Id (Id : E) return E is
1631 begin
1632 return Node17 (Id);
1633 end Master_Id;
1635 function Materialize_Entity (Id : E) return B is
1636 begin
1637 return Flag168 (Id);
1638 end Materialize_Entity;
1640 function Mechanism (Id : E) return M is
1641 begin
1642 pragma Assert (Ekind (Id) = E_Function or else Is_Formal (Id));
1643 return UI_To_Int (Uint8 (Id));
1644 end Mechanism;
1646 function Modulus (Id : E) return Uint is
1647 begin
1648 pragma Assert (Is_Modular_Integer_Type (Id));
1649 return Uint17 (Base_Type (Id));
1650 end Modulus;
1652 function Needs_Debug_Info (Id : E) return B is
1653 begin
1654 return Flag147 (Id);
1655 end Needs_Debug_Info;
1657 function Needs_No_Actuals (Id : E) return B is
1658 begin
1659 pragma Assert
1660 (Is_Overloadable (Id)
1661 or else Ekind (Id) = E_Subprogram_Type
1662 or else Ekind (Id) = E_Entry_Family);
1663 return Flag22 (Id);
1664 end Needs_No_Actuals;
1666 function Next_Inlined_Subprogram (Id : E) return E is
1667 begin
1668 return Node12 (Id);
1669 end Next_Inlined_Subprogram;
1671 function No_Pool_Assigned (Id : E) return B is
1672 begin
1673 pragma Assert (Is_Access_Type (Id));
1674 return Flag131 (Root_Type (Id));
1675 end No_Pool_Assigned;
1677 function No_Return (Id : E) return B is
1678 begin
1679 pragma Assert
1680 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Generic_Procedure);
1681 return Flag113 (Id);
1682 end No_Return;
1684 function Non_Binary_Modulus (Id : E) return B is
1685 begin
1686 pragma Assert (Is_Modular_Integer_Type (Id));
1687 return Flag58 (Base_Type (Id));
1688 end Non_Binary_Modulus;
1690 function Nonzero_Is_True (Id : E) return B is
1691 begin
1692 pragma Assert (Root_Type (Id) = Standard_Boolean);
1693 return Flag162 (Base_Type (Id));
1694 end Nonzero_Is_True;
1696 function Normalized_First_Bit (Id : E) return U is
1697 begin
1698 pragma Assert
1699 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
1700 return Uint8 (Id);
1701 end Normalized_First_Bit;
1703 function Normalized_Position (Id : E) return U is
1704 begin
1705 pragma Assert
1706 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
1707 return Uint9 (Id);
1708 end Normalized_Position;
1710 function Normalized_Position_Max (Id : E) return U is
1711 begin
1712 pragma Assert
1713 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
1714 return Uint10 (Id);
1715 end Normalized_Position_Max;
1717 function Not_Source_Assigned (Id : E) return B is
1718 begin
1719 return Flag115 (Id);
1720 end Not_Source_Assigned;
1722 function Object_Ref (Id : E) return E is
1723 begin
1724 pragma Assert (Ekind (Id) = E_Protected_Body);
1725 return Node17 (Id);
1726 end Object_Ref;
1728 function Original_Array_Type (Id : E) return E is
1729 begin
1730 pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id));
1731 return Node21 (Id);
1732 end Original_Array_Type;
1734 function Original_Record_Component (Id : E) return E is
1735 begin
1736 return Node22 (Id);
1737 end Original_Record_Component;
1739 function Packed_Array_Type (Id : E) return E is
1740 begin
1741 pragma Assert (Is_Array_Type (Id));
1742 return Node23 (Id);
1743 end Packed_Array_Type;
1745 function Parent_Subtype (Id : E) return E is
1746 begin
1747 pragma Assert (Ekind (Id) = E_Record_Type);
1748 return Node19 (Id);
1749 end Parent_Subtype;
1751 function Primitive_Operations (Id : E) return L is
1752 begin
1753 pragma Assert (Is_Tagged_Type (Id));
1754 return Elist15 (Id);
1755 end Primitive_Operations;
1757 function Prival (Id : E) return E is
1758 begin
1759 pragma Assert (Is_Protected_Private (Id));
1760 return Node17 (Id);
1761 end Prival;
1763 function Privals_Chain (Id : E) return L is
1764 begin
1765 pragma Assert (Is_Overloadable (Id)
1766 or else Ekind (Id) = E_Entry_Family);
1767 return Elist23 (Id);
1768 end Privals_Chain;
1770 function Private_Dependents (Id : E) return L is
1771 begin
1772 pragma Assert (Is_Incomplete_Or_Private_Type (Id));
1773 return Elist18 (Id);
1774 end Private_Dependents;
1776 function Private_View (Id : E) return N is
1777 begin
1778 pragma Assert (Is_Private_Type (Id));
1779 return Node22 (Id);
1780 end Private_View;
1782 function Protected_Body_Subprogram (Id : E) return E is
1783 begin
1784 pragma Assert (Is_Subprogram (Id) or else Is_Entry (Id));
1785 return Node11 (Id);
1786 end Protected_Body_Subprogram;
1788 function Protected_Formal (Id : E) return E is
1789 begin
1790 pragma Assert (Is_Formal (Id));
1791 return Node22 (Id);
1792 end Protected_Formal;
1794 function Protected_Operation (Id : E) return N is
1795 begin
1796 pragma Assert (Is_Protected_Private (Id));
1797 return Node23 (Id);
1798 end Protected_Operation;
1800 function Reachable (Id : E) return B is
1801 begin
1802 return Flag49 (Id);
1803 end Reachable;
1805 function Referenced (Id : E) return B is
1806 begin
1807 return Flag156 (Id);
1808 end Referenced;
1810 function Referenced_Object (Id : E) return N is
1811 begin
1812 pragma Assert (Is_Type (Id));
1813 return Node10 (Id);
1814 end Referenced_Object;
1816 function Register_Exception_Call (Id : E) return N is
1817 begin
1818 pragma Assert (Ekind (Id) = E_Exception);
1819 return Node20 (Id);
1820 end Register_Exception_Call;
1822 function Related_Array_Object (Id : E) return E is
1823 begin
1824 pragma Assert (Is_Array_Type (Id));
1825 return Node19 (Id);
1826 end Related_Array_Object;
1828 function Related_Instance (Id : E) return E is
1829 begin
1830 pragma Assert (Ekind (Id) = E_Package);
1831 return Node15 (Id);
1832 end Related_Instance;
1834 function Renamed_Entity (Id : E) return N is
1835 begin
1836 return Node18 (Id);
1837 end Renamed_Entity;
1839 function Renamed_Object (Id : E) return N is
1840 begin
1841 return Node18 (Id);
1842 end Renamed_Object;
1844 function Renaming_Map (Id : E) return U is
1845 begin
1846 return Uint9 (Id);
1847 end Renaming_Map;
1849 function Return_Present (Id : E) return B is
1850 begin
1851 return Flag54 (Id);
1852 end Return_Present;
1854 function Returns_By_Ref (Id : E) return B is
1855 begin
1856 return Flag90 (Id);
1857 end Returns_By_Ref;
1859 function Reverse_Bit_Order (Id : E) return B is
1860 begin
1861 pragma Assert (Is_Record_Type (Id));
1862 return Flag164 (Base_Type (Id));
1863 end Reverse_Bit_Order;
1865 function RM_Size (Id : E) return U is
1866 begin
1867 pragma Assert (Is_Type (Id));
1868 return Uint13 (Id);
1869 end RM_Size;
1871 function Scalar_Range (Id : E) return N is
1872 begin
1873 return Node20 (Id);
1874 end Scalar_Range;
1876 function Scale_Value (Id : E) return U is
1877 begin
1878 return Uint15 (Id);
1879 end Scale_Value;
1881 function Scope_Depth_Value (Id : E) return U is
1882 begin
1883 return Uint22 (Id);
1884 end Scope_Depth_Value;
1886 function Sec_Stack_Needed_For_Return (Id : E) return B is
1887 begin
1888 return Flag167 (Id);
1889 end Sec_Stack_Needed_For_Return;
1891 function Shadow_Entities (Id : E) return S is
1892 begin
1893 pragma Assert
1894 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
1895 return List14 (Id);
1896 end Shadow_Entities;
1898 function Shared_Var_Assign_Proc (Id : E) return E is
1899 begin
1900 pragma Assert (Ekind (Id) = E_Variable);
1901 return Node22 (Id);
1902 end Shared_Var_Assign_Proc;
1904 function Shared_Var_Read_Proc (Id : E) return E is
1905 begin
1906 pragma Assert (Ekind (Id) = E_Variable);
1907 return Node15 (Id);
1908 end Shared_Var_Read_Proc;
1910 function Size_Check_Code (Id : E) return N is
1911 begin
1912 pragma Assert (Ekind (Id) = E_Constant or else Ekind (Id) = E_Variable);
1913 return Node9 (Id);
1914 end Size_Check_Code;
1916 function Size_Depends_On_Discriminant (Id : E) return B is
1917 begin
1918 return Flag177 (Id);
1919 end Size_Depends_On_Discriminant;
1921 function Size_Known_At_Compile_Time (Id : E) return B is
1922 begin
1923 return Flag92 (Id);
1924 end Size_Known_At_Compile_Time;
1926 function Small_Value (Id : E) return R is
1927 begin
1928 pragma Assert (Is_Fixed_Point_Type (Id));
1929 return Ureal21 (Id);
1930 end Small_Value;
1932 function Spec_Entity (Id : E) return E is
1933 begin
1934 pragma Assert
1935 (Ekind (Id) = E_Package_Body or else Is_Formal (Id));
1936 return Node19 (Id);
1937 end Spec_Entity;
1939 function Storage_Size_Variable (Id : E) return E is
1940 begin
1941 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
1942 return Node15 (Implementation_Base_Type (Id));
1943 end Storage_Size_Variable;
1945 function Strict_Alignment (Id : E) return B is
1946 begin
1947 return Flag145 (Implementation_Base_Type (Id));
1948 end Strict_Alignment;
1950 function String_Literal_Length (Id : E) return U is
1951 begin
1952 return Uint16 (Id);
1953 end String_Literal_Length;
1955 function String_Literal_Low_Bound (Id : E) return N is
1956 begin
1957 return Node15 (Id);
1958 end String_Literal_Low_Bound;
1960 function Suppress_Access_Checks (Id : E) return B is
1961 begin
1962 return Flag31 (Id);
1963 end Suppress_Access_Checks;
1965 function Suppress_Accessibility_Checks (Id : E) return B is
1966 begin
1967 return Flag32 (Id);
1968 end Suppress_Accessibility_Checks;
1970 function Suppress_Discriminant_Checks (Id : E) return B is
1971 begin
1972 return Flag33 (Id);
1973 end Suppress_Discriminant_Checks;
1975 function Suppress_Division_Checks (Id : E) return B is
1976 begin
1977 return Flag34 (Id);
1978 end Suppress_Division_Checks;
1980 function Suppress_Elaboration_Checks (Id : E) return B is
1981 begin
1982 return Flag35 (Id);
1983 end Suppress_Elaboration_Checks;
1985 function Suppress_Elaboration_Warnings (Id : E) return B is
1986 begin
1987 return Flag148 (Id);
1988 end Suppress_Elaboration_Warnings;
1990 function Suppress_Index_Checks (Id : E) return B is
1991 begin
1992 return Flag36 (Id);
1993 end Suppress_Index_Checks;
1995 function Suppress_Init_Proc (Id : E) return B is
1996 begin
1997 return Flag105 (Base_Type (Id));
1998 end Suppress_Init_Proc;
2000 function Suppress_Length_Checks (Id : E) return B is
2001 begin
2002 return Flag37 (Id);
2003 end Suppress_Length_Checks;
2005 function Suppress_Overflow_Checks (Id : E) return B is
2006 begin
2007 return Flag38 (Id);
2008 end Suppress_Overflow_Checks;
2010 function Suppress_Range_Checks (Id : E) return B is
2011 begin
2012 return Flag39 (Id);
2013 end Suppress_Range_Checks;
2015 function Suppress_Storage_Checks (Id : E) return B is
2016 begin
2017 return Flag40 (Id);
2018 end Suppress_Storage_Checks;
2020 function Suppress_Style_Checks (Id : E) return B is
2021 begin
2022 return Flag165 (Id);
2023 end Suppress_Style_Checks;
2025 function Suppress_Tag_Checks (Id : E) return B is
2026 begin
2027 return Flag41 (Id);
2028 end Suppress_Tag_Checks;
2030 function Underlying_Full_View (Id : E) return E is
2031 begin
2032 pragma Assert (Ekind (Id) in Private_Kind);
2033 return Node19 (Id);
2034 end Underlying_Full_View;
2036 function Unset_Reference (Id : E) return N is
2037 begin
2038 return Node16 (Id);
2039 end Unset_Reference;
2041 function Uses_Sec_Stack (Id : E) return B is
2042 begin
2043 return Flag95 (Id);
2044 end Uses_Sec_Stack;
2046 function Vax_Float (Id : E) return B is
2047 begin
2048 return Flag151 (Base_Type (Id));
2049 end Vax_Float;
2051 function Warnings_Off (Id : E) return B is
2052 begin
2053 return Flag96 (Id);
2054 end Warnings_Off;
2056 ------------------------------
2057 -- Classification Functions --
2058 ------------------------------
2060 function Is_Access_Type (Id : E) return B is
2061 begin
2062 return Ekind (Id) in Access_Kind;
2063 end Is_Access_Type;
2065 function Is_Array_Type (Id : E) return B is
2066 begin
2067 return Ekind (Id) in Array_Kind;
2068 end Is_Array_Type;
2070 function Is_Class_Wide_Type (Id : E) return B is
2071 begin
2072 return Ekind (Id) in Class_Wide_Kind;
2073 end Is_Class_Wide_Type;
2075 function Is_Composite_Type (Id : E) return B is
2076 begin
2077 return Ekind (Id) in Composite_Kind;
2078 end Is_Composite_Type;
2080 function Is_Concurrent_Body (Id : E) return B is
2081 begin
2082 return Ekind (Id) in
2083 Concurrent_Body_Kind;
2084 end Is_Concurrent_Body;
2086 function Is_Concurrent_Record_Type (Id : E) return B is
2087 begin
2088 return Flag20 (Id);
2089 end Is_Concurrent_Record_Type;
2091 function Is_Concurrent_Type (Id : E) return B is
2092 begin
2093 return Ekind (Id) in Concurrent_Kind;
2094 end Is_Concurrent_Type;
2096 function Is_Decimal_Fixed_Point_Type (Id : E) return B is
2097 begin
2098 return Ekind (Id) in
2099 Decimal_Fixed_Point_Kind;
2100 end Is_Decimal_Fixed_Point_Type;
2102 function Is_Digits_Type (Id : E) return B is
2103 begin
2104 return Ekind (Id) in Digits_Kind;
2105 end Is_Digits_Type;
2107 function Is_Discrete_Or_Fixed_Point_Type (Id : E) return B is
2108 begin
2109 return Ekind (Id) in Discrete_Or_Fixed_Point_Kind;
2110 end Is_Discrete_Or_Fixed_Point_Type;
2112 function Is_Discrete_Type (Id : E) return B is
2113 begin
2114 return Ekind (Id) in Discrete_Kind;
2115 end Is_Discrete_Type;
2117 function Is_Elementary_Type (Id : E) return B is
2118 begin
2119 return Ekind (Id) in Elementary_Kind;
2120 end Is_Elementary_Type;
2122 function Is_Entry (Id : E) return B is
2123 begin
2124 return Ekind (Id) in Entry_Kind;
2125 end Is_Entry;
2127 function Is_Enumeration_Type (Id : E) return B is
2128 begin
2129 return Ekind (Id) in
2130 Enumeration_Kind;
2131 end Is_Enumeration_Type;
2133 function Is_Fixed_Point_Type (Id : E) return B is
2134 begin
2135 return Ekind (Id) in
2136 Fixed_Point_Kind;
2137 end Is_Fixed_Point_Type;
2139 function Is_Floating_Point_Type (Id : E) return B is
2140 begin
2141 return Ekind (Id) in Float_Kind;
2142 end Is_Floating_Point_Type;
2144 function Is_Formal (Id : E) return B is
2145 begin
2146 return Ekind (Id) in Formal_Kind;
2147 end Is_Formal;
2149 function Is_Generic_Unit (Id : E) return B is
2150 begin
2151 return Ekind (Id) in Generic_Unit_Kind;
2152 end Is_Generic_Unit;
2154 function Is_Incomplete_Or_Private_Type (Id : E) return B is
2155 begin
2156 return Ekind (Id) in
2157 Incomplete_Or_Private_Kind;
2158 end Is_Incomplete_Or_Private_Type;
2160 function Is_Integer_Type (Id : E) return B is
2161 begin
2162 return Ekind (Id) in Integer_Kind;
2163 end Is_Integer_Type;
2165 function Is_Modular_Integer_Type (Id : E) return B is
2166 begin
2167 return Ekind (Id) in
2168 Modular_Integer_Kind;
2169 end Is_Modular_Integer_Type;
2171 function Is_Named_Number (Id : E) return B is
2172 begin
2173 return Ekind (Id) in Named_Kind;
2174 end Is_Named_Number;
2176 function Is_Numeric_Type (Id : E) return B is
2177 begin
2178 return Ekind (Id) in Numeric_Kind;
2179 end Is_Numeric_Type;
2181 function Is_Object (Id : E) return B is
2182 begin
2183 return Ekind (Id) in Object_Kind;
2184 end Is_Object;
2186 function Is_Ordinary_Fixed_Point_Type (Id : E) return B is
2187 begin
2188 return Ekind (Id) in
2189 Ordinary_Fixed_Point_Kind;
2190 end Is_Ordinary_Fixed_Point_Type;
2192 function Is_Overloadable (Id : E) return B is
2193 begin
2194 return Ekind (Id) in Overloadable_Kind;
2195 end Is_Overloadable;
2197 function Is_Private_Type (Id : E) return B is
2198 begin
2199 return Ekind (Id) in Private_Kind;
2200 end Is_Private_Type;
2202 function Is_Protected_Type (Id : E) return B is
2203 begin
2204 return Ekind (Id) in Protected_Kind;
2205 end Is_Protected_Type;
2207 function Is_Real_Type (Id : E) return B is
2208 begin
2209 return Ekind (Id) in Real_Kind;
2210 end Is_Real_Type;
2212 function Is_Record_Type (Id : E) return B is
2213 begin
2214 return Ekind (Id) in Record_Kind;
2215 end Is_Record_Type;
2217 function Is_Scalar_Type (Id : E) return B is
2218 begin
2219 return Ekind (Id) in Scalar_Kind;
2220 end Is_Scalar_Type;
2222 function Is_Signed_Integer_Type (Id : E) return B is
2223 begin
2224 return Ekind (Id) in
2225 Signed_Integer_Kind;
2226 end Is_Signed_Integer_Type;
2228 function Is_Subprogram (Id : E) return B is
2229 begin
2230 return Ekind (Id) in Subprogram_Kind;
2231 end Is_Subprogram;
2233 function Is_Task_Type (Id : E) return B is
2234 begin
2235 return Ekind (Id) in Task_Kind;
2236 end Is_Task_Type;
2238 function Is_Type (Id : E) return B is
2239 begin
2240 return Ekind (Id) in Type_Kind;
2241 end Is_Type;
2243 ------------------------------
2244 -- Attribute Set Procedures --
2245 ------------------------------
2247 procedure Set_Accept_Address (Id : E; V : L) is
2248 begin
2249 Set_Elist21 (Id, V);
2250 end Set_Accept_Address;
2252 procedure Set_Access_Disp_Table (Id : E; V : E) is
2253 begin
2254 pragma Assert (Is_Tagged_Type (Id) and then Id = Base_Type (Id));
2255 Set_Node16 (Id, V);
2256 end Set_Access_Disp_Table;
2258 procedure Set_Associated_Final_Chain (Id : E; V : E) is
2259 begin
2260 pragma Assert (Is_Access_Type (Id));
2261 Set_Node23 (Id, V);
2262 end Set_Associated_Final_Chain;
2264 procedure Set_Associated_Formal_Package (Id : E; V : E) is
2265 begin
2266 Set_Node12 (Id, V);
2267 end Set_Associated_Formal_Package;
2269 procedure Set_Associated_Node_For_Itype (Id : E; V : E) is
2270 begin
2271 Set_Node8 (Id, V);
2272 end Set_Associated_Node_For_Itype;
2274 procedure Set_Associated_Storage_Pool (Id : E; V : E) is
2275 begin
2276 pragma Assert (Is_Access_Type (Id) and then Id = Base_Type (Id));
2277 Set_Node22 (Id, V);
2278 end Set_Associated_Storage_Pool;
2280 procedure Set_Actual_Subtype (Id : E; V : E) is
2281 begin
2282 pragma Assert
2283 (Ekind (Id) = E_Constant
2284 or else Ekind (Id) = E_Variable
2285 or else Ekind (Id) = E_Generic_In_Out_Parameter
2286 or else Ekind (Id) in E_In_Parameter .. E_In_Out_Parameter);
2287 Set_Node17 (Id, V);
2288 end Set_Actual_Subtype;
2290 procedure Set_Address_Taken (Id : E; V : B := True) is
2291 begin
2292 Set_Flag104 (Id, V);
2293 end Set_Address_Taken;
2295 procedure Set_Alias (Id : E; V : E) is
2296 begin
2297 pragma Assert
2298 (Is_Overloadable (Id) or else Ekind (Id) = E_Subprogram_Type);
2299 Set_Node18 (Id, V);
2300 end Set_Alias;
2302 procedure Set_Alignment (Id : E; V : U) is
2303 begin
2304 Set_Uint14 (Id, V);
2305 end Set_Alignment;
2307 procedure Set_Barrier_Function (Id : E; V : N) is
2308 begin
2309 pragma Assert (Is_Entry (Id));
2310 Set_Node12 (Id, V);
2311 end Set_Barrier_Function;
2313 procedure Set_Block_Node (Id : E; V : N) is
2314 begin
2315 pragma Assert (Ekind (Id) = E_Block);
2316 Set_Node11 (Id, V);
2317 end Set_Block_Node;
2319 procedure Set_Body_Entity (Id : E; V : E) is
2320 begin
2321 pragma Assert
2322 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
2323 Set_Node19 (Id, V);
2324 end Set_Body_Entity;
2326 procedure Set_C_Pass_By_Copy (Id : E; V : B := True) is
2327 begin
2328 pragma Assert (Is_Record_Type (Id) and then Id = Base_Type (Id));
2329 Set_Flag125 (Id, V);
2330 end Set_C_Pass_By_Copy;
2332 procedure Set_Class_Wide_Type (Id : E; V : E) is
2333 begin
2334 pragma Assert (Is_Type (Id));
2335 Set_Node9 (Id, V);
2336 end Set_Class_Wide_Type;
2338 procedure Set_Cloned_Subtype (Id : E; V : E) is
2339 begin
2340 pragma Assert
2341 (Ekind (Id) = E_Record_Subtype
2342 or else Ekind (Id) = E_Class_Wide_Subtype);
2343 Set_Node16 (Id, V);
2344 end Set_Cloned_Subtype;
2346 procedure Set_Component_Bit_Offset (Id : E; V : U) is
2347 begin
2348 pragma Assert
2349 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
2350 Set_Uint11 (Id, V);
2351 end Set_Component_Bit_Offset;
2353 procedure Set_Component_Clause (Id : E; V : N) is
2354 begin
2355 pragma Assert
2356 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
2357 Set_Node13 (Id, V);
2358 end Set_Component_Clause;
2360 procedure Set_Component_Size (Id : E; V : U) is
2361 begin
2362 pragma Assert (Is_Array_Type (Id) and then Id = Base_Type (Id));
2363 Set_Uint22 (Id, V);
2364 end Set_Component_Size;
2366 procedure Set_Component_Type (Id : E; V : E) is
2367 begin
2368 pragma Assert (Is_Array_Type (Id) and then Id = Base_Type (Id));
2369 Set_Node20 (Id, V);
2370 end Set_Component_Type;
2372 procedure Set_Corresponding_Concurrent_Type (Id : E; V : E) is
2373 begin
2374 pragma Assert
2375 (Ekind (Id) = E_Record_Type and then Is_Concurrent_Type (V));
2376 Set_Node18 (Id, V);
2377 end Set_Corresponding_Concurrent_Type;
2379 procedure Set_Corresponding_Discriminant (Id : E; V : E) is
2380 begin
2381 pragma Assert (Ekind (Id) = E_Discriminant);
2382 Set_Node19 (Id, V);
2383 end Set_Corresponding_Discriminant;
2385 procedure Set_Corresponding_Equality (Id : E; V : E) is
2386 begin
2387 pragma Assert
2388 (Ekind (Id) = E_Function
2389 and then not Comes_From_Source (Id)
2390 and then Chars (Id) = Name_Op_Ne);
2391 Set_Node13 (Id, V);
2392 end Set_Corresponding_Equality;
2394 procedure Set_Corresponding_Record_Type (Id : E; V : E) is
2395 begin
2396 pragma Assert (Is_Concurrent_Type (Id));
2397 Set_Node18 (Id, V);
2398 end Set_Corresponding_Record_Type;
2400 procedure Set_Corresponding_Remote_Type (Id : E; V : E) is
2401 begin
2402 Set_Node22 (Id, V);
2403 end Set_Corresponding_Remote_Type;
2405 procedure Set_CR_Discriminant (Id : E; V : E) is
2406 begin
2407 Set_Node23 (Id, V);
2408 end Set_CR_Discriminant;
2410 procedure Set_Debug_Info_Off (Id : E; V : B := True) is
2411 begin
2412 Set_Flag166 (Id, V);
2413 end Set_Debug_Info_Off;
2415 procedure Set_Debug_Renaming_Link (Id : E; V : E) is
2416 begin
2417 Set_Node13 (Id, V);
2418 end Set_Debug_Renaming_Link;
2420 procedure Set_Default_Expr_Function (Id : E; V : E) is
2421 begin
2422 pragma Assert (Is_Formal (Id));
2423 Set_Node21 (Id, V);
2424 end Set_Default_Expr_Function;
2426 procedure Set_Default_Expressions_Processed (Id : E; V : B := True) is
2427 begin
2428 Set_Flag108 (Id, V);
2429 end Set_Default_Expressions_Processed;
2431 procedure Set_Default_Value (Id : E; V : N) is
2432 begin
2433 pragma Assert (Is_Formal (Id));
2434 Set_Node20 (Id, V);
2435 end Set_Default_Value;
2437 procedure Set_Delay_Cleanups (Id : E; V : B := True) is
2438 begin
2439 pragma Assert
2440 (Is_Subprogram (Id)
2441 or else Is_Task_Type (Id)
2442 or else Ekind (Id) = E_Block);
2443 Set_Flag114 (Id, V);
2444 end Set_Delay_Cleanups;
2446 procedure Set_Delay_Subprogram_Descriptors (Id : E; V : B := True) is
2447 begin
2448 pragma Assert
2449 (Is_Subprogram (Id)
2450 or else Ekind (Id) = E_Package
2451 or else Ekind (Id) = E_Package_Body);
2452 Set_Flag50 (Id, V);
2453 end Set_Delay_Subprogram_Descriptors;
2455 procedure Set_Delta_Value (Id : E; V : R) is
2456 begin
2457 pragma Assert (Is_Fixed_Point_Type (Id));
2458 Set_Ureal18 (Id, V);
2459 end Set_Delta_Value;
2461 procedure Set_Dependent_Instances (Id : E; V : L) is
2462 begin
2463 pragma Assert (Is_Generic_Instance (Id));
2464 Set_Elist8 (Id, V);
2465 end Set_Dependent_Instances;
2467 procedure Set_Depends_On_Private (Id : E; V : B := True) is
2468 begin
2469 pragma Assert (Nkind (Id) in N_Entity);
2470 Set_Flag14 (Id, V);
2471 end Set_Depends_On_Private;
2473 procedure Set_Digits_Value (Id : E; V : U) is
2474 begin
2475 pragma Assert
2476 (Is_Floating_Point_Type (Id)
2477 or else Is_Decimal_Fixed_Point_Type (Id));
2478 Set_Uint17 (Id, V);
2479 end Set_Digits_Value;
2481 procedure Set_Directly_Designated_Type (Id : E; V : E) is
2482 begin
2483 Set_Node20 (Id, V);
2484 end Set_Directly_Designated_Type;
2486 procedure Set_Discard_Names (Id : E; V : B := True) is
2487 begin
2488 Set_Flag88 (Id, V);
2489 end Set_Discard_Names;
2491 procedure Set_Discriminal (Id : E; V : E) is
2492 begin
2493 pragma Assert (Ekind (Id) = E_Discriminant);
2494 Set_Node17 (Id, V);
2495 end Set_Discriminal;
2497 procedure Set_Discriminal_Link (Id : E; V : E) is
2498 begin
2499 Set_Node10 (Id, V);
2500 end Set_Discriminal_Link;
2502 procedure Set_Discriminant_Checking_Func (Id : E; V : E) is
2503 begin
2504 pragma Assert
2505 (Ekind (Id) = E_Component and Ekind (Scope (Id)) in Record_Kind);
2506 Set_Node20 (Id, V);
2507 end Set_Discriminant_Checking_Func;
2509 procedure Set_Discriminant_Constraint (Id : E; V : L) is
2510 begin
2511 pragma Assert (Nkind (Id) in N_Entity);
2512 Set_Elist21 (Id, V);
2513 end Set_Discriminant_Constraint;
2515 procedure Set_Discriminant_Default_Value (Id : E; V : N) is
2516 begin
2517 Set_Node20 (Id, V);
2518 end Set_Discriminant_Default_Value;
2520 procedure Set_Discriminant_Number (Id : E; V : U) is
2521 begin
2522 Set_Uint15 (Id, V);
2523 end Set_Discriminant_Number;
2525 procedure Set_DT_Entry_Count (Id : E; V : U) is
2526 begin
2527 pragma Assert (Ekind (Id) = E_Component);
2528 Set_Uint15 (Id, V);
2529 end Set_DT_Entry_Count;
2531 procedure Set_DT_Position (Id : E; V : U) is
2532 begin
2533 pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2534 Set_Uint15 (Id, V);
2535 end Set_DT_Position;
2537 procedure Set_DTC_Entity (Id : E; V : E) is
2538 begin
2539 pragma Assert
2540 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2541 Set_Node16 (Id, V);
2542 end Set_DTC_Entity;
2544 procedure Set_Elaborate_All_Desirable (Id : E; V : B := True) is
2545 begin
2546 Set_Flag146 (Id, V);
2547 end Set_Elaborate_All_Desirable;
2549 procedure Set_Elaboration_Entity (Id : E; V : E) is
2550 begin
2551 pragma Assert
2552 (Is_Subprogram (Id)
2553 or else
2554 Ekind (Id) = E_Package
2555 or else
2556 Is_Generic_Unit (Id));
2557 Set_Node13 (Id, V);
2558 end Set_Elaboration_Entity;
2560 procedure Set_Elaboration_Entity_Required (Id : E; V : B := True) is
2561 begin
2562 pragma Assert
2563 (Is_Subprogram (Id)
2564 or else
2565 Ekind (Id) = E_Package
2566 or else
2567 Is_Generic_Unit (Id));
2568 Set_Flag174 (Id, V);
2569 end Set_Elaboration_Entity_Required;
2571 procedure Set_Enclosing_Scope (Id : E; V : E) is
2572 begin
2573 Set_Node18 (Id, V);
2574 end Set_Enclosing_Scope;
2576 procedure Set_Entry_Accepted (Id : E; V : B := True) is
2577 begin
2578 pragma Assert (Is_Entry (Id));
2579 Set_Flag152 (Id, V);
2580 end Set_Entry_Accepted;
2582 procedure Set_Entry_Bodies_Array (Id : E; V : E) is
2583 begin
2584 Set_Node15 (Id, V);
2585 end Set_Entry_Bodies_Array;
2587 procedure Set_Entry_Cancel_Parameter (Id : E; V : E) is
2588 begin
2589 Set_Node23 (Id, V);
2590 end Set_Entry_Cancel_Parameter;
2592 procedure Set_Entry_Component (Id : E; V : E) is
2593 begin
2594 Set_Node11 (Id, V);
2595 end Set_Entry_Component;
2597 procedure Set_Entry_Formal (Id : E; V : E) is
2598 begin
2599 Set_Node16 (Id, V);
2600 end Set_Entry_Formal;
2602 procedure Set_Entry_Index_Constant (Id : E; V : E) is
2603 begin
2604 pragma Assert (Ekind (Id) = E_Entry_Index_Parameter);
2605 Set_Node18 (Id, V);
2606 end Set_Entry_Index_Constant;
2608 procedure Set_Entry_Parameters_Type (Id : E; V : E) is
2609 begin
2610 Set_Node15 (Id, V);
2611 end Set_Entry_Parameters_Type;
2613 procedure Set_Enum_Pos_To_Rep (Id : E; V : E) is
2614 begin
2615 pragma Assert (Ekind (Id) = E_Enumeration_Type);
2616 Set_Node23 (Id, V);
2617 end Set_Enum_Pos_To_Rep;
2619 procedure Set_Enumeration_Pos (Id : E; V : U) is
2620 begin
2621 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2622 Set_Uint11 (Id, V);
2623 end Set_Enumeration_Pos;
2625 procedure Set_Enumeration_Rep (Id : E; V : U) is
2626 begin
2627 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2628 Set_Uint12 (Id, V);
2629 end Set_Enumeration_Rep;
2631 procedure Set_Enumeration_Rep_Expr (Id : E; V : N) is
2632 begin
2633 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2634 Set_Node22 (Id, V);
2635 end Set_Enumeration_Rep_Expr;
2637 procedure Set_Equivalent_Type (Id : E; V : E) is
2638 begin
2639 pragma Assert
2640 (Ekind (Id) = E_Class_Wide_Type or else
2641 Ekind (Id) = E_Class_Wide_Subtype or else
2642 Ekind (Id) = E_Access_Protected_Subprogram_Type or else
2643 Ekind (Id) = E_Access_Subprogram_Type or else
2644 Ekind (Id) = E_Exception_Type);
2645 Set_Node18 (Id, V);
2646 end Set_Equivalent_Type;
2648 procedure Set_Esize (Id : E; V : U) is
2649 begin
2650 Set_Uint12 (Id, V);
2651 end Set_Esize;
2653 procedure Set_Exception_Code (Id : E; V : U) is
2654 begin
2655 pragma Assert (Ekind (Id) = E_Exception);
2656 Set_Uint22 (Id, V);
2657 end Set_Exception_Code;
2659 procedure Set_Extra_Accessibility (Id : E; V : E) is
2660 begin
2661 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
2662 Set_Node13 (Id, V);
2663 end Set_Extra_Accessibility;
2665 procedure Set_Extra_Constrained (Id : E; V : E) is
2666 begin
2667 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
2668 Set_Node23 (Id, V);
2669 end Set_Extra_Constrained;
2671 procedure Set_Extra_Formal (Id : E; V : E) is
2672 begin
2673 Set_Node15 (Id, V);
2674 end Set_Extra_Formal;
2676 procedure Set_Finalization_Chain_Entity (Id : E; V : E) is
2677 begin
2678 Set_Node19 (Id, V);
2679 end Set_Finalization_Chain_Entity;
2681 procedure Set_Finalize_Storage_Only (Id : E; V : B := True) is
2682 begin
2683 pragma Assert (Is_Type (Id) and then Id = Base_Type (Id));
2684 Set_Flag158 (Id, V);
2685 end Set_Finalize_Storage_Only;
2687 procedure Set_First_Entity (Id : E; V : E) is
2688 begin
2689 Set_Node17 (Id, V);
2690 end Set_First_Entity;
2692 procedure Set_First_Index (Id : E; V : N) is
2693 begin
2694 Set_Node17 (Id, V);
2695 end Set_First_Index;
2697 procedure Set_First_Literal (Id : E; V : E) is
2698 begin
2699 Set_Node17 (Id, V);
2700 end Set_First_Literal;
2702 procedure Set_First_Optional_Parameter (Id : E; V : E) is
2703 begin
2704 pragma Assert
2705 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2706 Set_Node14 (Id, V);
2707 end Set_First_Optional_Parameter;
2709 procedure Set_First_Private_Entity (Id : E; V : E) is
2710 begin
2711 pragma Assert (Nkind (Id) in N_Entity);
2712 Set_Node16 (Id, V);
2713 end Set_First_Private_Entity;
2715 procedure Set_First_Rep_Item (Id : E; V : N) is
2716 begin
2717 Set_Node6 (Id, V);
2718 end Set_First_Rep_Item;
2720 procedure Set_Freeze_Node (Id : E; V : N) is
2721 begin
2722 Set_Node7 (Id, V);
2723 end Set_Freeze_Node;
2725 procedure Set_From_With_Type (Id : E; V : B := True) is
2726 begin
2727 pragma Assert
2728 (Is_Type (Id)
2729 or else Ekind (Id) = E_Package);
2730 Set_Flag159 (Id, V);
2731 end Set_From_With_Type;
2733 procedure Set_Full_View (Id : E; V : E) is
2734 begin
2735 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Constant);
2736 Set_Node11 (Id, V);
2737 end Set_Full_View;
2739 procedure Set_Function_Returns_With_DSP (Id : E; V : B := True) is
2740 begin
2741 pragma Assert
2742 (Is_Subprogram (Id) or else Ekind (Id) = E_Subprogram_Type);
2743 Set_Flag169 (Id, V);
2744 end Set_Function_Returns_With_DSP;
2746 procedure Set_Generic_Renamings (Id : E; V : L) is
2747 begin
2748 Set_Elist23 (Id, V);
2749 end Set_Generic_Renamings;
2751 procedure Set_Girder_Constraint (Id : E; V : L) is
2752 begin
2753 pragma Assert (Nkind (Id) in N_Entity);
2754 Set_Elist23 (Id, V);
2755 end Set_Girder_Constraint;
2757 procedure Set_Handler_Records (Id : E; V : S) is
2758 begin
2759 Set_List10 (Id, V);
2760 end Set_Handler_Records;
2762 procedure Set_Has_Aliased_Components (Id : E; V : B := True) is
2763 begin
2764 pragma Assert (Base_Type (Id) = Id);
2765 Set_Flag135 (Id, V);
2766 end Set_Has_Aliased_Components;
2768 procedure Set_Has_Alignment_Clause (Id : E; V : B := True) is
2769 begin
2770 Set_Flag46 (Id, V);
2771 end Set_Has_Alignment_Clause;
2773 procedure Set_Has_All_Calls_Remote (Id : E; V : B := True) is
2774 begin
2775 Set_Flag79 (Id, V);
2776 end Set_Has_All_Calls_Remote;
2778 procedure Set_Has_Atomic_Components (Id : E; V : B := True) is
2779 begin
2780 pragma Assert (not Is_Type (Id) or else Base_Type (Id) = Id);
2781 Set_Flag86 (Id, V);
2782 end Set_Has_Atomic_Components;
2784 procedure Set_Has_Biased_Representation (Id : E; V : B := True) is
2785 begin
2786 pragma Assert
2787 ((V = False) or else (Is_Discrete_Type (Id) or Is_Object (Id)));
2788 Set_Flag139 (Id, V);
2789 end Set_Has_Biased_Representation;
2791 procedure Set_Has_Completion (Id : E; V : B := True) is
2792 begin
2793 Set_Flag26 (Id, V);
2794 end Set_Has_Completion;
2796 procedure Set_Has_Completion_In_Body (Id : E; V : B := True) is
2797 begin
2798 pragma Assert (Ekind (Id) = E_Incomplete_Type);
2799 Set_Flag71 (Id, V);
2800 end Set_Has_Completion_In_Body;
2802 procedure Set_Has_Complex_Representation (Id : E; V : B := True) is
2803 begin
2804 pragma Assert (Ekind (Id) = E_Record_Type);
2805 Set_Flag140 (Id, V);
2806 end Set_Has_Complex_Representation;
2808 procedure Set_Has_Component_Size_Clause (Id : E; V : B := True) is
2809 begin
2810 pragma Assert (Ekind (Id) = E_Array_Type);
2811 Set_Flag68 (Id, V);
2812 end Set_Has_Component_Size_Clause;
2814 procedure Set_Has_Controlled_Component (Id : E; V : B := True) is
2815 begin
2816 pragma Assert (Base_Type (Id) = Id);
2817 Set_Flag43 (Id, V);
2818 end Set_Has_Controlled_Component;
2820 procedure Set_Has_Controlling_Result (Id : E; V : B := True) is
2821 begin
2822 Set_Flag98 (Id, V);
2823 end Set_Has_Controlling_Result;
2825 procedure Set_Has_Convention_Pragma (Id : E; V : B := True) is
2826 begin
2827 Set_Flag119 (Id, V);
2828 end Set_Has_Convention_Pragma;
2830 procedure Set_Has_Delayed_Freeze (Id : E; V : B := True) is
2831 begin
2832 pragma Assert (Nkind (Id) in N_Entity);
2833 Set_Flag18 (Id, V);
2834 end Set_Has_Delayed_Freeze;
2836 procedure Set_Has_Discriminants (Id : E; V : B := True) is
2837 begin
2838 pragma Assert (Nkind (Id) in N_Entity);
2839 Set_Flag5 (Id, V);
2840 end Set_Has_Discriminants;
2842 procedure Set_Has_Enumeration_Rep_Clause (Id : E; V : B := True) is
2843 begin
2844 pragma Assert (Is_Enumeration_Type (Id));
2845 Set_Flag66 (Id, V);
2846 end Set_Has_Enumeration_Rep_Clause;
2848 procedure Set_Has_Exit (Id : E; V : B := True) is
2849 begin
2850 Set_Flag47 (Id, V);
2851 end Set_Has_Exit;
2853 procedure Set_Has_External_Tag_Rep_Clause (Id : E; V : B := True) is
2854 begin
2855 pragma Assert (Is_Tagged_Type (Id));
2856 Set_Flag110 (Id, V);
2857 end Set_Has_External_Tag_Rep_Clause;
2859 procedure Set_Has_Forward_Instantiation (Id : E; V : B := True) is
2860 begin
2861 Set_Flag175 (Id, V);
2862 end Set_Has_Forward_Instantiation;
2864 procedure Set_Has_Fully_Qualified_Name (Id : E; V : B := True) is
2865 begin
2866 Set_Flag173 (Id, V);
2867 end Set_Has_Fully_Qualified_Name;
2869 procedure Set_Has_Gigi_Rep_Item (Id : E; V : B := True) is
2870 begin
2871 Set_Flag82 (Id, V);
2872 end Set_Has_Gigi_Rep_Item;
2874 procedure Set_Has_Homonym (Id : E; V : B := True) is
2875 begin
2876 Set_Flag56 (Id, V);
2877 end Set_Has_Homonym;
2879 procedure Set_Has_Machine_Radix_Clause (Id : E; V : B := True) is
2880 begin
2881 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
2882 Set_Flag83 (Id, V);
2883 end Set_Has_Machine_Radix_Clause;
2885 procedure Set_Has_Master_Entity (Id : E; V : B := True) is
2886 begin
2887 Set_Flag21 (Id, V);
2888 end Set_Has_Master_Entity;
2890 procedure Set_Has_Missing_Return (Id : E; V : B := True) is
2891 begin
2892 pragma Assert
2893 (Ekind (Id) = E_Function or else Ekind (Id) = E_Generic_Function);
2894 Set_Flag142 (Id, V);
2895 end Set_Has_Missing_Return;
2897 procedure Set_Has_Nested_Block_With_Handler (Id : E; V : B := True) is
2898 begin
2899 Set_Flag101 (Id, V);
2900 end Set_Has_Nested_Block_With_Handler;
2902 procedure Set_Has_Non_Standard_Rep (Id : E; V : B := True) is
2903 begin
2904 pragma Assert (Base_Type (Id) = Id);
2905 Set_Flag75 (Id, V);
2906 end Set_Has_Non_Standard_Rep;
2908 procedure Set_Has_Object_Size_Clause (Id : E; V : B := True) is
2909 begin
2910 pragma Assert (Is_Type (Id));
2911 Set_Flag172 (Id, V);
2912 end Set_Has_Object_Size_Clause;
2914 procedure Set_Has_Per_Object_Constraint (Id : E; V : B := True) is
2915 begin
2916 Set_Flag154 (Id, V);
2917 end Set_Has_Per_Object_Constraint;
2919 procedure Set_Has_Pragma_Controlled (Id : E; V : B := True) is
2920 begin
2921 pragma Assert (Is_Access_Type (Id));
2922 Set_Flag27 (Base_Type (Id), V);
2923 end Set_Has_Pragma_Controlled;
2925 procedure Set_Has_Pragma_Elaborate_Body (Id : E; V : B := True) is
2926 begin
2927 Set_Flag150 (Id, V);
2928 end Set_Has_Pragma_Elaborate_Body;
2930 procedure Set_Has_Pragma_Inline (Id : E; V : B := True) is
2931 begin
2932 Set_Flag157 (Id, V);
2933 end Set_Has_Pragma_Inline;
2935 procedure Set_Has_Pragma_Pack (Id : E; V : B := True) is
2936 begin
2937 pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id));
2938 pragma Assert (Id = Base_Type (Id));
2939 Set_Flag121 (Id, V);
2940 end Set_Has_Pragma_Pack;
2942 procedure Set_Has_Pragma_Pure_Function (Id : E; V : B := True) is
2943 begin
2944 pragma Assert (Is_Subprogram (Id));
2945 Set_Flag179 (Id, V);
2946 end Set_Has_Pragma_Pure_Function;
2948 procedure Set_Has_Pragma_Unreferenced (Id : E; V : B := True) is
2949 begin
2950 Set_Flag180 (Id, V);
2951 end Set_Has_Pragma_Unreferenced;
2953 procedure Set_Has_Primitive_Operations (Id : E; V : B := True) is
2954 begin
2955 pragma Assert (Id = Base_Type (Id));
2956 Set_Flag120 (Id, V);
2957 end Set_Has_Primitive_Operations;
2959 procedure Set_Has_Private_Declaration (Id : E; V : B := True) is
2960 begin
2961 Set_Flag155 (Id, V);
2962 end Set_Has_Private_Declaration;
2964 procedure Set_Has_Qualified_Name (Id : E; V : B := True) is
2965 begin
2966 Set_Flag161 (Id, V);
2967 end Set_Has_Qualified_Name;
2969 procedure Set_Has_Record_Rep_Clause (Id : E; V : B := True) is
2970 begin
2971 pragma Assert (Id = Base_Type (Id));
2972 Set_Flag65 (Id, V);
2973 end Set_Has_Record_Rep_Clause;
2975 procedure Set_Has_Recursive_Call (Id : E; V : B := True) is
2976 begin
2977 pragma Assert (Is_Subprogram (Id));
2978 Set_Flag143 (Id, V);
2979 end Set_Has_Recursive_Call;
2981 procedure Set_Has_Size_Clause (Id : E; V : B := True) is
2982 begin
2983 Set_Flag29 (Id, V);
2984 end Set_Has_Size_Clause;
2986 procedure Set_Has_Small_Clause (Id : E; V : B := True) is
2987 begin
2988 Set_Flag67 (Id, V);
2989 end Set_Has_Small_Clause;
2991 procedure Set_Has_Specified_Layout (Id : E; V : B := True) is
2992 begin
2993 pragma Assert (Id = Base_Type (Id));
2994 Set_Flag100 (Id, V);
2995 end Set_Has_Specified_Layout;
2997 procedure Set_Has_Storage_Size_Clause (Id : E; V : B := True) is
2998 begin
2999 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
3000 pragma Assert (Base_Type (Id) = Id);
3001 Set_Flag23 (Id, V);
3002 end Set_Has_Storage_Size_Clause;
3004 procedure Set_Has_Subprogram_Descriptor (Id : E; V : B := True) is
3005 begin
3006 Set_Flag93 (Id, V);
3007 end Set_Has_Subprogram_Descriptor;
3009 procedure Set_Has_Task (Id : E; V : B := True) is
3010 begin
3011 pragma Assert (Base_Type (Id) = Id);
3012 Set_Flag30 (Id, V);
3013 end Set_Has_Task;
3015 procedure Set_Has_Unchecked_Union (Id : E; V : B := True) is
3016 begin
3017 pragma Assert (Base_Type (Id) = Id);
3018 Set_Flag123 (Id, V);
3019 end Set_Has_Unchecked_Union;
3021 procedure Set_Has_Unknown_Discriminants (Id : E; V : B := True) is
3022 begin
3023 pragma Assert (Is_Type (Id));
3024 Set_Flag72 (Id, V);
3025 end Set_Has_Unknown_Discriminants;
3027 procedure Set_Has_Volatile_Components (Id : E; V : B := True) is
3028 begin
3029 pragma Assert (not Is_Type (Id) or else Base_Type (Id) = Id);
3030 Set_Flag87 (Id, V);
3031 end Set_Has_Volatile_Components;
3033 procedure Set_Hiding_Loop_Variable (Id : E; V : E) is
3034 begin
3035 pragma Assert (Ekind (Id) = E_Variable);
3036 Set_Node8 (Id, V);
3037 end Set_Hiding_Loop_Variable;
3039 procedure Set_Homonym (Id : E; V : E) is
3040 begin
3041 pragma Assert (Id /= V);
3042 Set_Node4 (Id, V);
3043 end Set_Homonym;
3044 procedure Set_In_Package_Body (Id : E; V : B := True) is
3045 begin
3046 Set_Flag48 (Id, V);
3047 end Set_In_Package_Body;
3049 procedure Set_In_Private_Part (Id : E; V : B := True) is
3050 begin
3051 Set_Flag45 (Id, V);
3052 end Set_In_Private_Part;
3054 procedure Set_In_Use (Id : E; V : B := True) is
3055 begin
3056 pragma Assert (Nkind (Id) in N_Entity);
3057 Set_Flag8 (Id, V);
3058 end Set_In_Use;
3060 procedure Set_Inner_Instances (Id : E; V : L) is
3061 begin
3062 Set_Elist23 (Id, V);
3063 end Set_Inner_Instances;
3065 procedure Set_Interface_Name (Id : E; V : N) is
3066 begin
3067 Set_Node21 (Id, V);
3068 end Set_Interface_Name;
3070 procedure Set_Is_Abstract (Id : E; V : B := True) is
3071 begin
3072 Set_Flag19 (Id, V);
3073 end Set_Is_Abstract;
3075 procedure Set_Is_Access_Constant (Id : E; V : B := True) is
3076 begin
3077 pragma Assert (Is_Access_Type (Id));
3078 Set_Flag69 (Id, V);
3079 end Set_Is_Access_Constant;
3081 procedure Set_Is_Aliased (Id : E; V : B := True) is
3082 begin
3083 pragma Assert (Nkind (Id) in N_Entity);
3084 Set_Flag15 (Id, V);
3085 end Set_Is_Aliased;
3087 procedure Set_Is_AST_Entry (Id : E; V : B := True) is
3088 begin
3089 pragma Assert (Is_Entry (Id));
3090 Set_Flag132 (Id, V);
3091 end Set_Is_AST_Entry;
3093 procedure Set_Is_Asynchronous (Id : E; V : B := True) is
3094 begin
3095 pragma Assert
3096 (Ekind (Id) = E_Procedure or else Is_Type (Id));
3097 Set_Flag81 (Id, V);
3098 end Set_Is_Asynchronous;
3100 procedure Set_Is_Atomic (Id : E; V : B := True) is
3101 begin
3102 Set_Flag85 (Id, V);
3103 end Set_Is_Atomic;
3105 procedure Set_Is_Bit_Packed_Array (Id : E; V : B := True) is
3106 begin
3107 pragma Assert ((not V)
3108 or else (Is_Array_Type (Id) and then Id = Base_Type (Id)));
3110 Set_Flag122 (Id, V);
3111 end Set_Is_Bit_Packed_Array;
3113 procedure Set_Is_Called (Id : E; V : B := True) is
3114 begin
3115 pragma Assert
3116 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Function);
3117 Set_Flag102 (Id, V);
3118 end Set_Is_Called;
3120 procedure Set_Is_Character_Type (Id : E; V : B := True) is
3121 begin
3122 Set_Flag63 (Id, V);
3123 end Set_Is_Character_Type;
3125 procedure Set_Is_Child_Unit (Id : E; V : B := True) is
3126 begin
3127 Set_Flag73 (Id, V);
3128 end Set_Is_Child_Unit;
3130 procedure Set_Is_Compilation_Unit (Id : E; V : B := True) is
3131 begin
3132 Set_Flag149 (Id, V);
3133 end Set_Is_Compilation_Unit;
3135 procedure Set_Is_Completely_Hidden (Id : E; V : B := True) is
3136 begin
3137 pragma Assert (Ekind (Id) = E_Discriminant);
3138 Set_Flag103 (Id, V);
3139 end Set_Is_Completely_Hidden;
3141 procedure Set_Is_Concurrent_Record_Type (Id : E; V : B := True) is
3142 begin
3143 Set_Flag20 (Id, V);
3144 end Set_Is_Concurrent_Record_Type;
3146 procedure Set_Is_Constr_Subt_For_U_Nominal (Id : E; V : B := True) is
3147 begin
3148 Set_Flag80 (Id, V);
3149 end Set_Is_Constr_Subt_For_U_Nominal;
3151 procedure Set_Is_Constr_Subt_For_UN_Aliased (Id : E; V : B := True) is
3152 begin
3153 Set_Flag141 (Id, V);
3154 end Set_Is_Constr_Subt_For_UN_Aliased;
3156 procedure Set_Is_Constrained (Id : E; V : B := True) is
3157 begin
3158 pragma Assert (Nkind (Id) in N_Entity);
3159 Set_Flag12 (Id, V);
3160 end Set_Is_Constrained;
3162 procedure Set_Is_Constructor (Id : E; V : B := True) is
3163 begin
3164 Set_Flag76 (Id, V);
3165 end Set_Is_Constructor;
3167 procedure Set_Is_Controlled (Id : E; V : B := True) is
3168 begin
3169 pragma Assert (Id = Base_Type (Id));
3170 Set_Flag42 (Id, V);
3171 end Set_Is_Controlled;
3173 procedure Set_Is_Controlling_Formal (Id : E; V : B := True) is
3174 begin
3175 pragma Assert (Is_Formal (Id));
3176 Set_Flag97 (Id, V);
3177 end Set_Is_Controlling_Formal;
3179 procedure Set_Is_CPP_Class (Id : E; V : B := True) is
3180 begin
3181 Set_Flag74 (Id, V);
3182 end Set_Is_CPP_Class;
3184 procedure Set_Is_Destructor (Id : E; V : B := True) is
3185 begin
3186 Set_Flag77 (Id, V);
3187 end Set_Is_Destructor;
3189 procedure Set_Is_Discrim_SO_Function (Id : E; V : B := True) is
3190 begin
3191 Set_Flag176 (Id, V);
3192 end Set_Is_Discrim_SO_Function;
3194 procedure Set_Is_Dispatching_Operation (Id : E; V : B := True) is
3195 begin
3196 pragma Assert
3197 (V = False
3198 or else
3199 Is_Overloadable (Id)
3200 or else
3201 Ekind (Id) = E_Subprogram_Type);
3203 Set_Flag6 (Id, V);
3204 end Set_Is_Dispatching_Operation;
3206 procedure Set_Is_Eliminated (Id : E; V : B := True) is
3207 begin
3208 Set_Flag124 (Id, V);
3209 end Set_Is_Eliminated;
3211 procedure Set_Is_Entry_Formal (Id : E; V : B := True) is
3212 begin
3213 Set_Flag52 (Id, V);
3214 end Set_Is_Entry_Formal;
3216 procedure Set_Is_Exported (Id : E; V : B := True) is
3217 begin
3218 Set_Flag99 (Id, V);
3219 end Set_Is_Exported;
3221 procedure Set_Is_First_Subtype (Id : E; V : B := True) is
3222 begin
3223 Set_Flag70 (Id, V);
3224 end Set_Is_First_Subtype;
3226 procedure Set_Is_For_Access_Subtype (Id : E; V : B := True) is
3227 begin
3228 pragma Assert
3229 (Ekind (Id) = E_Record_Subtype
3230 or else
3231 Ekind (Id) = E_Private_Subtype);
3232 Set_Flag118 (Id, V);
3233 end Set_Is_For_Access_Subtype;
3235 procedure Set_Is_Formal_Subprogram (Id : E; V : B := True) is
3236 begin
3237 Set_Flag111 (Id, V);
3238 end Set_Is_Formal_Subprogram;
3240 procedure Set_Is_Frozen (Id : E; V : B := True) is
3241 begin
3242 pragma Assert (Nkind (Id) in N_Entity);
3243 Set_Flag4 (Id, V);
3244 end Set_Is_Frozen;
3246 procedure Set_Is_Generic_Actual_Type (Id : E; V : B := True) is
3247 begin
3248 pragma Assert (Is_Type (Id));
3249 Set_Flag94 (Id, V);
3250 end Set_Is_Generic_Actual_Type;
3252 procedure Set_Is_Generic_Instance (Id : E; V : B := True) is
3253 begin
3254 Set_Flag130 (Id, V);
3255 end Set_Is_Generic_Instance;
3257 procedure Set_Is_Generic_Type (Id : E; V : B := True) is
3258 begin
3259 pragma Assert (Nkind (Id) in N_Entity);
3260 Set_Flag13 (Id, V);
3261 end Set_Is_Generic_Type;
3263 procedure Set_Is_Hidden (Id : E; V : B := True) is
3264 begin
3265 Set_Flag57 (Id, V);
3266 end Set_Is_Hidden;
3268 procedure Set_Is_Hidden_Open_Scope (Id : E; V : B := True) is
3269 begin
3270 Set_Flag171 (Id, V);
3271 end Set_Is_Hidden_Open_Scope;
3273 procedure Set_Is_Immediately_Visible (Id : E; V : B := True) is
3274 begin
3275 pragma Assert (Nkind (Id) in N_Entity);
3276 Set_Flag7 (Id, V);
3277 end Set_Is_Immediately_Visible;
3279 procedure Set_Is_Imported (Id : E; V : B := True) is
3280 begin
3281 Set_Flag24 (Id, V);
3282 end Set_Is_Imported;
3284 procedure Set_Is_Inlined (Id : E; V : B := True) is
3285 begin
3286 Set_Flag11 (Id, V);
3287 end Set_Is_Inlined;
3289 procedure Set_Is_Instantiated (Id : E; V : B := True) is
3290 begin
3291 Set_Flag126 (Id, V);
3292 end Set_Is_Instantiated;
3294 procedure Set_Is_Internal (Id : E; V : B := True) is
3295 begin
3296 pragma Assert (Nkind (Id) in N_Entity);
3297 Set_Flag17 (Id, V);
3298 end Set_Is_Internal;
3300 procedure Set_Is_Interrupt_Handler (Id : E; V : B := True) is
3301 begin
3302 pragma Assert (Nkind (Id) in N_Entity);
3303 Set_Flag89 (Id, V);
3304 end Set_Is_Interrupt_Handler;
3306 procedure Set_Is_Intrinsic_Subprogram (Id : E; V : B := True) is
3307 begin
3308 Set_Flag64 (Id, V);
3309 end Set_Is_Intrinsic_Subprogram;
3311 procedure Set_Is_Itype (Id : E; V : B := True) is
3312 begin
3313 Set_Flag91 (Id, V);
3314 end Set_Is_Itype;
3316 procedure Set_Is_Known_Valid (Id : E; V : B := True) is
3317 begin
3318 Set_Flag170 (Id, V);
3319 end Set_Is_Known_Valid;
3321 procedure Set_Is_Limited_Composite (Id : E; V : B := True) is
3322 begin
3323 pragma Assert (Is_Type (Id));
3324 Set_Flag106 (Id, V);
3325 end Set_Is_Limited_Composite;
3327 procedure Set_Is_Limited_Record (Id : E; V : B := True) is
3328 begin
3329 Set_Flag25 (Id, V);
3330 end Set_Is_Limited_Record;
3332 procedure Set_Is_Machine_Code_Subprogram (Id : E; V : B := True) is
3333 begin
3334 pragma Assert (Is_Subprogram (Id));
3335 Set_Flag137 (Id, V);
3336 end Set_Is_Machine_Code_Subprogram;
3338 procedure Set_Is_Non_Static_Subtype (Id : E; V : B := True) is
3339 begin
3340 pragma Assert (Is_Type (Id));
3341 Set_Flag109 (Id, V);
3342 end Set_Is_Non_Static_Subtype;
3344 procedure Set_Is_Null_Init_Proc (Id : E; V : B := True) is
3345 begin
3346 pragma Assert (Ekind (Id) = E_Procedure);
3347 Set_Flag178 (Id, V);
3348 end Set_Is_Null_Init_Proc;
3350 procedure Set_Is_Optional_Parameter (Id : E; V : B := True) is
3351 begin
3352 pragma Assert (Is_Formal (Id));
3353 Set_Flag134 (Id, V);
3354 end Set_Is_Optional_Parameter;
3356 procedure Set_Is_Package_Body_Entity (Id : E; V : B := True) is
3357 begin
3358 Set_Flag160 (Id, V);
3359 end Set_Is_Package_Body_Entity;
3361 procedure Set_Is_Packed (Id : E; V : B := True) is
3362 begin
3363 pragma Assert (Base_Type (Id) = Id);
3364 Set_Flag51 (Id, V);
3365 end Set_Is_Packed;
3367 procedure Set_Is_Packed_Array_Type (Id : E; V : B := True) is
3368 begin
3369 Set_Flag138 (Id, V);
3370 end Set_Is_Packed_Array_Type;
3372 procedure Set_Is_Potentially_Use_Visible (Id : E; V : B := True) is
3373 begin
3374 pragma Assert (Nkind (Id) in N_Entity);
3375 Set_Flag9 (Id, V);
3376 end Set_Is_Potentially_Use_Visible;
3378 procedure Set_Is_Preelaborated (Id : E; V : B := True) is
3379 begin
3380 Set_Flag59 (Id, V);
3381 end Set_Is_Preelaborated;
3383 procedure Set_Is_Private_Composite (Id : E; V : B := True) is
3384 begin
3385 pragma Assert (Is_Type (Id));
3386 Set_Flag107 (Id, V);
3387 end Set_Is_Private_Composite;
3389 procedure Set_Is_Private_Descendant (Id : E; V : B := True) is
3390 begin
3391 Set_Flag53 (Id, V);
3392 end Set_Is_Private_Descendant;
3394 procedure Set_Is_Psected (Id : E; V : B := True) is
3395 begin
3396 Set_Flag153 (Id, V);
3397 end Set_Is_Psected;
3399 procedure Set_Is_Public (Id : E; V : B := True) is
3400 begin
3401 pragma Assert (Nkind (Id) in N_Entity);
3402 Set_Flag10 (Id, V);
3403 end Set_Is_Public;
3405 procedure Set_Is_Pure (Id : E; V : B := True) is
3406 begin
3407 Set_Flag44 (Id, V);
3408 end Set_Is_Pure;
3410 procedure Set_Is_Remote_Call_Interface (Id : E; V : B := True) is
3411 begin
3412 Set_Flag62 (Id, V);
3413 end Set_Is_Remote_Call_Interface;
3415 procedure Set_Is_Remote_Types (Id : E; V : B := True) is
3416 begin
3417 Set_Flag61 (Id, V);
3418 end Set_Is_Remote_Types;
3420 procedure Set_Is_Renaming_Of_Object (Id : E; V : B := True) is
3421 begin
3422 Set_Flag112 (Id, V);
3423 end Set_Is_Renaming_Of_Object;
3425 procedure Set_Is_Shared_Passive (Id : E; V : B := True) is
3426 begin
3427 Set_Flag60 (Id, V);
3428 end Set_Is_Shared_Passive;
3430 procedure Set_Is_Statically_Allocated (Id : E; V : B := True) is
3431 begin
3432 pragma Assert
3433 (Ekind (Id) = E_Exception
3434 or else Ekind (Id) = E_Variable
3435 or else Ekind (Id) = E_Constant
3436 or else Is_Type (Id)
3437 or else Ekind (Id) = E_Void);
3438 Set_Flag28 (Id, V);
3439 end Set_Is_Statically_Allocated;
3441 procedure Set_Is_Tag (Id : E; V : B := True) is
3442 begin
3443 pragma Assert (Nkind (Id) in N_Entity);
3444 Set_Flag78 (Id, V);
3445 end Set_Is_Tag;
3447 procedure Set_Is_Tagged_Type (Id : E; V : B := True) is
3448 begin
3449 Set_Flag55 (Id, V);
3450 end Set_Is_Tagged_Type;
3452 procedure Set_Is_True_Constant (Id : E; V : B := True) is
3453 begin
3454 Set_Flag163 (Id, V);
3455 end Set_Is_True_Constant;
3457 procedure Set_Is_Unchecked_Union (Id : E; V : B := True) is
3458 begin
3459 pragma Assert (Base_Type (Id) = Id);
3460 Set_Flag117 (Id, V);
3461 end Set_Is_Unchecked_Union;
3463 procedure Set_Is_Unsigned_Type (Id : E; V : B := True) is
3464 begin
3465 pragma Assert (Is_Discrete_Or_Fixed_Point_Type (Id));
3466 Set_Flag144 (Id, V);
3467 end Set_Is_Unsigned_Type;
3469 procedure Set_Is_Valued_Procedure (Id : E; V : B := True) is
3470 begin
3471 pragma Assert (Ekind (Id) = E_Procedure);
3472 Set_Flag127 (Id, V);
3473 end Set_Is_Valued_Procedure;
3475 procedure Set_Is_Visible_Child_Unit (Id : E; V : B := True) is
3476 begin
3477 pragma Assert (Is_Child_Unit (Id));
3478 Set_Flag116 (Id, V);
3479 end Set_Is_Visible_Child_Unit;
3481 procedure Set_Is_VMS_Exception (Id : E; V : B := True) is
3482 begin
3483 pragma Assert (Ekind (Id) = E_Exception);
3484 Set_Flag133 (Id, V);
3485 end Set_Is_VMS_Exception;
3487 procedure Set_Is_Volatile (Id : E; V : B := True) is
3488 begin
3489 pragma Assert (Nkind (Id) in N_Entity);
3490 Set_Flag16 (Id, V);
3491 end Set_Is_Volatile;
3493 procedure Set_Last_Entity (Id : E; V : E) is
3494 begin
3495 Set_Node20 (Id, V);
3496 end Set_Last_Entity;
3498 procedure Set_Lit_Indexes (Id : E; V : E) is
3499 begin
3500 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
3501 Set_Node15 (Id, V);
3502 end Set_Lit_Indexes;
3504 procedure Set_Lit_Strings (Id : E; V : E) is
3505 begin
3506 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
3507 Set_Node16 (Id, V);
3508 end Set_Lit_Strings;
3510 procedure Set_Machine_Radix_10 (Id : E; V : B := True) is
3511 begin
3512 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
3513 Set_Flag84 (Id, V);
3514 end Set_Machine_Radix_10;
3516 procedure Set_Master_Id (Id : E; V : E) is
3517 begin
3518 Set_Node17 (Id, V);
3519 end Set_Master_Id;
3521 procedure Set_Materialize_Entity (Id : E; V : B := True) is
3522 begin
3523 Set_Flag168 (Id, V);
3524 end Set_Materialize_Entity;
3526 procedure Set_Mechanism (Id : E; V : M) is
3527 begin
3528 pragma Assert (Ekind (Id) = E_Function or else Is_Formal (Id));
3529 Set_Uint8 (Id, UI_From_Int (V));
3530 end Set_Mechanism;
3532 procedure Set_Modulus (Id : E; V : U) is
3533 begin
3534 pragma Assert (Ekind (Id) = E_Modular_Integer_Type);
3535 Set_Uint17 (Id, V);
3536 end Set_Modulus;
3538 procedure Set_Needs_Debug_Info (Id : E; V : B := True) is
3539 begin
3540 Set_Flag147 (Id, V);
3541 end Set_Needs_Debug_Info;
3543 procedure Set_Needs_No_Actuals (Id : E; V : B := True) is
3544 begin
3545 pragma Assert
3546 (Is_Overloadable (Id)
3547 or else Ekind (Id) = E_Subprogram_Type
3548 or else Ekind (Id) = E_Entry_Family);
3549 Set_Flag22 (Id, V);
3550 end Set_Needs_No_Actuals;
3552 procedure Set_Next_Inlined_Subprogram (Id : E; V : E) is
3553 begin
3554 Set_Node12 (Id, V);
3555 end Set_Next_Inlined_Subprogram;
3557 procedure Set_No_Pool_Assigned (Id : E; V : B := True) is
3558 begin
3559 pragma Assert (Is_Access_Type (Id) and then Base_Type (Id) = Id);
3560 Set_Flag131 (Id, V);
3561 end Set_No_Pool_Assigned;
3563 procedure Set_No_Return (Id : E; V : B := True) is
3564 begin
3565 pragma Assert
3566 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Generic_Procedure);
3567 Set_Flag113 (Id, V);
3568 end Set_No_Return;
3570 procedure Set_Non_Binary_Modulus (Id : E; V : B := True) is
3571 begin
3572 pragma Assert (Ekind (Id) = E_Modular_Integer_Type);
3573 Set_Flag58 (Id, V);
3574 end Set_Non_Binary_Modulus;
3576 procedure Set_Nonzero_Is_True (Id : E; V : B := True) is
3577 begin
3578 pragma Assert
3579 (Root_Type (Id) = Standard_Boolean
3580 and then Ekind (Id) = E_Enumeration_Type);
3581 Set_Flag162 (Id, V);
3582 end Set_Nonzero_Is_True;
3584 procedure Set_Normalized_First_Bit (Id : E; V : U) is
3585 begin
3586 pragma Assert
3587 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
3588 Set_Uint8 (Id, V);
3589 end Set_Normalized_First_Bit;
3591 procedure Set_Normalized_Position (Id : E; V : U) is
3592 begin
3593 pragma Assert
3594 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
3595 Set_Uint9 (Id, V);
3596 end Set_Normalized_Position;
3598 procedure Set_Normalized_Position_Max (Id : E; V : U) is
3599 begin
3600 pragma Assert
3601 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
3602 Set_Uint10 (Id, V);
3603 end Set_Normalized_Position_Max;
3605 procedure Set_Not_Source_Assigned (Id : E; V : B := True) is
3606 begin
3607 Set_Flag115 (Id, V);
3608 end Set_Not_Source_Assigned;
3610 procedure Set_Object_Ref (Id : E; V : E) is
3611 begin
3612 pragma Assert (Ekind (Id) = E_Protected_Body);
3613 Set_Node17 (Id, V);
3614 end Set_Object_Ref;
3616 procedure Set_Original_Array_Type (Id : E; V : E) is
3617 begin
3618 pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id));
3619 Set_Node21 (Id, V);
3620 end Set_Original_Array_Type;
3622 procedure Set_Original_Record_Component (Id : E; V : E) is
3623 begin
3624 Set_Node22 (Id, V);
3625 end Set_Original_Record_Component;
3627 procedure Set_Packed_Array_Type (Id : E; V : E) is
3628 begin
3629 pragma Assert (Is_Array_Type (Id));
3630 Set_Node23 (Id, V);
3631 end Set_Packed_Array_Type;
3633 procedure Set_Parent_Subtype (Id : E; V : E) is
3634 begin
3635 pragma Assert (Ekind (Id) = E_Record_Type);
3636 Set_Node19 (Id, V);
3637 end Set_Parent_Subtype;
3639 procedure Set_Primitive_Operations (Id : E; V : L) is
3640 begin
3641 pragma Assert (Is_Tagged_Type (Id));
3642 Set_Elist15 (Id, V);
3643 end Set_Primitive_Operations;
3645 procedure Set_Prival (Id : E; V : E) is
3646 begin
3647 pragma Assert (Is_Protected_Private (Id));
3648 Set_Node17 (Id, V);
3649 end Set_Prival;
3651 procedure Set_Privals_Chain (Id : E; V : L) is
3652 begin
3653 pragma Assert (Is_Overloadable (Id)
3654 or else Ekind (Id) = E_Entry_Family);
3655 Set_Elist23 (Id, V);
3656 end Set_Privals_Chain;
3658 procedure Set_Private_Dependents (Id : E; V : L) is
3659 begin
3660 pragma Assert (Is_Incomplete_Or_Private_Type (Id));
3661 Set_Elist18 (Id, V);
3662 end Set_Private_Dependents;
3664 procedure Set_Private_View (Id : E; V : N) is
3665 begin
3666 pragma Assert (Is_Private_Type (Id));
3667 Set_Node22 (Id, V);
3668 end Set_Private_View;
3670 procedure Set_Protected_Body_Subprogram (Id : E; V : E) is
3671 begin
3672 pragma Assert (Is_Subprogram (Id) or else Is_Entry (Id));
3673 Set_Node11 (Id, V);
3674 end Set_Protected_Body_Subprogram;
3676 procedure Set_Protected_Formal (Id : E; V : E) is
3677 begin
3678 pragma Assert (Is_Formal (Id));
3679 Set_Node22 (Id, V);
3680 end Set_Protected_Formal;
3682 procedure Set_Protected_Operation (Id : E; V : N) is
3683 begin
3684 pragma Assert (Is_Protected_Private (Id));
3685 Set_Node23 (Id, V);
3686 end Set_Protected_Operation;
3688 procedure Set_Reachable (Id : E; V : B := True) is
3689 begin
3690 Set_Flag49 (Id, V);
3691 end Set_Reachable;
3693 procedure Set_Referenced (Id : E; V : B := True) is
3694 begin
3695 Set_Flag156 (Id, V);
3696 end Set_Referenced;
3698 procedure Set_Referenced_Object (Id : E; V : N) is
3699 begin
3700 pragma Assert (Is_Type (Id));
3701 Set_Node10 (Id, V);
3702 end Set_Referenced_Object;
3704 procedure Set_Register_Exception_Call (Id : E; V : N) is
3705 begin
3706 pragma Assert (Ekind (Id) = E_Exception);
3707 Set_Node20 (Id, V);
3708 end Set_Register_Exception_Call;
3710 procedure Set_Related_Array_Object (Id : E; V : E) is
3711 begin
3712 pragma Assert (Is_Array_Type (Id));
3713 Set_Node19 (Id, V);
3714 end Set_Related_Array_Object;
3716 procedure Set_Related_Instance (Id : E; V : E) is
3717 begin
3718 pragma Assert (Ekind (Id) = E_Package);
3719 Set_Node15 (Id, V);
3720 end Set_Related_Instance;
3722 procedure Set_Renamed_Entity (Id : E; V : N) is
3723 begin
3724 Set_Node18 (Id, V);
3725 end Set_Renamed_Entity;
3727 procedure Set_Renamed_Object (Id : E; V : N) is
3728 begin
3729 Set_Node18 (Id, V);
3730 end Set_Renamed_Object;
3732 procedure Set_Renaming_Map (Id : E; V : U) is
3733 begin
3734 Set_Uint9 (Id, V);
3735 end Set_Renaming_Map;
3737 procedure Set_Return_Present (Id : E; V : B := True) is
3738 begin
3739 Set_Flag54 (Id, V);
3740 end Set_Return_Present;
3742 procedure Set_Returns_By_Ref (Id : E; V : B := True) is
3743 begin
3744 Set_Flag90 (Id, V);
3745 end Set_Returns_By_Ref;
3747 procedure Set_Reverse_Bit_Order (Id : E; V : B := True) is
3748 begin
3749 pragma Assert
3750 (Is_Record_Type (Id) and then Id = Base_Type (Id));
3751 Set_Flag164 (Id, V);
3752 end Set_Reverse_Bit_Order;
3754 procedure Set_RM_Size (Id : E; V : U) is
3755 begin
3756 pragma Assert (Is_Type (Id));
3757 Set_Uint13 (Id, V);
3758 end Set_RM_Size;
3760 procedure Set_Scalar_Range (Id : E; V : N) is
3761 begin
3762 Set_Node20 (Id, V);
3763 end Set_Scalar_Range;
3765 procedure Set_Scale_Value (Id : E; V : U) is
3766 begin
3767 Set_Uint15 (Id, V);
3768 end Set_Scale_Value;
3770 procedure Set_Scope_Depth_Value (Id : E; V : U) is
3771 begin
3772 pragma Assert (not Is_Record_Type (Id));
3773 Set_Uint22 (Id, V);
3774 end Set_Scope_Depth_Value;
3776 procedure Set_Sec_Stack_Needed_For_Return (Id : E; V : B := True) is
3777 begin
3778 Set_Flag167 (Id, V);
3779 end Set_Sec_Stack_Needed_For_Return;
3781 procedure Set_Shadow_Entities (Id : E; V : S) is
3782 begin
3783 pragma Assert
3784 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
3785 Set_List14 (Id, V);
3786 end Set_Shadow_Entities;
3788 procedure Set_Shared_Var_Assign_Proc (Id : E; V : E) is
3789 begin
3790 pragma Assert (Ekind (Id) = E_Variable);
3791 Set_Node22 (Id, V);
3792 end Set_Shared_Var_Assign_Proc;
3794 procedure Set_Shared_Var_Read_Proc (Id : E; V : E) is
3795 begin
3796 pragma Assert (Ekind (Id) = E_Variable);
3797 Set_Node15 (Id, V);
3798 end Set_Shared_Var_Read_Proc;
3800 procedure Set_Size_Check_Code (Id : E; V : N) is
3801 begin
3802 pragma Assert (Ekind (Id) = E_Constant or else Ekind (Id) = E_Variable);
3803 Set_Node9 (Id, V);
3804 end Set_Size_Check_Code;
3806 procedure Set_Size_Depends_On_Discriminant (Id : E; V : B := True) is
3807 begin
3808 Set_Flag177 (Id, V);
3809 end Set_Size_Depends_On_Discriminant;
3811 procedure Set_Size_Known_At_Compile_Time (Id : E; V : B := True) is
3812 begin
3813 Set_Flag92 (Id, V);
3814 end Set_Size_Known_At_Compile_Time;
3816 procedure Set_Small_Value (Id : E; V : R) is
3817 begin
3818 pragma Assert (Is_Fixed_Point_Type (Id));
3819 Set_Ureal21 (Id, V);
3820 end Set_Small_Value;
3822 procedure Set_Spec_Entity (Id : E; V : E) is
3823 begin
3824 pragma Assert (Ekind (Id) = E_Package_Body or else Is_Formal (Id));
3825 Set_Node19 (Id, V);
3826 end Set_Spec_Entity;
3828 procedure Set_Storage_Size_Variable (Id : E; V : E) is
3829 begin
3830 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
3831 pragma Assert (Base_Type (Id) = Id);
3832 Set_Node15 (Id, V);
3833 end Set_Storage_Size_Variable;
3835 procedure Set_Strict_Alignment (Id : E; V : B := True) is
3836 begin
3837 pragma Assert (Base_Type (Id) = Id);
3838 Set_Flag145 (Id, V);
3839 end Set_Strict_Alignment;
3841 procedure Set_String_Literal_Length (Id : E; V : U) is
3842 begin
3843 pragma Assert (Ekind (Id) = E_String_Literal_Subtype);
3844 Set_Uint16 (Id, V);
3845 end Set_String_Literal_Length;
3847 procedure Set_String_Literal_Low_Bound (Id : E; V : N) is
3848 begin
3849 pragma Assert (Ekind (Id) = E_String_Literal_Subtype);
3850 Set_Node15 (Id, V);
3851 end Set_String_Literal_Low_Bound;
3853 procedure Set_Suppress_Access_Checks (Id : E; V : B := True) is
3854 begin
3855 Set_Flag31 (Id, V);
3856 end Set_Suppress_Access_Checks;
3858 procedure Set_Suppress_Accessibility_Checks (Id : E; V : B := True) is
3859 begin
3860 Set_Flag32 (Id, V);
3861 end Set_Suppress_Accessibility_Checks;
3863 procedure Set_Suppress_Discriminant_Checks (Id : E; V : B := True) is
3864 begin
3865 Set_Flag33 (Id, V);
3866 end Set_Suppress_Discriminant_Checks;
3868 procedure Set_Suppress_Division_Checks (Id : E; V : B := True) is
3869 begin
3870 Set_Flag34 (Id, V);
3871 end Set_Suppress_Division_Checks;
3873 procedure Set_Suppress_Elaboration_Checks (Id : E; V : B := True) is
3874 begin
3875 Set_Flag35 (Id, V);
3876 end Set_Suppress_Elaboration_Checks;
3878 procedure Set_Suppress_Elaboration_Warnings (Id : E; V : B := True) is
3879 begin
3880 Set_Flag148 (Id, V);
3881 end Set_Suppress_Elaboration_Warnings;
3883 procedure Set_Suppress_Index_Checks (Id : E; V : B := True) is
3884 begin
3885 Set_Flag36 (Id, V);
3886 end Set_Suppress_Index_Checks;
3888 procedure Set_Suppress_Init_Proc (Id : E; V : B := True) is
3889 begin
3890 pragma Assert (Id = Base_Type (Id));
3891 Set_Flag105 (Id, V);
3892 end Set_Suppress_Init_Proc;
3894 procedure Set_Suppress_Length_Checks (Id : E; V : B := True) is
3895 begin
3896 Set_Flag37 (Id, V);
3897 end Set_Suppress_Length_Checks;
3899 procedure Set_Suppress_Overflow_Checks (Id : E; V : B := True) is
3900 begin
3901 Set_Flag38 (Id, V);
3902 end Set_Suppress_Overflow_Checks;
3904 procedure Set_Suppress_Range_Checks (Id : E; V : B := True) is
3905 begin
3906 Set_Flag39 (Id, V);
3907 end Set_Suppress_Range_Checks;
3909 procedure Set_Suppress_Storage_Checks (Id : E; V : B := True) is
3910 begin
3911 Set_Flag40 (Id, V);
3912 end Set_Suppress_Storage_Checks;
3914 procedure Set_Suppress_Style_Checks (Id : E; V : B := True) is
3915 begin
3916 Set_Flag165 (Id, V);
3917 end Set_Suppress_Style_Checks;
3919 procedure Set_Suppress_Tag_Checks (Id : E; V : B := True) is
3920 begin
3921 Set_Flag41 (Id, V);
3922 end Set_Suppress_Tag_Checks;
3924 procedure Set_Underlying_Full_View (Id : E; V : E) is
3925 begin
3926 pragma Assert (Ekind (Id) in Private_Kind);
3927 Set_Node19 (Id, V);
3928 end Set_Underlying_Full_View;
3930 procedure Set_Unset_Reference (Id : E; V : N) is
3931 begin
3932 Set_Node16 (Id, V);
3933 end Set_Unset_Reference;
3935 procedure Set_Uses_Sec_Stack (Id : E; V : B := True) is
3936 begin
3937 Set_Flag95 (Id, V);
3938 end Set_Uses_Sec_Stack;
3940 procedure Set_Vax_Float (Id : E; V : B := True) is
3941 begin
3942 pragma Assert (Id = Base_Type (Id));
3943 Set_Flag151 (Id, V);
3944 end Set_Vax_Float;
3946 procedure Set_Warnings_Off (Id : E; V : B := True) is
3947 begin
3948 Set_Flag96 (Id, V);
3949 end Set_Warnings_Off;
3951 -----------------------------------
3952 -- Field Initialization Routines --
3953 -----------------------------------
3955 procedure Init_Alignment (Id : E) is
3956 begin
3957 Set_Uint14 (Id, Uint_0);
3958 end Init_Alignment;
3960 procedure Init_Alignment (Id : E; V : Int) is
3961 begin
3962 Set_Uint14 (Id, UI_From_Int (V));
3963 end Init_Alignment;
3965 procedure Init_Component_Bit_Offset (Id : E) is
3966 begin
3967 Set_Uint11 (Id, No_Uint);
3968 end Init_Component_Bit_Offset;
3970 procedure Init_Component_Bit_Offset (Id : E; V : Int) is
3971 begin
3972 Set_Uint11 (Id, UI_From_Int (V));
3973 end Init_Component_Bit_Offset;
3975 procedure Init_Component_Size (Id : E) is
3976 begin
3977 Set_Uint22 (Id, Uint_0);
3978 end Init_Component_Size;
3980 procedure Init_Component_Size (Id : E; V : Int) is
3981 begin
3982 Set_Uint22 (Id, UI_From_Int (V));
3983 end Init_Component_Size;
3985 procedure Init_Digits_Value (Id : E) is
3986 begin
3987 Set_Uint17 (Id, Uint_0);
3988 end Init_Digits_Value;
3990 procedure Init_Digits_Value (Id : E; V : Int) is
3991 begin
3992 Set_Uint17 (Id, UI_From_Int (V));
3993 end Init_Digits_Value;
3995 procedure Init_Esize (Id : E) is
3996 begin
3997 Set_Uint12 (Id, Uint_0);
3998 end Init_Esize;
4000 procedure Init_Esize (Id : E; V : Int) is
4001 begin
4002 Set_Uint12 (Id, UI_From_Int (V));
4003 end Init_Esize;
4005 procedure Init_Normalized_First_Bit (Id : E) is
4006 begin
4007 Set_Uint8 (Id, No_Uint);
4008 end Init_Normalized_First_Bit;
4010 procedure Init_Normalized_First_Bit (Id : E; V : Int) is
4011 begin
4012 Set_Uint8 (Id, UI_From_Int (V));
4013 end Init_Normalized_First_Bit;
4015 procedure Init_Normalized_Position (Id : E) is
4016 begin
4017 Set_Uint9 (Id, No_Uint);
4018 end Init_Normalized_Position;
4020 procedure Init_Normalized_Position (Id : E; V : Int) is
4021 begin
4022 Set_Uint9 (Id, UI_From_Int (V));
4023 end Init_Normalized_Position;
4025 procedure Init_Normalized_Position_Max (Id : E) is
4026 begin
4027 Set_Uint10 (Id, No_Uint);
4028 end Init_Normalized_Position_Max;
4030 procedure Init_Normalized_Position_Max (Id : E; V : Int) is
4031 begin
4032 Set_Uint10 (Id, UI_From_Int (V));
4033 end Init_Normalized_Position_Max;
4035 procedure Init_RM_Size (Id : E) is
4036 begin
4037 Set_Uint13 (Id, Uint_0);
4038 end Init_RM_Size;
4040 procedure Init_RM_Size (Id : E; V : Int) is
4041 begin
4042 Set_Uint13 (Id, UI_From_Int (V));
4043 end Init_RM_Size;
4045 -----------------------------
4046 -- Init_Component_Location --
4047 -----------------------------
4049 procedure Init_Component_Location (Id : E) is
4050 begin
4051 Set_Uint8 (Id, No_Uint); -- Normalized_First_Bit
4052 Set_Uint9 (Id, No_Uint); -- Normalized_Position
4053 Set_Uint11 (Id, No_Uint); -- Component_First_Bit
4054 Set_Uint12 (Id, Uint_0); -- Esize
4055 Set_Uint10 (Id, No_Uint); -- Normalized_Position_Max
4056 end Init_Component_Location;
4058 ---------------
4059 -- Init_Size --
4060 ---------------
4062 procedure Init_Size (Id : E; V : Int) is
4063 begin
4064 Set_Uint12 (Id, UI_From_Int (V)); -- Esize
4065 Set_Uint13 (Id, UI_From_Int (V)); -- RM_Size
4066 end Init_Size;
4068 ---------------------
4069 -- Init_Size_Align --
4070 ---------------------
4072 procedure Init_Size_Align (Id : E) is
4073 begin
4074 Set_Uint12 (Id, Uint_0); -- Esize
4075 Set_Uint13 (Id, Uint_0); -- RM_Size
4076 Set_Uint14 (Id, Uint_0); -- Alignment
4077 end Init_Size_Align;
4079 ----------------------------------------------
4080 -- Type Representation Attribute Predicates --
4081 ----------------------------------------------
4083 function Known_Alignment (E : Entity_Id) return B is
4084 begin
4085 return Uint14 (E) /= Uint_0
4086 and then Uint14 (E) /= No_Uint;
4087 end Known_Alignment;
4089 function Known_Component_Bit_Offset (E : Entity_Id) return B is
4090 begin
4091 return Uint11 (E) /= No_Uint;
4092 end Known_Component_Bit_Offset;
4094 function Known_Component_Size (E : Entity_Id) return B is
4095 begin
4096 return Uint22 (Base_Type (E)) /= Uint_0
4097 and then Uint22 (Base_Type (E)) /= No_Uint;
4098 end Known_Component_Size;
4100 function Known_Esize (E : Entity_Id) return B is
4101 begin
4102 return Uint12 (E) /= Uint_0
4103 and then Uint12 (E) /= No_Uint;
4104 end Known_Esize;
4106 function Known_Normalized_First_Bit (E : Entity_Id) return B is
4107 begin
4108 return Uint8 (E) /= No_Uint;
4109 end Known_Normalized_First_Bit;
4111 function Known_Normalized_Position (E : Entity_Id) return B is
4112 begin
4113 return Uint9 (E) /= No_Uint;
4114 end Known_Normalized_Position;
4116 function Known_Normalized_Position_Max (E : Entity_Id) return B is
4117 begin
4118 return Uint10 (E) /= No_Uint;
4119 end Known_Normalized_Position_Max;
4121 function Known_RM_Size (E : Entity_Id) return B is
4122 begin
4123 return Uint13 (E) /= No_Uint
4124 and then (Uint13 (E) /= Uint_0
4125 or else Is_Discrete_Type (E));
4126 end Known_RM_Size;
4128 function Known_Static_Component_Bit_Offset (E : Entity_Id) return B is
4129 begin
4130 return Uint11 (E) /= No_Uint
4131 and then Uint11 (E) >= Uint_0;
4132 end Known_Static_Component_Bit_Offset;
4134 function Known_Static_Component_Size (E : Entity_Id) return B is
4135 begin
4136 return Uint22 (Base_Type (E)) > Uint_0;
4137 end Known_Static_Component_Size;
4139 function Known_Static_Esize (E : Entity_Id) return B is
4140 begin
4141 return Uint12 (E) > Uint_0;
4142 end Known_Static_Esize;
4144 function Known_Static_Normalized_First_Bit (E : Entity_Id) return B is
4145 begin
4146 return Uint8 (E) /= No_Uint
4147 and then Uint8 (E) >= Uint_0;
4148 end Known_Static_Normalized_First_Bit;
4150 function Known_Static_Normalized_Position (E : Entity_Id) return B is
4151 begin
4152 return Uint9 (E) /= No_Uint
4153 and then Uint9 (E) >= Uint_0;
4154 end Known_Static_Normalized_Position;
4156 function Known_Static_Normalized_Position_Max (E : Entity_Id) return B is
4157 begin
4158 return Uint10 (E) /= No_Uint
4159 and then Uint10 (E) >= Uint_0;
4160 end Known_Static_Normalized_Position_Max;
4162 function Known_Static_RM_Size (E : Entity_Id) return B is
4163 begin
4164 return Uint13 (E) > Uint_0
4165 or else Is_Discrete_Type (E);
4166 end Known_Static_RM_Size;
4168 function Unknown_Alignment (E : Entity_Id) return B is
4169 begin
4170 return Uint14 (E) = Uint_0
4171 or else Uint14 (E) = No_Uint;
4172 end Unknown_Alignment;
4174 function Unknown_Component_Bit_Offset (E : Entity_Id) return B is
4175 begin
4176 return Uint11 (E) = No_Uint;
4177 end Unknown_Component_Bit_Offset;
4179 function Unknown_Component_Size (E : Entity_Id) return B is
4180 begin
4181 return Uint22 (Base_Type (E)) = Uint_0
4182 or else
4183 Uint22 (Base_Type (E)) = No_Uint;
4184 end Unknown_Component_Size;
4186 function Unknown_Esize (E : Entity_Id) return B is
4187 begin
4188 return Uint12 (E) = No_Uint
4189 or else
4190 Uint12 (E) = Uint_0;
4191 end Unknown_Esize;
4193 function Unknown_Normalized_First_Bit (E : Entity_Id) return B is
4194 begin
4195 return Uint8 (E) = No_Uint;
4196 end Unknown_Normalized_First_Bit;
4198 function Unknown_Normalized_Position (E : Entity_Id) return B is
4199 begin
4200 return Uint9 (E) = No_Uint;
4201 end Unknown_Normalized_Position;
4203 function Unknown_Normalized_Position_Max (E : Entity_Id) return B is
4204 begin
4205 return Uint10 (E) = No_Uint;
4206 end Unknown_Normalized_Position_Max;
4208 function Unknown_RM_Size (E : Entity_Id) return B is
4209 begin
4210 return (Uint13 (E) = Uint_0
4211 and then not Is_Discrete_Type (E))
4212 or else Uint13 (E) = No_Uint;
4213 end Unknown_RM_Size;
4215 --------------------
4216 -- Address_Clause --
4217 --------------------
4219 function Address_Clause (Id : E) return N is
4220 Ritem : Node_Id;
4222 begin
4223 Ritem := First_Rep_Item (Id);
4224 while Present (Ritem) loop
4225 if Nkind (Ritem) = N_Attribute_Definition_Clause
4226 and then Chars (Ritem) = Name_Address
4227 then
4228 return Ritem;
4229 else
4230 Ritem := Next_Rep_Item (Ritem);
4231 end if;
4232 end loop;
4234 return Empty;
4235 end Address_Clause;
4237 ----------------------
4238 -- Alignment_Clause --
4239 ----------------------
4241 function Alignment_Clause (Id : E) return N is
4242 Ritem : Node_Id;
4244 begin
4245 Ritem := First_Rep_Item (Id);
4246 while Present (Ritem) loop
4247 if Nkind (Ritem) = N_Attribute_Definition_Clause
4248 and then Chars (Ritem) = Name_Alignment
4249 then
4250 return Ritem;
4251 else
4252 Ritem := Next_Rep_Item (Ritem);
4253 end if;
4254 end loop;
4256 return Empty;
4257 end Alignment_Clause;
4259 ----------------------
4260 -- Ancestor_Subtype --
4261 ----------------------
4263 function Ancestor_Subtype (Id : E) return E is
4264 begin
4265 -- If this is first subtype, or is a base type, then there is no
4266 -- ancestor subtype, so we return Empty to indicate this fact.
4268 if Is_First_Subtype (Id)
4269 or else Id = Base_Type (Id)
4270 then
4271 return Empty;
4272 end if;
4274 declare
4275 D : constant Node_Id := Declaration_Node (Id);
4277 begin
4278 -- If we have a subtype declaration, get the ancestor subtype
4280 if Nkind (D) = N_Subtype_Declaration then
4281 if Nkind (Subtype_Indication (D)) = N_Subtype_Indication then
4282 return Entity (Subtype_Mark (Subtype_Indication (D)));
4283 else
4284 return Entity (Subtype_Indication (D));
4285 end if;
4287 -- If not, then no subtype indication is available
4289 else
4290 return Empty;
4291 end if;
4292 end;
4293 end Ancestor_Subtype;
4295 -------------------
4296 -- Append_Entity --
4297 -------------------
4299 procedure Append_Entity (Id : Entity_Id; V : Entity_Id) is
4300 begin
4301 if Last_Entity (V) = Empty then
4302 Set_First_Entity (V, Id);
4303 else
4304 Set_Next_Entity (Last_Entity (V), Id);
4305 end if;
4307 Set_Next_Entity (Id, Empty);
4308 Set_Scope (Id, V);
4309 Set_Last_Entity (V, Id);
4310 end Append_Entity;
4312 ---------------
4313 -- Base_Type --
4314 ---------------
4316 function Base_Type (Id : E) return E is
4317 begin
4318 case Ekind (Id) is
4319 when E_Enumeration_Subtype |
4320 E_Signed_Integer_Subtype |
4321 E_Modular_Integer_Subtype |
4322 E_Floating_Point_Subtype |
4323 E_Ordinary_Fixed_Point_Subtype |
4324 E_Decimal_Fixed_Point_Subtype |
4325 E_Array_Subtype |
4326 E_String_Subtype |
4327 E_Record_Subtype |
4328 E_Private_Subtype |
4329 E_Record_Subtype_With_Private |
4330 E_Limited_Private_Subtype |
4331 E_Access_Subtype |
4332 E_Protected_Subtype |
4333 E_Task_Subtype |
4334 E_String_Literal_Subtype |
4335 E_Class_Wide_Subtype =>
4336 return Etype (Id);
4338 when E_Incomplete_Type =>
4339 if Present (Etype (Id)) then
4340 return Etype (Id);
4341 else
4342 return Id;
4343 end if;
4345 when others =>
4346 return Id;
4347 end case;
4348 end Base_Type;
4350 -------------------------
4351 -- Component_Alignment --
4352 -------------------------
4354 -- Component Alignment is encoded using two flags, Flag128/129 as
4355 -- follows. Note that both flags False = Align_Default, so that the
4356 -- default initialization of flags to False initializes component
4357 -- alignment to the default value as required.
4359 -- Flag128 Flag129 Value
4360 -- ------- ------- -----
4361 -- False False Calign_Default
4362 -- False True Calign_Component_Size
4363 -- True False Calign_Component_Size_4
4364 -- True True Calign_Storage_Unit
4366 function Component_Alignment (Id : E) return C is
4367 BT : Node_Id := Base_Type (Id);
4369 begin
4370 pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id));
4372 if Flag128 (BT) then
4373 if Flag129 (BT) then
4374 return Calign_Storage_Unit;
4375 else
4376 return Calign_Component_Size_4;
4377 end if;
4379 else
4380 if Flag129 (BT) then
4381 return Calign_Component_Size;
4382 else
4383 return Calign_Default;
4384 end if;
4385 end if;
4386 end Component_Alignment;
4388 --------------------
4389 -- Constant_Value --
4390 --------------------
4392 function Constant_Value (Id : E) return N is
4393 D : constant Node_Id := Declaration_Node (Id);
4394 Full_D : Node_Id;
4396 begin
4397 -- If we have no declaration node, then return no constant value.
4398 -- Not clear how this can happen, but it does sometimes ???
4399 -- To investigate, remove this check and compile discrim_po.adb.
4401 if No (D) then
4402 return Empty;
4404 -- Normal case where a declaration node is present
4406 elsif Nkind (D) = N_Object_Renaming_Declaration then
4407 return Renamed_Object (Id);
4409 -- If this is a component declaration whose entity is constant, it
4410 -- is a prival within a protected function. It does not have
4411 -- a constant value.
4413 elsif Nkind (D) = N_Component_Declaration then
4414 return Empty;
4416 else
4417 if Present (Expression (D)) then
4418 return (Expression (D));
4420 elsif Present (Full_View (Id)) then
4421 Full_D := Parent (Full_View (Id));
4423 -- The full view may have been rewritten as an object renaming.
4425 if Nkind (Full_D) = N_Object_Renaming_Declaration then
4426 return Name (Full_D);
4427 else
4428 return Expression (Full_D);
4429 end if;
4430 else
4431 return Empty;
4432 end if;
4433 end if;
4434 end Constant_Value;
4436 ----------------------
4437 -- Declaration_Node --
4438 ----------------------
4440 function Declaration_Node (Id : E) return N is
4441 P : Node_Id;
4443 begin
4444 if Ekind (Id) = E_Incomplete_Type
4445 and then Present (Full_View (Id))
4446 then
4447 P := Parent (Full_View (Id));
4448 else
4449 P := Parent (Id);
4450 end if;
4452 loop
4453 if Nkind (P) /= N_Selected_Component
4454 and then Nkind (P) /= N_Expanded_Name
4455 and then
4456 not (Nkind (P) = N_Defining_Program_Unit_Name
4457 and then Is_Child_Unit (Id))
4458 then
4459 return P;
4460 else
4461 P := Parent (P);
4462 end if;
4463 end loop;
4465 end Declaration_Node;
4467 ---------------------
4468 -- Designated_Type --
4469 ---------------------
4471 function Designated_Type (Id : E) return E is
4472 Desig_Type : E;
4474 begin
4475 Desig_Type := Directly_Designated_Type (Id);
4477 if (Ekind (Desig_Type) = E_Incomplete_Type
4478 and then Present (Full_View (Desig_Type)))
4479 then
4480 return Full_View (Desig_Type);
4482 elsif Is_Class_Wide_Type (Desig_Type)
4483 and then Ekind (Etype (Desig_Type)) = E_Incomplete_Type
4484 and then Present (Full_View (Etype (Desig_Type)))
4485 and then Present (Class_Wide_Type (Full_View (Etype (Desig_Type))))
4486 then
4487 return Class_Wide_Type (Full_View (Etype (Desig_Type)));
4489 else
4490 return Desig_Type;
4491 end if;
4492 end Designated_Type;
4494 -----------------------------
4495 -- Enclosing_Dynamic_Scope --
4496 -----------------------------
4498 function Enclosing_Dynamic_Scope (Id : E) return E is
4499 S : Entity_Id;
4501 begin
4502 S := Scope (Id);
4503 while S /= Standard_Standard
4504 and then not Is_Dynamic_Scope (S)
4505 loop
4506 S := Scope (S);
4507 end loop;
4509 return S;
4510 end Enclosing_Dynamic_Scope;
4512 ----------------------
4513 -- Entry_Index_Type --
4514 ----------------------
4516 function Entry_Index_Type (Id : E) return N is
4517 begin
4518 pragma Assert (Ekind (Id) = E_Entry_Family);
4519 return Etype (Discrete_Subtype_Definition (Parent (Id)));
4520 end Entry_Index_Type;
4522 ---------------------
4523 -- First_Component --
4524 ---------------------
4526 function First_Component (Id : E) return E is
4527 Comp_Id : E;
4529 begin
4530 pragma Assert
4531 (Is_Record_Type (Id) or else Is_Incomplete_Or_Private_Type (Id));
4533 Comp_Id := First_Entity (Id);
4535 while Present (Comp_Id) loop
4536 exit when Ekind (Comp_Id) = E_Component;
4537 Comp_Id := Next_Entity (Comp_Id);
4538 end loop;
4540 return Comp_Id;
4541 end First_Component;
4543 ------------------------
4544 -- First_Discriminant --
4545 ------------------------
4547 function First_Discriminant (Id : E) return E is
4548 Ent : Entity_Id;
4550 begin
4551 pragma Assert
4552 (Has_Discriminants (Id)
4553 or else Has_Unknown_Discriminants (Id));
4555 Ent := First_Entity (Id);
4557 -- The discriminants are not necessarily contiguous, because access
4558 -- discriminants will generate itypes. They are not the first entities
4559 -- either, because tag and controller record must be ahead of them.
4561 if Chars (Ent) = Name_uTag then
4562 Ent := Next_Entity (Ent);
4563 end if;
4565 if Chars (Ent) = Name_uController then
4566 Ent := Next_Entity (Ent);
4567 end if;
4569 -- Skip all hidden girder discriminants if any.
4571 while Present (Ent) loop
4572 exit when Ekind (Ent) = E_Discriminant
4573 and then not Is_Completely_Hidden (Ent);
4575 Ent := Next_Entity (Ent);
4576 end loop;
4578 pragma Assert (Ekind (Ent) = E_Discriminant);
4580 return Ent;
4581 end First_Discriminant;
4583 ------------------
4584 -- First_Formal --
4585 ------------------
4587 function First_Formal (Id : E) return E is
4588 Formal : E;
4590 begin
4591 pragma Assert
4592 (Is_Overloadable (Id)
4593 or else Ekind (Id) = E_Entry_Family
4594 or else Ekind (Id) = E_Subprogram_Body
4595 or else Ekind (Id) = E_Subprogram_Type);
4597 if Ekind (Id) = E_Enumeration_Literal then
4598 return Empty;
4600 else
4601 Formal := First_Entity (Id);
4603 if Present (Formal) and then Is_Formal (Formal) then
4604 return Formal;
4605 else
4606 return Empty;
4607 end if;
4608 end if;
4609 end First_Formal;
4611 -------------------------------
4612 -- First_Girder_Discriminant --
4613 -------------------------------
4615 function First_Girder_Discriminant (Id : E) return E is
4616 Ent : Entity_Id;
4618 function Has_Completely_Hidden_Discriminant (Id : E) return Boolean;
4619 -- Scans the Discriminants to see whether any are Completely_Hidden
4620 -- (the mechanism for describing non-specified girder discriminants)
4622 function Has_Completely_Hidden_Discriminant (Id : E) return Boolean is
4623 Ent : Entity_Id := Id;
4625 begin
4626 pragma Assert (Ekind (Id) = E_Discriminant);
4628 while Present (Ent) and then Ekind (Ent) = E_Discriminant loop
4630 if Is_Completely_Hidden (Ent) then
4631 return True;
4632 end if;
4634 Ent := Next_Entity (Ent);
4635 end loop;
4637 return False;
4638 end Has_Completely_Hidden_Discriminant;
4640 -- Start of processing for First_Girder_Discriminant
4642 begin
4643 pragma Assert
4644 (Has_Discriminants (Id)
4645 or else Has_Unknown_Discriminants (Id));
4647 Ent := First_Entity (Id);
4649 if Chars (Ent) = Name_uTag then
4650 Ent := Next_Entity (Ent);
4651 end if;
4653 if Chars (Ent) = Name_uController then
4654 Ent := Next_Entity (Ent);
4655 end if;
4657 if Has_Completely_Hidden_Discriminant (Ent) then
4659 while Present (Ent) loop
4660 exit when Is_Completely_Hidden (Ent);
4661 Ent := Next_Entity (Ent);
4662 end loop;
4664 end if;
4666 pragma Assert (Ekind (Ent) = E_Discriminant);
4668 return Ent;
4669 end First_Girder_Discriminant;
4671 -------------------
4672 -- First_Subtype --
4673 -------------------
4675 function First_Subtype (Id : E) return E is
4676 B : constant Entity_Id := Base_Type (Id);
4677 F : constant Node_Id := Freeze_Node (B);
4678 Ent : Entity_Id;
4680 begin
4681 -- If the base type has no freeze node, it is a type in standard,
4682 -- and always acts as its own first subtype unless it is one of
4683 -- the predefined integer types. If the type is formal, it is also
4684 -- a first subtype, and its base type has no freeze node. On the other
4685 -- hand, a subtype of a generic formal is not its own first_subtype.
4686 -- Its base type, if anonymous, is attached to the formal type decl.
4687 -- from which the first subtype is obtained.
4689 if No (F) then
4691 if B = Base_Type (Standard_Integer) then
4692 return Standard_Integer;
4694 elsif B = Base_Type (Standard_Long_Integer) then
4695 return Standard_Long_Integer;
4697 elsif B = Base_Type (Standard_Short_Short_Integer) then
4698 return Standard_Short_Short_Integer;
4700 elsif B = Base_Type (Standard_Short_Integer) then
4701 return Standard_Short_Integer;
4703 elsif B = Base_Type (Standard_Long_Long_Integer) then
4704 return Standard_Long_Long_Integer;
4706 elsif Is_Generic_Type (Id) then
4707 if Present (Parent (B)) then
4708 return Defining_Identifier (Parent (B));
4709 else
4710 return Defining_Identifier (Associated_Node_For_Itype (B));
4711 end if;
4713 else
4714 return B;
4715 end if;
4717 -- Otherwise we check the freeze node, if it has a First_Subtype_Link
4718 -- then we use that link, otherwise (happens with some Itypes), we use
4719 -- the base type itself.
4721 else
4722 Ent := First_Subtype_Link (F);
4724 if Present (Ent) then
4725 return Ent;
4726 else
4727 return B;
4728 end if;
4729 end if;
4730 end First_Subtype;
4732 -------------------------------------
4733 -- Get_Attribute_Definition_Clause --
4734 -------------------------------------
4736 function Get_Attribute_Definition_Clause
4737 (E : Entity_Id;
4738 Id : Attribute_Id)
4739 return Node_Id
4741 N : Node_Id;
4743 begin
4744 N := First_Rep_Item (E);
4745 while Present (N) loop
4746 if Nkind (N) = N_Attribute_Definition_Clause
4747 and then Get_Attribute_Id (Chars (N)) = Id
4748 then
4749 return N;
4750 else
4751 Next_Rep_Item (N);
4752 end if;
4753 end loop;
4755 return Empty;
4756 end Get_Attribute_Definition_Clause;
4758 --------------------
4759 -- Get_Rep_Pragma --
4760 --------------------
4762 function Get_Rep_Pragma (E : Entity_Id; Nam : Name_Id) return Node_Id is
4763 N : Node_Id;
4764 Typ : Entity_Id;
4766 begin
4767 N := First_Rep_Item (E);
4769 while Present (N) loop
4770 if Nkind (N) = N_Pragma and then Chars (N) = Nam then
4772 if Nam = Name_Stream_Convert then
4774 -- For tagged types this pragma is not inherited, so we
4775 -- must verify that it is defined for the given type and
4776 -- not an ancestor.
4778 Typ := Entity (Expression
4779 (First (Pragma_Argument_Associations (N))));
4781 if not Is_Tagged_Type (E)
4782 or else E = Typ
4783 or else (Is_Private_Type (Typ)
4784 and then E = Full_View (Typ))
4785 then
4786 return N;
4787 else
4788 Next_Rep_Item (N);
4789 end if;
4791 else
4792 return N;
4793 end if;
4794 else
4795 Next_Rep_Item (N);
4796 end if;
4797 end loop;
4799 return Empty;
4800 end Get_Rep_Pragma;
4802 ------------------------
4803 -- Has_Attach_Handler --
4804 ------------------------
4806 function Has_Attach_Handler (Id : E) return B is
4807 Ritem : Node_Id;
4809 begin
4810 pragma Assert (Is_Protected_Type (Id));
4812 Ritem := First_Rep_Item (Id);
4813 while Present (Ritem) loop
4814 if Nkind (Ritem) = N_Pragma
4815 and then Chars (Ritem) = Name_Attach_Handler
4816 then
4817 return True;
4818 else
4819 Ritem := Next_Rep_Item (Ritem);
4820 end if;
4821 end loop;
4823 return False;
4824 end Has_Attach_Handler;
4826 -----------------
4827 -- Has_Entries --
4828 -----------------
4830 function Has_Entries (Id : E) return B is
4831 Result : Boolean := False;
4832 Ent : Entity_Id;
4834 begin
4835 pragma Assert (Is_Concurrent_Type (Id));
4836 Ent := First_Entity (Id);
4838 while Present (Ent) loop
4839 if Is_Entry (Ent) then
4840 Result := True;
4841 exit;
4842 end if;
4844 Ent := Next_Entity (Ent);
4845 end loop;
4847 return Result;
4848 end Has_Entries;
4850 ----------------------------
4851 -- Has_Foreign_Convention --
4852 ----------------------------
4854 function Has_Foreign_Convention (Id : E) return B is
4855 begin
4856 return Convention (Id) >= Foreign_Convention'First;
4857 end Has_Foreign_Convention;
4859 ---------------------------
4860 -- Has_Interrupt_Handler --
4861 ---------------------------
4863 function Has_Interrupt_Handler (Id : E) return B is
4864 Ritem : Node_Id;
4866 begin
4867 pragma Assert (Is_Protected_Type (Id));
4869 Ritem := First_Rep_Item (Id);
4870 while Present (Ritem) loop
4871 if Nkind (Ritem) = N_Pragma
4872 and then Chars (Ritem) = Name_Interrupt_Handler
4873 then
4874 return True;
4875 else
4876 Ritem := Next_Rep_Item (Ritem);
4877 end if;
4878 end loop;
4880 return False;
4881 end Has_Interrupt_Handler;
4883 --------------------------
4884 -- Has_Private_Ancestor --
4885 --------------------------
4887 function Has_Private_Ancestor (Id : E) return B is
4888 R : constant Entity_Id := Root_Type (Id);
4889 T1 : Entity_Id := Id;
4891 begin
4892 loop
4893 if Is_Private_Type (T1) then
4894 return True;
4896 elsif T1 = R then
4897 return False;
4899 else
4900 T1 := Etype (T1);
4901 end if;
4902 end loop;
4903 end Has_Private_Ancestor;
4905 ------------------------------
4906 -- Implementation_Base_Type --
4907 ------------------------------
4909 function Implementation_Base_Type (Id : E) return E is
4910 Bastyp : Entity_Id;
4911 Imptyp : Entity_Id;
4913 begin
4914 Bastyp := Base_Type (Id);
4916 if Is_Incomplete_Or_Private_Type (Bastyp) then
4917 Imptyp := Underlying_Type (Bastyp);
4919 -- If we have an implementation type, then just return it,
4920 -- otherwise we return the Base_Type anyway. This can only
4921 -- happen in error situations and should avoid some error bombs.
4923 if Present (Imptyp) then
4924 return Base_Type (Imptyp);
4925 else
4926 return Bastyp;
4927 end if;
4929 else
4930 return Bastyp;
4931 end if;
4932 end Implementation_Base_Type;
4934 -----------------------
4935 -- Is_Always_Inlined --
4936 -----------------------
4938 function Is_Always_Inlined (Id : E) return B is
4939 Item : Node_Id;
4941 begin
4942 Item := First_Rep_Item (Id);
4944 while Present (Item) loop
4945 if Nkind (Item) = N_Pragma
4946 and then Get_Pragma_Id (Chars (Item)) = Pragma_Inline_Always
4947 then
4948 return True;
4949 end if;
4951 Next_Rep_Item (Item);
4952 end loop;
4954 return False;
4955 end Is_Always_Inlined;
4957 ---------------------
4958 -- Is_Boolean_Type --
4959 ---------------------
4961 function Is_Boolean_Type (Id : E) return B is
4962 begin
4963 return Root_Type (Id) = Standard_Boolean;
4964 end Is_Boolean_Type;
4966 ---------------------
4967 -- Is_By_Copy_Type --
4968 ---------------------
4970 function Is_By_Copy_Type (Id : E) return B is
4971 begin
4972 -- If Id is a private type whose full declaration has not been seen,
4973 -- we assume for now that it is not a By_Copy type. Clearly this
4974 -- attribute should not be used before the type is frozen, but it is
4975 -- needed to build the associated record of a protected type. Another
4976 -- place where some lookahead for a full view is needed ???
4978 return
4979 Is_Elementary_Type (Id)
4980 or else (Is_Private_Type (Id)
4981 and then Present (Underlying_Type (Id))
4982 and then Is_Elementary_Type (Underlying_Type (Id)));
4983 end Is_By_Copy_Type;
4985 --------------------------
4986 -- Is_By_Reference_Type --
4987 --------------------------
4989 function Is_By_Reference_Type (Id : E) return B is
4990 Btype : constant Entity_Id := Base_Type (Id);
4992 begin
4993 if Error_Posted (Id)
4994 or else Error_Posted (Btype)
4995 then
4996 return False;
4998 elsif Is_Private_Type (Btype) then
4999 declare
5000 Utyp : constant Entity_Id := Underlying_Type (Btype);
5002 begin
5003 if No (Utyp) then
5004 return False;
5005 else
5006 return Is_By_Reference_Type (Utyp);
5007 end if;
5008 end;
5010 elsif Is_Concurrent_Type (Btype) then
5011 return True;
5013 elsif Is_Record_Type (Btype) then
5015 if Is_Limited_Record (Btype)
5016 or else Is_Tagged_Type (Btype)
5017 or else Is_Volatile (Btype)
5018 then
5019 return True;
5021 else
5022 declare
5023 C : Entity_Id := First_Component (Btype);
5025 begin
5026 while Present (C) loop
5027 if Is_By_Reference_Type (Etype (C))
5028 or else Is_Volatile (Etype (C))
5029 then
5030 return True;
5031 end if;
5033 C := Next_Component (C);
5034 end loop;
5035 end;
5037 return False;
5038 end if;
5040 elsif Is_Array_Type (Btype) then
5041 return
5042 Is_Volatile (Btype)
5043 or else Is_By_Reference_Type (Component_Type (Btype))
5044 or else Is_Volatile (Component_Type (Btype))
5045 or else Has_Volatile_Components (Btype);
5047 else
5048 return False;
5049 end if;
5050 end Is_By_Reference_Type;
5052 ---------------------
5053 -- Is_Derived_Type --
5054 ---------------------
5056 function Is_Derived_Type (Id : E) return B is
5057 Par : Node_Id;
5059 begin
5060 if Base_Type (Id) /= Root_Type (Id)
5061 and then not Is_Generic_Type (Id)
5062 and then not Is_Class_Wide_Type (Id)
5063 then
5064 if not Is_Numeric_Type (Root_Type (Id)) then
5065 return True;
5067 else
5068 Par := Parent (First_Subtype (Id));
5070 return Present (Par)
5071 and then Nkind (Par) = N_Full_Type_Declaration
5072 and then Nkind (Type_Definition (Par))
5073 = N_Derived_Type_Definition;
5074 end if;
5076 else
5077 return False;
5078 end if;
5079 end Is_Derived_Type;
5081 ----------------------
5082 -- Is_Dynamic_Scope --
5083 ----------------------
5085 function Is_Dynamic_Scope (Id : E) return B is
5086 begin
5087 return
5088 Ekind (Id) = E_Block
5089 or else
5090 Ekind (Id) = E_Function
5091 or else
5092 Ekind (Id) = E_Procedure
5093 or else
5094 Ekind (Id) = E_Subprogram_Body
5095 or else
5096 Ekind (Id) = E_Task_Type
5097 or else
5098 Ekind (Id) = E_Entry
5099 or else
5100 Ekind (Id) = E_Entry_Family;
5101 end Is_Dynamic_Scope;
5103 --------------------
5104 -- Is_Entity_Name --
5105 --------------------
5107 function Is_Entity_Name (N : Node_Id) return Boolean is
5108 Kind : constant Node_Kind := Nkind (N);
5110 begin
5111 -- Identifiers, operator symbols, expanded names are entity names
5113 return Kind = N_Identifier
5114 or else Kind = N_Operator_Symbol
5115 or else Kind = N_Expanded_Name
5117 -- Attribute references are entity names if they refer to an entity.
5118 -- Note that we don't do this by testing for the presence of the
5119 -- Entity field in the N_Attribute_Reference node, since it may not
5120 -- have been set yet.
5122 or else (Kind = N_Attribute_Reference
5123 and then Is_Entity_Attribute_Name (Attribute_Name (N)));
5124 end Is_Entity_Name;
5126 ---------------------------
5127 -- Is_Indefinite_Subtype --
5128 ---------------------------
5130 function Is_Indefinite_Subtype (Id : Entity_Id) return B is
5131 K : constant Entity_Kind := Ekind (Id);
5133 begin
5134 if Is_Constrained (Id) then
5135 return False;
5137 elsif K in Array_Kind
5138 or else K in Class_Wide_Kind
5139 or else Has_Unknown_Discriminants (Id)
5140 then
5141 return True;
5143 -- Known discriminants: indefinite if there are no default values
5145 elsif K in Record_Kind
5146 or else Is_Incomplete_Or_Private_Type (Id)
5147 or else Is_Concurrent_Type (Id)
5148 then
5149 return (Has_Discriminants (Id)
5150 and then No (Discriminant_Default_Value (First_Discriminant (Id))));
5152 else
5153 return False;
5154 end if;
5155 end Is_Indefinite_Subtype;
5157 ---------------------
5158 -- Is_Limited_Type --
5159 ---------------------
5161 function Is_Limited_Type (Id : E) return B is
5162 Btype : constant E := Base_Type (Id);
5164 begin
5165 if not Is_Type (Id) then
5166 return False;
5168 elsif Ekind (Btype) = E_Limited_Private_Type
5169 or else Is_Limited_Composite (Btype)
5170 then
5171 return True;
5173 elsif Is_Concurrent_Type (Btype) then
5174 return True;
5176 -- Otherwise we will look around to see if there is some other reason
5177 -- for it to be limited, except that if an error was posted on the
5178 -- entity, then just assume it is non-limited, because it can cause
5179 -- trouble to recurse into a murky erroneous entity!
5181 elsif Error_Posted (Id) then
5182 return False;
5184 elsif Is_Record_Type (Btype) then
5185 if Is_Limited_Record (Root_Type (Btype)) then
5186 return True;
5188 elsif Is_Class_Wide_Type (Btype) then
5189 return Is_Limited_Type (Root_Type (Btype));
5191 else
5192 declare
5193 C : E := First_Component (Btype);
5195 begin
5196 while Present (C) loop
5197 if Is_Limited_Type (Etype (C)) then
5198 return True;
5199 end if;
5201 C := Next_Component (C);
5202 end loop;
5203 end;
5205 return False;
5206 end if;
5208 elsif Is_Array_Type (Btype) then
5209 return Is_Limited_Type (Component_Type (Btype));
5211 else
5212 return False;
5213 end if;
5214 end Is_Limited_Type;
5216 ----------------
5217 -- Is_Package --
5218 ----------------
5220 function Is_Package (Id : E) return B is
5221 begin
5222 return
5223 Ekind (Id) = E_Package
5224 or else
5225 Ekind (Id) = E_Generic_Package;
5226 end Is_Package;
5228 --------------------------
5229 -- Is_Protected_Private --
5230 --------------------------
5232 function Is_Protected_Private (Id : E) return B is
5234 begin
5235 pragma Assert (Ekind (Id) = E_Component);
5236 return Is_Protected_Type (Scope (Id));
5237 end Is_Protected_Private;
5239 ------------------------------
5240 -- Is_Protected_Record_Type --
5241 ------------------------------
5243 function Is_Protected_Record_Type (Id : E) return B is
5244 begin
5245 return
5246 Is_Concurrent_Record_Type (Id)
5247 and then Is_Protected_Type (Corresponding_Concurrent_Type (Id));
5248 end Is_Protected_Record_Type;
5250 ---------------------------------
5251 -- Is_Return_By_Reference_Type --
5252 ---------------------------------
5254 function Is_Return_By_Reference_Type (Id : E) return B is
5255 Btype : constant Entity_Id := Base_Type (Id);
5257 begin
5258 if Is_Private_Type (Btype) then
5259 declare
5260 Utyp : constant Entity_Id := Underlying_Type (Btype);
5262 begin
5263 if No (Utyp) then
5264 return False;
5265 else
5266 return Is_Return_By_Reference_Type (Utyp);
5267 end if;
5268 end;
5270 elsif Is_Concurrent_Type (Btype) then
5271 return True;
5273 elsif Is_Record_Type (Btype) then
5274 if Is_Limited_Record (Btype) then
5275 return True;
5277 elsif Is_Class_Wide_Type (Btype) then
5278 return Is_Return_By_Reference_Type (Root_Type (Btype));
5280 else
5281 declare
5282 C : Entity_Id := First_Component (Btype);
5284 begin
5285 while Present (C) loop
5286 if Is_Return_By_Reference_Type (Etype (C)) then
5287 return True;
5288 end if;
5290 C := Next_Component (C);
5291 end loop;
5292 end;
5294 return False;
5295 end if;
5297 elsif Is_Array_Type (Btype) then
5298 return Is_Return_By_Reference_Type (Component_Type (Btype));
5300 else
5301 return False;
5302 end if;
5303 end Is_Return_By_Reference_Type;
5305 --------------------
5306 -- Is_String_Type --
5307 --------------------
5309 function Is_String_Type (Id : E) return B is
5310 begin
5311 return Ekind (Id) in String_Kind
5312 or else (Is_Array_Type (Id)
5313 and then Number_Dimensions (Id) = 1
5314 and then Is_Character_Type (Component_Type (Id)));
5315 end Is_String_Type;
5317 -------------------------
5318 -- Is_Task_Record_Type --
5319 -------------------------
5321 function Is_Task_Record_Type (Id : E) return B is
5322 begin
5323 return
5324 Is_Concurrent_Record_Type (Id)
5325 and then Is_Task_Type (Corresponding_Concurrent_Type (Id));
5326 end Is_Task_Record_Type;
5328 ------------------------
5329 -- Is_Wrapper_Package --
5330 ------------------------
5332 function Is_Wrapper_Package (Id : E) return B is
5333 begin
5334 return (Ekind (Id) = E_Package
5335 and then Present (Related_Instance (Id)));
5336 end Is_Wrapper_Package;
5338 --------------------
5339 -- Next_Component --
5340 --------------------
5342 function Next_Component (Id : E) return E is
5343 Comp_Id : E;
5345 begin
5346 Comp_Id := Next_Entity (Id);
5348 while Present (Comp_Id) loop
5349 exit when Ekind (Comp_Id) = E_Component;
5350 Comp_Id := Next_Entity (Comp_Id);
5351 end loop;
5353 return Comp_Id;
5354 end Next_Component;
5356 -----------------------
5357 -- Next_Discriminant --
5358 -----------------------
5360 -- This function actually implements both Next_Discriminant and
5361 -- Next_Girder_Discriminant by making sure that the Discriminant
5362 -- returned is of the same variety as Id.
5364 function Next_Discriminant (Id : E) return E is
5366 -- Derived Tagged types with private extensions look like this...
5368 -- E_Discriminant d1
5369 -- E_Discriminant d2
5370 -- E_Component _tag
5371 -- E_Discriminant d1
5372 -- E_Discriminant d2
5373 -- ...
5374 -- so it is critical not to go past the leading discriminants.
5376 D : E := Id;
5378 begin
5379 pragma Assert (Ekind (Id) = E_Discriminant);
5381 loop
5382 D := Next_Entity (D);
5383 if not Present (D)
5384 or else (Ekind (D) /= E_Discriminant
5385 and then not Is_Itype (D))
5386 then
5387 return Empty;
5388 end if;
5390 exit when Ekind (D) = E_Discriminant
5391 and then (Is_Completely_Hidden (D) = Is_Completely_Hidden (Id));
5392 end loop;
5394 return D;
5395 end Next_Discriminant;
5397 -----------------
5398 -- Next_Formal --
5399 -----------------
5401 function Next_Formal (Id : E) return E is
5402 P : E;
5404 begin
5405 -- Follow the chain of declared entities as long as the kind of
5406 -- the entity corresponds to a formal parameter. Skip internal
5407 -- entities that may have been created for implicit subtypes,
5408 -- in the process of analyzing default expressions.
5410 P := Id;
5412 loop
5413 P := Next_Entity (P);
5415 if No (P) or else Is_Formal (P) then
5416 return P;
5417 elsif not Is_Internal (P) then
5418 return Empty;
5419 end if;
5420 end loop;
5421 end Next_Formal;
5423 -----------------------------
5424 -- Next_Formal_With_Extras --
5425 -----------------------------
5427 function Next_Formal_With_Extras (Id : E) return E is
5428 begin
5429 if Present (Extra_Formal (Id)) then
5430 return Extra_Formal (Id);
5432 else
5433 return Next_Formal (Id);
5434 end if;
5435 end Next_Formal_With_Extras;
5437 ------------------------------
5438 -- Next_Girder_Discriminant --
5439 ------------------------------
5441 function Next_Girder_Discriminant (Id : E) return E is
5442 begin
5443 -- See comment in Next_Discriminant
5445 return Next_Discriminant (Id);
5446 end Next_Girder_Discriminant;
5448 ----------------
5449 -- Next_Index --
5450 ----------------
5452 function Next_Index (Id : Node_Id) return Node_Id is
5453 begin
5454 return Next (Id);
5455 end Next_Index;
5457 ------------------
5458 -- Next_Literal --
5459 ------------------
5461 function Next_Literal (Id : E) return E is
5462 begin
5463 pragma Assert (Nkind (Id) in N_Entity);
5464 return Next (Id);
5465 end Next_Literal;
5467 -----------------------
5468 -- Number_Dimensions --
5469 -----------------------
5471 function Number_Dimensions (Id : E) return Pos is
5472 N : Int;
5473 T : Node_Id;
5475 begin
5476 if Ekind (Id) in String_Kind then
5477 return 1;
5479 else
5480 N := 0;
5481 T := First_Index (Id);
5483 while Present (T) loop
5484 N := N + 1;
5485 T := Next (T);
5486 end loop;
5488 return N;
5489 end if;
5490 end Number_Dimensions;
5492 --------------------------
5493 -- Number_Discriminants --
5494 --------------------------
5496 function Number_Discriminants (Id : E) return Pos is
5497 N : Int;
5498 Discr : Entity_Id;
5500 begin
5501 N := 0;
5502 Discr := First_Discriminant (Id);
5504 while Present (Discr) loop
5505 N := N + 1;
5506 Discr := Next_Discriminant (Discr);
5507 end loop;
5509 return N;
5510 end Number_Discriminants;
5512 --------------------
5513 -- Number_Entries --
5514 --------------------
5516 function Number_Entries (Id : E) return Nat is
5517 N : Int;
5518 Ent : Entity_Id;
5520 begin
5521 pragma Assert (Is_Concurrent_Type (Id));
5522 N := 0;
5523 Ent := First_Entity (Id);
5525 while Present (Ent) loop
5526 if Is_Entry (Ent) then
5527 N := N + 1;
5528 end if;
5530 Ent := Next_Entity (Ent);
5531 end loop;
5533 return N;
5534 end Number_Entries;
5536 --------------------
5537 -- Number_Formals --
5538 --------------------
5540 function Number_Formals (Id : E) return Pos is
5541 N : Int;
5542 Formal : Entity_Id;
5544 begin
5545 N := 0;
5546 Formal := First_Formal (Id);
5548 while Present (Formal) loop
5549 N := N + 1;
5550 Formal := Next_Formal (Formal);
5551 end loop;
5553 return N;
5554 end Number_Formals;
5556 --------------------
5557 -- Parameter_Mode --
5558 --------------------
5560 function Parameter_Mode (Id : E) return Formal_Kind is
5561 begin
5562 return Ekind (Id);
5563 end Parameter_Mode;
5565 ---------------
5566 -- Root_Type --
5567 ---------------
5569 function Root_Type (Id : E) return E is
5570 T, Etyp : E;
5572 begin
5573 pragma Assert (Nkind (Id) in N_Entity);
5575 T := Base_Type (Id);
5577 if Ekind (T) = E_Class_Wide_Type then
5578 return Etype (T);
5580 -- All other cases
5582 else
5583 loop
5584 Etyp := Etype (T);
5586 if T = Etyp then
5587 return T;
5589 elsif Is_Private_Type (T) and then Etyp = Full_View (T) then
5590 return T;
5592 elsif Is_Private_Type (Etyp) and then Full_View (Etyp) = T then
5593 return T;
5594 end if;
5596 T := Etyp;
5597 end loop;
5598 end if;
5600 raise Program_Error;
5601 end Root_Type;
5603 -----------------
5604 -- Scope_Depth --
5605 -----------------
5607 function Scope_Depth (Id : E) return Uint is
5608 Scop : Entity_Id := Id;
5610 begin
5611 while Is_Record_Type (Scop) loop
5612 Scop := Scope (Scop);
5613 end loop;
5615 return Scope_Depth_Value (Scop);
5616 end Scope_Depth;
5618 ---------------------
5619 -- Scope_Depth_Set --
5620 ---------------------
5622 function Scope_Depth_Set (Id : E) return B is
5623 begin
5624 return not Is_Record_Type (Id)
5625 and then Field22 (Id) /= Union_Id (Empty);
5626 end Scope_Depth_Set;
5628 -----------------------------
5629 -- Set_Component_Alignment --
5630 -----------------------------
5632 -- Component Alignment is encoded using two flags, Flag128/129 as
5633 -- follows. Note that both flags False = Align_Default, so that the
5634 -- default initialization of flags to False initializes component
5635 -- alignment to the default value as required.
5637 -- Flag128 Flag129 Value
5638 -- ------- ------- -----
5639 -- False False Calign_Default
5640 -- False True Calign_Component_Size
5641 -- True False Calign_Component_Size_4
5642 -- True True Calign_Storage_Unit
5644 procedure Set_Component_Alignment (Id : E; V : C) is
5645 begin
5646 pragma Assert ((Is_Array_Type (Id) or else Is_Record_Type (Id))
5647 and then Id = Base_Type (Id));
5649 case V is
5650 when Calign_Default =>
5651 Set_Flag128 (Id, False);
5652 Set_Flag129 (Id, False);
5654 when Calign_Component_Size =>
5655 Set_Flag128 (Id, False);
5656 Set_Flag129 (Id, True);
5658 when Calign_Component_Size_4 =>
5659 Set_Flag128 (Id, True);
5660 Set_Flag129 (Id, False);
5662 when Calign_Storage_Unit =>
5663 Set_Flag128 (Id, True);
5664 Set_Flag129 (Id, True);
5665 end case;
5666 end Set_Component_Alignment;
5668 -----------------
5669 -- Size_Clause --
5670 -----------------
5672 function Size_Clause (Id : E) return N is
5673 Ritem : Node_Id;
5675 begin
5676 Ritem := First_Rep_Item (Id);
5677 while Present (Ritem) loop
5678 if Nkind (Ritem) = N_Attribute_Definition_Clause
5679 and then Chars (Ritem) = Name_Size
5680 then
5681 return Ritem;
5682 else
5683 Ritem := Next_Rep_Item (Ritem);
5684 end if;
5685 end loop;
5687 return Empty;
5688 end Size_Clause;
5690 ------------------
5691 -- Subtype_Kind --
5692 ------------------
5694 function Subtype_Kind (K : Entity_Kind) return Entity_Kind is
5695 Kind : Entity_Kind;
5697 begin
5698 case K is
5699 when Access_Kind =>
5700 Kind := E_Access_Subtype;
5702 when E_Array_Type |
5703 E_Array_Subtype =>
5704 Kind := E_Array_Subtype;
5706 when E_Class_Wide_Type |
5707 E_Class_Wide_Subtype =>
5708 Kind := E_Class_Wide_Subtype;
5710 when E_Decimal_Fixed_Point_Type |
5711 E_Decimal_Fixed_Point_Subtype =>
5712 Kind := E_Decimal_Fixed_Point_Subtype;
5714 when E_Ordinary_Fixed_Point_Type |
5715 E_Ordinary_Fixed_Point_Subtype =>
5716 Kind := E_Ordinary_Fixed_Point_Subtype;
5718 when E_Private_Type |
5719 E_Private_Subtype =>
5720 Kind := E_Private_Subtype;
5722 when E_Limited_Private_Type |
5723 E_Limited_Private_Subtype =>
5724 Kind := E_Limited_Private_Subtype;
5726 when E_Record_Type_With_Private |
5727 E_Record_Subtype_With_Private =>
5728 Kind := E_Record_Subtype_With_Private;
5730 when E_Record_Type |
5731 E_Record_Subtype =>
5732 Kind := E_Record_Subtype;
5734 when E_String_Type |
5735 E_String_Subtype =>
5736 Kind := E_String_Subtype;
5738 when Enumeration_Kind =>
5739 Kind := E_Enumeration_Subtype;
5741 when Float_Kind =>
5742 Kind := E_Floating_Point_Subtype;
5744 when Signed_Integer_Kind =>
5745 Kind := E_Signed_Integer_Subtype;
5747 when Modular_Integer_Kind =>
5748 Kind := E_Modular_Integer_Subtype;
5750 when Protected_Kind =>
5751 Kind := E_Protected_Subtype;
5753 when Task_Kind =>
5754 Kind := E_Task_Subtype;
5756 when others =>
5757 Kind := E_Void;
5758 raise Program_Error;
5759 end case;
5761 return Kind;
5762 end Subtype_Kind;
5764 -------------------
5765 -- Tag_Component --
5766 -------------------
5768 function Tag_Component (Id : E) return E is
5769 Comp : Entity_Id;
5770 Typ : Entity_Id := Id;
5772 begin
5773 pragma Assert (Is_Tagged_Type (Typ));
5775 if Is_Class_Wide_Type (Typ) then
5776 Typ := Root_Type (Typ);
5777 end if;
5779 if Is_Private_Type (Typ) then
5780 Typ := Underlying_Type (Typ);
5781 end if;
5783 Comp := First_Entity (Typ);
5784 while Present (Comp) loop
5785 if Is_Tag (Comp) then
5786 return Comp;
5787 end if;
5789 Comp := Next_Entity (Comp);
5790 end loop;
5792 -- No tag component found
5794 return Empty;
5795 end Tag_Component;
5797 ---------------------
5798 -- Type_High_Bound --
5799 ---------------------
5801 function Type_High_Bound (Id : E) return Node_Id is
5802 begin
5803 if Nkind (Scalar_Range (Id)) = N_Subtype_Indication then
5804 return High_Bound (Range_Expression (Constraint (Scalar_Range (Id))));
5805 else
5806 return High_Bound (Scalar_Range (Id));
5807 end if;
5808 end Type_High_Bound;
5810 --------------------
5811 -- Type_Low_Bound --
5812 --------------------
5814 function Type_Low_Bound (Id : E) return Node_Id is
5815 begin
5816 if Nkind (Scalar_Range (Id)) = N_Subtype_Indication then
5817 return Low_Bound (Range_Expression (Constraint (Scalar_Range (Id))));
5818 else
5819 return Low_Bound (Scalar_Range (Id));
5820 end if;
5821 end Type_Low_Bound;
5823 ---------------------
5824 -- Underlying_Type --
5825 ---------------------
5827 function Underlying_Type (Id : E) return E is
5828 begin
5830 -- For record_with_private the underlying type is always the direct
5831 -- full view. Never try to take the full view of the parent it
5832 -- doesn't make sense.
5834 if Ekind (Id) = E_Record_Type_With_Private then
5835 return Full_View (Id);
5837 elsif Ekind (Id) in Incomplete_Or_Private_Kind then
5839 -- If we have an incomplete or private type with a full view,
5840 -- then we return the Underlying_Type of this full view
5842 if Present (Full_View (Id)) then
5843 return Underlying_Type (Full_View (Id));
5845 -- Otherwise check for the case where we have a derived type or
5846 -- subtype, and if so get the Underlying_Type of the parent type.
5848 elsif Etype (Id) /= Id then
5849 return Underlying_Type (Etype (Id));
5851 -- Otherwise we have an incomplete or private type that has
5852 -- no full view, which means that we have not encountered the
5853 -- completion, so return Empty to indicate the underlying type
5854 -- is not yet known.
5856 else
5857 return Empty;
5858 end if;
5860 -- For non-incomplete, non-private types, return the type itself
5861 -- Also for entities that are not types at all return the entity
5862 -- itself.
5864 else
5865 return Id;
5866 end if;
5867 end Underlying_Type;
5869 ------------------------
5870 -- Write_Entity_Flags --
5871 ------------------------
5873 procedure Write_Entity_Flags (Id : Entity_Id; Prefix : String) is
5875 procedure W (Flag_Name : String; Flag : Boolean);
5876 -- Write out given flag if it is set
5878 procedure W (Flag_Name : String; Flag : Boolean) is
5879 begin
5880 if Flag then
5881 Write_Str (Prefix);
5882 Write_Str (Flag_Name);
5883 Write_Str (" = True");
5884 Write_Eol;
5885 end if;
5886 end W;
5888 -- Start of processing for Write_Entity_Flags
5890 begin
5891 if (Is_Array_Type (Id) or else Is_Record_Type (Id))
5892 and then Base_Type (Id) = Id
5893 then
5894 Write_Str (Prefix);
5895 Write_Str ("Component_Alignment = ");
5897 case Component_Alignment (Id) is
5898 when Calign_Default =>
5899 Write_Str ("Calign_Default");
5901 when Calign_Component_Size =>
5902 Write_Str ("Calign_Component_Size");
5904 when Calign_Component_Size_4 =>
5905 Write_Str ("Calign_Component_Size_4");
5907 when Calign_Storage_Unit =>
5908 Write_Str ("Calign_Storage_Unit");
5909 end case;
5911 Write_Eol;
5912 end if;
5914 W ("Address_Taken", Flag104 (Id));
5915 W ("C_Pass_By_Copy", Flag125 (Id));
5916 W ("Debug_Info_Off", Flag166 (Id));
5917 W ("Default_Expressions_Processed", Flag108 (Id));
5918 W ("Delay_Cleanups", Flag114 (Id));
5919 W ("Delay_Subprogram_Descriptors", Flag50 (Id));
5920 W ("Depends_On_Private", Flag14 (Id));
5921 W ("Discard_Names", Flag88 (Id));
5922 W ("Elaborate_All_Desirable", Flag146 (Id));
5923 W ("Elaboration_Entity_Required", Flag174 (Id));
5924 W ("Entry_Accepted", Flag152 (Id));
5925 W ("Finalize_Storage_Only", Flag158 (Id));
5926 W ("From_With_Type", Flag159 (Id));
5927 W ("Function_Returns_With_DSP", Flag169 (Id));
5928 W ("Has_Aliased_Components", Flag135 (Id));
5929 W ("Has_Alignment_Clause", Flag46 (Id));
5930 W ("Has_All_Calls_Remote", Flag79 (Id));
5931 W ("Has_Atomic_Components", Flag86 (Id));
5932 W ("Has_Biased_Representation", Flag139 (Id));
5933 W ("Has_Completion", Flag26 (Id));
5934 W ("Has_Completion_In_Body", Flag71 (Id));
5935 W ("Has_Complex_Representation", Flag140 (Id));
5936 W ("Has_Component_Size_Clause", Flag68 (Id));
5937 W ("Has_Controlled_Component", Flag43 (Id));
5938 W ("Has_Controlling_Result", Flag98 (Id));
5939 W ("Has_Convention_Pragma", Flag119 (Id));
5940 W ("Has_Delayed_Freeze", Flag18 (Id));
5941 W ("Has_Discriminants", Flag5 (Id));
5942 W ("Has_Enumeration_Rep_Clause", Flag66 (Id));
5943 W ("Has_Exit", Flag47 (Id));
5944 W ("Has_External_Tag_Rep_Clause", Flag110 (Id));
5945 W ("Has_Forward_Instantiation", Flag175 (Id));
5946 W ("Has_Fully_Qualified_Name", Flag173 (Id));
5947 W ("Has_Gigi_Rep_Item", Flag82 (Id));
5948 W ("Has_Homonym", Flag56 (Id));
5949 W ("Has_Machine_Radix_Clause", Flag83 (Id));
5950 W ("Has_Master_Entity", Flag21 (Id));
5951 W ("Has_Missing_Return", Flag142 (Id));
5952 W ("Has_Nested_Block_With_Handler", Flag101 (Id));
5953 W ("Has_Non_Standard_Rep", Flag75 (Id));
5954 W ("Has_Object_Size_Clause", Flag172 (Id));
5955 W ("Has_Per_Object_Constraint", Flag154 (Id));
5956 W ("Has_Pragma_Controlled", Flag27 (Id));
5957 W ("Has_Pragma_Elaborate_Body", Flag150 (Id));
5958 W ("Has_Pragma_Inline", Flag157 (Id));
5959 W ("Has_Pragma_Pack", Flag121 (Id));
5960 W ("Has_Pragma_Pure_Function", Flag179 (Id));
5961 W ("Has_Pragma_Unreferenced", Flag180 (Id));
5962 W ("Has_Primitive_Operations", Flag120 (Id));
5963 W ("Has_Private_Declaration", Flag155 (Id));
5964 W ("Has_Qualified_Name", Flag161 (Id));
5965 W ("Has_Record_Rep_Clause", Flag65 (Id));
5966 W ("Has_Recursive_Call", Flag143 (Id));
5967 W ("Has_Size_Clause", Flag29 (Id));
5968 W ("Has_Small_Clause", Flag67 (Id));
5969 W ("Has_Specified_Layout", Flag100 (Id));
5970 W ("Has_Storage_Size_Clause", Flag23 (Id));
5971 W ("Has_Subprogram_Descriptor", Flag93 (Id));
5972 W ("Has_Task", Flag30 (Id));
5973 W ("Has_Unchecked_Union", Flag123 (Id));
5974 W ("Has_Unknown_Discriminants", Flag72 (Id));
5975 W ("Has_Volatile_Components", Flag87 (Id));
5976 W ("In_Package_Body", Flag48 (Id));
5977 W ("In_Private_Part", Flag45 (Id));
5978 W ("In_Use", Flag8 (Id));
5979 W ("Is_AST_Entry", Flag132 (Id));
5980 W ("Is_Abstract", Flag19 (Id));
5981 W ("Is_Access_Constant", Flag69 (Id));
5982 W ("Is_Aliased", Flag15 (Id));
5983 W ("Is_Asynchronous", Flag81 (Id));
5984 W ("Is_Atomic", Flag85 (Id));
5985 W ("Is_Bit_Packed_Array", Flag122 (Id));
5986 W ("Is_CPP_Class", Flag74 (Id));
5987 W ("Is_Called", Flag102 (Id));
5988 W ("Is_Character_Type", Flag63 (Id));
5989 W ("Is_Child_Unit", Flag73 (Id));
5990 W ("Is_Compilation_Unit", Flag149 (Id));
5991 W ("Is_Completely_Hidden", Flag103 (Id));
5992 W ("Is_Concurrent_Record_Type", Flag20 (Id));
5993 W ("Is_Constr_Subt_For_UN_Aliased", Flag141 (Id));
5994 W ("Is_Constr_Subt_For_U_Nominal", Flag80 (Id));
5995 W ("Is_Constrained", Flag12 (Id));
5996 W ("Is_Constructor", Flag76 (Id));
5997 W ("Is_Controlled", Flag42 (Id));
5998 W ("Is_Controlling_Formal", Flag97 (Id));
5999 W ("Is_Destructor", Flag77 (Id));
6000 W ("Is_Discrim_SO_Function", Flag176 (Id));
6001 W ("Is_Dispatching_Operation", Flag6 (Id));
6002 W ("Is_Eliminated", Flag124 (Id));
6003 W ("Is_Entry_Formal", Flag52 (Id));
6004 W ("Is_Exported", Flag99 (Id));
6005 W ("Is_First_Subtype", Flag70 (Id));
6006 W ("Is_For_Access_Subtype", Flag118 (Id));
6007 W ("Is_Formal_Subprogram", Flag111 (Id));
6008 W ("Is_Frozen", Flag4 (Id));
6009 W ("Is_Generic_Actual_Type", Flag94 (Id));
6010 W ("Is_Generic_Instance", Flag130 (Id));
6011 W ("Is_Generic_Type", Flag13 (Id));
6012 W ("Is_Hidden", Flag57 (Id));
6013 W ("Is_Hidden_Open_Scope", Flag171 (Id));
6014 W ("Is_Immediately_Visible", Flag7 (Id));
6015 W ("Is_Imported", Flag24 (Id));
6016 W ("Is_Inlined", Flag11 (Id));
6017 W ("Is_Instantiated", Flag126 (Id));
6018 W ("Is_Internal", Flag17 (Id));
6019 W ("Is_Interrupt_Handler", Flag89 (Id));
6020 W ("Is_Intrinsic_Subprogram", Flag64 (Id));
6021 W ("Is_Itype", Flag91 (Id));
6022 W ("Is_Known_Valid", Flag170 (Id));
6023 W ("Is_Limited_Composite", Flag106 (Id));
6024 W ("Is_Limited_Record", Flag25 (Id));
6025 W ("Is_Non_Static_Subtype", Flag109 (Id));
6026 W ("Is_Null_Init_Proc", Flag178 (Id));
6027 W ("Is_Optional_Parameter", Flag134 (Id));
6028 W ("Is_Package_Body_Entity", Flag160 (Id));
6029 W ("Is_Packed", Flag51 (Id));
6030 W ("Is_Packed_Array_Type", Flag138 (Id));
6031 W ("Is_Potentially_Use_Visible", Flag9 (Id));
6032 W ("Is_Preelaborated", Flag59 (Id));
6033 W ("Is_Private_Composite", Flag107 (Id));
6034 W ("Is_Private_Descendant", Flag53 (Id));
6035 W ("Is_Psected", Flag153 (Id));
6036 W ("Is_Public", Flag10 (Id));
6037 W ("Is_Pure", Flag44 (Id));
6038 W ("Is_Remote_Call_Interface", Flag62 (Id));
6039 W ("Is_Remote_Types", Flag61 (Id));
6040 W ("Is_Renaming_Of_Object", Flag112 (Id));
6041 W ("Is_Shared_Passive", Flag60 (Id));
6042 W ("Is_Statically_Allocated", Flag28 (Id));
6043 W ("Is_Tag", Flag78 (Id));
6044 W ("Is_Tagged_Type", Flag55 (Id));
6045 W ("Is_True_Constant", Flag163 (Id));
6046 W ("Is_Unchecked_Union", Flag117 (Id));
6047 W ("Is_Unsigned_Type", Flag144 (Id));
6048 W ("Is_VMS_Exception", Flag133 (Id));
6049 W ("Is_Valued_Procedure", Flag127 (Id));
6050 W ("Is_Visible_Child_Unit", Flag116 (Id));
6051 W ("Is_Volatile", Flag16 (Id));
6052 W ("Machine_Radix_10", Flag84 (Id));
6053 W ("Materialize_Entity", Flag168 (Id));
6054 W ("Needs_Debug_Info", Flag147 (Id));
6055 W ("Needs_No_Actuals", Flag22 (Id));
6056 W ("No_Pool_Assigned", Flag131 (Id));
6057 W ("No_Return", Flag113 (Id));
6058 W ("Non_Binary_Modulus", Flag58 (Id));
6059 W ("Nonzero_Is_True", Flag162 (Id));
6060 W ("Not_Source_Assigned", Flag115 (Id));
6061 W ("Reachable", Flag49 (Id));
6062 W ("Referenced", Flag156 (Id));
6063 W ("Return_Present", Flag54 (Id));
6064 W ("Returns_By_Ref", Flag90 (Id));
6065 W ("Reverse_Bit_Order", Flag164 (Id));
6066 W ("Sec_Stack_Needed_For_Return", Flag167 (Id));
6067 W ("Size_Depends_On_Discriminant", Flag177 (Id));
6068 W ("Size_Known_At_Compile_Time", Flag92 (Id));
6069 W ("Strict_Alignment", Flag145 (Id));
6070 W ("Suppress_Access_Checks", Flag31 (Id));
6071 W ("Suppress_Accessibility_Checks", Flag32 (Id));
6072 W ("Suppress_Discriminant_Checks", Flag33 (Id));
6073 W ("Suppress_Division_Checks", Flag34 (Id));
6074 W ("Suppress_Elaboration_Checks", Flag35 (Id));
6075 W ("Suppress_Elaboration_Warnings", Flag148 (Id));
6076 W ("Suppress_Index_Checks", Flag36 (Id));
6077 W ("Suppress_Init_Proc", Flag105 (Id));
6078 W ("Suppress_Length_Checks", Flag37 (Id));
6079 W ("Suppress_Overflow_Checks", Flag38 (Id));
6080 W ("Suppress_Range_Checks", Flag39 (Id));
6081 W ("Suppress_Storage_Checks", Flag40 (Id));
6082 W ("Suppress_Style_Checks", Flag165 (Id));
6083 W ("Suppress_Tag_Checks", Flag41 (Id));
6084 W ("Uses_Sec_Stack", Flag95 (Id));
6085 W ("Vax_Float", Flag151 (Id));
6086 W ("Warnings_Off", Flag96 (Id));
6088 end Write_Entity_Flags;
6090 -----------------------
6091 -- Write_Entity_Info --
6092 -----------------------
6094 procedure Write_Entity_Info (Id : Entity_Id; Prefix : String) is
6096 procedure Write_Attribute (Which : String; Nam : E);
6097 -- Write attribute value with given string name
6099 procedure Write_Kind (Id : Entity_Id);
6100 -- Write Ekind field of entity
6102 procedure Write_Attribute (Which : String; Nam : E) is
6103 begin
6104 Write_Str (Prefix);
6105 Write_Str (Which);
6106 Write_Int (Int (Nam));
6107 Write_Str (" ");
6108 Write_Name (Chars (Nam));
6109 Write_Str (" ");
6110 end Write_Attribute;
6112 procedure Write_Kind (Id : Entity_Id) is
6113 K : constant String := Entity_Kind'Image (Ekind (Id));
6115 begin
6116 Write_Str (Prefix);
6117 Write_Str (" Kind ");
6119 if Is_Type (Id) and then Is_Tagged_Type (Id) then
6120 Write_Str ("TAGGED ");
6121 end if;
6123 Write_Str (K (3 .. K'Length));
6124 Write_Str (" ");
6126 if Is_Type (Id) and then Depends_On_Private (Id) then
6127 Write_Str ("Depends_On_Private ");
6128 end if;
6129 end Write_Kind;
6131 -- Start of processing for Write_Entity_Info
6133 begin
6134 Write_Eol;
6135 Write_Attribute ("Name ", Id);
6136 Write_Int (Int (Id));
6137 Write_Eol;
6138 Write_Kind (Id);
6139 Write_Eol;
6140 Write_Attribute (" Type ", Etype (Id));
6141 Write_Eol;
6142 Write_Attribute (" Scope ", Scope (Id));
6143 Write_Eol;
6145 case Ekind (Id) is
6147 when Discrete_Kind =>
6148 Write_Str ("Bounds: Id = ");
6150 if Present (Scalar_Range (Id)) then
6151 Write_Int (Int (Type_Low_Bound (Id)));
6152 Write_Str (" .. Id = ");
6153 Write_Int (Int (Type_High_Bound (Id)));
6154 else
6155 Write_Str ("Empty");
6156 end if;
6158 Write_Eol;
6160 when Array_Kind =>
6161 declare
6162 Index : E;
6164 begin
6165 Write_Attribute (" Component Type ",
6166 Component_Type (Id));
6167 Write_Eol;
6168 Write_Str (Prefix);
6169 Write_Str (" Indices ");
6171 Index := First_Index (Id);
6173 while Present (Index) loop
6174 Write_Attribute (" ", Etype (Index));
6175 Index := Next_Index (Index);
6176 end loop;
6178 Write_Eol;
6179 end;
6181 when Access_Kind =>
6182 Write_Attribute
6183 (" Directly Designated Type ",
6184 Directly_Designated_Type (Id));
6185 Write_Eol;
6187 when Overloadable_Kind =>
6188 if Present (Homonym (Id)) then
6189 Write_Str (" Homonym ");
6190 Write_Name (Chars (Homonym (Id)));
6191 Write_Str (" ");
6192 Write_Int (Int (Homonym (Id)));
6193 Write_Eol;
6194 end if;
6196 Write_Eol;
6198 when E_Component =>
6199 if Ekind (Scope (Id)) in Record_Kind then
6200 Write_Attribute (
6201 " Original_Record_Component ",
6202 Original_Record_Component (Id));
6203 Write_Int (Int (Original_Record_Component (Id)));
6204 Write_Eol;
6205 end if;
6207 when others => null;
6208 end case;
6209 end Write_Entity_Info;
6211 -----------------------
6212 -- Write_Field6_Name --
6213 -----------------------
6215 procedure Write_Field6_Name (Id : Entity_Id) is
6216 pragma Warnings (Off, Id);
6218 begin
6219 Write_Str ("First_Rep_Item");
6220 end Write_Field6_Name;
6222 -----------------------
6223 -- Write_Field7_Name --
6224 -----------------------
6226 procedure Write_Field7_Name (Id : Entity_Id) is
6227 pragma Warnings (Off, Id);
6229 begin
6230 Write_Str ("Freeze_Node");
6231 end Write_Field7_Name;
6233 -----------------------
6234 -- Write_Field8_Name --
6235 -----------------------
6237 procedure Write_Field8_Name (Id : Entity_Id) is
6238 begin
6239 case Ekind (Id) is
6240 when E_Component |
6241 E_Discriminant =>
6242 Write_Str ("Normalized_First_Bit");
6244 when Formal_Kind |
6245 E_Function |
6246 E_Subprogram_Body =>
6247 Write_Str ("Mechanism");
6249 when Type_Kind =>
6250 Write_Str ("Associated_Node_For_Itype");
6252 when E_Package =>
6253 Write_Str ("Dependent_Instances");
6255 when E_Variable =>
6256 Write_Str ("Hiding_Loop_Variable");
6258 when others =>
6259 Write_Str ("Field8??");
6260 end case;
6261 end Write_Field8_Name;
6263 -----------------------
6264 -- Write_Field9_Name --
6265 -----------------------
6267 procedure Write_Field9_Name (Id : Entity_Id) is
6268 begin
6269 case Ekind (Id) is
6270 when Type_Kind =>
6271 Write_Str ("Class_Wide_Type");
6273 when E_Constant | E_Variable =>
6274 Write_Str ("Size_Check_Code");
6276 when E_Function |
6277 E_Generic_Function |
6278 E_Generic_Package |
6279 E_Generic_Procedure |
6280 E_Package |
6281 E_Procedure =>
6282 Write_Str ("Renaming_Map");
6284 when E_Component |
6285 E_Discriminant =>
6286 Write_Str ("Normalized_Position");
6288 when others =>
6289 Write_Str ("Field9??");
6290 end case;
6291 end Write_Field9_Name;
6293 ------------------------
6294 -- Write_Field10_Name --
6295 ------------------------
6297 procedure Write_Field10_Name (Id : Entity_Id) is
6298 begin
6299 case Ekind (Id) is
6300 when Type_Kind =>
6301 Write_Str ("Referenced_Object");
6303 when E_In_Parameter |
6304 E_Constant =>
6305 Write_Str ("Discriminal_Link");
6307 when E_Function |
6308 E_Package |
6309 E_Package_Body |
6310 E_Procedure =>
6311 Write_Str ("Handler_Records");
6313 when E_Component |
6314 E_Discriminant =>
6315 Write_Str ("Normalized_Position_Max");
6317 when others =>
6318 Write_Str ("Field10??");
6319 end case;
6320 end Write_Field10_Name;
6322 ------------------------
6323 -- Write_Field11_Name --
6324 ------------------------
6326 procedure Write_Field11_Name (Id : Entity_Id) is
6327 begin
6328 case Ekind (Id) is
6329 when Formal_Kind =>
6330 Write_Str ("Entry_Component");
6332 when E_Component |
6333 E_Discriminant =>
6334 Write_Str ("Component_Bit_Offset");
6336 when E_Constant =>
6337 Write_Str ("Full_View");
6339 when E_Enumeration_Literal =>
6340 Write_Str ("Enumeration_Pos");
6342 when E_Block =>
6343 Write_Str ("Block_Node");
6345 when E_Function |
6346 E_Procedure |
6347 E_Entry |
6348 E_Entry_Family =>
6349 Write_Str ("Protected_Body_Subprogram");
6351 when Type_Kind =>
6352 Write_Str ("Full_View");
6354 when others =>
6355 Write_Str ("Field11??");
6356 end case;
6357 end Write_Field11_Name;
6359 ------------------------
6360 -- Write_Field12_Name --
6361 ------------------------
6363 procedure Write_Field12_Name (Id : Entity_Id) is
6364 begin
6365 case Ekind (Id) is
6366 when Entry_Kind =>
6367 Write_Str ("Barrier_Function");
6369 when E_Enumeration_Literal =>
6370 Write_Str ("Enumeration_Rep");
6372 when Type_Kind |
6373 E_Component |
6374 E_Constant |
6375 E_Discriminant |
6376 E_In_Parameter |
6377 E_In_Out_Parameter |
6378 E_Out_Parameter |
6379 E_Loop_Parameter |
6380 E_Variable =>
6381 Write_Str ("Esize");
6383 when E_Function |
6384 E_Procedure =>
6385 Write_Str ("Next_Inlined_Subprogram");
6387 when E_Package =>
6388 Write_Str ("Associated_Formal_Package");
6390 when others =>
6391 Write_Str ("Field12??");
6392 end case;
6393 end Write_Field12_Name;
6395 ------------------------
6396 -- Write_Field13_Name --
6397 ------------------------
6399 procedure Write_Field13_Name (Id : Entity_Id) is
6400 begin
6401 case Ekind (Id) is
6402 when Type_Kind =>
6403 Write_Str ("RM_Size");
6405 when E_Component |
6406 E_Discriminant =>
6407 Write_Str ("Component_Clause");
6409 when E_Enumeration_Literal =>
6410 Write_Str ("Debug_Renaming_Link");
6412 when E_Function =>
6413 if not Comes_From_Source (Id)
6414 and then
6415 Chars (Id) = Name_Op_Ne
6416 then
6417 Write_Str ("Corresponding_Equality");
6419 elsif Comes_From_Source (Id) then
6420 Write_Str ("Elaboration_Entity");
6422 else
6423 Write_Str ("Field13??");
6424 end if;
6426 when Formal_Kind |
6427 E_Variable =>
6428 Write_Str ("Extra_Accessibility");
6430 when E_Procedure |
6431 E_Package |
6432 Generic_Unit_Kind =>
6433 Write_Str ("Elaboration_Entity");
6435 when others =>
6436 Write_Str ("Field13??");
6437 end case;
6438 end Write_Field13_Name;
6440 -----------------------
6441 -- Write_Field14_Name --
6442 -----------------------
6444 procedure Write_Field14_Name (Id : Entity_Id) is
6445 begin
6446 case Ekind (Id) is
6447 when Type_Kind |
6448 Object_Kind =>
6449 Write_Str ("Alignment");
6451 when E_Function |
6452 E_Procedure =>
6453 Write_Str ("First_Optional_Parameter");
6455 when E_Package |
6456 E_Generic_Package =>
6457 Write_Str ("Shadow_Entities");
6459 when others =>
6460 Write_Str ("Field14??");
6461 end case;
6462 end Write_Field14_Name;
6464 ------------------------
6465 -- Write_Field15_Name --
6466 ------------------------
6468 procedure Write_Field15_Name (Id : Entity_Id) is
6469 begin
6470 case Ekind (Id) is
6471 when Access_Kind |
6472 Task_Kind =>
6473 Write_Str ("Storage_Size_Variable");
6475 when Class_Wide_Kind |
6476 E_Record_Type |
6477 E_Record_Subtype |
6478 Private_Kind =>
6479 Write_Str ("Primitive_Operations");
6481 when E_Component =>
6482 Write_Str ("DT_Entry_Count");
6484 when Decimal_Fixed_Point_Kind =>
6485 Write_Str ("Scale_Value");
6487 when E_Discriminant =>
6488 Write_Str ("Discriminant_Number");
6490 when Formal_Kind =>
6491 Write_Str ("Extra_Formal");
6493 when E_Function |
6494 E_Procedure =>
6495 Write_Str ("DT_Position");
6497 when Entry_Kind =>
6498 Write_Str ("Entry_Parameters_Type");
6500 when Enumeration_Kind =>
6501 Write_Str ("Lit_Indexes");
6503 when E_Package =>
6504 Write_Str ("Related_Instance");
6506 when E_Protected_Type =>
6507 Write_Str ("Entry_Bodies_Array");
6509 when E_String_Literal_Subtype =>
6510 Write_Str ("String_Literal_Low_Bound");
6512 when E_Variable =>
6513 Write_Str ("Shared_Var_Read_Proc");
6515 when others =>
6516 Write_Str ("Field15??");
6517 end case;
6518 end Write_Field15_Name;
6520 ------------------------
6521 -- Write_Field16_Name --
6522 ------------------------
6524 procedure Write_Field16_Name (Id : Entity_Id) is
6525 begin
6526 case Ekind (Id) is
6527 when E_Component =>
6528 Write_Str ("Entry_Formal");
6530 when E_Function |
6531 E_Procedure =>
6532 Write_Str ("DTC_Entity");
6534 when E_Package |
6535 E_Generic_Package |
6536 Concurrent_Kind =>
6537 Write_Str ("First_Private_Entity");
6539 when E_Record_Type |
6540 E_Record_Type_With_Private =>
6541 Write_Str ("Access_Disp_Table");
6543 when E_String_Literal_Subtype =>
6544 Write_Str ("String_Literal_Length");
6546 when Enumeration_Kind =>
6547 Write_Str ("Lit_Strings");
6549 when E_Variable |
6550 E_Out_Parameter =>
6551 Write_Str ("Unset_Reference");
6553 when E_Record_Subtype |
6554 E_Class_Wide_Subtype =>
6555 Write_Str ("Cloned_Subtype");
6557 when others =>
6558 Write_Str ("Field16??");
6559 end case;
6560 end Write_Field16_Name;
6562 ------------------------
6563 -- Write_Field17_Name --
6564 ------------------------
6566 procedure Write_Field17_Name (Id : Entity_Id) is
6567 begin
6568 case Ekind (Id) is
6569 when Digits_Kind =>
6570 Write_Str ("Digits_Value");
6572 when E_Component =>
6573 Write_Str ("Prival");
6575 when E_Discriminant =>
6576 Write_Str ("Discriminal");
6578 when E_Block |
6579 Class_Wide_Kind |
6580 Concurrent_Kind |
6581 Private_Kind |
6582 E_Entry |
6583 E_Entry_Family |
6584 E_Function |
6585 E_Generic_Function |
6586 E_Generic_Package |
6587 E_Generic_Procedure |
6588 E_Loop |
6589 E_Operator |
6590 E_Package |
6591 E_Package_Body |
6592 E_Procedure |
6593 E_Record_Type |
6594 E_Record_Subtype |
6595 E_Subprogram_Body |
6596 E_Subprogram_Type =>
6597 Write_Str ("First_Entity");
6599 when Array_Kind =>
6600 Write_Str ("First_Index");
6602 when E_Protected_Body =>
6603 Write_Str ("Object_Ref");
6605 when Enumeration_Kind =>
6606 Write_Str ("First_Literal");
6608 when Access_Kind =>
6609 Write_Str ("Master_Id");
6611 when Modular_Integer_Kind =>
6612 Write_Str ("Modulus");
6614 when Formal_Kind |
6615 E_Constant |
6616 E_Generic_In_Out_Parameter |
6617 E_Variable =>
6618 Write_Str ("Actual_Subtype");
6620 when others =>
6621 Write_Str ("Field17??");
6622 end case;
6623 end Write_Field17_Name;
6625 -----------------------
6626 -- Write_Field18_Name --
6627 -----------------------
6629 procedure Write_Field18_Name (Id : Entity_Id) is
6630 begin
6631 case Ekind (Id) is
6632 when E_Enumeration_Literal |
6633 E_Function |
6634 E_Operator |
6635 E_Procedure =>
6636 Write_Str ("Alias");
6638 when E_Record_Type =>
6639 Write_Str ("Corresponding_Concurrent_Type");
6641 when E_Entry_Index_Parameter =>
6642 Write_Str ("Entry_Index_Constant");
6644 when E_Class_Wide_Subtype |
6645 E_Access_Protected_Subprogram_Type |
6646 E_Access_Subprogram_Type |
6647 E_Exception_Type =>
6648 Write_Str ("Equivalent_Type");
6650 when Fixed_Point_Kind =>
6651 Write_Str ("Delta_Value");
6653 when E_Constant |
6654 E_Variable =>
6655 Write_Str ("Renamed_Object");
6657 when E_Exception |
6658 E_Package |
6659 E_Generic_Function |
6660 E_Generic_Procedure |
6661 E_Generic_Package =>
6662 Write_Str ("Renamed_Entity");
6664 when Incomplete_Or_Private_Kind =>
6665 Write_Str ("Private_Dependents");
6667 when Concurrent_Kind =>
6668 Write_Str ("Corresponding_Record_Type");
6670 when E_Label |
6671 E_Loop |
6672 E_Block =>
6673 Write_Str ("Enclosing_Scope");
6675 when others =>
6676 Write_Str ("Field18??");
6677 end case;
6678 end Write_Field18_Name;
6680 -----------------------
6681 -- Write_Field19_Name --
6682 -----------------------
6684 procedure Write_Field19_Name (Id : Entity_Id) is
6685 begin
6686 case Ekind (Id) is
6687 when E_Array_Type |
6688 E_Array_Subtype =>
6689 Write_Str ("Related_Array_Object");
6691 when E_Block |
6692 Concurrent_Kind |
6693 E_Function |
6694 E_Procedure |
6695 Entry_Kind =>
6696 Write_Str ("Finalization_Chain_Entity");
6698 when E_Discriminant =>
6699 Write_Str ("Corresponding_Discriminant");
6701 when E_Package |
6702 E_Generic_Package =>
6703 Write_Str ("Body_Entity");
6705 when E_Package_Body |
6706 Formal_Kind =>
6707 Write_Str ("Spec_Entity");
6709 when Private_Kind =>
6710 Write_Str ("Underlying_Full_View");
6712 when E_Record_Type =>
6713 Write_Str ("Parent_Subtype");
6715 when others =>
6716 Write_Str ("Field19??");
6717 end case;
6718 end Write_Field19_Name;
6720 -----------------------
6721 -- Write_Field20_Name --
6722 -----------------------
6724 procedure Write_Field20_Name (Id : Entity_Id) is
6725 begin
6726 case Ekind (Id) is
6727 when Array_Kind =>
6728 Write_Str ("Component_Type");
6730 when E_In_Parameter |
6731 E_Generic_In_Parameter =>
6732 Write_Str ("Default_Value");
6734 when Access_Kind =>
6735 Write_Str ("Directly_Designated_Type");
6737 when E_Component =>
6738 Write_Str ("Discriminant_Checking_Func");
6740 when E_Discriminant =>
6741 Write_Str ("Discriminant_Default_Value");
6743 when E_Block |
6744 Class_Wide_Kind |
6745 Concurrent_Kind |
6746 Private_Kind |
6747 E_Entry |
6748 E_Entry_Family |
6749 E_Function |
6750 E_Generic_Function |
6751 E_Generic_Package |
6752 E_Generic_Procedure |
6753 E_Loop |
6754 E_Operator |
6755 E_Package |
6756 E_Package_Body |
6757 E_Procedure |
6758 E_Record_Type |
6759 E_Record_Subtype |
6760 E_Subprogram_Body |
6761 E_Subprogram_Type =>
6763 Write_Str ("Last_Entity");
6765 when Scalar_Kind =>
6766 Write_Str ("Scalar_Range");
6768 when E_Exception =>
6769 Write_Str ("Register_Exception_Call");
6771 when others =>
6772 Write_Str ("Field20??");
6773 end case;
6774 end Write_Field20_Name;
6776 -----------------------
6777 -- Write_Field21_Name --
6778 -----------------------
6780 procedure Write_Field21_Name (Id : Entity_Id) is
6781 begin
6782 case Ekind (Id) is
6783 when E_Constant |
6784 E_Exception |
6785 E_Function |
6786 E_Generic_Function |
6787 E_Procedure |
6788 E_Generic_Procedure |
6789 E_Variable =>
6790 Write_Str ("Interface_Name");
6792 when Concurrent_Kind |
6793 Incomplete_Or_Private_Kind |
6794 Class_Wide_Kind |
6795 E_Record_Type |
6796 E_Record_Subtype =>
6797 Write_Str ("Discriminant_Constraint");
6799 when Entry_Kind =>
6800 Write_Str ("Accept_Address");
6802 when Fixed_Point_Kind =>
6803 Write_Str ("Small_Value");
6805 when E_In_Parameter =>
6806 Write_Str ("Default_Expr_Function");
6808 when Array_Kind |
6809 Modular_Integer_Kind =>
6810 Write_Str ("Original_Array_Type");
6812 when others =>
6813 Write_Str ("Field21??");
6814 end case;
6815 end Write_Field21_Name;
6817 -----------------------
6818 -- Write_Field22_Name --
6819 -----------------------
6821 procedure Write_Field22_Name (Id : Entity_Id) is
6822 begin
6823 case Ekind (Id) is
6824 when Access_Kind =>
6825 Write_Str ("Associated_Storage_Pool");
6827 when Array_Kind =>
6828 Write_Str ("Component_Size");
6830 when E_Component |
6831 E_Discriminant =>
6832 Write_Str ("Original_Record_Component");
6834 when E_Enumeration_Literal =>
6835 Write_Str ("Enumeration_Rep_Expr");
6837 when E_Exception =>
6838 Write_Str ("Exception_Code");
6840 when Formal_Kind =>
6841 Write_Str ("Protected_Formal");
6843 when E_Record_Type =>
6844 Write_Str ("Corresponding_Remote_Type");
6846 when E_Block |
6847 E_Entry |
6848 E_Entry_Family |
6849 E_Function |
6850 E_Loop |
6851 E_Package |
6852 E_Package_Body |
6853 E_Generic_Package |
6854 E_Generic_Function |
6855 E_Generic_Procedure |
6856 E_Procedure |
6857 E_Protected_Type |
6858 E_Subprogram_Body |
6859 E_Task_Type =>
6860 Write_Str ("Scope_Depth_Value");
6862 when E_Record_Type_With_Private |
6863 E_Record_Subtype_With_Private |
6864 E_Private_Type |
6865 E_Private_Subtype |
6866 E_Limited_Private_Type |
6867 E_Limited_Private_Subtype =>
6868 Write_Str ("Private_View");
6870 when E_Variable =>
6871 Write_Str ("Shared_Var_Assign_Proc");
6873 when others =>
6874 Write_Str ("Field22??");
6875 end case;
6876 end Write_Field22_Name;
6878 ------------------------
6879 -- Write_Field23_Name --
6880 ------------------------
6882 procedure Write_Field23_Name (Id : Entity_Id) is
6883 begin
6884 case Ekind (Id) is
6885 when Access_Kind =>
6886 Write_Str ("Associated_Final_Chain");
6888 when Array_Kind =>
6889 Write_Str ("Packed_Array_Type");
6891 when E_Block =>
6892 Write_Str ("Entry_Cancel_Parameter");
6894 when E_Component =>
6895 Write_Str ("Protected_Operation");
6897 when E_Discriminant =>
6898 Write_Str ("CR_Discriminant");
6900 when E_Enumeration_Type =>
6901 Write_Str ("Enum_Pos_To_Rep");
6903 when Formal_Kind |
6904 E_Variable =>
6905 Write_Str ("Extra_Constrained");
6907 when E_Generic_Function |
6908 E_Generic_Package |
6909 E_Generic_Procedure =>
6910 Write_Str ("Inner_Instances");
6912 when Concurrent_Kind |
6913 Incomplete_Or_Private_Kind |
6914 Class_Wide_Kind |
6915 E_Record_Type |
6916 E_Record_Subtype =>
6917 Write_Str ("Girder_Constraint");
6919 when E_Function |
6920 E_Package |
6921 E_Procedure =>
6922 Write_Str ("Generic_Renamings");
6924 -- What about Privals_Chain for protected operations ???
6926 when Entry_Kind =>
6927 Write_Str ("Privals_Chain");
6929 when others =>
6930 Write_Str ("Field23??");
6931 end case;
6932 end Write_Field23_Name;
6934 -------------------------
6935 -- Iterator Procedures --
6936 -------------------------
6938 procedure Proc_Next_Component (N : in out Node_Id) is
6939 begin
6940 N := Next_Component (N);
6941 end Proc_Next_Component;
6943 procedure Proc_Next_Discriminant (N : in out Node_Id) is
6944 begin
6945 N := Next_Discriminant (N);
6946 end Proc_Next_Discriminant;
6948 procedure Proc_Next_Formal (N : in out Node_Id) is
6949 begin
6950 N := Next_Formal (N);
6951 end Proc_Next_Formal;
6953 procedure Proc_Next_Formal_With_Extras (N : in out Node_Id) is
6954 begin
6955 N := Next_Formal_With_Extras (N);
6956 end Proc_Next_Formal_With_Extras;
6958 procedure Proc_Next_Girder_Discriminant (N : in out Node_Id) is
6959 begin
6960 N := Next_Girder_Discriminant (N);
6961 end Proc_Next_Girder_Discriminant;
6963 procedure Proc_Next_Index (N : in out Node_Id) is
6964 begin
6965 N := Next_Index (N);
6966 end Proc_Next_Index;
6968 procedure Proc_Next_Inlined_Subprogram (N : in out Node_Id) is
6969 begin
6970 N := Next_Inlined_Subprogram (N);
6971 end Proc_Next_Inlined_Subprogram;
6973 procedure Proc_Next_Literal (N : in out Node_Id) is
6974 begin
6975 N := Next_Literal (N);
6976 end Proc_Next_Literal;
6978 end Einfo;