1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
32 ------------------------------------------------------------------------------
34 pragma Style_Checks (All_Checks);
35 -- Turn off subprogram ordering, not used for this unit
37 with Atree; use Atree;
38 with Namet; use Namet;
39 with Nlists; use Nlists;
40 with Sinfo; use Sinfo;
41 with Stand; use Stand;
42 with Output; use Output;
46 use Atree.Unchecked_Access;
47 -- This is one of the packages that is allowed direct untyped access to
48 -- the fields in a node, since it provides the next level abstraction
49 -- which incorporates appropriate checks.
51 ----------------------------------------------
52 -- Usage of Fields in Defining Entity Nodes --
53 ----------------------------------------------
55 -- Four of these fields are defined in Sinfo, since they in are the
56 -- base part of the node. The access routines for these fields and
57 -- the corresponding set procedures are defined in Sinfo. These fields
58 -- are present in all entities. Note that Homonym is also in the base
59 -- part of the node, but has access routines that are more properly
60 -- part of Einfo, which is why they are defined here.
67 -- Remaining fields are present only in extended nodes (i.e. entities)
69 -- The following fields are present in all entities
72 -- First_Rep_Item Node6
75 -- The usage of each field (and the entity kinds to which it applies)
76 -- depends on the particular field (see Einfo spec for details).
78 -- Associated_Node_For_Itype Node8
79 -- Dependent_Instances Elist8
80 -- Hiding_Loop_Variable Node8
81 -- Mechanism Uint8 (but returns Mechanism_Type)
82 -- Normalized_First_Bit Uint8
84 -- Class_Wide_Type Node9
85 -- Current_Value Node9
88 -- Discriminal_Link Node10
89 -- Handler_Records List10
90 -- Normalized_Position_Max Uint10
91 -- Referenced_Object Node10
93 -- Component_Bit_Offset Uint11
95 -- Entry_Component Node11
96 -- Enumeration_Pos Uint11
97 -- Generic_Homonym Node11
98 -- Protected_Body_Subprogram Node11
101 -- Barrier_Function Node12
102 -- Enumeration_Rep Uint12
104 -- Next_Inlined_Subprogram Node12
106 -- Corresponding_Equality Node13
107 -- Component_Clause Node13
108 -- Debug_Renaming_Link Node13
109 -- Elaboration_Entity Node13
110 -- Extra_Accessibility Node13
114 -- First_Optional_Parameter Node14
115 -- Normalized_Position Uint14
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
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
149 -- Non_Limited_View Node17
154 -- Corresponding_Concurrent_Type Node18
155 -- Corresponding_Record_Type Node18
156 -- Delta_Value Ureal18
157 -- Enclosing_Scope Node18
158 -- Equivalent_Type Node18
159 -- Private_Dependents Elist18
160 -- Renamed_Entity Node18
161 -- Renamed_Object Node18
163 -- Body_Entity Node19
164 -- Corresponding_Discriminant Node19
165 -- Finalization_Chain_Entity Node19
166 -- Parent_Subtype Node19
167 -- Related_Array_Object Node19
168 -- Size_Check_Code Node19
169 -- Spec_Entity Node19
170 -- Underlying_Full_View Node19
172 -- Component_Type Node20
173 -- Default_Value Node20
174 -- Directly_Designated_Type Node20
175 -- Discriminant_Checking_Func Node20
176 -- Discriminant_Default_Value Node20
177 -- Last_Entity Node20
178 -- Register_Exception_Call Node20
179 -- Scalar_Range Node20
181 -- Accept_Address Elist21
182 -- Default_Expr_Function Node21
183 -- Discriminant_Constraint Elist21
184 -- Interface_Name Node21
185 -- Original_Array_Type Node21
186 -- Small_Value Ureal21
188 -- Associated_Storage_Pool Node22
189 -- Component_Size Uint22
190 -- Corresponding_Remote_Type Node22
191 -- Enumeration_Rep_Expr Node22
192 -- Exception_Code Uint22
193 -- Original_Record_Component Node22
194 -- Private_View Node22
195 -- Protected_Formal Node22
196 -- Scope_Depth_Value Uint22
197 -- Shared_Var_Assign_Proc Node22
199 -- Associated_Final_Chain Node23
200 -- CR_Discriminant Node23
201 -- Stored_Constraint Elist23
202 -- Entry_Cancel_Parameter Node23
203 -- Extra_Constrained Node23
204 -- Generic_Renamings Elist23
205 -- Inner_Instances Elist23
206 -- Enum_Pos_To_Rep Node23
207 -- Packed_Array_Type Node23
208 -- Limited_View Node23
209 -- Privals_Chain Elist23
210 -- Protected_Operation Node23
212 ---------------------------------------------
213 -- Usage of Flags in Defining Entity Nodes --
214 ---------------------------------------------
216 -- All flags are unique, there is no overlaying, so each flag is physically
217 -- present in every entity. However, for many of the flags, it only makes
218 -- sense for them to be set true for certain subsets of entity kinds. See
219 -- the spec of Einfo for further details.
221 -- Note: Flag1-Flag3 are absent from this list, since these flag positions
222 -- are used for the flags Analyzed, Comes_From_Source, and Error_Posted,
223 -- which are common to all nodes, including entity nodes.
226 -- Has_Discriminants Flag5
227 -- Is_Dispatching_Operation Flag6
228 -- Is_Immediately_Visible Flag7
230 -- Is_Potentially_Use_Visible Flag9
234 -- Is_Constrained Flag12
235 -- Is_Generic_Type Flag13
236 -- Depends_On_Private Flag14
238 -- Is_Volatile Flag16
239 -- Is_Internal Flag17
240 -- Has_Delayed_Freeze Flag18
241 -- Is_Abstract Flag19
242 -- Is_Concurrent_Record_Type Flag20
244 -- Has_Master_Entity Flag21
245 -- Needs_No_Actuals Flag22
246 -- Has_Storage_Size_Clause Flag23
247 -- Is_Imported Flag24
248 -- Is_Limited_Record Flag25
249 -- Has_Completion Flag26
250 -- Has_Pragma_Controlled Flag27
251 -- Is_Statically_Allocated Flag28
252 -- Has_Size_Clause Flag29
255 -- Checks_May_Be_Suppressed Flag31
256 -- Kill_Elaboration_Checks Flag32
257 -- Kill_Range_Checks Flag33
258 -- Kill_Tag_Checks Flag34
259 -- Is_Class_Wide_Equivalent_Type Flag35
260 -- Referenced_As_LHS Flag36
261 -- Is_Known_Non_Null Flag37
262 -- Can_Never_Be_Null Flag38
263 -- Is_Overriding_Operation Flag39
264 -- Body_Needed_For_SAL Flag40
266 -- Treat_As_Volatile Flag41
267 -- Is_Controlled Flag42
268 -- Has_Controlled_Component Flag43
270 -- In_Private_Part Flag45
271 -- Has_Alignment_Clause Flag46
273 -- In_Package_Body Flag48
275 -- Delay_Subprogram_Descriptors Flag50
278 -- Is_Entry_Formal Flag52
279 -- Is_Private_Descendant Flag53
280 -- Return_Present Flag54
281 -- Is_Tagged_Type Flag55
282 -- Has_Homonym Flag56
284 -- Non_Binary_Modulus Flag58
285 -- Is_Preelaborated Flag59
286 -- Is_Shared_Passive Flag60
288 -- Is_Remote_Types Flag61
289 -- Is_Remote_Call_Interface Flag62
290 -- Is_Character_Type Flag63
291 -- Is_Intrinsic_Subprogram Flag64
292 -- Has_Record_Rep_Clause Flag65
293 -- Has_Enumeration_Rep_Clause Flag66
294 -- Has_Small_Clause Flag67
295 -- Has_Component_Size_Clause Flag68
296 -- Is_Access_Constant Flag69
297 -- Is_First_Subtype Flag70
299 -- Has_Completion_In_Body Flag71
300 -- Has_Unknown_Discriminants Flag72
301 -- Is_Child_Unit Flag73
302 -- Is_CPP_Class Flag74
303 -- Has_Non_Standard_Rep Flag75
304 -- Is_Constructor Flag76
305 -- Is_Thread_Body Flag77
307 -- Has_All_Calls_Remote Flag79
308 -- Is_Constr_Subt_For_U_Nominal Flag80
310 -- Is_Asynchronous Flag81
311 -- Has_Gigi_Rep_Item Flag82
312 -- Has_Machine_Radix_Clause Flag83
313 -- Machine_Radix_10 Flag84
315 -- Has_Atomic_Components Flag86
316 -- Has_Volatile_Components Flag87
317 -- Discard_Names Flag88
318 -- Is_Interrupt_Handler Flag89
319 -- Returns_By_Ref Flag90
322 -- Size_Known_At_Compile_Time Flag92
323 -- Has_Subprogram_Descriptor Flag93
324 -- Is_Generic_Actual_Type Flag94
325 -- Uses_Sec_Stack Flag95
326 -- Warnings_Off Flag96
327 -- Is_Controlling_Formal Flag97
328 -- Has_Controlling_Result Flag98
329 -- Is_Exported Flag99
330 -- Has_Specified_Layout Flag100
332 -- Has_Nested_Block_With_Handler Flag101
334 -- Is_Completely_Hidden Flag103
335 -- Address_Taken Flag104
336 -- Suppress_Init_Proc Flag105
337 -- Is_Limited_Composite Flag106
338 -- Is_Private_Composite Flag107
339 -- Default_Expressions_Processed Flag108
340 -- Is_Non_Static_Subtype Flag109
341 -- Has_External_Tag_Rep_Clause Flag110
343 -- Is_Formal_Subprogram Flag111
344 -- Is_Renaming_Of_Object Flag112
346 -- Delay_Cleanups Flag114
347 -- Never_Set_In_Source Flag115
348 -- Is_Visible_Child_Unit Flag116
349 -- Is_Unchecked_Union Flag117
350 -- Is_For_Access_Subtype Flag118
351 -- Has_Convention_Pragma Flag119
352 -- Has_Primitive_Operations Flag120
354 -- Has_Pragma_Pack Flag121
355 -- Is_Bit_Packed_Array Flag122
356 -- Has_Unchecked_Union Flag123
357 -- Is_Eliminated Flag124
358 -- C_Pass_By_Copy Flag125
359 -- Is_Instantiated Flag126
360 -- Is_Valued_Procedure Flag127
361 -- (used for Component_Alignment) Flag128
362 -- (used for Component_Alignment) Flag129
363 -- Is_Generic_Instance Flag130
365 -- No_Pool_Assigned Flag131
366 -- Is_AST_Entry Flag132
367 -- Is_VMS_Exception Flag133
368 -- Is_Optional_Parameter Flag134
369 -- Has_Aliased_Components Flag135
370 -- No_Strict_Aliasing Flag136
371 -- Is_Machine_Code_Subprogram Flag137
372 -- Is_Packed_Array_Type Flag138
373 -- Has_Biased_Representation Flag139
374 -- Has_Complex_Representation Flag140
376 -- Is_Constr_Subt_For_UN_Aliased Flag141
377 -- Has_Missing_Return Flag142
378 -- Has_Recursive_Call Flag143
379 -- Is_Unsigned_Type Flag144
380 -- Strict_Alignment Flag145
381 -- Elaborate_All_Desirable Flag146
382 -- Needs_Debug_Info Flag147
383 -- Suppress_Elaboration_Warnings Flag148
384 -- Is_Compilation_Unit Flag149
385 -- Has_Pragma_Elaborate_Body Flag150
388 -- Entry_Accepted Flag152
389 -- Is_Psected Flag153
390 -- Has_Per_Object_Constraint Flag154
391 -- Has_Private_Declaration Flag155
392 -- Referenced Flag156
393 -- Has_Pragma_Inline Flag157
394 -- Finalize_Storage_Only Flag158
395 -- From_With_Type Flag159
396 -- Is_Package_Body_Entity Flag160
398 -- Has_Qualified_Name Flag161
399 -- Nonzero_Is_True Flag162
400 -- Is_True_Constant Flag163
401 -- Reverse_Bit_Order Flag164
402 -- Suppress_Style_Checks Flag165
403 -- Debug_Info_Off Flag166
404 -- Sec_Stack_Needed_For_Return Flag167
405 -- Materialize_Entity Flag168
406 -- Function_Returns_With_DSP Flag169
407 -- Is_Known_Valid Flag170
409 -- Is_Hidden_Open_Scope Flag171
410 -- Has_Object_Size_Clause Flag172
411 -- Has_Fully_Qualified_Name Flag173
412 -- Elaboration_Entity_Required Flag174
413 -- Has_Forward_Instantiation Flag175
414 -- Is_Discrim_SO_Function Flag176
415 -- Size_Depends_On_Discriminant Flag177
416 -- Is_Null_Init_Proc Flag178
417 -- Has_Pragma_Pure_Function Flag179
418 -- Has_Pragma_Unreferenced Flag180
420 -- Has_Contiguous_Rep Flag181
421 -- Has_Xref_Entry Flag182
422 -- Must_Be_On_Byte_Boundary Flag183
424 -- Note: there are no unused flags currently!
426 --------------------------------
427 -- Attribute Access Functions --
428 --------------------------------
430 function Accept_Address (Id : E) return L is
435 function Access_Disp_Table (Id : E) return E is
437 pragma Assert (Is_Tagged_Type (Id));
438 return Node16 (Implementation_Base_Type (Id));
439 end Access_Disp_Table;
441 function Actual_Subtype (Id : E) return E is
444 (Ekind (Id) = E_Constant
445 or else Ekind (Id) = E_Variable
446 or else Ekind (Id) = E_Generic_In_Out_Parameter
447 or else Ekind (Id) in E_In_Parameter .. E_In_Out_Parameter);
451 function Address_Taken (Id : E) return B is
456 function Alias (Id : E) return E is
459 (Is_Overloadable (Id) or else Ekind (Id) = E_Subprogram_Type);
463 function Alignment (Id : E) return U is
465 pragma Assert (Is_Type (Id)
466 or else Is_Formal (Id)
467 or else Ekind (Id) = E_Loop_Parameter
468 or else Ekind (Id) = E_Constant
469 or else Ekind (Id) = E_Exception
470 or else Ekind (Id) = E_Variable);
474 function Associated_Final_Chain (Id : E) return E is
476 pragma Assert (Is_Access_Type (Id));
478 end Associated_Final_Chain;
480 function Associated_Formal_Package (Id : E) return E is
482 pragma Assert (Ekind (Id) = E_Package);
484 end Associated_Formal_Package;
486 function Associated_Node_For_Itype (Id : E) return N is
489 end Associated_Node_For_Itype;
491 function Associated_Storage_Pool (Id : E) return E is
493 pragma Assert (Is_Access_Type (Id));
494 return Node22 (Root_Type (Id));
495 end Associated_Storage_Pool;
497 function Barrier_Function (Id : E) return N is
499 pragma Assert (Is_Entry (Id));
501 end Barrier_Function;
503 function Block_Node (Id : E) return N is
505 pragma Assert (Ekind (Id) = E_Block);
509 function Body_Entity (Id : E) return E is
512 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
516 function Body_Needed_For_SAL (Id : E) return B is
519 (Ekind (Id) = E_Package
520 or else Is_Subprogram (Id)
521 or else Is_Generic_Unit (Id));
523 end Body_Needed_For_SAL;
525 function C_Pass_By_Copy (Id : E) return B is
527 pragma Assert (Is_Record_Type (Id));
528 return Flag125 (Implementation_Base_Type (Id));
531 function Can_Never_Be_Null (Id : E) return B is
534 end Can_Never_Be_Null;
536 function Checks_May_Be_Suppressed (Id : E) return B is
539 end Checks_May_Be_Suppressed;
541 function Class_Wide_Type (Id : E) return E is
543 pragma Assert (Is_Type (Id));
547 function Cloned_Subtype (Id : E) return E is
550 (Ekind (Id) = E_Record_Subtype
551 or else Ekind (Id) = E_Class_Wide_Subtype);
555 function Component_Bit_Offset (Id : E) return U is
558 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
560 end Component_Bit_Offset;
562 function Component_Clause (Id : E) return N is
565 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
567 end Component_Clause;
569 function Component_Size (Id : E) return U is
571 pragma Assert (Is_Array_Type (Id));
572 return Uint22 (Implementation_Base_Type (Id));
575 function Component_Type (Id : E) return E is
577 return Node20 (Implementation_Base_Type (Id));
580 function Corresponding_Concurrent_Type (Id : E) return E is
582 pragma Assert (Ekind (Id) = E_Record_Type);
584 end Corresponding_Concurrent_Type;
586 function Corresponding_Discriminant (Id : E) return E is
588 pragma Assert (Ekind (Id) = E_Discriminant);
590 end Corresponding_Discriminant;
592 function Corresponding_Equality (Id : E) return E is
595 (Ekind (Id) = E_Function
596 and then not Comes_From_Source (Id)
597 and then Chars (Id) = Name_Op_Ne);
599 end Corresponding_Equality;
601 function Corresponding_Record_Type (Id : E) return E is
603 pragma Assert (Is_Concurrent_Type (Id));
605 end Corresponding_Record_Type;
607 function Corresponding_Remote_Type (Id : E) return E is
610 end Corresponding_Remote_Type;
612 function Current_Value (Id : E) return N is
614 pragma Assert (Ekind (Id) in Object_Kind);
618 function CR_Discriminant (Id : E) return E is
623 function Debug_Info_Off (Id : E) return B is
628 function Debug_Renaming_Link (Id : E) return E is
631 end Debug_Renaming_Link;
633 function Default_Expr_Function (Id : E) return E is
635 pragma Assert (Is_Formal (Id));
637 end Default_Expr_Function;
639 function Default_Expressions_Processed (Id : E) return B is
642 end Default_Expressions_Processed;
644 function Default_Value (Id : E) return N is
646 pragma Assert (Is_Formal (Id));
650 function Delay_Cleanups (Id : E) return B is
655 function Delay_Subprogram_Descriptors (Id : E) return B is
658 end Delay_Subprogram_Descriptors;
660 function Delta_Value (Id : E) return R is
662 pragma Assert (Is_Fixed_Point_Type (Id));
666 function Dependent_Instances (Id : E) return L is
668 pragma Assert (Is_Generic_Instance (Id));
670 end Dependent_Instances;
672 function Depends_On_Private (Id : E) return B is
674 pragma Assert (Nkind (Id) in N_Entity);
676 end Depends_On_Private;
678 function Digits_Value (Id : E) return U is
681 (Is_Floating_Point_Type (Id)
682 or else Is_Decimal_Fixed_Point_Type (Id));
686 function Directly_Designated_Type (Id : E) return E is
689 end Directly_Designated_Type;
691 function Discard_Names (Id : E) return B is
696 function Discriminal (Id : E) return E is
698 pragma Assert (Ekind (Id) = E_Discriminant);
702 function Discriminal_Link (Id : E) return N is
705 end Discriminal_Link;
707 function Discriminant_Checking_Func (Id : E) return E is
709 pragma Assert (Ekind (Id) = E_Component);
711 end Discriminant_Checking_Func;
713 function Discriminant_Constraint (Id : E) return L is
715 pragma Assert (Is_Composite_Type (Id) and then Has_Discriminants (Id));
717 end Discriminant_Constraint;
719 function Discriminant_Default_Value (Id : E) return N is
721 pragma Assert (Ekind (Id) = E_Discriminant);
723 end Discriminant_Default_Value;
725 function Discriminant_Number (Id : E) return U is
727 pragma Assert (Ekind (Id) = E_Discriminant);
729 end Discriminant_Number;
731 function DT_Entry_Count (Id : E) return U is
733 pragma Assert (Ekind (Id) = E_Component and then Is_Tag (Id));
737 function DT_Position (Id : E) return U is
740 ((Ekind (Id) = E_Function
741 or else Ekind (Id) = E_Procedure)
742 and then Present (DTC_Entity (Id)));
746 function DTC_Entity (Id : E) return E is
749 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
753 function Elaborate_All_Desirable (Id : E) return B is
756 end Elaborate_All_Desirable;
758 function Elaboration_Entity (Id : E) return E is
763 Ekind (Id) = E_Package
765 Is_Generic_Unit (Id));
767 end Elaboration_Entity;
769 function Elaboration_Entity_Required (Id : E) return B is
774 Ekind (Id) = E_Package
776 Is_Generic_Unit (Id));
778 end Elaboration_Entity_Required;
780 function Enclosing_Scope (Id : E) return E is
785 function Entry_Accepted (Id : E) return B is
787 pragma Assert (Is_Entry (Id));
791 function Entry_Bodies_Array (Id : E) return E is
794 end Entry_Bodies_Array;
796 function Entry_Cancel_Parameter (Id : E) return E is
799 end Entry_Cancel_Parameter;
801 function Entry_Component (Id : E) return E is
806 function Entry_Formal (Id : E) return E is
811 function Entry_Index_Constant (Id : E) return N is
813 pragma Assert (Ekind (Id) = E_Entry_Index_Parameter);
815 end Entry_Index_Constant;
817 function Entry_Parameters_Type (Id : E) return E is
820 end Entry_Parameters_Type;
822 function Enum_Pos_To_Rep (Id : E) return E is
824 pragma Assert (Ekind (Id) = E_Enumeration_Type);
828 function Enumeration_Pos (Id : E) return Uint is
830 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
834 function Enumeration_Rep (Id : E) return U is
836 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
840 function Enumeration_Rep_Expr (Id : E) return N is
842 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
844 end Enumeration_Rep_Expr;
846 function Equivalent_Type (Id : E) return E is
849 (Ekind (Id) = E_Class_Wide_Subtype or else
850 Ekind (Id) = E_Access_Protected_Subprogram_Type or else
851 Ekind (Id) = E_Access_Subprogram_Type or else
852 Ekind (Id) = E_Exception_Type);
856 function Esize (Id : E) return Uint is
861 function Exception_Code (Id : E) return Uint is
863 pragma Assert (Ekind (Id) = E_Exception);
867 function Extra_Accessibility (Id : E) return E is
869 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
871 end Extra_Accessibility;
873 function Extra_Constrained (Id : E) return E is
875 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
877 end Extra_Constrained;
879 function Extra_Formal (Id : E) return E is
884 function Finalization_Chain_Entity (Id : E) return E is
887 end Finalization_Chain_Entity;
889 function Finalize_Storage_Only (Id : E) return B is
891 pragma Assert (Is_Type (Id));
892 return Flag158 (Base_Type (Id));
893 end Finalize_Storage_Only;
895 function First_Entity (Id : E) return E is
900 function First_Index (Id : E) return N is
905 function First_Literal (Id : E) return E is
910 function First_Optional_Parameter (Id : E) return E is
913 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
915 end First_Optional_Parameter;
917 function First_Private_Entity (Id : E) return E is
920 end First_Private_Entity;
922 function First_Rep_Item (Id : E) return E is
927 function Freeze_Node (Id : E) return N is
932 function From_With_Type (Id : E) return B is
937 function Full_View (Id : E) return E is
939 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Constant);
943 function Function_Returns_With_DSP (Id : E) return B is
946 (Is_Subprogram (Id) or else Ekind (Id) = E_Subprogram_Type);
948 end Function_Returns_With_DSP;
950 function Generic_Homonym (Id : E) return E is
952 pragma Assert (Ekind (Id) = E_Generic_Package);
956 function Generic_Renamings (Id : E) return L is
959 end Generic_Renamings;
961 function Handler_Records (Id : E) return S is
966 function Has_Aliased_Components (Id : E) return B is
968 return Flag135 (Implementation_Base_Type (Id));
969 end Has_Aliased_Components;
971 function Has_Alignment_Clause (Id : E) return B is
974 end Has_Alignment_Clause;
976 function Has_All_Calls_Remote (Id : E) return B is
979 end Has_All_Calls_Remote;
981 function Has_Atomic_Components (Id : E) return B is
983 return Flag86 (Implementation_Base_Type (Id));
984 end Has_Atomic_Components;
986 function Has_Biased_Representation (Id : E) return B is
989 end Has_Biased_Representation;
991 function Has_Completion (Id : E) return B is
996 function Has_Completion_In_Body (Id : E) return B is
998 pragma Assert (Is_Type (Id));
1000 end Has_Completion_In_Body;
1002 function Has_Complex_Representation (Id : E) return B is
1004 pragma Assert (Is_Type (Id));
1005 return Flag140 (Implementation_Base_Type (Id));
1006 end Has_Complex_Representation;
1008 function Has_Component_Size_Clause (Id : E) return B is
1010 pragma Assert (Is_Array_Type (Id));
1011 return Flag68 (Implementation_Base_Type (Id));
1012 end Has_Component_Size_Clause;
1014 function Has_Controlled_Component (Id : E) return B is
1016 return Flag43 (Base_Type (Id));
1017 end Has_Controlled_Component;
1019 function Has_Contiguous_Rep (Id : E) return B is
1021 return Flag181 (Id);
1022 end Has_Contiguous_Rep;
1024 function Has_Controlling_Result (Id : E) return B is
1027 end Has_Controlling_Result;
1029 function Has_Convention_Pragma (Id : E) return B is
1031 return Flag119 (Id);
1032 end Has_Convention_Pragma;
1034 function Has_Delayed_Freeze (Id : E) return B is
1036 pragma Assert (Nkind (Id) in N_Entity);
1038 end Has_Delayed_Freeze;
1040 function Has_Discriminants (Id : E) return B is
1042 pragma Assert (Nkind (Id) in N_Entity);
1044 end Has_Discriminants;
1046 function Has_Enumeration_Rep_Clause (Id : E) return B is
1048 pragma Assert (Is_Enumeration_Type (Id));
1050 end Has_Enumeration_Rep_Clause;
1052 function Has_Exit (Id : E) return B is
1057 function Has_External_Tag_Rep_Clause (Id : E) return B is
1059 pragma Assert (Is_Tagged_Type (Id));
1060 return Flag110 (Id);
1061 end Has_External_Tag_Rep_Clause;
1063 function Has_Forward_Instantiation (Id : E) return B is
1065 return Flag175 (Id);
1066 end Has_Forward_Instantiation;
1068 function Has_Fully_Qualified_Name (Id : E) return B is
1070 return Flag173 (Id);
1071 end Has_Fully_Qualified_Name;
1073 function Has_Gigi_Rep_Item (Id : E) return B is
1076 end Has_Gigi_Rep_Item;
1078 function Has_Homonym (Id : E) return B is
1083 function Has_Machine_Radix_Clause (Id : E) return B is
1085 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
1087 end Has_Machine_Radix_Clause;
1089 function Has_Master_Entity (Id : E) return B is
1092 end Has_Master_Entity;
1094 function Has_Missing_Return (Id : E) return B is
1097 (Ekind (Id) = E_Function or else Ekind (Id) = E_Generic_Function);
1098 return Flag142 (Id);
1099 end Has_Missing_Return;
1101 function Has_Nested_Block_With_Handler (Id : E) return B is
1103 return Flag101 (Id);
1104 end Has_Nested_Block_With_Handler;
1106 function Has_Non_Standard_Rep (Id : E) return B is
1108 return Flag75 (Implementation_Base_Type (Id));
1109 end Has_Non_Standard_Rep;
1111 function Has_Object_Size_Clause (Id : E) return B is
1113 pragma Assert (Is_Type (Id));
1114 return Flag172 (Id);
1115 end Has_Object_Size_Clause;
1117 function Has_Per_Object_Constraint (Id : E) return B is
1119 return Flag154 (Id);
1120 end Has_Per_Object_Constraint;
1122 function Has_Pragma_Controlled (Id : E) return B is
1124 pragma Assert (Is_Access_Type (Id));
1125 return Flag27 (Implementation_Base_Type (Id));
1126 end Has_Pragma_Controlled;
1128 function Has_Pragma_Elaborate_Body (Id : E) return B is
1130 return Flag150 (Id);
1131 end Has_Pragma_Elaborate_Body;
1133 function Has_Pragma_Inline (Id : E) return B is
1135 return Flag157 (Id);
1136 end Has_Pragma_Inline;
1138 function Has_Pragma_Pack (Id : E) return B is
1140 pragma Assert (Is_Record_Type (Id) or else Is_Array_Type (Id));
1141 return Flag121 (Implementation_Base_Type (Id));
1142 end Has_Pragma_Pack;
1144 function Has_Pragma_Pure_Function (Id : E) return B is
1146 pragma Assert (Is_Subprogram (Id));
1147 return Flag179 (Id);
1148 end Has_Pragma_Pure_Function;
1150 function Has_Pragma_Unreferenced (Id : E) return B is
1152 return Flag180 (Id);
1153 end Has_Pragma_Unreferenced;
1155 function Has_Primitive_Operations (Id : E) return B is
1157 pragma Assert (Is_Type (Id));
1158 return Flag120 (Base_Type (Id));
1159 end Has_Primitive_Operations;
1161 function Has_Private_Declaration (Id : E) return B is
1163 return Flag155 (Id);
1164 end Has_Private_Declaration;
1166 function Has_Qualified_Name (Id : E) return B is
1168 return Flag161 (Id);
1169 end Has_Qualified_Name;
1171 function Has_Record_Rep_Clause (Id : E) return B is
1173 pragma Assert (Is_Record_Type (Id));
1174 return Flag65 (Implementation_Base_Type (Id));
1175 end Has_Record_Rep_Clause;
1177 function Has_Recursive_Call (Id : E) return B is
1179 pragma Assert (Is_Subprogram (Id));
1180 return Flag143 (Id);
1181 end Has_Recursive_Call;
1183 function Has_Size_Clause (Id : E) return B is
1186 end Has_Size_Clause;
1188 function Has_Small_Clause (Id : E) return B is
1191 end Has_Small_Clause;
1193 function Has_Specified_Layout (Id : E) return B is
1195 pragma Assert (Is_Type (Id));
1196 return Flag100 (Implementation_Base_Type (Id));
1197 end Has_Specified_Layout;
1199 function Has_Storage_Size_Clause (Id : E) return B is
1201 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
1202 return Flag23 (Implementation_Base_Type (Id));
1203 end Has_Storage_Size_Clause;
1205 function Has_Subprogram_Descriptor (Id : E) return B is
1208 end Has_Subprogram_Descriptor;
1210 function Has_Task (Id : E) return B is
1212 return Flag30 (Base_Type (Id));
1215 function Has_Unchecked_Union (Id : E) return B is
1217 return Flag123 (Base_Type (Id));
1218 end Has_Unchecked_Union;
1220 function Has_Unknown_Discriminants (Id : E) return B is
1222 pragma Assert (Is_Type (Id));
1224 end Has_Unknown_Discriminants;
1226 function Has_Volatile_Components (Id : E) return B is
1228 return Flag87 (Implementation_Base_Type (Id));
1229 end Has_Volatile_Components;
1231 function Has_Xref_Entry (Id : E) return B is
1233 return Flag182 (Implementation_Base_Type (Id));
1236 function Hiding_Loop_Variable (Id : E) return E is
1238 pragma Assert (Ekind (Id) = E_Variable);
1240 end Hiding_Loop_Variable;
1242 function Homonym (Id : E) return E is
1247 function In_Package_Body (Id : E) return B is
1250 end In_Package_Body;
1252 function In_Private_Part (Id : E) return B is
1255 end In_Private_Part;
1257 function In_Use (Id : E) return B is
1259 pragma Assert (Nkind (Id) in N_Entity);
1263 function Inner_Instances (Id : E) return L is
1265 return Elist23 (Id);
1266 end Inner_Instances;
1268 function Interface_Name (Id : E) return N is
1273 function Is_Abstract (Id : E) return B is
1278 function Is_Access_Constant (Id : E) return B is
1280 pragma Assert (Is_Access_Type (Id));
1282 end Is_Access_Constant;
1284 function Is_Aliased (Id : E) return B is
1286 pragma Assert (Nkind (Id) in N_Entity);
1290 function Is_AST_Entry (Id : E) return B is
1292 pragma Assert (Is_Entry (Id));
1293 return Flag132 (Id);
1296 function Is_Asynchronous (Id : E) return B is
1299 (Ekind (Id) = E_Procedure or else Is_Type (Id));
1301 end Is_Asynchronous;
1303 function Is_Atomic (Id : E) return B is
1308 function Is_Bit_Packed_Array (Id : E) return B is
1310 return Flag122 (Implementation_Base_Type (Id));
1311 end Is_Bit_Packed_Array;
1313 function Is_Called (Id : E) return B is
1316 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Function);
1317 return Flag102 (Id);
1320 function Is_Character_Type (Id : E) return B is
1323 end Is_Character_Type;
1325 function Is_Child_Unit (Id : E) return B is
1330 function Is_Class_Wide_Equivalent_Type (Id : E) return B is
1333 end Is_Class_Wide_Equivalent_Type;
1335 function Is_Compilation_Unit (Id : E) return B is
1337 return Flag149 (Id);
1338 end Is_Compilation_Unit;
1340 function Is_Completely_Hidden (Id : E) return B is
1342 pragma Assert (Ekind (Id) = E_Discriminant);
1343 return Flag103 (Id);
1344 end Is_Completely_Hidden;
1346 function Is_Constr_Subt_For_U_Nominal (Id : E) return B is
1349 end Is_Constr_Subt_For_U_Nominal;
1351 function Is_Constr_Subt_For_UN_Aliased (Id : E) return B is
1353 return Flag141 (Id);
1354 end Is_Constr_Subt_For_UN_Aliased;
1356 function Is_Constrained (Id : E) return B is
1358 pragma Assert (Nkind (Id) in N_Entity);
1362 function Is_Constructor (Id : E) return B is
1367 function Is_Controlled (Id : E) return B is
1369 return Flag42 (Base_Type (Id));
1372 function Is_Controlling_Formal (Id : E) return B is
1374 pragma Assert (Is_Formal (Id));
1376 end Is_Controlling_Formal;
1378 function Is_CPP_Class (Id : E) return B is
1383 function Is_Discrim_SO_Function (Id : E) return B is
1385 return Flag176 (Id);
1386 end Is_Discrim_SO_Function;
1388 function Is_Dispatching_Operation (Id : E) return B is
1390 pragma Assert (Nkind (Id) in N_Entity);
1392 end Is_Dispatching_Operation;
1394 function Is_Eliminated (Id : E) return B is
1396 return Flag124 (Id);
1399 function Is_Entry_Formal (Id : E) return B is
1402 end Is_Entry_Formal;
1404 function Is_Exported (Id : E) return B is
1409 function Is_First_Subtype (Id : E) return B is
1412 end Is_First_Subtype;
1414 function Is_For_Access_Subtype (Id : E) return B is
1417 (Ekind (Id) = E_Record_Subtype
1419 Ekind (Id) = E_Private_Subtype);
1420 return Flag118 (Id);
1421 end Is_For_Access_Subtype;
1423 function Is_Formal_Subprogram (Id : E) return B is
1425 return Flag111 (Id);
1426 end Is_Formal_Subprogram;
1428 function Is_Frozen (Id : E) return B is
1433 function Is_Generic_Actual_Type (Id : E) return B is
1435 pragma Assert (Is_Type (Id));
1437 end Is_Generic_Actual_Type;
1439 function Is_Generic_Instance (Id : E) return B is
1441 return Flag130 (Id);
1442 end Is_Generic_Instance;
1444 function Is_Generic_Type (Id : E) return B is
1446 pragma Assert (Nkind (Id) in N_Entity);
1448 end Is_Generic_Type;
1450 function Is_Hidden (Id : E) return B is
1455 function Is_Hidden_Open_Scope (Id : E) return B is
1457 return Flag171 (Id);
1458 end Is_Hidden_Open_Scope;
1460 function Is_Immediately_Visible (Id : E) return B is
1462 pragma Assert (Nkind (Id) in N_Entity);
1464 end Is_Immediately_Visible;
1466 function Is_Imported (Id : E) return B is
1471 function Is_Inlined (Id : E) return B is
1476 function Is_Instantiated (Id : E) return B is
1478 return Flag126 (Id);
1479 end Is_Instantiated;
1481 function Is_Internal (Id : E) return B is
1483 pragma Assert (Nkind (Id) in N_Entity);
1487 function Is_Interrupt_Handler (Id : E) return B is
1489 pragma Assert (Nkind (Id) in N_Entity);
1491 end Is_Interrupt_Handler;
1493 function Is_Intrinsic_Subprogram (Id : E) return B is
1496 end Is_Intrinsic_Subprogram;
1498 function Is_Itype (Id : E) return B is
1503 function Is_Known_Non_Null (Id : E) return B is
1506 end Is_Known_Non_Null;
1508 function Is_Known_Valid (Id : E) return B is
1510 return Flag170 (Id);
1513 function Is_Limited_Composite (Id : E) return B is
1515 return Flag106 (Id);
1516 end Is_Limited_Composite;
1518 function Is_Limited_Record (Id : E) return B is
1521 end Is_Limited_Record;
1523 function Is_Machine_Code_Subprogram (Id : E) return B is
1525 pragma Assert (Is_Subprogram (Id));
1526 return Flag137 (Id);
1527 end Is_Machine_Code_Subprogram;
1529 function Is_Non_Static_Subtype (Id : E) return B is
1531 pragma Assert (Is_Type (Id));
1532 return Flag109 (Id);
1533 end Is_Non_Static_Subtype;
1535 function Is_Null_Init_Proc (Id : E) return B is
1537 pragma Assert (Ekind (Id) = E_Procedure);
1538 return Flag178 (Id);
1539 end Is_Null_Init_Proc;
1541 function Is_Optional_Parameter (Id : E) return B is
1543 pragma Assert (Is_Formal (Id));
1544 return Flag134 (Id);
1545 end Is_Optional_Parameter;
1547 function Is_Overriding_Operation (Id : E) return B is
1549 pragma Assert (Is_Subprogram (Id));
1551 end Is_Overriding_Operation;
1553 function Is_Package_Body_Entity (Id : E) return B is
1555 return Flag160 (Id);
1556 end Is_Package_Body_Entity;
1558 function Is_Packed (Id : E) return B is
1560 return Flag51 (Implementation_Base_Type (Id));
1563 function Is_Packed_Array_Type (Id : E) return B is
1565 return Flag138 (Id);
1566 end Is_Packed_Array_Type;
1568 function Is_Potentially_Use_Visible (Id : E) return B is
1570 pragma Assert (Nkind (Id) in N_Entity);
1572 end Is_Potentially_Use_Visible;
1574 function Is_Preelaborated (Id : E) return B is
1577 end Is_Preelaborated;
1579 function Is_Private_Composite (Id : E) return B is
1581 pragma Assert (Is_Type (Id));
1582 return Flag107 (Id);
1583 end Is_Private_Composite;
1585 function Is_Private_Descendant (Id : E) return B is
1588 end Is_Private_Descendant;
1590 function Is_Psected (Id : E) return B is
1592 return Flag153 (Id);
1595 function Is_Public (Id : E) return B is
1597 pragma Assert (Nkind (Id) in N_Entity);
1601 function Is_Pure (Id : E) return B is
1606 function Is_Remote_Call_Interface (Id : E) return B is
1609 end Is_Remote_Call_Interface;
1611 function Is_Remote_Types (Id : E) return B is
1614 end Is_Remote_Types;
1616 function Is_Renaming_Of_Object (Id : E) return B is
1618 return Flag112 (Id);
1619 end Is_Renaming_Of_Object;
1621 function Is_Shared_Passive (Id : E) return B is
1624 end Is_Shared_Passive;
1626 function Is_Statically_Allocated (Id : E) return B is
1629 end Is_Statically_Allocated;
1631 function Is_Tag (Id : E) return B is
1633 pragma Assert (Nkind (Id) in N_Entity);
1637 function Is_Tagged_Type (Id : E) return B is
1642 function Is_Thread_Body (Id : E) return B is
1647 function Is_True_Constant (Id : E) return B is
1649 return Flag163 (Id);
1650 end Is_True_Constant;
1652 function Is_Unchecked_Union (Id : E) return B is
1654 return Flag117 (Id);
1655 end Is_Unchecked_Union;
1657 function Is_Unsigned_Type (Id : E) return B is
1659 pragma Assert (Is_Type (Id));
1660 return Flag144 (Id);
1661 end Is_Unsigned_Type;
1663 function Is_Valued_Procedure (Id : E) return B is
1665 pragma Assert (Ekind (Id) = E_Procedure);
1666 return Flag127 (Id);
1667 end Is_Valued_Procedure;
1669 function Is_Visible_Child_Unit (Id : E) return B is
1671 pragma Assert (Is_Child_Unit (Id));
1672 return Flag116 (Id);
1673 end Is_Visible_Child_Unit;
1675 function Is_VMS_Exception (Id : E) return B is
1677 return Flag133 (Id);
1678 end Is_VMS_Exception;
1680 function Is_Volatile (Id : E) return B is
1682 pragma Assert (Nkind (Id) in N_Entity);
1683 if Is_Type (Id) then
1684 return Flag16 (Base_Type (Id));
1690 function Kill_Elaboration_Checks (Id : E) return B is
1693 end Kill_Elaboration_Checks;
1695 function Kill_Range_Checks (Id : E) return B is
1698 end Kill_Range_Checks;
1700 function Kill_Tag_Checks (Id : E) return B is
1703 end Kill_Tag_Checks;
1705 function Last_Entity (Id : E) return E is
1710 function Limited_View (Id : E) return E is
1712 pragma Assert (Ekind (Id) = E_Package);
1716 function Lit_Indexes (Id : E) return E is
1718 pragma Assert (Is_Enumeration_Type (Id));
1722 function Lit_Strings (Id : E) return E is
1724 pragma Assert (Is_Enumeration_Type (Id));
1728 function Machine_Radix_10 (Id : E) return B is
1730 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
1732 end Machine_Radix_10;
1734 function Master_Id (Id : E) return E is
1739 function Materialize_Entity (Id : E) return B is
1741 return Flag168 (Id);
1742 end Materialize_Entity;
1744 function Mechanism (Id : E) return M is
1746 pragma Assert (Ekind (Id) = E_Function or else Is_Formal (Id));
1747 return UI_To_Int (Uint8 (Id));
1750 function Modulus (Id : E) return Uint is
1752 pragma Assert (Is_Modular_Integer_Type (Id));
1753 return Uint17 (Base_Type (Id));
1756 function Must_Be_On_Byte_Boundary (Id : E) return B is
1758 pragma Assert (Is_Type (Id));
1759 return Flag183 (Id);
1760 end Must_Be_On_Byte_Boundary;
1762 function Needs_Debug_Info (Id : E) return B is
1764 return Flag147 (Id);
1765 end Needs_Debug_Info;
1767 function Needs_No_Actuals (Id : E) return B is
1770 (Is_Overloadable (Id)
1771 or else Ekind (Id) = E_Subprogram_Type
1772 or else Ekind (Id) = E_Entry_Family);
1774 end Needs_No_Actuals;
1776 function Never_Set_In_Source (Id : E) return B is
1778 return Flag115 (Id);
1779 end Never_Set_In_Source;
1781 function Next_Inlined_Subprogram (Id : E) return E is
1784 end Next_Inlined_Subprogram;
1786 function No_Pool_Assigned (Id : E) return B is
1788 pragma Assert (Is_Access_Type (Id));
1789 return Flag131 (Root_Type (Id));
1790 end No_Pool_Assigned;
1792 function No_Return (Id : E) return B is
1796 or else Ekind (Id) = E_Procedure
1797 or else Ekind (Id) = E_Generic_Procedure);
1798 return Flag113 (Id);
1801 function No_Strict_Aliasing (Id : E) return B is
1803 pragma Assert (Is_Access_Type (Id));
1804 return Flag136 (Base_Type (Id));
1805 end No_Strict_Aliasing;
1807 function Non_Binary_Modulus (Id : E) return B is
1809 pragma Assert (Is_Modular_Integer_Type (Id));
1810 return Flag58 (Base_Type (Id));
1811 end Non_Binary_Modulus;
1813 function Non_Limited_View (Id : E) return E is
1815 pragma Assert (False
1816 or else Ekind (Id) = E_Incomplete_Type);
1818 end Non_Limited_View;
1820 function Nonzero_Is_True (Id : E) return B is
1822 pragma Assert (Root_Type (Id) = Standard_Boolean);
1823 return Flag162 (Base_Type (Id));
1824 end Nonzero_Is_True;
1826 function Normalized_First_Bit (Id : E) return U is
1829 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
1831 end Normalized_First_Bit;
1833 function Normalized_Position (Id : E) return U is
1836 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
1838 end Normalized_Position;
1840 function Normalized_Position_Max (Id : E) return U is
1843 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
1845 end Normalized_Position_Max;
1847 function Object_Ref (Id : E) return E is
1849 pragma Assert (Ekind (Id) = E_Protected_Body);
1853 function Original_Access_Type (Id : E) return E is
1856 (Ekind (Id) = E_Access_Subprogram_Type
1857 or else Ekind (Id) = E_Access_Protected_Subprogram_Type);
1859 end Original_Access_Type;
1861 function Original_Array_Type (Id : E) return E is
1863 pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id));
1865 end Original_Array_Type;
1867 function Original_Record_Component (Id : E) return E is
1870 (Ekind (Id) = E_Void
1871 or else Ekind (Id) = E_Component
1872 or else Ekind (Id) = E_Discriminant);
1874 end Original_Record_Component;
1876 function Packed_Array_Type (Id : E) return E is
1878 pragma Assert (Is_Array_Type (Id));
1880 end Packed_Array_Type;
1882 function Parent_Subtype (Id : E) return E is
1884 pragma Assert (Ekind (Id) = E_Record_Type);
1888 function Primitive_Operations (Id : E) return L is
1890 pragma Assert (Is_Tagged_Type (Id));
1891 return Elist15 (Id);
1892 end Primitive_Operations;
1894 function Prival (Id : E) return E is
1896 pragma Assert (Is_Protected_Private (Id));
1900 function Privals_Chain (Id : E) return L is
1902 pragma Assert (Is_Overloadable (Id)
1903 or else Ekind (Id) = E_Entry_Family);
1904 return Elist23 (Id);
1907 function Private_Dependents (Id : E) return L is
1909 pragma Assert (Is_Incomplete_Or_Private_Type (Id));
1910 return Elist18 (Id);
1911 end Private_Dependents;
1913 function Private_View (Id : E) return N is
1915 pragma Assert (Is_Private_Type (Id));
1919 function Protected_Body_Subprogram (Id : E) return E is
1921 pragma Assert (Is_Subprogram (Id) or else Is_Entry (Id));
1923 end Protected_Body_Subprogram;
1925 function Protected_Formal (Id : E) return E is
1927 pragma Assert (Is_Formal (Id));
1929 end Protected_Formal;
1931 function Protected_Operation (Id : E) return N is
1933 pragma Assert (Is_Protected_Private (Id));
1935 end Protected_Operation;
1937 function Reachable (Id : E) return B is
1942 function Referenced (Id : E) return B is
1944 return Flag156 (Id);
1947 function Referenced_As_LHS (Id : E) return B is
1950 end Referenced_As_LHS;
1952 function Referenced_Object (Id : E) return N is
1954 pragma Assert (Is_Type (Id));
1956 end Referenced_Object;
1958 function Register_Exception_Call (Id : E) return N is
1960 pragma Assert (Ekind (Id) = E_Exception);
1962 end Register_Exception_Call;
1964 function Related_Array_Object (Id : E) return E is
1966 pragma Assert (Is_Array_Type (Id));
1968 end Related_Array_Object;
1970 function Related_Instance (Id : E) return E is
1973 (Ekind (Id) = E_Package or else Ekind (Id) = E_Package_Body);
1975 end Related_Instance;
1977 function Renamed_Entity (Id : E) return N is
1982 function Renamed_Object (Id : E) return N is
1987 function Renaming_Map (Id : E) return U is
1992 function Return_Present (Id : E) return B is
1997 function Returns_By_Ref (Id : E) return B is
2002 function Reverse_Bit_Order (Id : E) return B is
2004 pragma Assert (Is_Record_Type (Id));
2005 return Flag164 (Base_Type (Id));
2006 end Reverse_Bit_Order;
2008 function RM_Size (Id : E) return U is
2010 pragma Assert (Is_Type (Id));
2014 function Scalar_Range (Id : E) return N is
2019 function Scale_Value (Id : E) return U is
2024 function Scope_Depth_Value (Id : E) return U is
2027 end Scope_Depth_Value;
2029 function Sec_Stack_Needed_For_Return (Id : E) return B is
2031 return Flag167 (Id);
2032 end Sec_Stack_Needed_For_Return;
2034 function Shadow_Entities (Id : E) return S is
2037 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
2039 end Shadow_Entities;
2041 function Shared_Var_Assign_Proc (Id : E) return E is
2043 pragma Assert (Ekind (Id) = E_Variable);
2045 end Shared_Var_Assign_Proc;
2047 function Shared_Var_Read_Proc (Id : E) return E is
2049 pragma Assert (Ekind (Id) = E_Variable);
2051 end Shared_Var_Read_Proc;
2053 function Size_Check_Code (Id : E) return N is
2055 pragma Assert (Ekind (Id) = E_Constant or else Ekind (Id) = E_Variable);
2057 end Size_Check_Code;
2059 function Size_Depends_On_Discriminant (Id : E) return B is
2061 return Flag177 (Id);
2062 end Size_Depends_On_Discriminant;
2064 function Size_Known_At_Compile_Time (Id : E) return B is
2067 end Size_Known_At_Compile_Time;
2069 function Small_Value (Id : E) return R is
2071 pragma Assert (Is_Fixed_Point_Type (Id));
2072 return Ureal21 (Id);
2075 function Spec_Entity (Id : E) return E is
2078 (Ekind (Id) = E_Package_Body or else Is_Formal (Id));
2082 function Storage_Size_Variable (Id : E) return E is
2084 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
2085 return Node15 (Implementation_Base_Type (Id));
2086 end Storage_Size_Variable;
2088 function Stored_Constraint (Id : E) return L is
2091 (Is_Composite_Type (Id) and then not Is_Array_Type (Id));
2092 return Elist23 (Id);
2093 end Stored_Constraint;
2095 function Strict_Alignment (Id : E) return B is
2097 return Flag145 (Implementation_Base_Type (Id));
2098 end Strict_Alignment;
2100 function String_Literal_Length (Id : E) return U is
2103 end String_Literal_Length;
2105 function String_Literal_Low_Bound (Id : E) return N is
2108 end String_Literal_Low_Bound;
2110 function Suppress_Elaboration_Warnings (Id : E) return B is
2112 return Flag148 (Id);
2113 end Suppress_Elaboration_Warnings;
2115 function Suppress_Init_Proc (Id : E) return B is
2117 return Flag105 (Base_Type (Id));
2118 end Suppress_Init_Proc;
2120 function Suppress_Style_Checks (Id : E) return B is
2122 return Flag165 (Id);
2123 end Suppress_Style_Checks;
2125 function Treat_As_Volatile (Id : E) return B is
2128 end Treat_As_Volatile;
2130 function Underlying_Full_View (Id : E) return E is
2132 pragma Assert (Ekind (Id) in Private_Kind);
2134 end Underlying_Full_View;
2136 function Unset_Reference (Id : E) return N is
2139 end Unset_Reference;
2141 function Uses_Sec_Stack (Id : E) return B is
2146 function Vax_Float (Id : E) return B is
2148 return Flag151 (Base_Type (Id));
2151 function Warnings_Off (Id : E) return B is
2156 ------------------------------
2157 -- Classification Functions --
2158 ------------------------------
2160 function Is_Access_Type (Id : E) return B is
2162 return Ekind (Id) in Access_Kind;
2165 function Is_Array_Type (Id : E) return B is
2167 return Ekind (Id) in Array_Kind;
2170 function Is_Class_Wide_Type (Id : E) return B is
2172 return Ekind (Id) in Class_Wide_Kind;
2173 end Is_Class_Wide_Type;
2175 function Is_Composite_Type (Id : E) return B is
2177 return Ekind (Id) in Composite_Kind;
2178 end Is_Composite_Type;
2180 function Is_Concurrent_Body (Id : E) return B is
2182 return Ekind (Id) in
2183 Concurrent_Body_Kind;
2184 end Is_Concurrent_Body;
2186 function Is_Concurrent_Record_Type (Id : E) return B is
2189 end Is_Concurrent_Record_Type;
2191 function Is_Concurrent_Type (Id : E) return B is
2193 return Ekind (Id) in Concurrent_Kind;
2194 end Is_Concurrent_Type;
2196 function Is_Decimal_Fixed_Point_Type (Id : E) return B is
2198 return Ekind (Id) in
2199 Decimal_Fixed_Point_Kind;
2200 end Is_Decimal_Fixed_Point_Type;
2202 function Is_Digits_Type (Id : E) return B is
2204 return Ekind (Id) in Digits_Kind;
2207 function Is_Discrete_Or_Fixed_Point_Type (Id : E) return B is
2209 return Ekind (Id) in Discrete_Or_Fixed_Point_Kind;
2210 end Is_Discrete_Or_Fixed_Point_Type;
2212 function Is_Discrete_Type (Id : E) return B is
2214 return Ekind (Id) in Discrete_Kind;
2215 end Is_Discrete_Type;
2217 function Is_Elementary_Type (Id : E) return B is
2219 return Ekind (Id) in Elementary_Kind;
2220 end Is_Elementary_Type;
2222 function Is_Entry (Id : E) return B is
2224 return Ekind (Id) in Entry_Kind;
2227 function Is_Enumeration_Type (Id : E) return B is
2229 return Ekind (Id) in
2231 end Is_Enumeration_Type;
2233 function Is_Fixed_Point_Type (Id : E) return B is
2235 return Ekind (Id) in
2237 end Is_Fixed_Point_Type;
2239 function Is_Floating_Point_Type (Id : E) return B is
2241 return Ekind (Id) in Float_Kind;
2242 end Is_Floating_Point_Type;
2244 function Is_Formal (Id : E) return B is
2246 return Ekind (Id) in Formal_Kind;
2249 function Is_Generic_Subprogram (Id : E) return B is
2251 return Ekind (Id) in Generic_Subprogram_Kind;
2252 end Is_Generic_Subprogram;
2254 function Is_Generic_Unit (Id : E) return B is
2256 return Ekind (Id) in Generic_Unit_Kind;
2257 end Is_Generic_Unit;
2259 function Is_Incomplete_Or_Private_Type (Id : E) return B is
2261 return Ekind (Id) in
2262 Incomplete_Or_Private_Kind;
2263 end Is_Incomplete_Or_Private_Type;
2265 function Is_Integer_Type (Id : E) return B is
2267 return Ekind (Id) in Integer_Kind;
2268 end Is_Integer_Type;
2270 function Is_Modular_Integer_Type (Id : E) return B is
2272 return Ekind (Id) in
2273 Modular_Integer_Kind;
2274 end Is_Modular_Integer_Type;
2276 function Is_Named_Number (Id : E) return B is
2278 return Ekind (Id) in Named_Kind;
2279 end Is_Named_Number;
2281 function Is_Numeric_Type (Id : E) return B is
2283 return Ekind (Id) in Numeric_Kind;
2284 end Is_Numeric_Type;
2286 function Is_Object (Id : E) return B is
2288 return Ekind (Id) in Object_Kind;
2291 function Is_Ordinary_Fixed_Point_Type (Id : E) return B is
2293 return Ekind (Id) in
2294 Ordinary_Fixed_Point_Kind;
2295 end Is_Ordinary_Fixed_Point_Type;
2297 function Is_Overloadable (Id : E) return B is
2299 return Ekind (Id) in Overloadable_Kind;
2300 end Is_Overloadable;
2302 function Is_Private_Type (Id : E) return B is
2304 return Ekind (Id) in Private_Kind;
2305 end Is_Private_Type;
2307 function Is_Protected_Type (Id : E) return B is
2309 return Ekind (Id) in Protected_Kind;
2310 end Is_Protected_Type;
2312 function Is_Real_Type (Id : E) return B is
2314 return Ekind (Id) in Real_Kind;
2317 function Is_Record_Type (Id : E) return B is
2319 return Ekind (Id) in Record_Kind;
2322 function Is_Scalar_Type (Id : E) return B is
2324 return Ekind (Id) in Scalar_Kind;
2327 function Is_Signed_Integer_Type (Id : E) return B is
2329 return Ekind (Id) in
2330 Signed_Integer_Kind;
2331 end Is_Signed_Integer_Type;
2333 function Is_Subprogram (Id : E) return B is
2335 return Ekind (Id) in Subprogram_Kind;
2338 function Is_Task_Type (Id : E) return B is
2340 return Ekind (Id) in Task_Kind;
2343 function Is_Type (Id : E) return B is
2345 return Ekind (Id) in Type_Kind;
2348 ------------------------------
2349 -- Attribute Set Procedures --
2350 ------------------------------
2352 procedure Set_Accept_Address (Id : E; V : L) is
2354 Set_Elist21 (Id, V);
2355 end Set_Accept_Address;
2357 procedure Set_Access_Disp_Table (Id : E; V : E) is
2359 pragma Assert (Is_Tagged_Type (Id) and then Id = Base_Type (Id));
2361 end Set_Access_Disp_Table;
2363 procedure Set_Associated_Final_Chain (Id : E; V : E) is
2365 pragma Assert (Is_Access_Type (Id));
2367 end Set_Associated_Final_Chain;
2369 procedure Set_Associated_Formal_Package (Id : E; V : E) is
2372 end Set_Associated_Formal_Package;
2374 procedure Set_Associated_Node_For_Itype (Id : E; V : E) is
2377 end Set_Associated_Node_For_Itype;
2379 procedure Set_Associated_Storage_Pool (Id : E; V : E) is
2381 pragma Assert (Is_Access_Type (Id) and then Id = Base_Type (Id));
2383 end Set_Associated_Storage_Pool;
2385 procedure Set_Actual_Subtype (Id : E; V : E) is
2388 (Ekind (Id) = E_Constant
2389 or else Ekind (Id) = E_Variable
2390 or else Ekind (Id) = E_Generic_In_Out_Parameter
2391 or else Ekind (Id) in E_In_Parameter .. E_In_Out_Parameter);
2393 end Set_Actual_Subtype;
2395 procedure Set_Address_Taken (Id : E; V : B := True) is
2397 Set_Flag104 (Id, V);
2398 end Set_Address_Taken;
2400 procedure Set_Alias (Id : E; V : E) is
2403 (Is_Overloadable (Id) or else Ekind (Id) = E_Subprogram_Type);
2407 procedure Set_Alignment (Id : E; V : U) is
2409 pragma Assert (Is_Type (Id)
2410 or else Is_Formal (Id)
2411 or else Ekind (Id) = E_Loop_Parameter
2412 or else Ekind (Id) = E_Constant
2413 or else Ekind (Id) = E_Exception
2414 or else Ekind (Id) = E_Variable);
2418 procedure Set_Barrier_Function (Id : E; V : N) is
2420 pragma Assert (Is_Entry (Id));
2422 end Set_Barrier_Function;
2424 procedure Set_Block_Node (Id : E; V : N) is
2426 pragma Assert (Ekind (Id) = E_Block);
2430 procedure Set_Body_Entity (Id : E; V : E) is
2433 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
2435 end Set_Body_Entity;
2437 procedure Set_Body_Needed_For_SAL (Id : E; V : B := True) is
2440 (Ekind (Id) = E_Package
2441 or else Is_Subprogram (Id)
2442 or else Is_Generic_Unit (Id));
2444 end Set_Body_Needed_For_SAL;
2446 procedure Set_C_Pass_By_Copy (Id : E; V : B := True) is
2448 pragma Assert (Is_Record_Type (Id) and then Id = Base_Type (Id));
2449 Set_Flag125 (Id, V);
2450 end Set_C_Pass_By_Copy;
2452 procedure Set_Can_Never_Be_Null (Id : E; V : B := True) is
2455 end Set_Can_Never_Be_Null;
2457 procedure Set_Checks_May_Be_Suppressed (Id : E; V : B := True) is
2460 end Set_Checks_May_Be_Suppressed;
2462 procedure Set_Class_Wide_Type (Id : E; V : E) is
2464 pragma Assert (Is_Type (Id));
2466 end Set_Class_Wide_Type;
2468 procedure Set_Cloned_Subtype (Id : E; V : E) is
2471 (Ekind (Id) = E_Record_Subtype
2472 or else Ekind (Id) = E_Class_Wide_Subtype);
2474 end Set_Cloned_Subtype;
2476 procedure Set_Component_Bit_Offset (Id : E; V : U) is
2479 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
2481 end Set_Component_Bit_Offset;
2483 procedure Set_Component_Clause (Id : E; V : N) is
2486 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
2488 end Set_Component_Clause;
2490 procedure Set_Component_Size (Id : E; V : U) is
2492 pragma Assert (Is_Array_Type (Id) and then Id = Base_Type (Id));
2494 end Set_Component_Size;
2496 procedure Set_Component_Type (Id : E; V : E) is
2498 pragma Assert (Is_Array_Type (Id) and then Id = Base_Type (Id));
2500 end Set_Component_Type;
2502 procedure Set_Corresponding_Concurrent_Type (Id : E; V : E) is
2505 (Ekind (Id) = E_Record_Type and then Is_Concurrent_Type (V));
2507 end Set_Corresponding_Concurrent_Type;
2509 procedure Set_Corresponding_Discriminant (Id : E; V : E) is
2511 pragma Assert (Ekind (Id) = E_Discriminant);
2513 end Set_Corresponding_Discriminant;
2515 procedure Set_Corresponding_Equality (Id : E; V : E) is
2518 (Ekind (Id) = E_Function
2519 and then not Comes_From_Source (Id)
2520 and then Chars (Id) = Name_Op_Ne);
2522 end Set_Corresponding_Equality;
2524 procedure Set_Corresponding_Record_Type (Id : E; V : E) is
2526 pragma Assert (Is_Concurrent_Type (Id));
2528 end Set_Corresponding_Record_Type;
2530 procedure Set_Corresponding_Remote_Type (Id : E; V : E) is
2533 end Set_Corresponding_Remote_Type;
2535 procedure Set_Current_Value (Id : E; V : E) is
2537 pragma Assert (Ekind (Id) in Object_Kind or else Ekind (Id) = E_Void);
2539 end Set_Current_Value;
2541 procedure Set_CR_Discriminant (Id : E; V : E) is
2544 end Set_CR_Discriminant;
2546 procedure Set_Debug_Info_Off (Id : E; V : B := True) is
2548 Set_Flag166 (Id, V);
2549 end Set_Debug_Info_Off;
2551 procedure Set_Debug_Renaming_Link (Id : E; V : E) is
2554 end Set_Debug_Renaming_Link;
2556 procedure Set_Default_Expr_Function (Id : E; V : E) is
2558 pragma Assert (Is_Formal (Id));
2560 end Set_Default_Expr_Function;
2562 procedure Set_Default_Expressions_Processed (Id : E; V : B := True) is
2564 Set_Flag108 (Id, V);
2565 end Set_Default_Expressions_Processed;
2567 procedure Set_Default_Value (Id : E; V : N) is
2569 pragma Assert (Is_Formal (Id));
2571 end Set_Default_Value;
2573 procedure Set_Delay_Cleanups (Id : E; V : B := True) is
2577 or else Is_Task_Type (Id)
2578 or else Ekind (Id) = E_Block);
2579 Set_Flag114 (Id, V);
2580 end Set_Delay_Cleanups;
2582 procedure Set_Delay_Subprogram_Descriptors (Id : E; V : B := True) is
2586 or else Ekind (Id) = E_Package
2587 or else Ekind (Id) = E_Package_Body);
2589 end Set_Delay_Subprogram_Descriptors;
2591 procedure Set_Delta_Value (Id : E; V : R) is
2593 pragma Assert (Is_Fixed_Point_Type (Id));
2594 Set_Ureal18 (Id, V);
2595 end Set_Delta_Value;
2597 procedure Set_Dependent_Instances (Id : E; V : L) is
2599 pragma Assert (Is_Generic_Instance (Id));
2601 end Set_Dependent_Instances;
2603 procedure Set_Depends_On_Private (Id : E; V : B := True) is
2605 pragma Assert (Nkind (Id) in N_Entity);
2607 end Set_Depends_On_Private;
2609 procedure Set_Digits_Value (Id : E; V : U) is
2612 (Is_Floating_Point_Type (Id)
2613 or else Is_Decimal_Fixed_Point_Type (Id));
2615 end Set_Digits_Value;
2617 procedure Set_Directly_Designated_Type (Id : E; V : E) is
2620 end Set_Directly_Designated_Type;
2622 procedure Set_Discard_Names (Id : E; V : B := True) is
2625 end Set_Discard_Names;
2627 procedure Set_Discriminal (Id : E; V : E) is
2629 pragma Assert (Ekind (Id) = E_Discriminant);
2631 end Set_Discriminal;
2633 procedure Set_Discriminal_Link (Id : E; V : E) is
2636 end Set_Discriminal_Link;
2638 procedure Set_Discriminant_Checking_Func (Id : E; V : E) is
2640 pragma Assert (Ekind (Id) = E_Component);
2642 end Set_Discriminant_Checking_Func;
2644 procedure Set_Discriminant_Constraint (Id : E; V : L) is
2646 pragma Assert (Nkind (Id) in N_Entity);
2647 Set_Elist21 (Id, V);
2648 end Set_Discriminant_Constraint;
2650 procedure Set_Discriminant_Default_Value (Id : E; V : N) is
2653 end Set_Discriminant_Default_Value;
2655 procedure Set_Discriminant_Number (Id : E; V : U) is
2658 end Set_Discriminant_Number;
2660 procedure Set_DT_Entry_Count (Id : E; V : U) is
2662 pragma Assert (Ekind (Id) = E_Component);
2664 end Set_DT_Entry_Count;
2666 procedure Set_DT_Position (Id : E; V : U) is
2668 pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2670 end Set_DT_Position;
2672 procedure Set_DTC_Entity (Id : E; V : E) is
2675 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2679 procedure Set_Elaborate_All_Desirable (Id : E; V : B := True) is
2681 Set_Flag146 (Id, V);
2682 end Set_Elaborate_All_Desirable;
2684 procedure Set_Elaboration_Entity (Id : E; V : E) is
2689 Ekind (Id) = E_Package
2691 Is_Generic_Unit (Id));
2693 end Set_Elaboration_Entity;
2695 procedure Set_Elaboration_Entity_Required (Id : E; V : B := True) is
2700 Ekind (Id) = E_Package
2702 Is_Generic_Unit (Id));
2703 Set_Flag174 (Id, V);
2704 end Set_Elaboration_Entity_Required;
2706 procedure Set_Enclosing_Scope (Id : E; V : E) is
2709 end Set_Enclosing_Scope;
2711 procedure Set_Entry_Accepted (Id : E; V : B := True) is
2713 pragma Assert (Is_Entry (Id));
2714 Set_Flag152 (Id, V);
2715 end Set_Entry_Accepted;
2717 procedure Set_Entry_Bodies_Array (Id : E; V : E) is
2720 end Set_Entry_Bodies_Array;
2722 procedure Set_Entry_Cancel_Parameter (Id : E; V : E) is
2725 end Set_Entry_Cancel_Parameter;
2727 procedure Set_Entry_Component (Id : E; V : E) is
2730 end Set_Entry_Component;
2732 procedure Set_Entry_Formal (Id : E; V : E) is
2735 end Set_Entry_Formal;
2737 procedure Set_Entry_Index_Constant (Id : E; V : E) is
2739 pragma Assert (Ekind (Id) = E_Entry_Index_Parameter);
2741 end Set_Entry_Index_Constant;
2743 procedure Set_Entry_Parameters_Type (Id : E; V : E) is
2746 end Set_Entry_Parameters_Type;
2748 procedure Set_Enum_Pos_To_Rep (Id : E; V : E) is
2750 pragma Assert (Ekind (Id) = E_Enumeration_Type);
2752 end Set_Enum_Pos_To_Rep;
2754 procedure Set_Enumeration_Pos (Id : E; V : U) is
2756 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2758 end Set_Enumeration_Pos;
2760 procedure Set_Enumeration_Rep (Id : E; V : U) is
2762 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2764 end Set_Enumeration_Rep;
2766 procedure Set_Enumeration_Rep_Expr (Id : E; V : N) is
2768 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2770 end Set_Enumeration_Rep_Expr;
2772 procedure Set_Equivalent_Type (Id : E; V : E) is
2775 (Ekind (Id) = E_Class_Wide_Type or else
2776 Ekind (Id) = E_Class_Wide_Subtype or else
2777 Ekind (Id) = E_Access_Protected_Subprogram_Type or else
2778 Ekind (Id) = E_Access_Subprogram_Type or else
2779 Ekind (Id) = E_Exception_Type);
2781 end Set_Equivalent_Type;
2783 procedure Set_Esize (Id : E; V : U) is
2788 procedure Set_Exception_Code (Id : E; V : U) is
2790 pragma Assert (Ekind (Id) = E_Exception);
2792 end Set_Exception_Code;
2794 procedure Set_Extra_Accessibility (Id : E; V : E) is
2796 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
2798 end Set_Extra_Accessibility;
2800 procedure Set_Extra_Constrained (Id : E; V : E) is
2802 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
2804 end Set_Extra_Constrained;
2806 procedure Set_Extra_Formal (Id : E; V : E) is
2809 end Set_Extra_Formal;
2811 procedure Set_Finalization_Chain_Entity (Id : E; V : E) is
2814 end Set_Finalization_Chain_Entity;
2816 procedure Set_Finalize_Storage_Only (Id : E; V : B := True) is
2818 pragma Assert (Is_Type (Id) and then Id = Base_Type (Id));
2819 Set_Flag158 (Id, V);
2820 end Set_Finalize_Storage_Only;
2822 procedure Set_First_Entity (Id : E; V : E) is
2825 end Set_First_Entity;
2827 procedure Set_First_Index (Id : E; V : N) is
2830 end Set_First_Index;
2832 procedure Set_First_Literal (Id : E; V : E) is
2835 end Set_First_Literal;
2837 procedure Set_First_Optional_Parameter (Id : E; V : E) is
2840 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2842 end Set_First_Optional_Parameter;
2844 procedure Set_First_Private_Entity (Id : E; V : E) is
2846 pragma Assert (Nkind (Id) in N_Entity);
2848 end Set_First_Private_Entity;
2850 procedure Set_First_Rep_Item (Id : E; V : N) is
2853 end Set_First_Rep_Item;
2855 procedure Set_Freeze_Node (Id : E; V : N) is
2858 end Set_Freeze_Node;
2860 procedure Set_From_With_Type (Id : E; V : B := True) is
2864 or else Ekind (Id) = E_Package);
2865 Set_Flag159 (Id, V);
2866 end Set_From_With_Type;
2868 procedure Set_Full_View (Id : E; V : E) is
2870 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Constant);
2874 procedure Set_Function_Returns_With_DSP (Id : E; V : B := True) is
2877 (Is_Subprogram (Id) or else Ekind (Id) = E_Subprogram_Type);
2878 Set_Flag169 (Id, V);
2879 end Set_Function_Returns_With_DSP;
2881 procedure Set_Generic_Homonym (Id : E; V : E) is
2884 end Set_Generic_Homonym;
2886 procedure Set_Generic_Renamings (Id : E; V : L) is
2888 Set_Elist23 (Id, V);
2889 end Set_Generic_Renamings;
2891 procedure Set_Handler_Records (Id : E; V : S) is
2894 end Set_Handler_Records;
2896 procedure Set_Has_Aliased_Components (Id : E; V : B := True) is
2898 pragma Assert (Base_Type (Id) = Id);
2899 Set_Flag135 (Id, V);
2900 end Set_Has_Aliased_Components;
2902 procedure Set_Has_Alignment_Clause (Id : E; V : B := True) is
2905 end Set_Has_Alignment_Clause;
2907 procedure Set_Has_All_Calls_Remote (Id : E; V : B := True) is
2910 end Set_Has_All_Calls_Remote;
2912 procedure Set_Has_Atomic_Components (Id : E; V : B := True) is
2914 pragma Assert (not Is_Type (Id) or else Base_Type (Id) = Id);
2916 end Set_Has_Atomic_Components;
2918 procedure Set_Has_Biased_Representation (Id : E; V : B := True) is
2921 ((V = False) or else (Is_Discrete_Type (Id) or Is_Object (Id)));
2922 Set_Flag139 (Id, V);
2923 end Set_Has_Biased_Representation;
2925 procedure Set_Has_Completion (Id : E; V : B := True) is
2928 end Set_Has_Completion;
2930 procedure Set_Has_Completion_In_Body (Id : E; V : B := True) is
2932 pragma Assert (Ekind (Id) = E_Incomplete_Type);
2934 end Set_Has_Completion_In_Body;
2936 procedure Set_Has_Complex_Representation (Id : E; V : B := True) is
2938 pragma Assert (Ekind (Id) = E_Record_Type);
2939 Set_Flag140 (Id, V);
2940 end Set_Has_Complex_Representation;
2942 procedure Set_Has_Component_Size_Clause (Id : E; V : B := True) is
2944 pragma Assert (Ekind (Id) = E_Array_Type);
2946 end Set_Has_Component_Size_Clause;
2948 procedure Set_Has_Contiguous_Rep (Id : E; V : B := True) is
2950 Set_Flag181 (Id, V);
2951 end Set_Has_Contiguous_Rep;
2953 procedure Set_Has_Controlled_Component (Id : E; V : B := True) is
2955 pragma Assert (Base_Type (Id) = Id);
2957 end Set_Has_Controlled_Component;
2959 procedure Set_Has_Controlling_Result (Id : E; V : B := True) is
2962 end Set_Has_Controlling_Result;
2964 procedure Set_Has_Convention_Pragma (Id : E; V : B := True) is
2966 Set_Flag119 (Id, V);
2967 end Set_Has_Convention_Pragma;
2969 procedure Set_Has_Delayed_Freeze (Id : E; V : B := True) is
2971 pragma Assert (Nkind (Id) in N_Entity);
2973 end Set_Has_Delayed_Freeze;
2975 procedure Set_Has_Discriminants (Id : E; V : B := True) is
2977 pragma Assert (Nkind (Id) in N_Entity);
2979 end Set_Has_Discriminants;
2981 procedure Set_Has_Enumeration_Rep_Clause (Id : E; V : B := True) is
2983 pragma Assert (Is_Enumeration_Type (Id));
2985 end Set_Has_Enumeration_Rep_Clause;
2987 procedure Set_Has_Exit (Id : E; V : B := True) is
2992 procedure Set_Has_External_Tag_Rep_Clause (Id : E; V : B := True) is
2994 pragma Assert (Is_Tagged_Type (Id));
2995 Set_Flag110 (Id, V);
2996 end Set_Has_External_Tag_Rep_Clause;
2998 procedure Set_Has_Forward_Instantiation (Id : E; V : B := True) is
3000 Set_Flag175 (Id, V);
3001 end Set_Has_Forward_Instantiation;
3003 procedure Set_Has_Fully_Qualified_Name (Id : E; V : B := True) is
3005 Set_Flag173 (Id, V);
3006 end Set_Has_Fully_Qualified_Name;
3008 procedure Set_Has_Gigi_Rep_Item (Id : E; V : B := True) is
3011 end Set_Has_Gigi_Rep_Item;
3013 procedure Set_Has_Homonym (Id : E; V : B := True) is
3016 end Set_Has_Homonym;
3018 procedure Set_Has_Machine_Radix_Clause (Id : E; V : B := True) is
3020 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
3022 end Set_Has_Machine_Radix_Clause;
3024 procedure Set_Has_Master_Entity (Id : E; V : B := True) is
3027 end Set_Has_Master_Entity;
3029 procedure Set_Has_Missing_Return (Id : E; V : B := True) is
3032 (Ekind (Id) = E_Function or else Ekind (Id) = E_Generic_Function);
3033 Set_Flag142 (Id, V);
3034 end Set_Has_Missing_Return;
3036 procedure Set_Has_Nested_Block_With_Handler (Id : E; V : B := True) is
3038 Set_Flag101 (Id, V);
3039 end Set_Has_Nested_Block_With_Handler;
3041 procedure Set_Has_Non_Standard_Rep (Id : E; V : B := True) is
3043 pragma Assert (Base_Type (Id) = Id);
3045 end Set_Has_Non_Standard_Rep;
3047 procedure Set_Has_Object_Size_Clause (Id : E; V : B := True) is
3049 pragma Assert (Is_Type (Id));
3050 Set_Flag172 (Id, V);
3051 end Set_Has_Object_Size_Clause;
3053 procedure Set_Has_Per_Object_Constraint (Id : E; V : B := True) is
3055 Set_Flag154 (Id, V);
3056 end Set_Has_Per_Object_Constraint;
3058 procedure Set_Has_Pragma_Controlled (Id : E; V : B := True) is
3060 pragma Assert (Is_Access_Type (Id));
3061 Set_Flag27 (Base_Type (Id), V);
3062 end Set_Has_Pragma_Controlled;
3064 procedure Set_Has_Pragma_Elaborate_Body (Id : E; V : B := True) is
3066 Set_Flag150 (Id, V);
3067 end Set_Has_Pragma_Elaborate_Body;
3069 procedure Set_Has_Pragma_Inline (Id : E; V : B := True) is
3071 Set_Flag157 (Id, V);
3072 end Set_Has_Pragma_Inline;
3074 procedure Set_Has_Pragma_Pack (Id : E; V : B := True) is
3076 pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id));
3077 pragma Assert (Id = Base_Type (Id));
3078 Set_Flag121 (Id, V);
3079 end Set_Has_Pragma_Pack;
3081 procedure Set_Has_Pragma_Pure_Function (Id : E; V : B := True) is
3083 pragma Assert (Is_Subprogram (Id));
3084 Set_Flag179 (Id, V);
3085 end Set_Has_Pragma_Pure_Function;
3087 procedure Set_Has_Pragma_Unreferenced (Id : E; V : B := True) is
3089 Set_Flag180 (Id, V);
3090 end Set_Has_Pragma_Unreferenced;
3092 procedure Set_Has_Primitive_Operations (Id : E; V : B := True) is
3094 pragma Assert (Id = Base_Type (Id));
3095 Set_Flag120 (Id, V);
3096 end Set_Has_Primitive_Operations;
3098 procedure Set_Has_Private_Declaration (Id : E; V : B := True) is
3100 Set_Flag155 (Id, V);
3101 end Set_Has_Private_Declaration;
3103 procedure Set_Has_Qualified_Name (Id : E; V : B := True) is
3105 Set_Flag161 (Id, V);
3106 end Set_Has_Qualified_Name;
3108 procedure Set_Has_Record_Rep_Clause (Id : E; V : B := True) is
3110 pragma Assert (Id = Base_Type (Id));
3112 end Set_Has_Record_Rep_Clause;
3114 procedure Set_Has_Recursive_Call (Id : E; V : B := True) is
3116 pragma Assert (Is_Subprogram (Id));
3117 Set_Flag143 (Id, V);
3118 end Set_Has_Recursive_Call;
3120 procedure Set_Has_Size_Clause (Id : E; V : B := True) is
3123 end Set_Has_Size_Clause;
3125 procedure Set_Has_Small_Clause (Id : E; V : B := True) is
3128 end Set_Has_Small_Clause;
3130 procedure Set_Has_Specified_Layout (Id : E; V : B := True) is
3132 pragma Assert (Id = Base_Type (Id));
3133 Set_Flag100 (Id, V);
3134 end Set_Has_Specified_Layout;
3136 procedure Set_Has_Storage_Size_Clause (Id : E; V : B := True) is
3138 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
3139 pragma Assert (Base_Type (Id) = Id);
3141 end Set_Has_Storage_Size_Clause;
3143 procedure Set_Has_Subprogram_Descriptor (Id : E; V : B := True) is
3146 end Set_Has_Subprogram_Descriptor;
3148 procedure Set_Has_Task (Id : E; V : B := True) is
3150 pragma Assert (Base_Type (Id) = Id);
3154 procedure Set_Has_Unchecked_Union (Id : E; V : B := True) is
3156 pragma Assert (Base_Type (Id) = Id);
3157 Set_Flag123 (Id, V);
3158 end Set_Has_Unchecked_Union;
3160 procedure Set_Has_Unknown_Discriminants (Id : E; V : B := True) is
3162 pragma Assert (Is_Type (Id));
3164 end Set_Has_Unknown_Discriminants;
3166 procedure Set_Has_Volatile_Components (Id : E; V : B := True) is
3168 pragma Assert (not Is_Type (Id) or else Base_Type (Id) = Id);
3170 end Set_Has_Volatile_Components;
3172 procedure Set_Has_Xref_Entry (Id : E; V : B := True) is
3174 Set_Flag182 (Id, V);
3175 end Set_Has_Xref_Entry;
3177 procedure Set_Hiding_Loop_Variable (Id : E; V : E) is
3179 pragma Assert (Ekind (Id) = E_Variable);
3181 end Set_Hiding_Loop_Variable;
3183 procedure Set_Homonym (Id : E; V : E) is
3185 pragma Assert (Id /= V);
3189 procedure Set_In_Package_Body (Id : E; V : B := True) is
3192 end Set_In_Package_Body;
3194 procedure Set_In_Private_Part (Id : E; V : B := True) is
3197 end Set_In_Private_Part;
3199 procedure Set_In_Use (Id : E; V : B := True) is
3201 pragma Assert (Nkind (Id) in N_Entity);
3205 procedure Set_Inner_Instances (Id : E; V : L) is
3207 Set_Elist23 (Id, V);
3208 end Set_Inner_Instances;
3210 procedure Set_Interface_Name (Id : E; V : N) is
3213 end Set_Interface_Name;
3215 procedure Set_Is_Abstract (Id : E; V : B := True) is
3218 end Set_Is_Abstract;
3220 procedure Set_Is_Access_Constant (Id : E; V : B := True) is
3222 pragma Assert (Is_Access_Type (Id));
3224 end Set_Is_Access_Constant;
3226 procedure Set_Is_Aliased (Id : E; V : B := True) is
3228 pragma Assert (Nkind (Id) in N_Entity);
3232 procedure Set_Is_AST_Entry (Id : E; V : B := True) is
3234 pragma Assert (Is_Entry (Id));
3235 Set_Flag132 (Id, V);
3236 end Set_Is_AST_Entry;
3238 procedure Set_Is_Asynchronous (Id : E; V : B := True) is
3241 (Ekind (Id) = E_Procedure or else Is_Type (Id));
3243 end Set_Is_Asynchronous;
3245 procedure Set_Is_Atomic (Id : E; V : B := True) is
3250 procedure Set_Is_Bit_Packed_Array (Id : E; V : B := True) is
3252 pragma Assert ((not V)
3253 or else (Is_Array_Type (Id) and then Id = Base_Type (Id)));
3255 Set_Flag122 (Id, V);
3256 end Set_Is_Bit_Packed_Array;
3258 procedure Set_Is_Called (Id : E; V : B := True) is
3261 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Function);
3262 Set_Flag102 (Id, V);
3265 procedure Set_Is_Character_Type (Id : E; V : B := True) is
3268 end Set_Is_Character_Type;
3270 procedure Set_Is_Child_Unit (Id : E; V : B := True) is
3273 end Set_Is_Child_Unit;
3275 procedure Set_Is_Class_Wide_Equivalent_Type (Id : E; V : B := True) is
3278 end Set_Is_Class_Wide_Equivalent_Type;
3280 procedure Set_Is_Compilation_Unit (Id : E; V : B := True) is
3282 Set_Flag149 (Id, V);
3283 end Set_Is_Compilation_Unit;
3285 procedure Set_Is_Completely_Hidden (Id : E; V : B := True) is
3287 pragma Assert (Ekind (Id) = E_Discriminant);
3288 Set_Flag103 (Id, V);
3289 end Set_Is_Completely_Hidden;
3291 procedure Set_Is_Concurrent_Record_Type (Id : E; V : B := True) is
3294 end Set_Is_Concurrent_Record_Type;
3296 procedure Set_Is_Constr_Subt_For_U_Nominal (Id : E; V : B := True) is
3299 end Set_Is_Constr_Subt_For_U_Nominal;
3301 procedure Set_Is_Constr_Subt_For_UN_Aliased (Id : E; V : B := True) is
3303 Set_Flag141 (Id, V);
3304 end Set_Is_Constr_Subt_For_UN_Aliased;
3306 procedure Set_Is_Constrained (Id : E; V : B := True) is
3308 pragma Assert (Nkind (Id) in N_Entity);
3310 end Set_Is_Constrained;
3312 procedure Set_Is_Constructor (Id : E; V : B := True) is
3315 end Set_Is_Constructor;
3317 procedure Set_Is_Controlled (Id : E; V : B := True) is
3319 pragma Assert (Id = Base_Type (Id));
3321 end Set_Is_Controlled;
3323 procedure Set_Is_Controlling_Formal (Id : E; V : B := True) is
3325 pragma Assert (Is_Formal (Id));
3327 end Set_Is_Controlling_Formal;
3329 procedure Set_Is_CPP_Class (Id : E; V : B := True) is
3332 end Set_Is_CPP_Class;
3334 procedure Set_Is_Discrim_SO_Function (Id : E; V : B := True) is
3336 Set_Flag176 (Id, V);
3337 end Set_Is_Discrim_SO_Function;
3339 procedure Set_Is_Dispatching_Operation (Id : E; V : B := True) is
3344 Is_Overloadable (Id)
3346 Ekind (Id) = E_Subprogram_Type);
3349 end Set_Is_Dispatching_Operation;
3351 procedure Set_Is_Eliminated (Id : E; V : B := True) is
3353 Set_Flag124 (Id, V);
3354 end Set_Is_Eliminated;
3356 procedure Set_Is_Entry_Formal (Id : E; V : B := True) is
3359 end Set_Is_Entry_Formal;
3361 procedure Set_Is_Exported (Id : E; V : B := True) is
3364 end Set_Is_Exported;
3366 procedure Set_Is_First_Subtype (Id : E; V : B := True) is
3369 end Set_Is_First_Subtype;
3371 procedure Set_Is_For_Access_Subtype (Id : E; V : B := True) is
3374 (Ekind (Id) = E_Record_Subtype
3376 Ekind (Id) = E_Private_Subtype);
3377 Set_Flag118 (Id, V);
3378 end Set_Is_For_Access_Subtype;
3380 procedure Set_Is_Formal_Subprogram (Id : E; V : B := True) is
3382 Set_Flag111 (Id, V);
3383 end Set_Is_Formal_Subprogram;
3385 procedure Set_Is_Frozen (Id : E; V : B := True) is
3387 pragma Assert (Nkind (Id) in N_Entity);
3391 procedure Set_Is_Generic_Actual_Type (Id : E; V : B := True) is
3393 pragma Assert (Is_Type (Id));
3395 end Set_Is_Generic_Actual_Type;
3397 procedure Set_Is_Generic_Instance (Id : E; V : B := True) is
3399 Set_Flag130 (Id, V);
3400 end Set_Is_Generic_Instance;
3402 procedure Set_Is_Generic_Type (Id : E; V : B := True) is
3404 pragma Assert (Nkind (Id) in N_Entity);
3406 end Set_Is_Generic_Type;
3408 procedure Set_Is_Hidden (Id : E; V : B := True) is
3413 procedure Set_Is_Hidden_Open_Scope (Id : E; V : B := True) is
3415 Set_Flag171 (Id, V);
3416 end Set_Is_Hidden_Open_Scope;
3418 procedure Set_Is_Immediately_Visible (Id : E; V : B := True) is
3420 pragma Assert (Nkind (Id) in N_Entity);
3422 end Set_Is_Immediately_Visible;
3424 procedure Set_Is_Imported (Id : E; V : B := True) is
3427 end Set_Is_Imported;
3429 procedure Set_Is_Inlined (Id : E; V : B := True) is
3434 procedure Set_Is_Instantiated (Id : E; V : B := True) is
3436 Set_Flag126 (Id, V);
3437 end Set_Is_Instantiated;
3439 procedure Set_Is_Internal (Id : E; V : B := True) is
3441 pragma Assert (Nkind (Id) in N_Entity);
3443 end Set_Is_Internal;
3445 procedure Set_Is_Interrupt_Handler (Id : E; V : B := True) is
3447 pragma Assert (Nkind (Id) in N_Entity);
3449 end Set_Is_Interrupt_Handler;
3451 procedure Set_Is_Intrinsic_Subprogram (Id : E; V : B := True) is
3454 end Set_Is_Intrinsic_Subprogram;
3456 procedure Set_Is_Itype (Id : E; V : B := True) is
3461 procedure Set_Is_Known_Non_Null (Id : E; V : B := True) is
3464 end Set_Is_Known_Non_Null;
3466 procedure Set_Is_Known_Valid (Id : E; V : B := True) is
3468 Set_Flag170 (Id, V);
3469 end Set_Is_Known_Valid;
3471 procedure Set_Is_Limited_Composite (Id : E; V : B := True) is
3473 pragma Assert (Is_Type (Id));
3474 Set_Flag106 (Id, V);
3475 end Set_Is_Limited_Composite;
3477 procedure Set_Is_Limited_Record (Id : E; V : B := True) is
3480 end Set_Is_Limited_Record;
3482 procedure Set_Is_Machine_Code_Subprogram (Id : E; V : B := True) is
3484 pragma Assert (Is_Subprogram (Id));
3485 Set_Flag137 (Id, V);
3486 end Set_Is_Machine_Code_Subprogram;
3488 procedure Set_Is_Non_Static_Subtype (Id : E; V : B := True) is
3490 pragma Assert (Is_Type (Id));
3491 Set_Flag109 (Id, V);
3492 end Set_Is_Non_Static_Subtype;
3494 procedure Set_Is_Null_Init_Proc (Id : E; V : B := True) is
3496 pragma Assert (Ekind (Id) = E_Procedure);
3497 Set_Flag178 (Id, V);
3498 end Set_Is_Null_Init_Proc;
3500 procedure Set_Is_Optional_Parameter (Id : E; V : B := True) is
3502 pragma Assert (Is_Formal (Id));
3503 Set_Flag134 (Id, V);
3504 end Set_Is_Optional_Parameter;
3506 procedure Set_Is_Overriding_Operation (Id : E; V : B := True) is
3508 pragma Assert (Is_Subprogram (Id));
3510 end Set_Is_Overriding_Operation;
3512 procedure Set_Is_Package_Body_Entity (Id : E; V : B := True) is
3514 Set_Flag160 (Id, V);
3515 end Set_Is_Package_Body_Entity;
3517 procedure Set_Is_Packed (Id : E; V : B := True) is
3519 pragma Assert (Base_Type (Id) = Id);
3523 procedure Set_Is_Packed_Array_Type (Id : E; V : B := True) is
3525 Set_Flag138 (Id, V);
3526 end Set_Is_Packed_Array_Type;
3528 procedure Set_Is_Potentially_Use_Visible (Id : E; V : B := True) is
3530 pragma Assert (Nkind (Id) in N_Entity);
3532 end Set_Is_Potentially_Use_Visible;
3534 procedure Set_Is_Preelaborated (Id : E; V : B := True) is
3537 end Set_Is_Preelaborated;
3539 procedure Set_Is_Private_Composite (Id : E; V : B := True) is
3541 pragma Assert (Is_Type (Id));
3542 Set_Flag107 (Id, V);
3543 end Set_Is_Private_Composite;
3545 procedure Set_Is_Private_Descendant (Id : E; V : B := True) is
3548 end Set_Is_Private_Descendant;
3550 procedure Set_Is_Psected (Id : E; V : B := True) is
3552 Set_Flag153 (Id, V);
3555 procedure Set_Is_Public (Id : E; V : B := True) is
3557 pragma Assert (Nkind (Id) in N_Entity);
3561 procedure Set_Is_Pure (Id : E; V : B := True) is
3566 procedure Set_Is_Remote_Call_Interface (Id : E; V : B := True) is
3569 end Set_Is_Remote_Call_Interface;
3571 procedure Set_Is_Remote_Types (Id : E; V : B := True) is
3574 end Set_Is_Remote_Types;
3576 procedure Set_Is_Renaming_Of_Object (Id : E; V : B := True) is
3578 Set_Flag112 (Id, V);
3579 end Set_Is_Renaming_Of_Object;
3581 procedure Set_Is_Shared_Passive (Id : E; V : B := True) is
3584 end Set_Is_Shared_Passive;
3586 procedure Set_Is_Statically_Allocated (Id : E; V : B := True) is
3589 (Ekind (Id) = E_Exception
3590 or else Ekind (Id) = E_Variable
3591 or else Ekind (Id) = E_Constant
3592 or else Is_Type (Id)
3593 or else Ekind (Id) = E_Void);
3595 end Set_Is_Statically_Allocated;
3597 procedure Set_Is_Tag (Id : E; V : B := True) is
3599 pragma Assert (Nkind (Id) in N_Entity);
3603 procedure Set_Is_Tagged_Type (Id : E; V : B := True) is
3606 end Set_Is_Tagged_Type;
3608 procedure Set_Is_Thread_Body (Id : E; V : B := True) is
3611 end Set_Is_Thread_Body;
3613 procedure Set_Is_True_Constant (Id : E; V : B := True) is
3615 Set_Flag163 (Id, V);
3616 end Set_Is_True_Constant;
3618 procedure Set_Is_Unchecked_Union (Id : E; V : B := True) is
3620 pragma Assert (Base_Type (Id) = Id);
3621 Set_Flag117 (Id, V);
3622 end Set_Is_Unchecked_Union;
3624 procedure Set_Is_Unsigned_Type (Id : E; V : B := True) is
3626 pragma Assert (Is_Discrete_Or_Fixed_Point_Type (Id));
3627 Set_Flag144 (Id, V);
3628 end Set_Is_Unsigned_Type;
3630 procedure Set_Is_Valued_Procedure (Id : E; V : B := True) is
3632 pragma Assert (Ekind (Id) = E_Procedure);
3633 Set_Flag127 (Id, V);
3634 end Set_Is_Valued_Procedure;
3636 procedure Set_Is_Visible_Child_Unit (Id : E; V : B := True) is
3638 pragma Assert (Is_Child_Unit (Id));
3639 Set_Flag116 (Id, V);
3640 end Set_Is_Visible_Child_Unit;
3642 procedure Set_Is_VMS_Exception (Id : E; V : B := True) is
3644 pragma Assert (Ekind (Id) = E_Exception);
3645 Set_Flag133 (Id, V);
3646 end Set_Is_VMS_Exception;
3648 procedure Set_Is_Volatile (Id : E; V : B := True) is
3650 pragma Assert (Nkind (Id) in N_Entity);
3652 end Set_Is_Volatile;
3654 procedure Set_Kill_Elaboration_Checks (Id : E; V : B := True) is
3657 end Set_Kill_Elaboration_Checks;
3659 procedure Set_Kill_Range_Checks (Id : E; V : B := True) is
3662 end Set_Kill_Range_Checks;
3664 procedure Set_Kill_Tag_Checks (Id : E; V : B := True) is
3667 end Set_Kill_Tag_Checks;
3669 procedure Set_Last_Entity (Id : E; V : E) is
3672 end Set_Last_Entity;
3674 procedure Set_Limited_View (Id : E; V : E) is
3676 pragma Assert (Ekind (Id) = E_Package);
3678 end Set_Limited_View;
3680 procedure Set_Lit_Indexes (Id : E; V : E) is
3682 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
3684 end Set_Lit_Indexes;
3686 procedure Set_Lit_Strings (Id : E; V : E) is
3688 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
3690 end Set_Lit_Strings;
3692 procedure Set_Machine_Radix_10 (Id : E; V : B := True) is
3694 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
3696 end Set_Machine_Radix_10;
3698 procedure Set_Master_Id (Id : E; V : E) is
3703 procedure Set_Materialize_Entity (Id : E; V : B := True) is
3705 Set_Flag168 (Id, V);
3706 end Set_Materialize_Entity;
3708 procedure Set_Mechanism (Id : E; V : M) is
3710 pragma Assert (Ekind (Id) = E_Function or else Is_Formal (Id));
3711 Set_Uint8 (Id, UI_From_Int (V));
3714 procedure Set_Modulus (Id : E; V : U) is
3716 pragma Assert (Ekind (Id) = E_Modular_Integer_Type);
3720 procedure Set_Must_Be_On_Byte_Boundary (Id : E; V : B := True) is
3722 pragma Assert (Is_Type (Id));
3723 Set_Flag183 (Id, V);
3724 end Set_Must_Be_On_Byte_Boundary;
3726 procedure Set_Needs_Debug_Info (Id : E; V : B := True) is
3728 Set_Flag147 (Id, V);
3729 end Set_Needs_Debug_Info;
3731 procedure Set_Needs_No_Actuals (Id : E; V : B := True) is
3734 (Is_Overloadable (Id)
3735 or else Ekind (Id) = E_Subprogram_Type
3736 or else Ekind (Id) = E_Entry_Family);
3738 end Set_Needs_No_Actuals;
3740 procedure Set_Never_Set_In_Source (Id : E; V : B := True) is
3742 Set_Flag115 (Id, V);
3743 end Set_Never_Set_In_Source;
3745 procedure Set_Next_Inlined_Subprogram (Id : E; V : E) is
3748 end Set_Next_Inlined_Subprogram;
3750 procedure Set_No_Pool_Assigned (Id : E; V : B := True) is
3752 pragma Assert (Is_Access_Type (Id) and then Base_Type (Id) = Id);
3753 Set_Flag131 (Id, V);
3754 end Set_No_Pool_Assigned;
3756 procedure Set_No_Return (Id : E; V : B := True) is
3759 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Generic_Procedure);
3760 Set_Flag113 (Id, V);
3763 procedure Set_No_Strict_Aliasing (Id : E; V : B := True) is
3765 pragma Assert (Is_Access_Type (Id) and then Base_Type (Id) = Id);
3766 Set_Flag136 (Id, V);
3767 end Set_No_Strict_Aliasing;
3769 procedure Set_Non_Binary_Modulus (Id : E; V : B := True) is
3771 pragma Assert (Ekind (Id) = E_Modular_Integer_Type);
3773 end Set_Non_Binary_Modulus;
3775 procedure Set_Non_Limited_View (Id : E; V : E) is
3776 pragma Assert (False
3777 or else Ekind (Id) = E_Incomplete_Type);
3780 end Set_Non_Limited_View;
3782 procedure Set_Nonzero_Is_True (Id : E; V : B := True) is
3785 (Root_Type (Id) = Standard_Boolean
3786 and then Ekind (Id) = E_Enumeration_Type);
3787 Set_Flag162 (Id, V);
3788 end Set_Nonzero_Is_True;
3790 procedure Set_Normalized_First_Bit (Id : E; V : U) is
3793 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
3795 end Set_Normalized_First_Bit;
3797 procedure Set_Normalized_Position (Id : E; V : U) is
3800 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
3802 end Set_Normalized_Position;
3804 procedure Set_Normalized_Position_Max (Id : E; V : U) is
3807 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
3809 end Set_Normalized_Position_Max;
3811 procedure Set_Object_Ref (Id : E; V : E) is
3813 pragma Assert (Ekind (Id) = E_Protected_Body);
3817 procedure Set_Original_Access_Type (Id : E; V : E) is
3820 (Ekind (Id) = E_Access_Subprogram_Type
3821 or else Ekind (Id) = E_Access_Protected_Subprogram_Type);
3823 end Set_Original_Access_Type;
3825 procedure Set_Original_Array_Type (Id : E; V : E) is
3827 pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id));
3829 end Set_Original_Array_Type;
3831 procedure Set_Original_Record_Component (Id : E; V : E) is
3834 (Ekind (Id) = E_Void
3835 or else Ekind (Id) = E_Component
3836 or else Ekind (Id) = E_Discriminant);
3838 end Set_Original_Record_Component;
3840 procedure Set_Packed_Array_Type (Id : E; V : E) is
3842 pragma Assert (Is_Array_Type (Id));
3844 end Set_Packed_Array_Type;
3846 procedure Set_Parent_Subtype (Id : E; V : E) is
3848 pragma Assert (Ekind (Id) = E_Record_Type);
3850 end Set_Parent_Subtype;
3852 procedure Set_Primitive_Operations (Id : E; V : L) is
3854 pragma Assert (Is_Tagged_Type (Id));
3855 Set_Elist15 (Id, V);
3856 end Set_Primitive_Operations;
3858 procedure Set_Prival (Id : E; V : E) is
3860 pragma Assert (Is_Protected_Private (Id));
3864 procedure Set_Privals_Chain (Id : E; V : L) is
3866 pragma Assert (Is_Overloadable (Id)
3867 or else Ekind (Id) = E_Entry_Family);
3868 Set_Elist23 (Id, V);
3869 end Set_Privals_Chain;
3871 procedure Set_Private_Dependents (Id : E; V : L) is
3873 pragma Assert (Is_Incomplete_Or_Private_Type (Id));
3874 Set_Elist18 (Id, V);
3875 end Set_Private_Dependents;
3877 procedure Set_Private_View (Id : E; V : N) is
3879 pragma Assert (Is_Private_Type (Id));
3881 end Set_Private_View;
3883 procedure Set_Protected_Body_Subprogram (Id : E; V : E) is
3885 pragma Assert (Is_Subprogram (Id) or else Is_Entry (Id));
3887 end Set_Protected_Body_Subprogram;
3889 procedure Set_Protected_Formal (Id : E; V : E) is
3891 pragma Assert (Is_Formal (Id));
3893 end Set_Protected_Formal;
3895 procedure Set_Protected_Operation (Id : E; V : N) is
3897 pragma Assert (Is_Protected_Private (Id));
3899 end Set_Protected_Operation;
3901 procedure Set_Reachable (Id : E; V : B := True) is
3906 procedure Set_Referenced (Id : E; V : B := True) is
3908 Set_Flag156 (Id, V);
3911 procedure Set_Referenced_As_LHS (Id : E; V : B := True) is
3914 end Set_Referenced_As_LHS;
3916 procedure Set_Referenced_Object (Id : E; V : N) is
3918 pragma Assert (Is_Type (Id));
3920 end Set_Referenced_Object;
3922 procedure Set_Register_Exception_Call (Id : E; V : N) is
3924 pragma Assert (Ekind (Id) = E_Exception);
3926 end Set_Register_Exception_Call;
3928 procedure Set_Related_Array_Object (Id : E; V : E) is
3930 pragma Assert (Is_Array_Type (Id));
3932 end Set_Related_Array_Object;
3934 procedure Set_Related_Instance (Id : E; V : E) is
3937 (Ekind (Id) = E_Package or else Ekind (Id) = E_Package_Body);
3939 end Set_Related_Instance;
3941 procedure Set_Renamed_Entity (Id : E; V : N) is
3944 end Set_Renamed_Entity;
3946 procedure Set_Renamed_Object (Id : E; V : N) is
3949 end Set_Renamed_Object;
3951 procedure Set_Renaming_Map (Id : E; V : U) is
3954 end Set_Renaming_Map;
3956 procedure Set_Return_Present (Id : E; V : B := True) is
3959 end Set_Return_Present;
3961 procedure Set_Returns_By_Ref (Id : E; V : B := True) is
3964 end Set_Returns_By_Ref;
3966 procedure Set_Reverse_Bit_Order (Id : E; V : B := True) is
3969 (Is_Record_Type (Id) and then Id = Base_Type (Id));
3970 Set_Flag164 (Id, V);
3971 end Set_Reverse_Bit_Order;
3973 procedure Set_RM_Size (Id : E; V : U) is
3975 pragma Assert (Is_Type (Id));
3979 procedure Set_Scalar_Range (Id : E; V : N) is
3982 end Set_Scalar_Range;
3984 procedure Set_Scale_Value (Id : E; V : U) is
3987 end Set_Scale_Value;
3989 procedure Set_Scope_Depth_Value (Id : E; V : U) is
3991 pragma Assert (not Is_Record_Type (Id));
3993 end Set_Scope_Depth_Value;
3995 procedure Set_Sec_Stack_Needed_For_Return (Id : E; V : B := True) is
3997 Set_Flag167 (Id, V);
3998 end Set_Sec_Stack_Needed_For_Return;
4000 procedure Set_Shadow_Entities (Id : E; V : S) is
4003 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
4005 end Set_Shadow_Entities;
4007 procedure Set_Shared_Var_Assign_Proc (Id : E; V : E) is
4009 pragma Assert (Ekind (Id) = E_Variable);
4011 end Set_Shared_Var_Assign_Proc;
4013 procedure Set_Shared_Var_Read_Proc (Id : E; V : E) is
4015 pragma Assert (Ekind (Id) = E_Variable);
4017 end Set_Shared_Var_Read_Proc;
4019 procedure Set_Size_Check_Code (Id : E; V : N) is
4021 pragma Assert (Ekind (Id) = E_Constant or else Ekind (Id) = E_Variable);
4023 end Set_Size_Check_Code;
4025 procedure Set_Size_Depends_On_Discriminant (Id : E; V : B := True) is
4027 Set_Flag177 (Id, V);
4028 end Set_Size_Depends_On_Discriminant;
4030 procedure Set_Size_Known_At_Compile_Time (Id : E; V : B := True) is
4033 end Set_Size_Known_At_Compile_Time;
4035 procedure Set_Small_Value (Id : E; V : R) is
4037 pragma Assert (Is_Fixed_Point_Type (Id));
4038 Set_Ureal21 (Id, V);
4039 end Set_Small_Value;
4041 procedure Set_Spec_Entity (Id : E; V : E) is
4043 pragma Assert (Ekind (Id) = E_Package_Body or else Is_Formal (Id));
4045 end Set_Spec_Entity;
4047 procedure Set_Storage_Size_Variable (Id : E; V : E) is
4049 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
4050 pragma Assert (Base_Type (Id) = Id);
4052 end Set_Storage_Size_Variable;
4054 procedure Set_Stored_Constraint (Id : E; V : L) is
4056 pragma Assert (Nkind (Id) in N_Entity);
4057 Set_Elist23 (Id, V);
4058 end Set_Stored_Constraint;
4060 procedure Set_Strict_Alignment (Id : E; V : B := True) is
4062 pragma Assert (Base_Type (Id) = Id);
4063 Set_Flag145 (Id, V);
4064 end Set_Strict_Alignment;
4066 procedure Set_String_Literal_Length (Id : E; V : U) is
4068 pragma Assert (Ekind (Id) = E_String_Literal_Subtype);
4070 end Set_String_Literal_Length;
4072 procedure Set_String_Literal_Low_Bound (Id : E; V : N) is
4074 pragma Assert (Ekind (Id) = E_String_Literal_Subtype);
4076 end Set_String_Literal_Low_Bound;
4078 procedure Set_Suppress_Elaboration_Warnings (Id : E; V : B := True) is
4080 Set_Flag148 (Id, V);
4081 end Set_Suppress_Elaboration_Warnings;
4083 procedure Set_Suppress_Init_Proc (Id : E; V : B := True) is
4085 pragma Assert (Id = Base_Type (Id));
4086 Set_Flag105 (Id, V);
4087 end Set_Suppress_Init_Proc;
4089 procedure Set_Suppress_Style_Checks (Id : E; V : B := True) is
4091 Set_Flag165 (Id, V);
4092 end Set_Suppress_Style_Checks;
4094 procedure Set_Treat_As_Volatile (Id : E; V : B := True) is
4097 end Set_Treat_As_Volatile;
4099 procedure Set_Underlying_Full_View (Id : E; V : E) is
4101 pragma Assert (Ekind (Id) in Private_Kind);
4103 end Set_Underlying_Full_View;
4105 procedure Set_Unset_Reference (Id : E; V : N) is
4108 end Set_Unset_Reference;
4110 procedure Set_Uses_Sec_Stack (Id : E; V : B := True) is
4113 end Set_Uses_Sec_Stack;
4115 procedure Set_Vax_Float (Id : E; V : B := True) is
4117 pragma Assert (Id = Base_Type (Id));
4118 Set_Flag151 (Id, V);
4121 procedure Set_Warnings_Off (Id : E; V : B := True) is
4124 end Set_Warnings_Off;
4126 -----------------------------------
4127 -- Field Initialization Routines --
4128 -----------------------------------
4130 procedure Init_Alignment (Id : E) is
4132 Set_Uint14 (Id, Uint_0);
4135 procedure Init_Alignment (Id : E; V : Int) is
4137 Set_Uint14 (Id, UI_From_Int (V));
4140 procedure Init_Component_Bit_Offset (Id : E) is
4142 Set_Uint11 (Id, No_Uint);
4143 end Init_Component_Bit_Offset;
4145 procedure Init_Component_Bit_Offset (Id : E; V : Int) is
4147 Set_Uint11 (Id, UI_From_Int (V));
4148 end Init_Component_Bit_Offset;
4150 procedure Init_Component_Size (Id : E) is
4152 Set_Uint22 (Id, Uint_0);
4153 end Init_Component_Size;
4155 procedure Init_Component_Size (Id : E; V : Int) is
4157 Set_Uint22 (Id, UI_From_Int (V));
4158 end Init_Component_Size;
4160 procedure Init_Digits_Value (Id : E) is
4162 Set_Uint17 (Id, Uint_0);
4163 end Init_Digits_Value;
4165 procedure Init_Digits_Value (Id : E; V : Int) is
4167 Set_Uint17 (Id, UI_From_Int (V));
4168 end Init_Digits_Value;
4170 procedure Init_Esize (Id : E) is
4172 Set_Uint12 (Id, Uint_0);
4175 procedure Init_Esize (Id : E; V : Int) is
4177 Set_Uint12 (Id, UI_From_Int (V));
4180 procedure Init_Normalized_First_Bit (Id : E) is
4182 Set_Uint8 (Id, No_Uint);
4183 end Init_Normalized_First_Bit;
4185 procedure Init_Normalized_First_Bit (Id : E; V : Int) is
4187 Set_Uint8 (Id, UI_From_Int (V));
4188 end Init_Normalized_First_Bit;
4190 procedure Init_Normalized_Position (Id : E) is
4192 Set_Uint14 (Id, No_Uint);
4193 end Init_Normalized_Position;
4195 procedure Init_Normalized_Position (Id : E; V : Int) is
4197 Set_Uint14 (Id, UI_From_Int (V));
4198 end Init_Normalized_Position;
4200 procedure Init_Normalized_Position_Max (Id : E) is
4202 Set_Uint10 (Id, No_Uint);
4203 end Init_Normalized_Position_Max;
4205 procedure Init_Normalized_Position_Max (Id : E; V : Int) is
4207 Set_Uint10 (Id, UI_From_Int (V));
4208 end Init_Normalized_Position_Max;
4210 procedure Init_RM_Size (Id : E) is
4212 Set_Uint13 (Id, Uint_0);
4215 procedure Init_RM_Size (Id : E; V : Int) is
4217 Set_Uint13 (Id, UI_From_Int (V));
4220 -----------------------------
4221 -- Init_Component_Location --
4222 -----------------------------
4224 procedure Init_Component_Location (Id : E) is
4226 Set_Uint8 (Id, No_Uint); -- Normalized_First_Bit
4227 Set_Uint10 (Id, No_Uint); -- Normalized_Position_Max
4228 Set_Uint11 (Id, No_Uint); -- Component_First_Bit
4229 Set_Uint12 (Id, Uint_0); -- Esize
4230 Set_Uint14 (Id, No_Uint); -- Normalized_Position
4231 end Init_Component_Location;
4237 procedure Init_Size (Id : E; V : Int) is
4239 Set_Uint12 (Id, UI_From_Int (V)); -- Esize
4240 Set_Uint13 (Id, UI_From_Int (V)); -- RM_Size
4243 ---------------------
4244 -- Init_Size_Align --
4245 ---------------------
4247 procedure Init_Size_Align (Id : E) is
4249 Set_Uint12 (Id, Uint_0); -- Esize
4250 Set_Uint13 (Id, Uint_0); -- RM_Size
4251 Set_Uint14 (Id, Uint_0); -- Alignment
4252 end Init_Size_Align;
4254 ----------------------------------------------
4255 -- Type Representation Attribute Predicates --
4256 ----------------------------------------------
4258 function Known_Alignment (E : Entity_Id) return B is
4260 return Uint14 (E) /= Uint_0
4261 and then Uint14 (E) /= No_Uint;
4262 end Known_Alignment;
4264 function Known_Component_Bit_Offset (E : Entity_Id) return B is
4266 return Uint11 (E) /= No_Uint;
4267 end Known_Component_Bit_Offset;
4269 function Known_Component_Size (E : Entity_Id) return B is
4271 return Uint22 (Base_Type (E)) /= Uint_0
4272 and then Uint22 (Base_Type (E)) /= No_Uint;
4273 end Known_Component_Size;
4275 function Known_Esize (E : Entity_Id) return B is
4277 return Uint12 (E) /= Uint_0
4278 and then Uint12 (E) /= No_Uint;
4281 function Known_Normalized_First_Bit (E : Entity_Id) return B is
4283 return Uint8 (E) /= No_Uint;
4284 end Known_Normalized_First_Bit;
4286 function Known_Normalized_Position (E : Entity_Id) return B is
4288 return Uint14 (E) /= No_Uint;
4289 end Known_Normalized_Position;
4291 function Known_Normalized_Position_Max (E : Entity_Id) return B is
4293 return Uint10 (E) /= No_Uint;
4294 end Known_Normalized_Position_Max;
4296 function Known_RM_Size (E : Entity_Id) return B is
4298 return Uint13 (E) /= No_Uint
4299 and then (Uint13 (E) /= Uint_0
4300 or else Is_Discrete_Type (E)
4301 or else Is_Fixed_Point_Type (E));
4304 function Known_Static_Component_Bit_Offset (E : Entity_Id) return B is
4306 return Uint11 (E) /= No_Uint
4307 and then Uint11 (E) >= Uint_0;
4308 end Known_Static_Component_Bit_Offset;
4310 function Known_Static_Component_Size (E : Entity_Id) return B is
4312 return Uint22 (Base_Type (E)) > Uint_0;
4313 end Known_Static_Component_Size;
4315 function Known_Static_Esize (E : Entity_Id) return B is
4317 return Uint12 (E) > Uint_0;
4318 end Known_Static_Esize;
4320 function Known_Static_Normalized_First_Bit (E : Entity_Id) return B is
4322 return Uint8 (E) /= No_Uint
4323 and then Uint8 (E) >= Uint_0;
4324 end Known_Static_Normalized_First_Bit;
4326 function Known_Static_Normalized_Position (E : Entity_Id) return B is
4328 return Uint14 (E) /= No_Uint
4329 and then Uint14 (E) >= Uint_0;
4330 end Known_Static_Normalized_Position;
4332 function Known_Static_Normalized_Position_Max (E : Entity_Id) return B is
4334 return Uint10 (E) /= No_Uint
4335 and then Uint10 (E) >= Uint_0;
4336 end Known_Static_Normalized_Position_Max;
4338 function Known_Static_RM_Size (E : Entity_Id) return B is
4340 return Uint13 (E) > Uint_0
4341 or else Is_Discrete_Type (E)
4342 or else Is_Fixed_Point_Type (E);
4343 end Known_Static_RM_Size;
4345 function Unknown_Alignment (E : Entity_Id) return B is
4347 return Uint14 (E) = Uint_0
4348 or else Uint14 (E) = No_Uint;
4349 end Unknown_Alignment;
4351 function Unknown_Component_Bit_Offset (E : Entity_Id) return B is
4353 return Uint11 (E) = No_Uint;
4354 end Unknown_Component_Bit_Offset;
4356 function Unknown_Component_Size (E : Entity_Id) return B is
4358 return Uint22 (Base_Type (E)) = Uint_0
4360 Uint22 (Base_Type (E)) = No_Uint;
4361 end Unknown_Component_Size;
4363 function Unknown_Esize (E : Entity_Id) return B is
4365 return Uint12 (E) = No_Uint
4367 Uint12 (E) = Uint_0;
4370 function Unknown_Normalized_First_Bit (E : Entity_Id) return B is
4372 return Uint8 (E) = No_Uint;
4373 end Unknown_Normalized_First_Bit;
4375 function Unknown_Normalized_Position (E : Entity_Id) return B is
4377 return Uint14 (E) = No_Uint;
4378 end Unknown_Normalized_Position;
4380 function Unknown_Normalized_Position_Max (E : Entity_Id) return B is
4382 return Uint10 (E) = No_Uint;
4383 end Unknown_Normalized_Position_Max;
4385 function Unknown_RM_Size (E : Entity_Id) return B is
4387 return (Uint13 (E) = Uint_0
4388 and then not Is_Discrete_Type (E)
4389 and then not Is_Fixed_Point_Type (E))
4390 or else Uint13 (E) = No_Uint;
4391 end Unknown_RM_Size;
4393 --------------------
4394 -- Address_Clause --
4395 --------------------
4397 function Address_Clause (Id : E) return N is
4401 Ritem := First_Rep_Item (Id);
4402 while Present (Ritem) loop
4403 if Nkind (Ritem) = N_Attribute_Definition_Clause
4404 and then Chars (Ritem) = Name_Address
4408 Ritem := Next_Rep_Item (Ritem);
4415 ----------------------
4416 -- Alignment_Clause --
4417 ----------------------
4419 function Alignment_Clause (Id : E) return N is
4423 Ritem := First_Rep_Item (Id);
4424 while Present (Ritem) loop
4425 if Nkind (Ritem) = N_Attribute_Definition_Clause
4426 and then Chars (Ritem) = Name_Alignment
4430 Ritem := Next_Rep_Item (Ritem);
4435 end Alignment_Clause;
4437 ----------------------
4438 -- Ancestor_Subtype --
4439 ----------------------
4441 function Ancestor_Subtype (Id : E) return E is
4443 -- If this is first subtype, or is a base type, then there is no
4444 -- ancestor subtype, so we return Empty to indicate this fact.
4446 if Is_First_Subtype (Id)
4447 or else Id = Base_Type (Id)
4453 D : constant Node_Id := Declaration_Node (Id);
4456 -- If we have a subtype declaration, get the ancestor subtype
4458 if Nkind (D) = N_Subtype_Declaration then
4459 if Nkind (Subtype_Indication (D)) = N_Subtype_Indication then
4460 return Entity (Subtype_Mark (Subtype_Indication (D)));
4462 return Entity (Subtype_Indication (D));
4465 -- If not, then no subtype indication is available
4471 end Ancestor_Subtype;
4477 procedure Append_Entity (Id : Entity_Id; V : Entity_Id) is
4479 if Last_Entity (V) = Empty then
4480 Set_First_Entity (V, Id);
4482 Set_Next_Entity (Last_Entity (V), Id);
4485 Set_Next_Entity (Id, Empty);
4487 Set_Last_Entity (V, Id);
4494 function Base_Type (Id : E) return E is
4497 when E_Enumeration_Subtype |
4499 E_Signed_Integer_Subtype |
4500 E_Modular_Integer_Subtype |
4501 E_Floating_Point_Subtype |
4502 E_Ordinary_Fixed_Point_Subtype |
4503 E_Decimal_Fixed_Point_Subtype |
4508 E_Record_Subtype_With_Private |
4509 E_Limited_Private_Subtype |
4511 E_Protected_Subtype |
4513 E_String_Literal_Subtype |
4514 E_Class_Wide_Subtype =>
4522 -------------------------
4523 -- Component_Alignment --
4524 -------------------------
4526 -- Component Alignment is encoded using two flags, Flag128/129 as
4527 -- follows. Note that both flags False = Align_Default, so that the
4528 -- default initialization of flags to False initializes component
4529 -- alignment to the default value as required.
4531 -- Flag128 Flag129 Value
4532 -- ------- ------- -----
4533 -- False False Calign_Default
4534 -- False True Calign_Component_Size
4535 -- True False Calign_Component_Size_4
4536 -- True True Calign_Storage_Unit
4538 function Component_Alignment (Id : E) return C is
4539 BT : constant Node_Id := Base_Type (Id);
4542 pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id));
4544 if Flag128 (BT) then
4545 if Flag129 (BT) then
4546 return Calign_Storage_Unit;
4548 return Calign_Component_Size_4;
4552 if Flag129 (BT) then
4553 return Calign_Component_Size;
4555 return Calign_Default;
4558 end Component_Alignment;
4560 --------------------
4561 -- Constant_Value --
4562 --------------------
4564 function Constant_Value (Id : E) return N is
4565 D : constant Node_Id := Declaration_Node (Id);
4569 -- If we have no declaration node, then return no constant value.
4570 -- Not clear how this can happen, but it does sometimes ???
4571 -- To investigate, remove this check and compile discrim_po.adb.
4576 -- Normal case where a declaration node is present
4578 elsif Nkind (D) = N_Object_Renaming_Declaration then
4579 return Renamed_Object (Id);
4581 -- If this is a component declaration whose entity is constant, it
4582 -- is a prival within a protected function. It does not have
4583 -- a constant value.
4585 elsif Nkind (D) = N_Component_Declaration then
4588 -- If there is an expression, return it
4590 elsif Present (Expression (D)) then
4591 return (Expression (D));
4593 -- For a constant, see if we have a full view
4595 elsif Ekind (Id) = E_Constant
4596 and then Present (Full_View (Id))
4598 Full_D := Parent (Full_View (Id));
4600 -- The full view may have been rewritten as an object renaming.
4602 if Nkind (Full_D) = N_Object_Renaming_Declaration then
4603 return Name (Full_D);
4605 return Expression (Full_D);
4608 -- Otherwise we have no expression to return
4615 ----------------------
4616 -- Declaration_Node --
4617 ----------------------
4619 function Declaration_Node (Id : E) return N is
4623 if Ekind (Id) = E_Incomplete_Type
4624 and then Present (Full_View (Id))
4626 P := Parent (Full_View (Id));
4632 if Nkind (P) /= N_Selected_Component
4633 and then Nkind (P) /= N_Expanded_Name
4635 not (Nkind (P) = N_Defining_Program_Unit_Name
4636 and then Is_Child_Unit (Id))
4644 end Declaration_Node;
4646 ---------------------
4647 -- Designated_Type --
4648 ---------------------
4650 function Designated_Type (Id : E) return E is
4654 Desig_Type := Directly_Designated_Type (Id);
4656 if Ekind (Desig_Type) = E_Incomplete_Type
4657 and then Present (Full_View (Desig_Type))
4659 return Full_View (Desig_Type);
4661 elsif Is_Class_Wide_Type (Desig_Type)
4662 and then Ekind (Etype (Desig_Type)) = E_Incomplete_Type
4663 and then Present (Full_View (Etype (Desig_Type)))
4664 and then Present (Class_Wide_Type (Full_View (Etype (Desig_Type))))
4666 return Class_Wide_Type (Full_View (Etype (Desig_Type)));
4671 end Designated_Type;
4673 -----------------------------
4674 -- Enclosing_Dynamic_Scope --
4675 -----------------------------
4677 function Enclosing_Dynamic_Scope (Id : E) return E is
4682 while S /= Standard_Standard
4683 and then not Is_Dynamic_Scope (S)
4689 end Enclosing_Dynamic_Scope;
4691 ----------------------
4692 -- Entry_Index_Type --
4693 ----------------------
4695 function Entry_Index_Type (Id : E) return N is
4697 pragma Assert (Ekind (Id) = E_Entry_Family);
4698 return Etype (Discrete_Subtype_Definition (Parent (Id)));
4699 end Entry_Index_Type;
4701 ---------------------
4703 ---------------------
4705 function First_Component (Id : E) return E is
4710 (Is_Record_Type (Id) or else Is_Incomplete_Or_Private_Type (Id));
4712 Comp_Id := First_Entity (Id);
4713 while Present (Comp_Id) loop
4714 exit when Ekind (Comp_Id) = E_Component;
4715 Comp_Id := Next_Entity (Comp_Id);
4719 end First_Component;
4721 ------------------------
4722 -- First_Discriminant --
4723 ------------------------
4725 function First_Discriminant (Id : E) return E is
4730 (Has_Discriminants (Id)
4731 or else Has_Unknown_Discriminants (Id));
4733 Ent := First_Entity (Id);
4735 -- The discriminants are not necessarily contiguous, because access
4736 -- discriminants will generate itypes. They are not the first entities
4737 -- either, because tag and controller record must be ahead of them.
4739 if Chars (Ent) = Name_uTag then
4740 Ent := Next_Entity (Ent);
4743 if Chars (Ent) = Name_uController then
4744 Ent := Next_Entity (Ent);
4747 -- Skip all hidden stored discriminants if any.
4749 while Present (Ent) loop
4750 exit when Ekind (Ent) = E_Discriminant
4751 and then not Is_Completely_Hidden (Ent);
4753 Ent := Next_Entity (Ent);
4756 pragma Assert (Ekind (Ent) = E_Discriminant);
4759 end First_Discriminant;
4765 function First_Formal (Id : E) return E is
4770 (Is_Overloadable (Id)
4771 or else Ekind (Id) = E_Entry_Family
4772 or else Ekind (Id) = E_Subprogram_Body
4773 or else Ekind (Id) = E_Subprogram_Type);
4775 if Ekind (Id) = E_Enumeration_Literal then
4779 Formal := First_Entity (Id);
4781 if Present (Formal) and then Is_Formal (Formal) then
4789 -------------------------------
4790 -- First_Stored_Discriminant --
4791 -------------------------------
4793 function First_Stored_Discriminant (Id : E) return E is
4796 function Has_Completely_Hidden_Discriminant (Id : E) return Boolean;
4797 -- Scans the Discriminants to see whether any are Completely_Hidden
4798 -- (the mechanism for describing non-specified stored discriminants)
4800 function Has_Completely_Hidden_Discriminant (Id : E) return Boolean is
4801 Ent : Entity_Id := Id;
4804 pragma Assert (Ekind (Id) = E_Discriminant);
4806 while Present (Ent) and then Ekind (Ent) = E_Discriminant loop
4808 if Is_Completely_Hidden (Ent) then
4812 Ent := Next_Entity (Ent);
4816 end Has_Completely_Hidden_Discriminant;
4818 -- Start of processing for First_Stored_Discriminant
4822 (Has_Discriminants (Id)
4823 or else Has_Unknown_Discriminants (Id));
4825 Ent := First_Entity (Id);
4827 if Chars (Ent) = Name_uTag then
4828 Ent := Next_Entity (Ent);
4831 if Chars (Ent) = Name_uController then
4832 Ent := Next_Entity (Ent);
4835 if Has_Completely_Hidden_Discriminant (Ent) then
4837 while Present (Ent) loop
4838 exit when Is_Completely_Hidden (Ent);
4839 Ent := Next_Entity (Ent);
4844 pragma Assert (Ekind (Ent) = E_Discriminant);
4847 end First_Stored_Discriminant;
4853 function First_Subtype (Id : E) return E is
4854 B : constant Entity_Id := Base_Type (Id);
4855 F : constant Node_Id := Freeze_Node (B);
4859 -- If the base type has no freeze node, it is a type in standard,
4860 -- and always acts as its own first subtype unless it is one of
4861 -- the predefined integer types. If the type is formal, it is also
4862 -- a first subtype, and its base type has no freeze node. On the other
4863 -- hand, a subtype of a generic formal is not its own first_subtype.
4864 -- Its base type, if anonymous, is attached to the formal type decl.
4865 -- from which the first subtype is obtained.
4869 if B = Base_Type (Standard_Integer) then
4870 return Standard_Integer;
4872 elsif B = Base_Type (Standard_Long_Integer) then
4873 return Standard_Long_Integer;
4875 elsif B = Base_Type (Standard_Short_Short_Integer) then
4876 return Standard_Short_Short_Integer;
4878 elsif B = Base_Type (Standard_Short_Integer) then
4879 return Standard_Short_Integer;
4881 elsif B = Base_Type (Standard_Long_Long_Integer) then
4882 return Standard_Long_Long_Integer;
4884 elsif Is_Generic_Type (Id) then
4885 if Present (Parent (B)) then
4886 return Defining_Identifier (Parent (B));
4888 return Defining_Identifier (Associated_Node_For_Itype (B));
4895 -- Otherwise we check the freeze node, if it has a First_Subtype_Link
4896 -- then we use that link, otherwise (happens with some Itypes), we use
4897 -- the base type itself.
4900 Ent := First_Subtype_Link (F);
4902 if Present (Ent) then
4910 -------------------------------------
4911 -- Get_Attribute_Definition_Clause --
4912 -------------------------------------
4914 function Get_Attribute_Definition_Clause
4922 N := First_Rep_Item (E);
4923 while Present (N) loop
4924 if Nkind (N) = N_Attribute_Definition_Clause
4925 and then Get_Attribute_Id (Chars (N)) = Id
4934 end Get_Attribute_Definition_Clause;
4936 --------------------
4937 -- Get_Rep_Pragma --
4938 --------------------
4940 function Get_Rep_Pragma (E : Entity_Id; Nam : Name_Id) return Node_Id is
4945 N := First_Rep_Item (E);
4947 while Present (N) loop
4948 if Nkind (N) = N_Pragma and then Chars (N) = Nam then
4950 if Nam = Name_Stream_Convert then
4952 -- For tagged types this pragma is not inherited, so we
4953 -- must verify that it is defined for the given type and
4956 Typ := Entity (Expression
4957 (First (Pragma_Argument_Associations (N))));
4959 if not Is_Tagged_Type (E)
4961 or else (Is_Private_Type (Typ)
4962 and then E = Full_View (Typ))
4980 ------------------------
4981 -- Has_Attach_Handler --
4982 ------------------------
4984 function Has_Attach_Handler (Id : E) return B is
4988 pragma Assert (Is_Protected_Type (Id));
4990 Ritem := First_Rep_Item (Id);
4991 while Present (Ritem) loop
4992 if Nkind (Ritem) = N_Pragma
4993 and then Chars (Ritem) = Name_Attach_Handler
4997 Ritem := Next_Rep_Item (Ritem);
5002 end Has_Attach_Handler;
5008 function Has_Entries (Id : E) return B is
5009 Result : Boolean := False;
5013 pragma Assert (Is_Concurrent_Type (Id));
5014 Ent := First_Entity (Id);
5016 while Present (Ent) loop
5017 if Is_Entry (Ent) then
5022 Ent := Next_Entity (Ent);
5028 ----------------------------
5029 -- Has_Foreign_Convention --
5030 ----------------------------
5032 function Has_Foreign_Convention (Id : E) return B is
5034 return Convention (Id) >= Foreign_Convention'First;
5035 end Has_Foreign_Convention;
5037 ---------------------------
5038 -- Has_Interrupt_Handler --
5039 ---------------------------
5041 function Has_Interrupt_Handler (Id : E) return B is
5045 pragma Assert (Is_Protected_Type (Id));
5047 Ritem := First_Rep_Item (Id);
5048 while Present (Ritem) loop
5049 if Nkind (Ritem) = N_Pragma
5050 and then Chars (Ritem) = Name_Interrupt_Handler
5054 Ritem := Next_Rep_Item (Ritem);
5059 end Has_Interrupt_Handler;
5061 --------------------------
5062 -- Has_Private_Ancestor --
5063 --------------------------
5065 function Has_Private_Ancestor (Id : E) return B is
5066 R : constant Entity_Id := Root_Type (Id);
5067 T1 : Entity_Id := Id;
5071 if Is_Private_Type (T1) then
5081 end Has_Private_Ancestor;
5083 ------------------------------
5084 -- Implementation_Base_Type --
5085 ------------------------------
5087 function Implementation_Base_Type (Id : E) return E is
5092 Bastyp := Base_Type (Id);
5094 if Is_Incomplete_Or_Private_Type (Bastyp) then
5095 Imptyp := Underlying_Type (Bastyp);
5097 -- If we have an implementation type, then just return it,
5098 -- otherwise we return the Base_Type anyway. This can only
5099 -- happen in error situations and should avoid some error bombs.
5101 if Present (Imptyp) then
5102 return Base_Type (Imptyp);
5110 end Implementation_Base_Type;
5112 -----------------------
5113 -- Is_Always_Inlined --
5114 -----------------------
5116 function Is_Always_Inlined (Id : E) return B is
5120 Item := First_Rep_Item (Id);
5122 while Present (Item) loop
5123 if Nkind (Item) = N_Pragma
5124 and then Get_Pragma_Id (Chars (Item)) = Pragma_Inline_Always
5129 Next_Rep_Item (Item);
5133 end Is_Always_Inlined;
5135 ---------------------
5136 -- Is_Boolean_Type --
5137 ---------------------
5139 function Is_Boolean_Type (Id : E) return B is
5141 return Root_Type (Id) = Standard_Boolean;
5142 end Is_Boolean_Type;
5144 ---------------------
5145 -- Is_By_Copy_Type --
5146 ---------------------
5148 function Is_By_Copy_Type (Id : E) return B is
5150 -- If Id is a private type whose full declaration has not been seen,
5151 -- we assume for now that it is not a By_Copy type. Clearly this
5152 -- attribute should not be used before the type is frozen, but it is
5153 -- needed to build the associated record of a protected type. Another
5154 -- place where some lookahead for a full view is needed ???
5157 Is_Elementary_Type (Id)
5158 or else (Is_Private_Type (Id)
5159 and then Present (Underlying_Type (Id))
5160 and then Is_Elementary_Type (Underlying_Type (Id)));
5161 end Is_By_Copy_Type;
5163 --------------------------
5164 -- Is_By_Reference_Type --
5165 --------------------------
5167 function Is_By_Reference_Type (Id : E) return B is
5168 Btype : constant Entity_Id := Base_Type (Id);
5171 if Error_Posted (Id)
5172 or else Error_Posted (Btype)
5176 elsif Is_Private_Type (Btype) then
5178 Utyp : constant Entity_Id := Underlying_Type (Btype);
5184 return Is_By_Reference_Type (Utyp);
5188 elsif Is_Concurrent_Type (Btype) then
5191 elsif Is_Record_Type (Btype) then
5192 if Is_Limited_Record (Btype)
5193 or else Is_Tagged_Type (Btype)
5194 or else Is_Volatile (Btype)
5200 C : Entity_Id := First_Component (Btype);
5203 while Present (C) loop
5204 if Is_By_Reference_Type (Etype (C))
5205 or else Is_Volatile (Etype (C))
5210 C := Next_Component (C);
5217 elsif Is_Array_Type (Btype) then
5220 or else Is_By_Reference_Type (Component_Type (Btype))
5221 or else Is_Volatile (Component_Type (Btype))
5222 or else Has_Volatile_Components (Btype);
5227 end Is_By_Reference_Type;
5229 ---------------------
5230 -- Is_Derived_Type --
5231 ---------------------
5233 function Is_Derived_Type (Id : E) return B is
5237 if Base_Type (Id) /= Root_Type (Id)
5238 and then not Is_Generic_Type (Id)
5239 and then not Is_Class_Wide_Type (Id)
5241 if not Is_Numeric_Type (Root_Type (Id)) then
5245 Par := Parent (First_Subtype (Id));
5247 return Present (Par)
5248 and then Nkind (Par) = N_Full_Type_Declaration
5249 and then Nkind (Type_Definition (Par))
5250 = N_Derived_Type_Definition;
5256 end Is_Derived_Type;
5258 ----------------------
5259 -- Is_Dynamic_Scope --
5260 ----------------------
5262 function Is_Dynamic_Scope (Id : E) return B is
5265 Ekind (Id) = E_Block
5267 Ekind (Id) = E_Function
5269 Ekind (Id) = E_Procedure
5271 Ekind (Id) = E_Subprogram_Body
5273 Ekind (Id) = E_Task_Type
5275 Ekind (Id) = E_Entry
5277 Ekind (Id) = E_Entry_Family;
5278 end Is_Dynamic_Scope;
5280 --------------------
5281 -- Is_Entity_Name --
5282 --------------------
5284 function Is_Entity_Name (N : Node_Id) return Boolean is
5285 Kind : constant Node_Kind := Nkind (N);
5288 -- Identifiers, operator symbols, expanded names are entity names
5290 return Kind = N_Identifier
5291 or else Kind = N_Operator_Symbol
5292 or else Kind = N_Expanded_Name
5294 -- Attribute references are entity names if they refer to an entity.
5295 -- Note that we don't do this by testing for the presence of the
5296 -- Entity field in the N_Attribute_Reference node, since it may not
5297 -- have been set yet.
5299 or else (Kind = N_Attribute_Reference
5300 and then Is_Entity_Attribute_Name (Attribute_Name (N)));
5303 ---------------------------
5304 -- Is_Indefinite_Subtype --
5305 ---------------------------
5307 function Is_Indefinite_Subtype (Id : Entity_Id) return B is
5308 K : constant Entity_Kind := Ekind (Id);
5311 if Is_Constrained (Id) then
5314 elsif K in Array_Kind
5315 or else K in Class_Wide_Kind
5316 or else Has_Unknown_Discriminants (Id)
5320 -- Known discriminants: indefinite if there are no default values
5322 elsif K in Record_Kind
5323 or else Is_Incomplete_Or_Private_Type (Id)
5324 or else Is_Concurrent_Type (Id)
5326 return (Has_Discriminants (Id)
5327 and then No (Discriminant_Default_Value (First_Discriminant (Id))));
5332 end Is_Indefinite_Subtype;
5334 ---------------------
5335 -- Is_Limited_Type --
5336 ---------------------
5338 function Is_Limited_Type (Id : E) return B is
5339 Btype : constant E := Base_Type (Id);
5342 if not Is_Type (Id) then
5345 elsif Ekind (Btype) = E_Limited_Private_Type
5346 or else Is_Limited_Composite (Btype)
5350 elsif Is_Concurrent_Type (Btype) then
5353 -- Otherwise we will look around to see if there is some other reason
5354 -- for it to be limited, except that if an error was posted on the
5355 -- entity, then just assume it is non-limited, because it can cause
5356 -- trouble to recurse into a murky erroneous entity!
5358 elsif Error_Posted (Id) then
5361 elsif Is_Record_Type (Btype) then
5362 if Is_Limited_Record (Root_Type (Btype)) then
5365 elsif Is_Class_Wide_Type (Btype) then
5366 return Is_Limited_Type (Root_Type (Btype));
5370 C : E := First_Component (Btype);
5373 while Present (C) loop
5374 if Is_Limited_Type (Etype (C)) then
5378 C := Next_Component (C);
5385 elsif Is_Array_Type (Btype) then
5386 return Is_Limited_Type (Component_Type (Btype));
5391 end Is_Limited_Type;
5397 function Is_Package (Id : E) return B is
5400 Ekind (Id) = E_Package
5402 Ekind (Id) = E_Generic_Package;
5405 --------------------------
5406 -- Is_Protected_Private --
5407 --------------------------
5409 function Is_Protected_Private (Id : E) return B is
5411 pragma Assert (Ekind (Id) = E_Component);
5412 return Is_Protected_Type (Scope (Id));
5413 end Is_Protected_Private;
5415 ------------------------------
5416 -- Is_Protected_Record_Type --
5417 ------------------------------
5419 function Is_Protected_Record_Type (Id : E) return B is
5422 Is_Concurrent_Record_Type (Id)
5423 and then Is_Protected_Type (Corresponding_Concurrent_Type (Id));
5424 end Is_Protected_Record_Type;
5426 ---------------------------------
5427 -- Is_Return_By_Reference_Type --
5428 ---------------------------------
5430 function Is_Return_By_Reference_Type (Id : E) return B is
5431 Btype : constant Entity_Id := Base_Type (Id);
5434 if Is_Private_Type (Btype) then
5436 Utyp : constant Entity_Id := Underlying_Type (Btype);
5442 return Is_Return_By_Reference_Type (Utyp);
5446 elsif Is_Concurrent_Type (Btype) then
5449 elsif Is_Record_Type (Btype) then
5450 if Is_Limited_Record (Btype) then
5453 elsif Is_Class_Wide_Type (Btype) then
5454 return Is_Return_By_Reference_Type (Root_Type (Btype));
5458 C : Entity_Id := First_Component (Btype);
5461 while Present (C) loop
5462 if Is_Return_By_Reference_Type (Etype (C)) then
5466 C := Next_Component (C);
5473 elsif Is_Array_Type (Btype) then
5474 return Is_Return_By_Reference_Type (Component_Type (Btype));
5479 end Is_Return_By_Reference_Type;
5481 --------------------
5482 -- Is_String_Type --
5483 --------------------
5485 function Is_String_Type (Id : E) return B is
5487 return Ekind (Id) in String_Kind
5488 or else (Is_Array_Type (Id)
5489 and then Number_Dimensions (Id) = 1
5490 and then Is_Character_Type (Component_Type (Id)));
5493 -------------------------
5494 -- Is_Task_Record_Type --
5495 -------------------------
5497 function Is_Task_Record_Type (Id : E) return B is
5500 Is_Concurrent_Record_Type (Id)
5501 and then Is_Task_Type (Corresponding_Concurrent_Type (Id));
5502 end Is_Task_Record_Type;
5504 ------------------------
5505 -- Is_Wrapper_Package --
5506 ------------------------
5508 function Is_Wrapper_Package (Id : E) return B is
5510 return (Ekind (Id) = E_Package
5511 and then Present (Related_Instance (Id)));
5512 end Is_Wrapper_Package;
5514 --------------------
5515 -- Next_Component --
5516 --------------------
5518 function Next_Component (Id : E) return E is
5522 Comp_Id := Next_Entity (Id);
5524 while Present (Comp_Id) loop
5525 exit when Ekind (Comp_Id) = E_Component;
5526 Comp_Id := Next_Entity (Comp_Id);
5532 -----------------------
5533 -- Next_Discriminant --
5534 -----------------------
5536 -- This function actually implements both Next_Discriminant and
5537 -- Next_Stored_Discriminant by making sure that the Discriminant
5538 -- returned is of the same variety as Id.
5540 function Next_Discriminant (Id : E) return E is
5542 -- Derived Tagged types with private extensions look like this...
5544 -- E_Discriminant d1
5545 -- E_Discriminant d2
5547 -- E_Discriminant d1
5548 -- E_Discriminant d2
5551 -- so it is critical not to go past the leading discriminants.
5556 pragma Assert (Ekind (Id) = E_Discriminant);
5559 D := Next_Entity (D);
5561 or else (Ekind (D) /= E_Discriminant
5562 and then not Is_Itype (D))
5567 exit when Ekind (D) = E_Discriminant
5568 and then (Is_Completely_Hidden (D) = Is_Completely_Hidden (Id));
5572 end Next_Discriminant;
5578 function Next_Formal (Id : E) return E is
5582 -- Follow the chain of declared entities as long as the kind of
5583 -- the entity corresponds to a formal parameter. Skip internal
5584 -- entities that may have been created for implicit subtypes,
5585 -- in the process of analyzing default expressions.
5590 P := Next_Entity (P);
5592 if No (P) or else Is_Formal (P) then
5594 elsif not Is_Internal (P) then
5600 -----------------------------
5601 -- Next_Formal_With_Extras --
5602 -----------------------------
5604 function Next_Formal_With_Extras (Id : E) return E is
5606 if Present (Extra_Formal (Id)) then
5607 return Extra_Formal (Id);
5609 return Next_Formal (Id);
5611 end Next_Formal_With_Extras;
5617 function Next_Index (Id : Node_Id) return Node_Id is
5626 function Next_Literal (Id : E) return E is
5628 pragma Assert (Nkind (Id) in N_Entity);
5632 ------------------------------
5633 -- Next_Stored_Discriminant --
5634 ------------------------------
5636 function Next_Stored_Discriminant (Id : E) return E is
5638 -- See comment in Next_Discriminant
5640 return Next_Discriminant (Id);
5641 end Next_Stored_Discriminant;
5643 -----------------------
5644 -- Number_Dimensions --
5645 -----------------------
5647 function Number_Dimensions (Id : E) return Pos is
5652 if Ekind (Id) in String_Kind then
5657 T := First_Index (Id);
5659 while Present (T) loop
5666 end Number_Dimensions;
5668 --------------------------
5669 -- Number_Discriminants --
5670 --------------------------
5672 function Number_Discriminants (Id : E) return Pos is
5678 Discr := First_Discriminant (Id);
5680 while Present (Discr) loop
5682 Discr := Next_Discriminant (Discr);
5686 end Number_Discriminants;
5688 --------------------
5689 -- Number_Entries --
5690 --------------------
5692 function Number_Entries (Id : E) return Nat is
5697 pragma Assert (Is_Concurrent_Type (Id));
5699 Ent := First_Entity (Id);
5701 while Present (Ent) loop
5702 if Is_Entry (Ent) then
5706 Ent := Next_Entity (Ent);
5712 --------------------
5713 -- Number_Formals --
5714 --------------------
5716 function Number_Formals (Id : E) return Pos is
5722 Formal := First_Formal (Id);
5724 while Present (Formal) loop
5726 Formal := Next_Formal (Formal);
5732 --------------------
5733 -- Parameter_Mode --
5734 --------------------
5736 function Parameter_Mode (Id : E) return Formal_Kind is
5745 function Root_Type (Id : E) return E is
5749 pragma Assert (Nkind (Id) in N_Entity);
5751 T := Base_Type (Id);
5753 if Ekind (T) = E_Class_Wide_Type then
5765 -- Following test catches some error cases resulting from
5768 elsif No (Etyp) then
5771 elsif Is_Private_Type (T) and then Etyp = Full_View (T) then
5774 elsif Is_Private_Type (Etyp) and then Full_View (Etyp) = T then
5780 -- Return if there is a circularity in the inheritance chain.
5781 -- This happens in some error situations and we do not want
5782 -- to get stuck in this loop.
5784 if T = Base_Type (Id) then
5790 raise Program_Error;
5797 function Scope_Depth (Id : E) return Uint is
5798 Scop : Entity_Id := Id;
5801 while Is_Record_Type (Scop) loop
5802 Scop := Scope (Scop);
5805 return Scope_Depth_Value (Scop);
5808 ---------------------
5809 -- Scope_Depth_Set --
5810 ---------------------
5812 function Scope_Depth_Set (Id : E) return B is
5814 return not Is_Record_Type (Id)
5815 and then Field22 (Id) /= Union_Id (Empty);
5816 end Scope_Depth_Set;
5818 -----------------------------
5819 -- Set_Component_Alignment --
5820 -----------------------------
5822 -- Component Alignment is encoded using two flags, Flag128/129 as
5823 -- follows. Note that both flags False = Align_Default, so that the
5824 -- default initialization of flags to False initializes component
5825 -- alignment to the default value as required.
5827 -- Flag128 Flag129 Value
5828 -- ------- ------- -----
5829 -- False False Calign_Default
5830 -- False True Calign_Component_Size
5831 -- True False Calign_Component_Size_4
5832 -- True True Calign_Storage_Unit
5834 procedure Set_Component_Alignment (Id : E; V : C) is
5836 pragma Assert ((Is_Array_Type (Id) or else Is_Record_Type (Id))
5837 and then Id = Base_Type (Id));
5840 when Calign_Default =>
5841 Set_Flag128 (Id, False);
5842 Set_Flag129 (Id, False);
5844 when Calign_Component_Size =>
5845 Set_Flag128 (Id, False);
5846 Set_Flag129 (Id, True);
5848 when Calign_Component_Size_4 =>
5849 Set_Flag128 (Id, True);
5850 Set_Flag129 (Id, False);
5852 when Calign_Storage_Unit =>
5853 Set_Flag128 (Id, True);
5854 Set_Flag129 (Id, True);
5856 end Set_Component_Alignment;
5862 function Size_Clause (Id : E) return N is
5866 Ritem := First_Rep_Item (Id);
5867 while Present (Ritem) loop
5868 if Nkind (Ritem) = N_Attribute_Definition_Clause
5869 and then Chars (Ritem) = Name_Size
5873 Ritem := Next_Rep_Item (Ritem);
5884 function Subtype_Kind (K : Entity_Kind) return Entity_Kind is
5890 Kind := E_Access_Subtype;
5894 Kind := E_Array_Subtype;
5896 when E_Class_Wide_Type |
5897 E_Class_Wide_Subtype =>
5898 Kind := E_Class_Wide_Subtype;
5900 when E_Decimal_Fixed_Point_Type |
5901 E_Decimal_Fixed_Point_Subtype =>
5902 Kind := E_Decimal_Fixed_Point_Subtype;
5904 when E_Ordinary_Fixed_Point_Type |
5905 E_Ordinary_Fixed_Point_Subtype =>
5906 Kind := E_Ordinary_Fixed_Point_Subtype;
5908 when E_Private_Type |
5909 E_Private_Subtype =>
5910 Kind := E_Private_Subtype;
5912 when E_Limited_Private_Type |
5913 E_Limited_Private_Subtype =>
5914 Kind := E_Limited_Private_Subtype;
5916 when E_Record_Type_With_Private |
5917 E_Record_Subtype_With_Private =>
5918 Kind := E_Record_Subtype_With_Private;
5920 when E_Record_Type |
5922 Kind := E_Record_Subtype;
5924 when E_String_Type |
5926 Kind := E_String_Subtype;
5928 when Enumeration_Kind =>
5929 Kind := E_Enumeration_Subtype;
5932 Kind := E_Floating_Point_Subtype;
5934 when Signed_Integer_Kind =>
5935 Kind := E_Signed_Integer_Subtype;
5937 when Modular_Integer_Kind =>
5938 Kind := E_Modular_Integer_Subtype;
5940 when Protected_Kind =>
5941 Kind := E_Protected_Subtype;
5944 Kind := E_Task_Subtype;
5948 raise Program_Error;
5958 function Tag_Component (Id : E) return E is
5960 Typ : Entity_Id := Id;
5963 pragma Assert (Is_Tagged_Type (Typ));
5965 if Is_Class_Wide_Type (Typ) then
5966 Typ := Root_Type (Typ);
5969 if Is_Private_Type (Typ) then
5970 Typ := Underlying_Type (Typ);
5973 Comp := First_Entity (Typ);
5974 while Present (Comp) loop
5975 if Is_Tag (Comp) then
5979 Comp := Next_Entity (Comp);
5982 -- No tag component found
5987 ---------------------
5988 -- Type_High_Bound --
5989 ---------------------
5991 function Type_High_Bound (Id : E) return Node_Id is
5993 if Nkind (Scalar_Range (Id)) = N_Subtype_Indication then
5994 return High_Bound (Range_Expression (Constraint (Scalar_Range (Id))));
5996 return High_Bound (Scalar_Range (Id));
5998 end Type_High_Bound;
6000 --------------------
6001 -- Type_Low_Bound --
6002 --------------------
6004 function Type_Low_Bound (Id : E) return Node_Id is
6006 if Nkind (Scalar_Range (Id)) = N_Subtype_Indication then
6007 return Low_Bound (Range_Expression (Constraint (Scalar_Range (Id))));
6009 return Low_Bound (Scalar_Range (Id));
6013 ---------------------
6014 -- Underlying_Type --
6015 ---------------------
6017 function Underlying_Type (Id : E) return E is
6019 -- For record_with_private the underlying type is always the direct
6020 -- full view. Never try to take the full view of the parent it
6021 -- doesn't make sense.
6023 if Ekind (Id) = E_Record_Type_With_Private then
6024 return Full_View (Id);
6026 elsif Ekind (Id) in Incomplete_Or_Private_Kind then
6028 -- If we have an incomplete or private type with a full view,
6029 -- then we return the Underlying_Type of this full view
6031 if Present (Full_View (Id)) then
6032 if Id = Full_View (Id) then
6034 -- Previous error in declaration
6039 return Underlying_Type (Full_View (Id));
6042 -- Otherwise check for the case where we have a derived type or
6043 -- subtype, and if so get the Underlying_Type of the parent type.
6045 elsif Etype (Id) /= Id then
6046 return Underlying_Type (Etype (Id));
6048 -- Otherwise we have an incomplete or private type that has
6049 -- no full view, which means that we have not encountered the
6050 -- completion, so return Empty to indicate the underlying type
6051 -- is not yet known.
6057 -- For non-incomplete, non-private types, return the type itself
6058 -- Also for entities that are not types at all return the entity
6064 end Underlying_Type;
6066 ------------------------
6067 -- Write_Entity_Flags --
6068 ------------------------
6070 procedure Write_Entity_Flags (Id : Entity_Id; Prefix : String) is
6072 procedure W (Flag_Name : String; Flag : Boolean);
6073 -- Write out given flag if it is set
6075 procedure W (Flag_Name : String; Flag : Boolean) is
6079 Write_Str (Flag_Name);
6080 Write_Str (" = True");
6085 -- Start of processing for Write_Entity_Flags
6088 if (Is_Array_Type (Id) or else Is_Record_Type (Id))
6089 and then Base_Type (Id) = Id
6092 Write_Str ("Component_Alignment = ");
6094 case Component_Alignment (Id) is
6095 when Calign_Default =>
6096 Write_Str ("Calign_Default");
6098 when Calign_Component_Size =>
6099 Write_Str ("Calign_Component_Size");
6101 when Calign_Component_Size_4 =>
6102 Write_Str ("Calign_Component_Size_4");
6104 when Calign_Storage_Unit =>
6105 Write_Str ("Calign_Storage_Unit");
6111 W ("Address_Taken", Flag104 (Id));
6112 W ("Body_Needed_For_SAL", Flag40 (Id));
6113 W ("C_Pass_By_Copy", Flag125 (Id));
6114 W ("Can_Never_Be_Null", Flag38 (Id));
6115 W ("Checks_May_Be_Suppressed", Flag31 (Id));
6116 W ("Debug_Info_Off", Flag166 (Id));
6117 W ("Default_Expressions_Processed", Flag108 (Id));
6118 W ("Delay_Cleanups", Flag114 (Id));
6119 W ("Delay_Subprogram_Descriptors", Flag50 (Id));
6120 W ("Depends_On_Private", Flag14 (Id));
6121 W ("Discard_Names", Flag88 (Id));
6122 W ("Elaborate_All_Desirable", Flag146 (Id));
6123 W ("Elaboration_Entity_Required", Flag174 (Id));
6124 W ("Entry_Accepted", Flag152 (Id));
6125 W ("Finalize_Storage_Only", Flag158 (Id));
6126 W ("From_With_Type", Flag159 (Id));
6127 W ("Function_Returns_With_DSP", Flag169 (Id));
6128 W ("Has_Aliased_Components", Flag135 (Id));
6129 W ("Has_Alignment_Clause", Flag46 (Id));
6130 W ("Has_All_Calls_Remote", Flag79 (Id));
6131 W ("Has_Atomic_Components", Flag86 (Id));
6132 W ("Has_Biased_Representation", Flag139 (Id));
6133 W ("Has_Completion", Flag26 (Id));
6134 W ("Has_Completion_In_Body", Flag71 (Id));
6135 W ("Has_Complex_Representation", Flag140 (Id));
6136 W ("Has_Component_Size_Clause", Flag68 (Id));
6137 W ("Has_Contiguous_Rep", Flag181 (Id));
6138 W ("Has_Controlled_Component", Flag43 (Id));
6139 W ("Has_Controlling_Result", Flag98 (Id));
6140 W ("Has_Convention_Pragma", Flag119 (Id));
6141 W ("Has_Delayed_Freeze", Flag18 (Id));
6142 W ("Has_Discriminants", Flag5 (Id));
6143 W ("Has_Enumeration_Rep_Clause", Flag66 (Id));
6144 W ("Has_Exit", Flag47 (Id));
6145 W ("Has_External_Tag_Rep_Clause", Flag110 (Id));
6146 W ("Has_Forward_Instantiation", Flag175 (Id));
6147 W ("Has_Fully_Qualified_Name", Flag173 (Id));
6148 W ("Has_Gigi_Rep_Item", Flag82 (Id));
6149 W ("Has_Homonym", Flag56 (Id));
6150 W ("Has_Machine_Radix_Clause", Flag83 (Id));
6151 W ("Has_Master_Entity", Flag21 (Id));
6152 W ("Has_Missing_Return", Flag142 (Id));
6153 W ("Has_Nested_Block_With_Handler", Flag101 (Id));
6154 W ("Has_Non_Standard_Rep", Flag75 (Id));
6155 W ("Has_Object_Size_Clause", Flag172 (Id));
6156 W ("Has_Per_Object_Constraint", Flag154 (Id));
6157 W ("Has_Pragma_Controlled", Flag27 (Id));
6158 W ("Has_Pragma_Elaborate_Body", Flag150 (Id));
6159 W ("Has_Pragma_Inline", Flag157 (Id));
6160 W ("Has_Pragma_Pack", Flag121 (Id));
6161 W ("Has_Pragma_Pure_Function", Flag179 (Id));
6162 W ("Has_Pragma_Unreferenced", Flag180 (Id));
6163 W ("Has_Primitive_Operations", Flag120 (Id));
6164 W ("Has_Private_Declaration", Flag155 (Id));
6165 W ("Has_Qualified_Name", Flag161 (Id));
6166 W ("Has_Record_Rep_Clause", Flag65 (Id));
6167 W ("Has_Recursive_Call", Flag143 (Id));
6168 W ("Has_Size_Clause", Flag29 (Id));
6169 W ("Has_Small_Clause", Flag67 (Id));
6170 W ("Has_Specified_Layout", Flag100 (Id));
6171 W ("Has_Storage_Size_Clause", Flag23 (Id));
6172 W ("Has_Subprogram_Descriptor", Flag93 (Id));
6173 W ("Has_Task", Flag30 (Id));
6174 W ("Has_Unchecked_Union", Flag123 (Id));
6175 W ("Has_Unknown_Discriminants", Flag72 (Id));
6176 W ("Has_Volatile_Components", Flag87 (Id));
6177 W ("Has_Xref_Entry", Flag182 (Id));
6178 W ("In_Package_Body", Flag48 (Id));
6179 W ("In_Private_Part", Flag45 (Id));
6180 W ("In_Use", Flag8 (Id));
6181 W ("Is_AST_Entry", Flag132 (Id));
6182 W ("Is_Abstract", Flag19 (Id));
6183 W ("Is_Access_Constant", Flag69 (Id));
6184 W ("Is_Aliased", Flag15 (Id));
6185 W ("Is_Asynchronous", Flag81 (Id));
6186 W ("Is_Atomic", Flag85 (Id));
6187 W ("Is_Bit_Packed_Array", Flag122 (Id));
6188 W ("Is_CPP_Class", Flag74 (Id));
6189 W ("Is_Called", Flag102 (Id));
6190 W ("Is_Character_Type", Flag63 (Id));
6191 W ("Is_Child_Unit", Flag73 (Id));
6192 W ("Is_Class_Wide_Equivalent_Type", Flag35 (Id));
6193 W ("Is_Compilation_Unit", Flag149 (Id));
6194 W ("Is_Completely_Hidden", Flag103 (Id));
6195 W ("Is_Concurrent_Record_Type", Flag20 (Id));
6196 W ("Is_Constr_Subt_For_UN_Aliased", Flag141 (Id));
6197 W ("Is_Constr_Subt_For_U_Nominal", Flag80 (Id));
6198 W ("Is_Constrained", Flag12 (Id));
6199 W ("Is_Constructor", Flag76 (Id));
6200 W ("Is_Controlled", Flag42 (Id));
6201 W ("Is_Controlling_Formal", Flag97 (Id));
6202 W ("Is_Discrim_SO_Function", Flag176 (Id));
6203 W ("Is_Dispatching_Operation", Flag6 (Id));
6204 W ("Is_Eliminated", Flag124 (Id));
6205 W ("Is_Entry_Formal", Flag52 (Id));
6206 W ("Is_Exported", Flag99 (Id));
6207 W ("Is_First_Subtype", Flag70 (Id));
6208 W ("Is_For_Access_Subtype", Flag118 (Id));
6209 W ("Is_Formal_Subprogram", Flag111 (Id));
6210 W ("Is_Frozen", Flag4 (Id));
6211 W ("Is_Generic_Actual_Type", Flag94 (Id));
6212 W ("Is_Generic_Instance", Flag130 (Id));
6213 W ("Is_Generic_Type", Flag13 (Id));
6214 W ("Is_Hidden", Flag57 (Id));
6215 W ("Is_Hidden_Open_Scope", Flag171 (Id));
6216 W ("Is_Immediately_Visible", Flag7 (Id));
6217 W ("Is_Imported", Flag24 (Id));
6218 W ("Is_Inlined", Flag11 (Id));
6219 W ("Is_Instantiated", Flag126 (Id));
6220 W ("Is_Internal", Flag17 (Id));
6221 W ("Is_Interrupt_Handler", Flag89 (Id));
6222 W ("Is_Intrinsic_Subprogram", Flag64 (Id));
6223 W ("Is_Itype", Flag91 (Id));
6224 W ("Is_Known_Valid", Flag37 (Id));
6225 W ("Is_Known_Valid", Flag170 (Id));
6226 W ("Is_Limited_Composite", Flag106 (Id));
6227 W ("Is_Limited_Record", Flag25 (Id));
6228 W ("Is_Machine_Code_Subprogram", Flag137 (Id));
6229 W ("Is_Non_Static_Subtype", Flag109 (Id));
6230 W ("Is_Null_Init_Proc", Flag178 (Id));
6231 W ("Is_Optional_Parameter", Flag134 (Id));
6232 W ("Is_Overriding_Operation", Flag39 (Id));
6233 W ("Is_Package_Body_Entity", Flag160 (Id));
6234 W ("Is_Packed", Flag51 (Id));
6235 W ("Is_Packed_Array_Type", Flag138 (Id));
6236 W ("Is_Potentially_Use_Visible", Flag9 (Id));
6237 W ("Is_Preelaborated", Flag59 (Id));
6238 W ("Is_Private_Composite", Flag107 (Id));
6239 W ("Is_Private_Descendant", Flag53 (Id));
6240 W ("Is_Psected", Flag153 (Id));
6241 W ("Is_Public", Flag10 (Id));
6242 W ("Is_Pure", Flag44 (Id));
6243 W ("Is_Remote_Call_Interface", Flag62 (Id));
6244 W ("Is_Remote_Types", Flag61 (Id));
6245 W ("Is_Renaming_Of_Object", Flag112 (Id));
6246 W ("Is_Shared_Passive", Flag60 (Id));
6247 W ("Is_Statically_Allocated", Flag28 (Id));
6248 W ("Is_Tag", Flag78 (Id));
6249 W ("Is_Tagged_Type", Flag55 (Id));
6250 W ("Is_Thread_Body", Flag77 (Id));
6251 W ("Is_True_Constant", Flag163 (Id));
6252 W ("Is_Unchecked_Union", Flag117 (Id));
6253 W ("Is_Unsigned_Type", Flag144 (Id));
6254 W ("Is_VMS_Exception", Flag133 (Id));
6255 W ("Is_Valued_Procedure", Flag127 (Id));
6256 W ("Is_Visible_Child_Unit", Flag116 (Id));
6257 W ("Is_Volatile", Flag16 (Id));
6258 W ("Kill_Elaboration_Checks", Flag32 (Id));
6259 W ("Kill_Range_Checks", Flag33 (Id));
6260 W ("Kill_Tag_Checks", Flag34 (Id));
6261 W ("Machine_Radix_10", Flag84 (Id));
6262 W ("Materialize_Entity", Flag168 (Id));
6263 W ("Must_Be_On_Byte_Boundary", Flag183 (Id));
6264 W ("Needs_Debug_Info", Flag147 (Id));
6265 W ("Needs_No_Actuals", Flag22 (Id));
6266 W ("Never_Set_In_Source", Flag115 (Id));
6267 W ("No_Pool_Assigned", Flag131 (Id));
6268 W ("No_Return", Flag113 (Id));
6269 W ("No_Strict_Aliasing", Flag136 (Id));
6270 W ("Non_Binary_Modulus", Flag58 (Id));
6271 W ("Nonzero_Is_True", Flag162 (Id));
6272 W ("Reachable", Flag49 (Id));
6273 W ("Referenced", Flag156 (Id));
6274 W ("Referenced_As_LHS", Flag36 (Id));
6275 W ("Return_Present", Flag54 (Id));
6276 W ("Returns_By_Ref", Flag90 (Id));
6277 W ("Reverse_Bit_Order", Flag164 (Id));
6278 W ("Sec_Stack_Needed_For_Return", Flag167 (Id));
6279 W ("Size_Depends_On_Discriminant", Flag177 (Id));
6280 W ("Size_Known_At_Compile_Time", Flag92 (Id));
6281 W ("Strict_Alignment", Flag145 (Id));
6282 W ("Suppress_Elaboration_Warnings", Flag148 (Id));
6283 W ("Suppress_Init_Proc", Flag105 (Id));
6284 W ("Suppress_Style_Checks", Flag165 (Id));
6285 W ("Treat_As_Volatile", Flag41 (Id));
6286 W ("Uses_Sec_Stack", Flag95 (Id));
6287 W ("Vax_Float", Flag151 (Id));
6288 W ("Warnings_Off", Flag96 (Id));
6289 end Write_Entity_Flags;
6291 -----------------------
6292 -- Write_Entity_Info --
6293 -----------------------
6295 procedure Write_Entity_Info (Id : Entity_Id; Prefix : String) is
6297 procedure Write_Attribute (Which : String; Nam : E);
6298 -- Write attribute value with given string name
6300 procedure Write_Kind (Id : Entity_Id);
6301 -- Write Ekind field of entity
6303 procedure Write_Attribute (Which : String; Nam : E) is
6307 Write_Int (Int (Nam));
6309 Write_Name (Chars (Nam));
6311 end Write_Attribute;
6313 procedure Write_Kind (Id : Entity_Id) is
6314 K : constant String := Entity_Kind'Image (Ekind (Id));
6318 Write_Str (" Kind ");
6320 if Is_Type (Id) and then Is_Tagged_Type (Id) then
6321 Write_Str ("TAGGED ");
6324 Write_Str (K (3 .. K'Length));
6327 if Is_Type (Id) and then Depends_On_Private (Id) then
6328 Write_Str ("Depends_On_Private ");
6332 -- Start of processing for Write_Entity_Info
6336 Write_Attribute ("Name ", Id);
6337 Write_Int (Int (Id));
6341 Write_Attribute (" Type ", Etype (Id));
6343 Write_Attribute (" Scope ", Scope (Id));
6348 when Discrete_Kind =>
6349 Write_Str ("Bounds: Id = ");
6351 if Present (Scalar_Range (Id)) then
6352 Write_Int (Int (Type_Low_Bound (Id)));
6353 Write_Str (" .. Id = ");
6354 Write_Int (Int (Type_High_Bound (Id)));
6356 Write_Str ("Empty");
6366 Write_Attribute (" Component Type ",
6367 Component_Type (Id));
6370 Write_Str (" Indices ");
6372 Index := First_Index (Id);
6374 while Present (Index) loop
6375 Write_Attribute (" ", Etype (Index));
6376 Index := Next_Index (Index);
6384 (" Directly Designated Type ",
6385 Directly_Designated_Type (Id));
6388 when Overloadable_Kind =>
6389 if Present (Homonym (Id)) then
6390 Write_Str (" Homonym ");
6391 Write_Name (Chars (Homonym (Id)));
6393 Write_Int (Int (Homonym (Id)));
6400 if Ekind (Scope (Id)) in Record_Kind then
6402 " Original_Record_Component ",
6403 Original_Record_Component (Id));
6404 Write_Int (Int (Original_Record_Component (Id)));
6408 when others => null;
6410 end Write_Entity_Info;
6412 -----------------------
6413 -- Write_Field6_Name --
6414 -----------------------
6416 procedure Write_Field6_Name (Id : Entity_Id) is
6417 pragma Warnings (Off, Id);
6420 Write_Str ("First_Rep_Item");
6421 end Write_Field6_Name;
6423 -----------------------
6424 -- Write_Field7_Name --
6425 -----------------------
6427 procedure Write_Field7_Name (Id : Entity_Id) is
6428 pragma Warnings (Off, Id);
6431 Write_Str ("Freeze_Node");
6432 end Write_Field7_Name;
6434 -----------------------
6435 -- Write_Field8_Name --
6436 -----------------------
6438 procedure Write_Field8_Name (Id : Entity_Id) is
6443 Write_Str ("Normalized_First_Bit");
6447 E_Subprogram_Body =>
6448 Write_Str ("Mechanism");
6451 Write_Str ("Associated_Node_For_Itype");
6454 Write_Str ("Dependent_Instances");
6457 Write_Str ("Hiding_Loop_Variable");
6460 Write_Str ("Field8??");
6462 end Write_Field8_Name;
6464 -----------------------
6465 -- Write_Field9_Name --
6466 -----------------------
6468 procedure Write_Field9_Name (Id : Entity_Id) is
6472 Write_Str ("Class_Wide_Type");
6475 E_Generic_Function |
6477 E_Generic_Procedure |
6480 Write_Str ("Renaming_Map");
6483 Write_Str ("Current_Value");
6486 Write_Str ("Field9??");
6488 end Write_Field9_Name;
6490 ------------------------
6491 -- Write_Field10_Name --
6492 ------------------------
6494 procedure Write_Field10_Name (Id : Entity_Id) is
6498 Write_Str ("Referenced_Object");
6500 when E_In_Parameter |
6502 Write_Str ("Discriminal_Link");
6508 Write_Str ("Handler_Records");
6512 Write_Str ("Normalized_Position_Max");
6515 Write_Str ("Field10??");
6517 end Write_Field10_Name;
6519 ------------------------
6520 -- Write_Field11_Name --
6521 ------------------------
6523 procedure Write_Field11_Name (Id : Entity_Id) is
6527 Write_Str ("Entry_Component");
6531 Write_Str ("Component_Bit_Offset");
6534 Write_Str ("Full_View");
6536 when E_Enumeration_Literal =>
6537 Write_Str ("Enumeration_Pos");
6540 Write_Str ("Block_Node");
6546 Write_Str ("Protected_Body_Subprogram");
6548 when E_Generic_Package =>
6549 Write_Str ("Generic_Homonym");
6552 Write_Str ("Full_View");
6555 Write_Str ("Field11??");
6557 end Write_Field11_Name;
6559 ------------------------
6560 -- Write_Field12_Name --
6561 ------------------------
6563 procedure Write_Field12_Name (Id : Entity_Id) is
6567 Write_Str ("Barrier_Function");
6569 when E_Enumeration_Literal =>
6570 Write_Str ("Enumeration_Rep");
6577 E_In_Out_Parameter |
6581 Write_Str ("Esize");
6585 Write_Str ("Next_Inlined_Subprogram");
6588 Write_Str ("Associated_Formal_Package");
6591 Write_Str ("Field12??");
6593 end Write_Field12_Name;
6595 ------------------------
6596 -- Write_Field13_Name --
6597 ------------------------
6599 procedure Write_Field13_Name (Id : Entity_Id) is
6603 Write_Str ("RM_Size");
6607 Write_Str ("Component_Clause");
6609 when E_Enumeration_Literal =>
6610 Write_Str ("Debug_Renaming_Link");
6613 if not Comes_From_Source (Id)
6615 Chars (Id) = Name_Op_Ne
6617 Write_Str ("Corresponding_Equality");
6619 elsif Comes_From_Source (Id) then
6620 Write_Str ("Elaboration_Entity");
6623 Write_Str ("Field13??");
6628 Write_Str ("Extra_Accessibility");
6632 Generic_Unit_Kind =>
6633 Write_Str ("Elaboration_Entity");
6636 Write_Str ("Field13??");
6638 end Write_Field13_Name;
6640 -----------------------
6641 -- Write_Field14_Name --
6642 -----------------------
6644 procedure Write_Field14_Name (Id : Entity_Id) is
6652 Write_Str ("Alignment");
6656 Write_Str ("Normalized_Position");
6660 Write_Str ("First_Optional_Parameter");
6663 E_Generic_Package =>
6664 Write_Str ("Shadow_Entities");
6667 Write_Str ("Field14??");
6669 end Write_Field14_Name;
6671 ------------------------
6672 -- Write_Field15_Name --
6673 ------------------------
6675 procedure Write_Field15_Name (Id : Entity_Id) is
6680 Write_Str ("Storage_Size_Variable");
6682 when Class_Wide_Kind |
6686 Write_Str ("Primitive_Operations");
6689 Write_Str ("DT_Entry_Count");
6691 when Decimal_Fixed_Point_Kind =>
6692 Write_Str ("Scale_Value");
6694 when E_Discriminant =>
6695 Write_Str ("Discriminant_Number");
6698 Write_Str ("Extra_Formal");
6702 Write_Str ("DT_Position");
6705 Write_Str ("Entry_Parameters_Type");
6707 when Enumeration_Kind =>
6708 Write_Str ("Lit_Indexes");
6712 Write_Str ("Related_Instance");
6714 when E_Protected_Type =>
6715 Write_Str ("Entry_Bodies_Array");
6717 when E_String_Literal_Subtype =>
6718 Write_Str ("String_Literal_Low_Bound");
6721 Write_Str ("Shared_Var_Read_Proc");
6724 Write_Str ("Field15??");
6726 end Write_Field15_Name;
6728 ------------------------
6729 -- Write_Field16_Name --
6730 ------------------------
6732 procedure Write_Field16_Name (Id : Entity_Id) is
6736 Write_Str ("Entry_Formal");
6740 Write_Str ("DTC_Entity");
6745 Write_Str ("First_Private_Entity");
6747 when E_Record_Type |
6748 E_Record_Type_With_Private =>
6749 Write_Str ("Access_Disp_Table");
6751 when E_String_Literal_Subtype =>
6752 Write_Str ("String_Literal_Length");
6754 when Enumeration_Kind =>
6755 Write_Str ("Lit_Strings");
6759 Write_Str ("Unset_Reference");
6761 when E_Record_Subtype |
6762 E_Class_Wide_Subtype =>
6763 Write_Str ("Cloned_Subtype");
6766 Write_Str ("Field16??");
6768 end Write_Field16_Name;
6770 ------------------------
6771 -- Write_Field17_Name --
6772 ------------------------
6774 procedure Write_Field17_Name (Id : Entity_Id) is
6778 Write_Str ("Digits_Value");
6781 Write_Str ("Prival");
6783 when E_Discriminant =>
6784 Write_Str ("Discriminal");
6793 E_Generic_Function |
6795 E_Generic_Procedure |
6804 E_Subprogram_Type =>
6805 Write_Str ("First_Entity");
6808 Write_Str ("First_Index");
6810 when E_Protected_Body =>
6811 Write_Str ("Object_Ref");
6813 when Enumeration_Kind =>
6814 Write_Str ("First_Literal");
6817 Write_Str ("Master_Id");
6819 when Modular_Integer_Kind =>
6820 Write_Str ("Modulus");
6824 E_Generic_In_Out_Parameter |
6826 Write_Str ("Actual_Subtype");
6828 when E_Incomplete_Type =>
6829 Write_Str ("Non-limited view");
6832 Write_Str ("Field17??");
6834 end Write_Field17_Name;
6836 -----------------------
6837 -- Write_Field18_Name --
6838 -----------------------
6840 procedure Write_Field18_Name (Id : Entity_Id) is
6843 when E_Enumeration_Literal |
6847 Write_Str ("Alias");
6849 when E_Record_Type =>
6850 Write_Str ("Corresponding_Concurrent_Type");
6852 when E_Entry_Index_Parameter =>
6853 Write_Str ("Entry_Index_Constant");
6855 when E_Class_Wide_Subtype |
6856 E_Access_Protected_Subprogram_Type |
6857 E_Access_Subprogram_Type |
6859 Write_Str ("Equivalent_Type");
6861 when Fixed_Point_Kind =>
6862 Write_Str ("Delta_Value");
6866 Write_Str ("Renamed_Object");
6870 E_Generic_Function |
6871 E_Generic_Procedure |
6872 E_Generic_Package =>
6873 Write_Str ("Renamed_Entity");
6875 when Incomplete_Or_Private_Kind =>
6876 Write_Str ("Private_Dependents");
6878 when Concurrent_Kind =>
6879 Write_Str ("Corresponding_Record_Type");
6884 Write_Str ("Enclosing_Scope");
6887 Write_Str ("Field18??");
6889 end Write_Field18_Name;
6891 -----------------------
6892 -- Write_Field19_Name --
6893 -----------------------
6895 procedure Write_Field19_Name (Id : Entity_Id) is
6900 Write_Str ("Related_Array_Object");
6907 Write_Str ("Finalization_Chain_Entity");
6909 when E_Constant | E_Variable =>
6910 Write_Str ("Size_Check_Code");
6912 when E_Discriminant =>
6913 Write_Str ("Corresponding_Discriminant");
6916 E_Generic_Package =>
6917 Write_Str ("Body_Entity");
6919 when E_Package_Body |
6921 Write_Str ("Spec_Entity");
6923 when Private_Kind =>
6924 Write_Str ("Underlying_Full_View");
6926 when E_Record_Type =>
6927 Write_Str ("Parent_Subtype");
6930 Write_Str ("Field19??");
6932 end Write_Field19_Name;
6934 -----------------------
6935 -- Write_Field20_Name --
6936 -----------------------
6938 procedure Write_Field20_Name (Id : Entity_Id) is
6942 Write_Str ("Component_Type");
6944 when E_In_Parameter |
6945 E_Generic_In_Parameter =>
6946 Write_Str ("Default_Value");
6949 Write_Str ("Directly_Designated_Type");
6952 Write_Str ("Discriminant_Checking_Func");
6954 when E_Discriminant =>
6955 Write_Str ("Discriminant_Default_Value");
6964 E_Generic_Function |
6966 E_Generic_Procedure |
6975 E_Subprogram_Type =>
6977 Write_Str ("Last_Entity");
6980 Write_Str ("Scalar_Range");
6983 Write_Str ("Register_Exception_Call");
6986 Write_Str ("Field20??");
6988 end Write_Field20_Name;
6990 -----------------------
6991 -- Write_Field21_Name --
6992 -----------------------
6994 procedure Write_Field21_Name (Id : Entity_Id) is
7000 E_Generic_Function |
7002 E_Generic_Procedure |
7004 Write_Str ("Interface_Name");
7006 when Concurrent_Kind |
7007 Incomplete_Or_Private_Kind |
7011 Write_Str ("Discriminant_Constraint");
7014 Write_Str ("Accept_Address");
7016 when Fixed_Point_Kind =>
7017 Write_Str ("Small_Value");
7019 when E_In_Parameter =>
7020 Write_Str ("Default_Expr_Function");
7023 Modular_Integer_Kind =>
7024 Write_Str ("Original_Array_Type");
7026 when E_Access_Subprogram_Type |
7027 E_Access_Protected_Subprogram_Type =>
7028 Write_Str ("Original_Access_Type");
7031 Write_Str ("Field21??");
7033 end Write_Field21_Name;
7035 -----------------------
7036 -- Write_Field22_Name --
7037 -----------------------
7039 procedure Write_Field22_Name (Id : Entity_Id) is
7043 Write_Str ("Associated_Storage_Pool");
7046 Write_Str ("Component_Size");
7050 Write_Str ("Original_Record_Component");
7052 when E_Enumeration_Literal =>
7053 Write_Str ("Enumeration_Rep_Expr");
7056 Write_Str ("Exception_Code");
7059 Write_Str ("Protected_Formal");
7061 when E_Record_Type =>
7062 Write_Str ("Corresponding_Remote_Type");
7072 E_Generic_Function |
7073 E_Generic_Procedure |
7078 Write_Str ("Scope_Depth_Value");
7080 when E_Record_Type_With_Private |
7081 E_Record_Subtype_With_Private |
7084 E_Limited_Private_Type |
7085 E_Limited_Private_Subtype =>
7086 Write_Str ("Private_View");
7089 Write_Str ("Shared_Var_Assign_Proc");
7092 Write_Str ("Field22??");
7094 end Write_Field22_Name;
7096 ------------------------
7097 -- Write_Field23_Name --
7098 ------------------------
7100 procedure Write_Field23_Name (Id : Entity_Id) is
7104 Write_Str ("Associated_Final_Chain");
7107 Write_Str ("Packed_Array_Type");
7110 Write_Str ("Entry_Cancel_Parameter");
7113 Write_Str ("Protected_Operation");
7115 when E_Discriminant =>
7116 Write_Str ("CR_Discriminant");
7118 when E_Enumeration_Type =>
7119 Write_Str ("Enum_Pos_To_Rep");
7123 Write_Str ("Extra_Constrained");
7125 when E_Generic_Function |
7127 E_Generic_Procedure =>
7128 Write_Str ("Inner_Instances");
7130 when Concurrent_Kind |
7131 Incomplete_Or_Private_Kind |
7135 Write_Str ("Stored_Constraint");
7139 Write_Str ("Generic_Renamings");
7142 if Is_Generic_Instance (Id) then
7143 Write_Str ("Generic_Renamings");
7145 Write_Str ("Limited Views");
7148 -- What about Privals_Chain for protected operations ???
7151 Write_Str ("Privals_Chain");
7154 Write_Str ("Field23??");
7156 end Write_Field23_Name;
7158 -------------------------
7159 -- Iterator Procedures --
7160 -------------------------
7162 procedure Proc_Next_Component (N : in out Node_Id) is
7164 N := Next_Component (N);
7165 end Proc_Next_Component;
7167 procedure Proc_Next_Discriminant (N : in out Node_Id) is
7169 N := Next_Discriminant (N);
7170 end Proc_Next_Discriminant;
7172 procedure Proc_Next_Formal (N : in out Node_Id) is
7174 N := Next_Formal (N);
7175 end Proc_Next_Formal;
7177 procedure Proc_Next_Formal_With_Extras (N : in out Node_Id) is
7179 N := Next_Formal_With_Extras (N);
7180 end Proc_Next_Formal_With_Extras;
7182 procedure Proc_Next_Index (N : in out Node_Id) is
7184 N := Next_Index (N);
7185 end Proc_Next_Index;
7187 procedure Proc_Next_Inlined_Subprogram (N : in out Node_Id) is
7189 N := Next_Inlined_Subprogram (N);
7190 end Proc_Next_Inlined_Subprogram;
7192 procedure Proc_Next_Literal (N : in out Node_Id) is
7194 N := Next_Literal (N);
7195 end Proc_Next_Literal;
7197 procedure Proc_Next_Stored_Discriminant (N : in out Node_Id) is
7199 N := Next_Stored_Discriminant (N);
7200 end Proc_Next_Stored_Discriminant;