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 -- Has_Per_Object_Constraint Flag154
390 -- Has_Private_Declaration Flag155
391 -- Referenced Flag156
392 -- Has_Pragma_Inline Flag157
393 -- Finalize_Storage_Only Flag158
394 -- From_With_Type Flag159
395 -- Is_Package_Body_Entity Flag160
397 -- Has_Qualified_Name Flag161
398 -- Nonzero_Is_True Flag162
399 -- Is_True_Constant Flag163
400 -- Reverse_Bit_Order Flag164
401 -- Suppress_Style_Checks Flag165
402 -- Debug_Info_Off Flag166
403 -- Sec_Stack_Needed_For_Return Flag167
404 -- Materialize_Entity Flag168
405 -- Function_Returns_With_DSP Flag169
406 -- Is_Known_Valid Flag170
408 -- Is_Hidden_Open_Scope Flag171
409 -- Has_Object_Size_Clause Flag172
410 -- Has_Fully_Qualified_Name Flag173
411 -- Elaboration_Entity_Required Flag174
412 -- Has_Forward_Instantiation Flag175
413 -- Is_Discrim_SO_Function Flag176
414 -- Size_Depends_On_Discriminant Flag177
415 -- Is_Null_Init_Proc Flag178
416 -- Has_Pragma_Pure_Function Flag179
417 -- Has_Pragma_Unreferenced Flag180
419 -- Has_Contiguous_Rep Flag181
420 -- Has_Xref_Entry Flag182
421 -- Must_Be_On_Byte_Boundary Flag183
425 --------------------------------
426 -- Attribute Access Functions --
427 --------------------------------
429 function Accept_Address (Id : E) return L is
434 function Access_Disp_Table (Id : E) return E is
436 pragma Assert (Is_Tagged_Type (Id));
437 return Node16 (Implementation_Base_Type (Id));
438 end Access_Disp_Table;
440 function Actual_Subtype (Id : E) return E is
443 (Ekind (Id) = E_Constant
444 or else Ekind (Id) = E_Variable
445 or else Ekind (Id) = E_Generic_In_Out_Parameter
446 or else Ekind (Id) in E_In_Parameter .. E_In_Out_Parameter);
450 function Address_Taken (Id : E) return B is
455 function Alias (Id : E) return E is
458 (Is_Overloadable (Id) or else Ekind (Id) = E_Subprogram_Type);
462 function Alignment (Id : E) return U is
464 pragma Assert (Is_Type (Id)
465 or else Is_Formal (Id)
466 or else Ekind (Id) = E_Loop_Parameter
467 or else Ekind (Id) = E_Constant
468 or else Ekind (Id) = E_Exception
469 or else Ekind (Id) = E_Variable);
473 function Associated_Final_Chain (Id : E) return E is
475 pragma Assert (Is_Access_Type (Id));
477 end Associated_Final_Chain;
479 function Associated_Formal_Package (Id : E) return E is
481 pragma Assert (Ekind (Id) = E_Package);
483 end Associated_Formal_Package;
485 function Associated_Node_For_Itype (Id : E) return N is
488 end Associated_Node_For_Itype;
490 function Associated_Storage_Pool (Id : E) return E is
492 pragma Assert (Is_Access_Type (Id));
493 return Node22 (Root_Type (Id));
494 end Associated_Storage_Pool;
496 function Barrier_Function (Id : E) return N is
498 pragma Assert (Is_Entry (Id));
500 end Barrier_Function;
502 function Block_Node (Id : E) return N is
504 pragma Assert (Ekind (Id) = E_Block);
508 function Body_Entity (Id : E) return E is
511 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
515 function Body_Needed_For_SAL (Id : E) return B is
518 (Ekind (Id) = E_Package
519 or else Is_Subprogram (Id)
520 or else Is_Generic_Unit (Id));
522 end Body_Needed_For_SAL;
524 function C_Pass_By_Copy (Id : E) return B is
526 pragma Assert (Is_Record_Type (Id));
527 return Flag125 (Implementation_Base_Type (Id));
530 function Can_Never_Be_Null (Id : E) return B is
533 end Can_Never_Be_Null;
535 function Checks_May_Be_Suppressed (Id : E) return B is
538 end Checks_May_Be_Suppressed;
540 function Class_Wide_Type (Id : E) return E is
542 pragma Assert (Is_Type (Id));
546 function Cloned_Subtype (Id : E) return E is
549 (Ekind (Id) = E_Record_Subtype
550 or else Ekind (Id) = E_Class_Wide_Subtype);
554 function Component_Bit_Offset (Id : E) return U is
557 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
559 end Component_Bit_Offset;
561 function Component_Clause (Id : E) return N is
564 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
566 end Component_Clause;
568 function Component_Size (Id : E) return U is
570 pragma Assert (Is_Array_Type (Id));
571 return Uint22 (Implementation_Base_Type (Id));
574 function Component_Type (Id : E) return E is
576 return Node20 (Implementation_Base_Type (Id));
579 function Corresponding_Concurrent_Type (Id : E) return E is
581 pragma Assert (Ekind (Id) = E_Record_Type);
583 end Corresponding_Concurrent_Type;
585 function Corresponding_Discriminant (Id : E) return E is
587 pragma Assert (Ekind (Id) = E_Discriminant);
589 end Corresponding_Discriminant;
591 function Corresponding_Equality (Id : E) return E is
594 (Ekind (Id) = E_Function
595 and then not Comes_From_Source (Id)
596 and then Chars (Id) = Name_Op_Ne);
598 end Corresponding_Equality;
600 function Corresponding_Record_Type (Id : E) return E is
602 pragma Assert (Is_Concurrent_Type (Id));
604 end Corresponding_Record_Type;
606 function Corresponding_Remote_Type (Id : E) return E is
609 end Corresponding_Remote_Type;
611 function Current_Value (Id : E) return N is
613 pragma Assert (Ekind (Id) in Object_Kind);
617 function CR_Discriminant (Id : E) return E is
622 function Debug_Info_Off (Id : E) return B is
627 function Debug_Renaming_Link (Id : E) return E is
630 end Debug_Renaming_Link;
632 function Default_Expr_Function (Id : E) return E is
634 pragma Assert (Is_Formal (Id));
636 end Default_Expr_Function;
638 function Default_Expressions_Processed (Id : E) return B is
641 end Default_Expressions_Processed;
643 function Default_Value (Id : E) return N is
645 pragma Assert (Is_Formal (Id));
649 function Delay_Cleanups (Id : E) return B is
654 function Delay_Subprogram_Descriptors (Id : E) return B is
657 end Delay_Subprogram_Descriptors;
659 function Delta_Value (Id : E) return R is
661 pragma Assert (Is_Fixed_Point_Type (Id));
665 function Dependent_Instances (Id : E) return L is
667 pragma Assert (Is_Generic_Instance (Id));
669 end Dependent_Instances;
671 function Depends_On_Private (Id : E) return B is
673 pragma Assert (Nkind (Id) in N_Entity);
675 end Depends_On_Private;
677 function Digits_Value (Id : E) return U is
680 (Is_Floating_Point_Type (Id)
681 or else Is_Decimal_Fixed_Point_Type (Id));
685 function Directly_Designated_Type (Id : E) return E is
688 end Directly_Designated_Type;
690 function Discard_Names (Id : E) return B is
695 function Discriminal (Id : E) return E is
697 pragma Assert (Ekind (Id) = E_Discriminant);
701 function Discriminal_Link (Id : E) return N is
704 end Discriminal_Link;
706 function Discriminant_Checking_Func (Id : E) return E is
708 pragma Assert (Ekind (Id) = E_Component);
710 end Discriminant_Checking_Func;
712 function Discriminant_Constraint (Id : E) return L is
714 pragma Assert (Is_Composite_Type (Id) and then Has_Discriminants (Id));
716 end Discriminant_Constraint;
718 function Discriminant_Default_Value (Id : E) return N is
720 pragma Assert (Ekind (Id) = E_Discriminant);
722 end Discriminant_Default_Value;
724 function Discriminant_Number (Id : E) return U is
726 pragma Assert (Ekind (Id) = E_Discriminant);
728 end Discriminant_Number;
730 function DT_Entry_Count (Id : E) return U is
732 pragma Assert (Ekind (Id) = E_Component and then Is_Tag (Id));
736 function DT_Position (Id : E) return U is
739 ((Ekind (Id) = E_Function
740 or else Ekind (Id) = E_Procedure)
741 and then Present (DTC_Entity (Id)));
745 function DTC_Entity (Id : E) return E is
748 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
752 function Elaborate_All_Desirable (Id : E) return B is
755 end Elaborate_All_Desirable;
757 function Elaboration_Entity (Id : E) return E is
762 Ekind (Id) = E_Package
764 Is_Generic_Unit (Id));
766 end Elaboration_Entity;
768 function Elaboration_Entity_Required (Id : E) return B is
773 Ekind (Id) = E_Package
775 Is_Generic_Unit (Id));
777 end Elaboration_Entity_Required;
779 function Enclosing_Scope (Id : E) return E is
784 function Entry_Accepted (Id : E) return B is
786 pragma Assert (Is_Entry (Id));
790 function Entry_Bodies_Array (Id : E) return E is
793 end Entry_Bodies_Array;
795 function Entry_Cancel_Parameter (Id : E) return E is
798 end Entry_Cancel_Parameter;
800 function Entry_Component (Id : E) return E is
805 function Entry_Formal (Id : E) return E is
810 function Entry_Index_Constant (Id : E) return N is
812 pragma Assert (Ekind (Id) = E_Entry_Index_Parameter);
814 end Entry_Index_Constant;
816 function Entry_Parameters_Type (Id : E) return E is
819 end Entry_Parameters_Type;
821 function Enum_Pos_To_Rep (Id : E) return E is
823 pragma Assert (Ekind (Id) = E_Enumeration_Type);
827 function Enumeration_Pos (Id : E) return Uint is
829 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
833 function Enumeration_Rep (Id : E) return U is
835 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
839 function Enumeration_Rep_Expr (Id : E) return N is
841 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
843 end Enumeration_Rep_Expr;
845 function Equivalent_Type (Id : E) return E is
848 (Ekind (Id) = E_Class_Wide_Subtype or else
849 Ekind (Id) = E_Access_Protected_Subprogram_Type or else
850 Ekind (Id) = E_Access_Subprogram_Type or else
851 Ekind (Id) = E_Exception_Type);
855 function Esize (Id : E) return Uint is
860 function Exception_Code (Id : E) return Uint is
862 pragma Assert (Ekind (Id) = E_Exception);
866 function Extra_Accessibility (Id : E) return E is
868 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
870 end Extra_Accessibility;
872 function Extra_Constrained (Id : E) return E is
874 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
876 end Extra_Constrained;
878 function Extra_Formal (Id : E) return E is
883 function Finalization_Chain_Entity (Id : E) return E is
886 end Finalization_Chain_Entity;
888 function Finalize_Storage_Only (Id : E) return B is
890 pragma Assert (Is_Type (Id));
891 return Flag158 (Base_Type (Id));
892 end Finalize_Storage_Only;
894 function First_Entity (Id : E) return E is
899 function First_Index (Id : E) return N is
904 function First_Literal (Id : E) return E is
909 function First_Optional_Parameter (Id : E) return E is
912 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
914 end First_Optional_Parameter;
916 function First_Private_Entity (Id : E) return E is
919 end First_Private_Entity;
921 function First_Rep_Item (Id : E) return E is
926 function Freeze_Node (Id : E) return N is
931 function From_With_Type (Id : E) return B is
936 function Full_View (Id : E) return E is
938 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Constant);
942 function Function_Returns_With_DSP (Id : E) return B is
945 (Is_Subprogram (Id) or else Ekind (Id) = E_Subprogram_Type);
947 end Function_Returns_With_DSP;
949 function Generic_Homonym (Id : E) return E is
951 pragma Assert (Ekind (Id) = E_Generic_Package);
955 function Generic_Renamings (Id : E) return L is
958 end Generic_Renamings;
960 function Handler_Records (Id : E) return S is
965 function Has_Aliased_Components (Id : E) return B is
967 return Flag135 (Implementation_Base_Type (Id));
968 end Has_Aliased_Components;
970 function Has_Alignment_Clause (Id : E) return B is
973 end Has_Alignment_Clause;
975 function Has_All_Calls_Remote (Id : E) return B is
978 end Has_All_Calls_Remote;
980 function Has_Atomic_Components (Id : E) return B is
982 return Flag86 (Implementation_Base_Type (Id));
983 end Has_Atomic_Components;
985 function Has_Biased_Representation (Id : E) return B is
988 end Has_Biased_Representation;
990 function Has_Completion (Id : E) return B is
995 function Has_Completion_In_Body (Id : E) return B is
997 pragma Assert (Is_Type (Id));
999 end Has_Completion_In_Body;
1001 function Has_Complex_Representation (Id : E) return B is
1003 pragma Assert (Is_Type (Id));
1004 return Flag140 (Implementation_Base_Type (Id));
1005 end Has_Complex_Representation;
1007 function Has_Component_Size_Clause (Id : E) return B is
1009 pragma Assert (Is_Array_Type (Id));
1010 return Flag68 (Implementation_Base_Type (Id));
1011 end Has_Component_Size_Clause;
1013 function Has_Controlled_Component (Id : E) return B is
1015 return Flag43 (Base_Type (Id));
1016 end Has_Controlled_Component;
1018 function Has_Contiguous_Rep (Id : E) return B is
1020 return Flag181 (Id);
1021 end Has_Contiguous_Rep;
1023 function Has_Controlling_Result (Id : E) return B is
1026 end Has_Controlling_Result;
1028 function Has_Convention_Pragma (Id : E) return B is
1030 return Flag119 (Id);
1031 end Has_Convention_Pragma;
1033 function Has_Delayed_Freeze (Id : E) return B is
1035 pragma Assert (Nkind (Id) in N_Entity);
1037 end Has_Delayed_Freeze;
1039 function Has_Discriminants (Id : E) return B is
1041 pragma Assert (Nkind (Id) in N_Entity);
1043 end Has_Discriminants;
1045 function Has_Enumeration_Rep_Clause (Id : E) return B is
1047 pragma Assert (Is_Enumeration_Type (Id));
1049 end Has_Enumeration_Rep_Clause;
1051 function Has_Exit (Id : E) return B is
1056 function Has_External_Tag_Rep_Clause (Id : E) return B is
1058 pragma Assert (Is_Tagged_Type (Id));
1059 return Flag110 (Id);
1060 end Has_External_Tag_Rep_Clause;
1062 function Has_Forward_Instantiation (Id : E) return B is
1064 return Flag175 (Id);
1065 end Has_Forward_Instantiation;
1067 function Has_Fully_Qualified_Name (Id : E) return B is
1069 return Flag173 (Id);
1070 end Has_Fully_Qualified_Name;
1072 function Has_Gigi_Rep_Item (Id : E) return B is
1075 end Has_Gigi_Rep_Item;
1077 function Has_Homonym (Id : E) return B is
1082 function Has_Machine_Radix_Clause (Id : E) return B is
1084 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
1086 end Has_Machine_Radix_Clause;
1088 function Has_Master_Entity (Id : E) return B is
1091 end Has_Master_Entity;
1093 function Has_Missing_Return (Id : E) return B is
1096 (Ekind (Id) = E_Function or else Ekind (Id) = E_Generic_Function);
1097 return Flag142 (Id);
1098 end Has_Missing_Return;
1100 function Has_Nested_Block_With_Handler (Id : E) return B is
1102 return Flag101 (Id);
1103 end Has_Nested_Block_With_Handler;
1105 function Has_Non_Standard_Rep (Id : E) return B is
1107 return Flag75 (Implementation_Base_Type (Id));
1108 end Has_Non_Standard_Rep;
1110 function Has_Object_Size_Clause (Id : E) return B is
1112 pragma Assert (Is_Type (Id));
1113 return Flag172 (Id);
1114 end Has_Object_Size_Clause;
1116 function Has_Per_Object_Constraint (Id : E) return B is
1118 return Flag154 (Id);
1119 end Has_Per_Object_Constraint;
1121 function Has_Pragma_Controlled (Id : E) return B is
1123 pragma Assert (Is_Access_Type (Id));
1124 return Flag27 (Implementation_Base_Type (Id));
1125 end Has_Pragma_Controlled;
1127 function Has_Pragma_Elaborate_Body (Id : E) return B is
1129 return Flag150 (Id);
1130 end Has_Pragma_Elaborate_Body;
1132 function Has_Pragma_Inline (Id : E) return B is
1134 return Flag157 (Id);
1135 end Has_Pragma_Inline;
1137 function Has_Pragma_Pack (Id : E) return B is
1139 pragma Assert (Is_Record_Type (Id) or else Is_Array_Type (Id));
1140 return Flag121 (Implementation_Base_Type (Id));
1141 end Has_Pragma_Pack;
1143 function Has_Pragma_Pure_Function (Id : E) return B is
1145 pragma Assert (Is_Subprogram (Id));
1146 return Flag179 (Id);
1147 end Has_Pragma_Pure_Function;
1149 function Has_Pragma_Unreferenced (Id : E) return B is
1151 return Flag180 (Id);
1152 end Has_Pragma_Unreferenced;
1154 function Has_Primitive_Operations (Id : E) return B is
1156 pragma Assert (Is_Type (Id));
1157 return Flag120 (Base_Type (Id));
1158 end Has_Primitive_Operations;
1160 function Has_Private_Declaration (Id : E) return B is
1162 return Flag155 (Id);
1163 end Has_Private_Declaration;
1165 function Has_Qualified_Name (Id : E) return B is
1167 return Flag161 (Id);
1168 end Has_Qualified_Name;
1170 function Has_Record_Rep_Clause (Id : E) return B is
1172 pragma Assert (Is_Record_Type (Id));
1173 return Flag65 (Implementation_Base_Type (Id));
1174 end Has_Record_Rep_Clause;
1176 function Has_Recursive_Call (Id : E) return B is
1178 pragma Assert (Is_Subprogram (Id));
1179 return Flag143 (Id);
1180 end Has_Recursive_Call;
1182 function Has_Size_Clause (Id : E) return B is
1185 end Has_Size_Clause;
1187 function Has_Small_Clause (Id : E) return B is
1190 end Has_Small_Clause;
1192 function Has_Specified_Layout (Id : E) return B is
1194 pragma Assert (Is_Type (Id));
1195 return Flag100 (Implementation_Base_Type (Id));
1196 end Has_Specified_Layout;
1198 function Has_Storage_Size_Clause (Id : E) return B is
1200 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
1201 return Flag23 (Implementation_Base_Type (Id));
1202 end Has_Storage_Size_Clause;
1204 function Has_Subprogram_Descriptor (Id : E) return B is
1207 end Has_Subprogram_Descriptor;
1209 function Has_Task (Id : E) return B is
1211 return Flag30 (Base_Type (Id));
1214 function Has_Unchecked_Union (Id : E) return B is
1216 return Flag123 (Base_Type (Id));
1217 end Has_Unchecked_Union;
1219 function Has_Unknown_Discriminants (Id : E) return B is
1221 pragma Assert (Is_Type (Id));
1223 end Has_Unknown_Discriminants;
1225 function Has_Volatile_Components (Id : E) return B is
1227 return Flag87 (Implementation_Base_Type (Id));
1228 end Has_Volatile_Components;
1230 function Has_Xref_Entry (Id : E) return B is
1232 return Flag182 (Implementation_Base_Type (Id));
1235 function Hiding_Loop_Variable (Id : E) return E is
1237 pragma Assert (Ekind (Id) = E_Variable);
1239 end Hiding_Loop_Variable;
1241 function Homonym (Id : E) return E is
1246 function In_Package_Body (Id : E) return B is
1249 end In_Package_Body;
1251 function In_Private_Part (Id : E) return B is
1254 end In_Private_Part;
1256 function In_Use (Id : E) return B is
1258 pragma Assert (Nkind (Id) in N_Entity);
1262 function Inner_Instances (Id : E) return L is
1264 return Elist23 (Id);
1265 end Inner_Instances;
1267 function Interface_Name (Id : E) return N is
1272 function Is_Abstract (Id : E) return B is
1277 function Is_Access_Constant (Id : E) return B is
1279 pragma Assert (Is_Access_Type (Id));
1281 end Is_Access_Constant;
1283 function Is_Aliased (Id : E) return B is
1285 pragma Assert (Nkind (Id) in N_Entity);
1289 function Is_AST_Entry (Id : E) return B is
1291 pragma Assert (Is_Entry (Id));
1292 return Flag132 (Id);
1295 function Is_Asynchronous (Id : E) return B is
1298 (Ekind (Id) = E_Procedure or else Is_Type (Id));
1300 end Is_Asynchronous;
1302 function Is_Atomic (Id : E) return B is
1307 function Is_Bit_Packed_Array (Id : E) return B is
1309 return Flag122 (Implementation_Base_Type (Id));
1310 end Is_Bit_Packed_Array;
1312 function Is_Called (Id : E) return B is
1315 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Function);
1316 return Flag102 (Id);
1319 function Is_Character_Type (Id : E) return B is
1322 end Is_Character_Type;
1324 function Is_Child_Unit (Id : E) return B is
1329 function Is_Class_Wide_Equivalent_Type (Id : E) return B is
1332 end Is_Class_Wide_Equivalent_Type;
1334 function Is_Compilation_Unit (Id : E) return B is
1336 return Flag149 (Id);
1337 end Is_Compilation_Unit;
1339 function Is_Completely_Hidden (Id : E) return B is
1341 pragma Assert (Ekind (Id) = E_Discriminant);
1342 return Flag103 (Id);
1343 end Is_Completely_Hidden;
1345 function Is_Constr_Subt_For_U_Nominal (Id : E) return B is
1348 end Is_Constr_Subt_For_U_Nominal;
1350 function Is_Constr_Subt_For_UN_Aliased (Id : E) return B is
1352 return Flag141 (Id);
1353 end Is_Constr_Subt_For_UN_Aliased;
1355 function Is_Constrained (Id : E) return B is
1357 pragma Assert (Nkind (Id) in N_Entity);
1361 function Is_Constructor (Id : E) return B is
1366 function Is_Controlled (Id : E) return B is
1368 return Flag42 (Base_Type (Id));
1371 function Is_Controlling_Formal (Id : E) return B is
1373 pragma Assert (Is_Formal (Id));
1375 end Is_Controlling_Formal;
1377 function Is_CPP_Class (Id : E) return B is
1382 function Is_Discrim_SO_Function (Id : E) return B is
1384 return Flag176 (Id);
1385 end Is_Discrim_SO_Function;
1387 function Is_Dispatching_Operation (Id : E) return B is
1389 pragma Assert (Nkind (Id) in N_Entity);
1391 end Is_Dispatching_Operation;
1393 function Is_Eliminated (Id : E) return B is
1395 return Flag124 (Id);
1398 function Is_Entry_Formal (Id : E) return B is
1401 end Is_Entry_Formal;
1403 function Is_Exported (Id : E) return B is
1408 function Is_First_Subtype (Id : E) return B is
1411 end Is_First_Subtype;
1413 function Is_For_Access_Subtype (Id : E) return B is
1416 (Ekind (Id) = E_Record_Subtype
1418 Ekind (Id) = E_Private_Subtype);
1419 return Flag118 (Id);
1420 end Is_For_Access_Subtype;
1422 function Is_Formal_Subprogram (Id : E) return B is
1424 return Flag111 (Id);
1425 end Is_Formal_Subprogram;
1427 function Is_Frozen (Id : E) return B is
1432 function Is_Generic_Actual_Type (Id : E) return B is
1434 pragma Assert (Is_Type (Id));
1436 end Is_Generic_Actual_Type;
1438 function Is_Generic_Instance (Id : E) return B is
1440 return Flag130 (Id);
1441 end Is_Generic_Instance;
1443 function Is_Generic_Type (Id : E) return B is
1445 pragma Assert (Nkind (Id) in N_Entity);
1447 end Is_Generic_Type;
1449 function Is_Hidden (Id : E) return B is
1454 function Is_Hidden_Open_Scope (Id : E) return B is
1456 return Flag171 (Id);
1457 end Is_Hidden_Open_Scope;
1459 function Is_Immediately_Visible (Id : E) return B is
1461 pragma Assert (Nkind (Id) in N_Entity);
1463 end Is_Immediately_Visible;
1465 function Is_Imported (Id : E) return B is
1470 function Is_Inlined (Id : E) return B is
1475 function Is_Instantiated (Id : E) return B is
1477 return Flag126 (Id);
1478 end Is_Instantiated;
1480 function Is_Internal (Id : E) return B is
1482 pragma Assert (Nkind (Id) in N_Entity);
1486 function Is_Interrupt_Handler (Id : E) return B is
1488 pragma Assert (Nkind (Id) in N_Entity);
1490 end Is_Interrupt_Handler;
1492 function Is_Intrinsic_Subprogram (Id : E) return B is
1495 end Is_Intrinsic_Subprogram;
1497 function Is_Itype (Id : E) return B is
1502 function Is_Known_Non_Null (Id : E) return B is
1505 end Is_Known_Non_Null;
1507 function Is_Known_Valid (Id : E) return B is
1509 return Flag170 (Id);
1512 function Is_Limited_Composite (Id : E) return B is
1514 return Flag106 (Id);
1515 end Is_Limited_Composite;
1517 function Is_Limited_Record (Id : E) return B is
1520 end Is_Limited_Record;
1522 function Is_Machine_Code_Subprogram (Id : E) return B is
1524 pragma Assert (Is_Subprogram (Id));
1525 return Flag137 (Id);
1526 end Is_Machine_Code_Subprogram;
1528 function Is_Non_Static_Subtype (Id : E) return B is
1530 pragma Assert (Is_Type (Id));
1531 return Flag109 (Id);
1532 end Is_Non_Static_Subtype;
1534 function Is_Null_Init_Proc (Id : E) return B is
1536 pragma Assert (Ekind (Id) = E_Procedure);
1537 return Flag178 (Id);
1538 end Is_Null_Init_Proc;
1540 function Is_Optional_Parameter (Id : E) return B is
1542 pragma Assert (Is_Formal (Id));
1543 return Flag134 (Id);
1544 end Is_Optional_Parameter;
1546 function Is_Overriding_Operation (Id : E) return B is
1548 pragma Assert (Is_Subprogram (Id));
1550 end Is_Overriding_Operation;
1552 function Is_Package_Body_Entity (Id : E) return B is
1554 return Flag160 (Id);
1555 end Is_Package_Body_Entity;
1557 function Is_Packed (Id : E) return B is
1559 return Flag51 (Implementation_Base_Type (Id));
1562 function Is_Packed_Array_Type (Id : E) return B is
1564 return Flag138 (Id);
1565 end Is_Packed_Array_Type;
1567 function Is_Potentially_Use_Visible (Id : E) return B is
1569 pragma Assert (Nkind (Id) in N_Entity);
1571 end Is_Potentially_Use_Visible;
1573 function Is_Preelaborated (Id : E) return B is
1576 end Is_Preelaborated;
1578 function Is_Private_Composite (Id : E) return B is
1580 pragma Assert (Is_Type (Id));
1581 return Flag107 (Id);
1582 end Is_Private_Composite;
1584 function Is_Private_Descendant (Id : E) return B is
1587 end Is_Private_Descendant;
1589 function Is_Public (Id : E) return B is
1591 pragma Assert (Nkind (Id) in N_Entity);
1595 function Is_Pure (Id : E) return B is
1600 function Is_Remote_Call_Interface (Id : E) return B is
1603 end Is_Remote_Call_Interface;
1605 function Is_Remote_Types (Id : E) return B is
1608 end Is_Remote_Types;
1610 function Is_Renaming_Of_Object (Id : E) return B is
1612 return Flag112 (Id);
1613 end Is_Renaming_Of_Object;
1615 function Is_Shared_Passive (Id : E) return B is
1618 end Is_Shared_Passive;
1620 function Is_Statically_Allocated (Id : E) return B is
1623 end Is_Statically_Allocated;
1625 function Is_Tag (Id : E) return B is
1627 pragma Assert (Nkind (Id) in N_Entity);
1631 function Is_Tagged_Type (Id : E) return B is
1636 function Is_Thread_Body (Id : E) return B is
1641 function Is_True_Constant (Id : E) return B is
1643 return Flag163 (Id);
1644 end Is_True_Constant;
1646 function Is_Unchecked_Union (Id : E) return B is
1648 return Flag117 (Id);
1649 end Is_Unchecked_Union;
1651 function Is_Unsigned_Type (Id : E) return B is
1653 pragma Assert (Is_Type (Id));
1654 return Flag144 (Id);
1655 end Is_Unsigned_Type;
1657 function Is_Valued_Procedure (Id : E) return B is
1659 pragma Assert (Ekind (Id) = E_Procedure);
1660 return Flag127 (Id);
1661 end Is_Valued_Procedure;
1663 function Is_Visible_Child_Unit (Id : E) return B is
1665 pragma Assert (Is_Child_Unit (Id));
1666 return Flag116 (Id);
1667 end Is_Visible_Child_Unit;
1669 function Is_VMS_Exception (Id : E) return B is
1671 return Flag133 (Id);
1672 end Is_VMS_Exception;
1674 function Is_Volatile (Id : E) return B is
1676 pragma Assert (Nkind (Id) in N_Entity);
1677 if Is_Type (Id) then
1678 return Flag16 (Base_Type (Id));
1684 function Kill_Elaboration_Checks (Id : E) return B is
1687 end Kill_Elaboration_Checks;
1689 function Kill_Range_Checks (Id : E) return B is
1692 end Kill_Range_Checks;
1694 function Kill_Tag_Checks (Id : E) return B is
1697 end Kill_Tag_Checks;
1699 function Last_Entity (Id : E) return E is
1704 function Limited_View (Id : E) return E is
1706 pragma Assert (Ekind (Id) = E_Package);
1710 function Lit_Indexes (Id : E) return E is
1712 pragma Assert (Is_Enumeration_Type (Id));
1716 function Lit_Strings (Id : E) return E is
1718 pragma Assert (Is_Enumeration_Type (Id));
1722 function Machine_Radix_10 (Id : E) return B is
1724 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
1726 end Machine_Radix_10;
1728 function Master_Id (Id : E) return E is
1733 function Materialize_Entity (Id : E) return B is
1735 return Flag168 (Id);
1736 end Materialize_Entity;
1738 function Mechanism (Id : E) return M is
1740 pragma Assert (Ekind (Id) = E_Function or else Is_Formal (Id));
1741 return UI_To_Int (Uint8 (Id));
1744 function Modulus (Id : E) return Uint is
1746 pragma Assert (Is_Modular_Integer_Type (Id));
1747 return Uint17 (Base_Type (Id));
1750 function Must_Be_On_Byte_Boundary (Id : E) return B is
1752 pragma Assert (Is_Type (Id));
1753 return Flag183 (Id);
1754 end Must_Be_On_Byte_Boundary;
1756 function Needs_Debug_Info (Id : E) return B is
1758 return Flag147 (Id);
1759 end Needs_Debug_Info;
1761 function Needs_No_Actuals (Id : E) return B is
1764 (Is_Overloadable (Id)
1765 or else Ekind (Id) = E_Subprogram_Type
1766 or else Ekind (Id) = E_Entry_Family);
1768 end Needs_No_Actuals;
1770 function Never_Set_In_Source (Id : E) return B is
1772 return Flag115 (Id);
1773 end Never_Set_In_Source;
1775 function Next_Inlined_Subprogram (Id : E) return E is
1778 end Next_Inlined_Subprogram;
1780 function No_Pool_Assigned (Id : E) return B is
1782 pragma Assert (Is_Access_Type (Id));
1783 return Flag131 (Root_Type (Id));
1784 end No_Pool_Assigned;
1786 function No_Return (Id : E) return B is
1790 or else Ekind (Id) = E_Procedure
1791 or else Ekind (Id) = E_Generic_Procedure);
1792 return Flag113 (Id);
1795 function No_Strict_Aliasing (Id : E) return B is
1797 pragma Assert (Is_Access_Type (Id));
1798 return Flag136 (Base_Type (Id));
1799 end No_Strict_Aliasing;
1801 function Non_Binary_Modulus (Id : E) return B is
1803 pragma Assert (Is_Modular_Integer_Type (Id));
1804 return Flag58 (Base_Type (Id));
1805 end Non_Binary_Modulus;
1807 function Non_Limited_View (Id : E) return E is
1809 pragma Assert (False
1810 or else Ekind (Id) = E_Incomplete_Type);
1812 end Non_Limited_View;
1814 function Nonzero_Is_True (Id : E) return B is
1816 pragma Assert (Root_Type (Id) = Standard_Boolean);
1817 return Flag162 (Base_Type (Id));
1818 end Nonzero_Is_True;
1820 function Normalized_First_Bit (Id : E) return U is
1823 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
1825 end Normalized_First_Bit;
1827 function Normalized_Position (Id : E) return U is
1830 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
1832 end Normalized_Position;
1834 function Normalized_Position_Max (Id : E) return U is
1837 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
1839 end Normalized_Position_Max;
1841 function Object_Ref (Id : E) return E is
1843 pragma Assert (Ekind (Id) = E_Protected_Body);
1847 function Original_Access_Type (Id : E) return E is
1850 (Ekind (Id) = E_Access_Subprogram_Type
1851 or else Ekind (Id) = E_Access_Protected_Subprogram_Type);
1853 end Original_Access_Type;
1855 function Original_Array_Type (Id : E) return E is
1857 pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id));
1859 end Original_Array_Type;
1861 function Original_Record_Component (Id : E) return E is
1864 (Ekind (Id) = E_Void
1865 or else Ekind (Id) = E_Component
1866 or else Ekind (Id) = E_Discriminant);
1868 end Original_Record_Component;
1870 function Packed_Array_Type (Id : E) return E is
1872 pragma Assert (Is_Array_Type (Id));
1874 end Packed_Array_Type;
1876 function Parent_Subtype (Id : E) return E is
1878 pragma Assert (Ekind (Id) = E_Record_Type);
1882 function Primitive_Operations (Id : E) return L is
1884 pragma Assert (Is_Tagged_Type (Id));
1885 return Elist15 (Id);
1886 end Primitive_Operations;
1888 function Prival (Id : E) return E is
1890 pragma Assert (Is_Protected_Private (Id));
1894 function Privals_Chain (Id : E) return L is
1896 pragma Assert (Is_Overloadable (Id)
1897 or else Ekind (Id) = E_Entry_Family);
1898 return Elist23 (Id);
1901 function Private_Dependents (Id : E) return L is
1903 pragma Assert (Is_Incomplete_Or_Private_Type (Id));
1904 return Elist18 (Id);
1905 end Private_Dependents;
1907 function Private_View (Id : E) return N is
1909 pragma Assert (Is_Private_Type (Id));
1913 function Protected_Body_Subprogram (Id : E) return E is
1915 pragma Assert (Is_Subprogram (Id) or else Is_Entry (Id));
1917 end Protected_Body_Subprogram;
1919 function Protected_Formal (Id : E) return E is
1921 pragma Assert (Is_Formal (Id));
1923 end Protected_Formal;
1925 function Protected_Operation (Id : E) return N is
1927 pragma Assert (Is_Protected_Private (Id));
1929 end Protected_Operation;
1931 function Reachable (Id : E) return B is
1936 function Referenced (Id : E) return B is
1938 return Flag156 (Id);
1941 function Referenced_As_LHS (Id : E) return B is
1944 end Referenced_As_LHS;
1946 function Referenced_Object (Id : E) return N is
1948 pragma Assert (Is_Type (Id));
1950 end Referenced_Object;
1952 function Register_Exception_Call (Id : E) return N is
1954 pragma Assert (Ekind (Id) = E_Exception);
1956 end Register_Exception_Call;
1958 function Related_Array_Object (Id : E) return E is
1960 pragma Assert (Is_Array_Type (Id));
1962 end Related_Array_Object;
1964 function Related_Instance (Id : E) return E is
1967 (Ekind (Id) = E_Package or else Ekind (Id) = E_Package_Body);
1969 end Related_Instance;
1971 function Renamed_Entity (Id : E) return N is
1976 function Renamed_Object (Id : E) return N is
1981 function Renaming_Map (Id : E) return U is
1986 function Return_Present (Id : E) return B is
1991 function Returns_By_Ref (Id : E) return B is
1996 function Reverse_Bit_Order (Id : E) return B is
1998 pragma Assert (Is_Record_Type (Id));
1999 return Flag164 (Base_Type (Id));
2000 end Reverse_Bit_Order;
2002 function RM_Size (Id : E) return U is
2004 pragma Assert (Is_Type (Id));
2008 function Scalar_Range (Id : E) return N is
2013 function Scale_Value (Id : E) return U is
2018 function Scope_Depth_Value (Id : E) return U is
2021 end Scope_Depth_Value;
2023 function Sec_Stack_Needed_For_Return (Id : E) return B is
2025 return Flag167 (Id);
2026 end Sec_Stack_Needed_For_Return;
2028 function Shadow_Entities (Id : E) return S is
2031 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
2033 end Shadow_Entities;
2035 function Shared_Var_Assign_Proc (Id : E) return E is
2037 pragma Assert (Ekind (Id) = E_Variable);
2039 end Shared_Var_Assign_Proc;
2041 function Shared_Var_Read_Proc (Id : E) return E is
2043 pragma Assert (Ekind (Id) = E_Variable);
2045 end Shared_Var_Read_Proc;
2047 function Size_Check_Code (Id : E) return N is
2049 pragma Assert (Ekind (Id) = E_Constant or else Ekind (Id) = E_Variable);
2051 end Size_Check_Code;
2053 function Size_Depends_On_Discriminant (Id : E) return B is
2055 return Flag177 (Id);
2056 end Size_Depends_On_Discriminant;
2058 function Size_Known_At_Compile_Time (Id : E) return B is
2061 end Size_Known_At_Compile_Time;
2063 function Small_Value (Id : E) return R is
2065 pragma Assert (Is_Fixed_Point_Type (Id));
2066 return Ureal21 (Id);
2069 function Spec_Entity (Id : E) return E is
2072 (Ekind (Id) = E_Package_Body or else Is_Formal (Id));
2076 function Storage_Size_Variable (Id : E) return E is
2078 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
2079 return Node15 (Implementation_Base_Type (Id));
2080 end Storage_Size_Variable;
2082 function Stored_Constraint (Id : E) return L is
2085 (Is_Composite_Type (Id) and then not Is_Array_Type (Id));
2086 return Elist23 (Id);
2087 end Stored_Constraint;
2089 function Strict_Alignment (Id : E) return B is
2091 return Flag145 (Implementation_Base_Type (Id));
2092 end Strict_Alignment;
2094 function String_Literal_Length (Id : E) return U is
2097 end String_Literal_Length;
2099 function String_Literal_Low_Bound (Id : E) return N is
2102 end String_Literal_Low_Bound;
2104 function Suppress_Elaboration_Warnings (Id : E) return B is
2106 return Flag148 (Id);
2107 end Suppress_Elaboration_Warnings;
2109 function Suppress_Init_Proc (Id : E) return B is
2111 return Flag105 (Base_Type (Id));
2112 end Suppress_Init_Proc;
2114 function Suppress_Style_Checks (Id : E) return B is
2116 return Flag165 (Id);
2117 end Suppress_Style_Checks;
2119 function Treat_As_Volatile (Id : E) return B is
2122 end Treat_As_Volatile;
2124 function Underlying_Full_View (Id : E) return E is
2126 pragma Assert (Ekind (Id) in Private_Kind);
2128 end Underlying_Full_View;
2130 function Unset_Reference (Id : E) return N is
2133 end Unset_Reference;
2135 function Uses_Sec_Stack (Id : E) return B is
2140 function Vax_Float (Id : E) return B is
2142 return Flag151 (Base_Type (Id));
2145 function Warnings_Off (Id : E) return B is
2150 ------------------------------
2151 -- Classification Functions --
2152 ------------------------------
2154 function Is_Access_Type (Id : E) return B is
2156 return Ekind (Id) in Access_Kind;
2159 function Is_Array_Type (Id : E) return B is
2161 return Ekind (Id) in Array_Kind;
2164 function Is_Class_Wide_Type (Id : E) return B is
2166 return Ekind (Id) in Class_Wide_Kind;
2167 end Is_Class_Wide_Type;
2169 function Is_Composite_Type (Id : E) return B is
2171 return Ekind (Id) in Composite_Kind;
2172 end Is_Composite_Type;
2174 function Is_Concurrent_Body (Id : E) return B is
2176 return Ekind (Id) in
2177 Concurrent_Body_Kind;
2178 end Is_Concurrent_Body;
2180 function Is_Concurrent_Record_Type (Id : E) return B is
2183 end Is_Concurrent_Record_Type;
2185 function Is_Concurrent_Type (Id : E) return B is
2187 return Ekind (Id) in Concurrent_Kind;
2188 end Is_Concurrent_Type;
2190 function Is_Decimal_Fixed_Point_Type (Id : E) return B is
2192 return Ekind (Id) in
2193 Decimal_Fixed_Point_Kind;
2194 end Is_Decimal_Fixed_Point_Type;
2196 function Is_Digits_Type (Id : E) return B is
2198 return Ekind (Id) in Digits_Kind;
2201 function Is_Discrete_Or_Fixed_Point_Type (Id : E) return B is
2203 return Ekind (Id) in Discrete_Or_Fixed_Point_Kind;
2204 end Is_Discrete_Or_Fixed_Point_Type;
2206 function Is_Discrete_Type (Id : E) return B is
2208 return Ekind (Id) in Discrete_Kind;
2209 end Is_Discrete_Type;
2211 function Is_Elementary_Type (Id : E) return B is
2213 return Ekind (Id) in Elementary_Kind;
2214 end Is_Elementary_Type;
2216 function Is_Entry (Id : E) return B is
2218 return Ekind (Id) in Entry_Kind;
2221 function Is_Enumeration_Type (Id : E) return B is
2223 return Ekind (Id) in
2225 end Is_Enumeration_Type;
2227 function Is_Fixed_Point_Type (Id : E) return B is
2229 return Ekind (Id) in
2231 end Is_Fixed_Point_Type;
2233 function Is_Floating_Point_Type (Id : E) return B is
2235 return Ekind (Id) in Float_Kind;
2236 end Is_Floating_Point_Type;
2238 function Is_Formal (Id : E) return B is
2240 return Ekind (Id) in Formal_Kind;
2243 function Is_Generic_Subprogram (Id : E) return B is
2245 return Ekind (Id) in Generic_Subprogram_Kind;
2246 end Is_Generic_Subprogram;
2248 function Is_Generic_Unit (Id : E) return B is
2250 return Ekind (Id) in Generic_Unit_Kind;
2251 end Is_Generic_Unit;
2253 function Is_Incomplete_Or_Private_Type (Id : E) return B is
2255 return Ekind (Id) in
2256 Incomplete_Or_Private_Kind;
2257 end Is_Incomplete_Or_Private_Type;
2259 function Is_Integer_Type (Id : E) return B is
2261 return Ekind (Id) in Integer_Kind;
2262 end Is_Integer_Type;
2264 function Is_Modular_Integer_Type (Id : E) return B is
2266 return Ekind (Id) in
2267 Modular_Integer_Kind;
2268 end Is_Modular_Integer_Type;
2270 function Is_Named_Number (Id : E) return B is
2272 return Ekind (Id) in Named_Kind;
2273 end Is_Named_Number;
2275 function Is_Numeric_Type (Id : E) return B is
2277 return Ekind (Id) in Numeric_Kind;
2278 end Is_Numeric_Type;
2280 function Is_Object (Id : E) return B is
2282 return Ekind (Id) in Object_Kind;
2285 function Is_Ordinary_Fixed_Point_Type (Id : E) return B is
2287 return Ekind (Id) in
2288 Ordinary_Fixed_Point_Kind;
2289 end Is_Ordinary_Fixed_Point_Type;
2291 function Is_Overloadable (Id : E) return B is
2293 return Ekind (Id) in Overloadable_Kind;
2294 end Is_Overloadable;
2296 function Is_Private_Type (Id : E) return B is
2298 return Ekind (Id) in Private_Kind;
2299 end Is_Private_Type;
2301 function Is_Protected_Type (Id : E) return B is
2303 return Ekind (Id) in Protected_Kind;
2304 end Is_Protected_Type;
2306 function Is_Real_Type (Id : E) return B is
2308 return Ekind (Id) in Real_Kind;
2311 function Is_Record_Type (Id : E) return B is
2313 return Ekind (Id) in Record_Kind;
2316 function Is_Scalar_Type (Id : E) return B is
2318 return Ekind (Id) in Scalar_Kind;
2321 function Is_Signed_Integer_Type (Id : E) return B is
2323 return Ekind (Id) in
2324 Signed_Integer_Kind;
2325 end Is_Signed_Integer_Type;
2327 function Is_Subprogram (Id : E) return B is
2329 return Ekind (Id) in Subprogram_Kind;
2332 function Is_Task_Type (Id : E) return B is
2334 return Ekind (Id) in Task_Kind;
2337 function Is_Type (Id : E) return B is
2339 return Ekind (Id) in Type_Kind;
2342 ------------------------------
2343 -- Attribute Set Procedures --
2344 ------------------------------
2346 procedure Set_Accept_Address (Id : E; V : L) is
2348 Set_Elist21 (Id, V);
2349 end Set_Accept_Address;
2351 procedure Set_Access_Disp_Table (Id : E; V : E) is
2353 pragma Assert (Is_Tagged_Type (Id) and then Id = Base_Type (Id));
2355 end Set_Access_Disp_Table;
2357 procedure Set_Associated_Final_Chain (Id : E; V : E) is
2359 pragma Assert (Is_Access_Type (Id));
2361 end Set_Associated_Final_Chain;
2363 procedure Set_Associated_Formal_Package (Id : E; V : E) is
2366 end Set_Associated_Formal_Package;
2368 procedure Set_Associated_Node_For_Itype (Id : E; V : E) is
2371 end Set_Associated_Node_For_Itype;
2373 procedure Set_Associated_Storage_Pool (Id : E; V : E) is
2375 pragma Assert (Is_Access_Type (Id) and then Id = Base_Type (Id));
2377 end Set_Associated_Storage_Pool;
2379 procedure Set_Actual_Subtype (Id : E; V : E) is
2382 (Ekind (Id) = E_Constant
2383 or else Ekind (Id) = E_Variable
2384 or else Ekind (Id) = E_Generic_In_Out_Parameter
2385 or else Ekind (Id) in E_In_Parameter .. E_In_Out_Parameter);
2387 end Set_Actual_Subtype;
2389 procedure Set_Address_Taken (Id : E; V : B := True) is
2391 Set_Flag104 (Id, V);
2392 end Set_Address_Taken;
2394 procedure Set_Alias (Id : E; V : E) is
2397 (Is_Overloadable (Id) or else Ekind (Id) = E_Subprogram_Type);
2401 procedure Set_Alignment (Id : E; V : U) is
2403 pragma Assert (Is_Type (Id)
2404 or else Is_Formal (Id)
2405 or else Ekind (Id) = E_Loop_Parameter
2406 or else Ekind (Id) = E_Constant
2407 or else Ekind (Id) = E_Exception
2408 or else Ekind (Id) = E_Variable);
2412 procedure Set_Barrier_Function (Id : E; V : N) is
2414 pragma Assert (Is_Entry (Id));
2416 end Set_Barrier_Function;
2418 procedure Set_Block_Node (Id : E; V : N) is
2420 pragma Assert (Ekind (Id) = E_Block);
2424 procedure Set_Body_Entity (Id : E; V : E) is
2427 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
2429 end Set_Body_Entity;
2431 procedure Set_Body_Needed_For_SAL (Id : E; V : B := True) is
2434 (Ekind (Id) = E_Package
2435 or else Is_Subprogram (Id)
2436 or else Is_Generic_Unit (Id));
2438 end Set_Body_Needed_For_SAL;
2440 procedure Set_C_Pass_By_Copy (Id : E; V : B := True) is
2442 pragma Assert (Is_Record_Type (Id) and then Id = Base_Type (Id));
2443 Set_Flag125 (Id, V);
2444 end Set_C_Pass_By_Copy;
2446 procedure Set_Can_Never_Be_Null (Id : E; V : B := True) is
2449 end Set_Can_Never_Be_Null;
2451 procedure Set_Checks_May_Be_Suppressed (Id : E; V : B := True) is
2454 end Set_Checks_May_Be_Suppressed;
2456 procedure Set_Class_Wide_Type (Id : E; V : E) is
2458 pragma Assert (Is_Type (Id));
2460 end Set_Class_Wide_Type;
2462 procedure Set_Cloned_Subtype (Id : E; V : E) is
2465 (Ekind (Id) = E_Record_Subtype
2466 or else Ekind (Id) = E_Class_Wide_Subtype);
2468 end Set_Cloned_Subtype;
2470 procedure Set_Component_Bit_Offset (Id : E; V : U) is
2473 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
2475 end Set_Component_Bit_Offset;
2477 procedure Set_Component_Clause (Id : E; V : N) is
2480 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
2482 end Set_Component_Clause;
2484 procedure Set_Component_Size (Id : E; V : U) is
2486 pragma Assert (Is_Array_Type (Id) and then Id = Base_Type (Id));
2488 end Set_Component_Size;
2490 procedure Set_Component_Type (Id : E; V : E) is
2492 pragma Assert (Is_Array_Type (Id) and then Id = Base_Type (Id));
2494 end Set_Component_Type;
2496 procedure Set_Corresponding_Concurrent_Type (Id : E; V : E) is
2499 (Ekind (Id) = E_Record_Type and then Is_Concurrent_Type (V));
2501 end Set_Corresponding_Concurrent_Type;
2503 procedure Set_Corresponding_Discriminant (Id : E; V : E) is
2505 pragma Assert (Ekind (Id) = E_Discriminant);
2507 end Set_Corresponding_Discriminant;
2509 procedure Set_Corresponding_Equality (Id : E; V : E) is
2512 (Ekind (Id) = E_Function
2513 and then not Comes_From_Source (Id)
2514 and then Chars (Id) = Name_Op_Ne);
2516 end Set_Corresponding_Equality;
2518 procedure Set_Corresponding_Record_Type (Id : E; V : E) is
2520 pragma Assert (Is_Concurrent_Type (Id));
2522 end Set_Corresponding_Record_Type;
2524 procedure Set_Corresponding_Remote_Type (Id : E; V : E) is
2527 end Set_Corresponding_Remote_Type;
2529 procedure Set_Current_Value (Id : E; V : E) is
2531 pragma Assert (Ekind (Id) in Object_Kind or else Ekind (Id) = E_Void);
2533 end Set_Current_Value;
2535 procedure Set_CR_Discriminant (Id : E; V : E) is
2538 end Set_CR_Discriminant;
2540 procedure Set_Debug_Info_Off (Id : E; V : B := True) is
2542 Set_Flag166 (Id, V);
2543 end Set_Debug_Info_Off;
2545 procedure Set_Debug_Renaming_Link (Id : E; V : E) is
2548 end Set_Debug_Renaming_Link;
2550 procedure Set_Default_Expr_Function (Id : E; V : E) is
2552 pragma Assert (Is_Formal (Id));
2554 end Set_Default_Expr_Function;
2556 procedure Set_Default_Expressions_Processed (Id : E; V : B := True) is
2558 Set_Flag108 (Id, V);
2559 end Set_Default_Expressions_Processed;
2561 procedure Set_Default_Value (Id : E; V : N) is
2563 pragma Assert (Is_Formal (Id));
2565 end Set_Default_Value;
2567 procedure Set_Delay_Cleanups (Id : E; V : B := True) is
2571 or else Is_Task_Type (Id)
2572 or else Ekind (Id) = E_Block);
2573 Set_Flag114 (Id, V);
2574 end Set_Delay_Cleanups;
2576 procedure Set_Delay_Subprogram_Descriptors (Id : E; V : B := True) is
2580 or else Ekind (Id) = E_Package
2581 or else Ekind (Id) = E_Package_Body);
2583 end Set_Delay_Subprogram_Descriptors;
2585 procedure Set_Delta_Value (Id : E; V : R) is
2587 pragma Assert (Is_Fixed_Point_Type (Id));
2588 Set_Ureal18 (Id, V);
2589 end Set_Delta_Value;
2591 procedure Set_Dependent_Instances (Id : E; V : L) is
2593 pragma Assert (Is_Generic_Instance (Id));
2595 end Set_Dependent_Instances;
2597 procedure Set_Depends_On_Private (Id : E; V : B := True) is
2599 pragma Assert (Nkind (Id) in N_Entity);
2601 end Set_Depends_On_Private;
2603 procedure Set_Digits_Value (Id : E; V : U) is
2606 (Is_Floating_Point_Type (Id)
2607 or else Is_Decimal_Fixed_Point_Type (Id));
2609 end Set_Digits_Value;
2611 procedure Set_Directly_Designated_Type (Id : E; V : E) is
2614 end Set_Directly_Designated_Type;
2616 procedure Set_Discard_Names (Id : E; V : B := True) is
2619 end Set_Discard_Names;
2621 procedure Set_Discriminal (Id : E; V : E) is
2623 pragma Assert (Ekind (Id) = E_Discriminant);
2625 end Set_Discriminal;
2627 procedure Set_Discriminal_Link (Id : E; V : E) is
2630 end Set_Discriminal_Link;
2632 procedure Set_Discriminant_Checking_Func (Id : E; V : E) is
2634 pragma Assert (Ekind (Id) = E_Component);
2636 end Set_Discriminant_Checking_Func;
2638 procedure Set_Discriminant_Constraint (Id : E; V : L) is
2640 pragma Assert (Nkind (Id) in N_Entity);
2641 Set_Elist21 (Id, V);
2642 end Set_Discriminant_Constraint;
2644 procedure Set_Discriminant_Default_Value (Id : E; V : N) is
2647 end Set_Discriminant_Default_Value;
2649 procedure Set_Discriminant_Number (Id : E; V : U) is
2652 end Set_Discriminant_Number;
2654 procedure Set_DT_Entry_Count (Id : E; V : U) is
2656 pragma Assert (Ekind (Id) = E_Component);
2658 end Set_DT_Entry_Count;
2660 procedure Set_DT_Position (Id : E; V : U) is
2662 pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2664 end Set_DT_Position;
2666 procedure Set_DTC_Entity (Id : E; V : E) is
2669 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2673 procedure Set_Elaborate_All_Desirable (Id : E; V : B := True) is
2675 Set_Flag146 (Id, V);
2676 end Set_Elaborate_All_Desirable;
2678 procedure Set_Elaboration_Entity (Id : E; V : E) is
2683 Ekind (Id) = E_Package
2685 Is_Generic_Unit (Id));
2687 end Set_Elaboration_Entity;
2689 procedure Set_Elaboration_Entity_Required (Id : E; V : B := True) is
2694 Ekind (Id) = E_Package
2696 Is_Generic_Unit (Id));
2697 Set_Flag174 (Id, V);
2698 end Set_Elaboration_Entity_Required;
2700 procedure Set_Enclosing_Scope (Id : E; V : E) is
2703 end Set_Enclosing_Scope;
2705 procedure Set_Entry_Accepted (Id : E; V : B := True) is
2707 pragma Assert (Is_Entry (Id));
2708 Set_Flag152 (Id, V);
2709 end Set_Entry_Accepted;
2711 procedure Set_Entry_Bodies_Array (Id : E; V : E) is
2714 end Set_Entry_Bodies_Array;
2716 procedure Set_Entry_Cancel_Parameter (Id : E; V : E) is
2719 end Set_Entry_Cancel_Parameter;
2721 procedure Set_Entry_Component (Id : E; V : E) is
2724 end Set_Entry_Component;
2726 procedure Set_Entry_Formal (Id : E; V : E) is
2729 end Set_Entry_Formal;
2731 procedure Set_Entry_Index_Constant (Id : E; V : E) is
2733 pragma Assert (Ekind (Id) = E_Entry_Index_Parameter);
2735 end Set_Entry_Index_Constant;
2737 procedure Set_Entry_Parameters_Type (Id : E; V : E) is
2740 end Set_Entry_Parameters_Type;
2742 procedure Set_Enum_Pos_To_Rep (Id : E; V : E) is
2744 pragma Assert (Ekind (Id) = E_Enumeration_Type);
2746 end Set_Enum_Pos_To_Rep;
2748 procedure Set_Enumeration_Pos (Id : E; V : U) is
2750 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2752 end Set_Enumeration_Pos;
2754 procedure Set_Enumeration_Rep (Id : E; V : U) is
2756 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2758 end Set_Enumeration_Rep;
2760 procedure Set_Enumeration_Rep_Expr (Id : E; V : N) is
2762 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2764 end Set_Enumeration_Rep_Expr;
2766 procedure Set_Equivalent_Type (Id : E; V : E) is
2769 (Ekind (Id) = E_Class_Wide_Type or else
2770 Ekind (Id) = E_Class_Wide_Subtype or else
2771 Ekind (Id) = E_Access_Protected_Subprogram_Type or else
2772 Ekind (Id) = E_Access_Subprogram_Type or else
2773 Ekind (Id) = E_Exception_Type);
2775 end Set_Equivalent_Type;
2777 procedure Set_Esize (Id : E; V : U) is
2782 procedure Set_Exception_Code (Id : E; V : U) is
2784 pragma Assert (Ekind (Id) = E_Exception);
2786 end Set_Exception_Code;
2788 procedure Set_Extra_Accessibility (Id : E; V : E) is
2790 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
2792 end Set_Extra_Accessibility;
2794 procedure Set_Extra_Constrained (Id : E; V : E) is
2796 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
2798 end Set_Extra_Constrained;
2800 procedure Set_Extra_Formal (Id : E; V : E) is
2803 end Set_Extra_Formal;
2805 procedure Set_Finalization_Chain_Entity (Id : E; V : E) is
2808 end Set_Finalization_Chain_Entity;
2810 procedure Set_Finalize_Storage_Only (Id : E; V : B := True) is
2812 pragma Assert (Is_Type (Id) and then Id = Base_Type (Id));
2813 Set_Flag158 (Id, V);
2814 end Set_Finalize_Storage_Only;
2816 procedure Set_First_Entity (Id : E; V : E) is
2819 end Set_First_Entity;
2821 procedure Set_First_Index (Id : E; V : N) is
2824 end Set_First_Index;
2826 procedure Set_First_Literal (Id : E; V : E) is
2829 end Set_First_Literal;
2831 procedure Set_First_Optional_Parameter (Id : E; V : E) is
2834 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2836 end Set_First_Optional_Parameter;
2838 procedure Set_First_Private_Entity (Id : E; V : E) is
2840 pragma Assert (Nkind (Id) in N_Entity);
2842 end Set_First_Private_Entity;
2844 procedure Set_First_Rep_Item (Id : E; V : N) is
2847 end Set_First_Rep_Item;
2849 procedure Set_Freeze_Node (Id : E; V : N) is
2852 end Set_Freeze_Node;
2854 procedure Set_From_With_Type (Id : E; V : B := True) is
2858 or else Ekind (Id) = E_Package);
2859 Set_Flag159 (Id, V);
2860 end Set_From_With_Type;
2862 procedure Set_Full_View (Id : E; V : E) is
2864 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Constant);
2868 procedure Set_Function_Returns_With_DSP (Id : E; V : B := True) is
2871 (Is_Subprogram (Id) or else Ekind (Id) = E_Subprogram_Type);
2872 Set_Flag169 (Id, V);
2873 end Set_Function_Returns_With_DSP;
2875 procedure Set_Generic_Homonym (Id : E; V : E) is
2878 end Set_Generic_Homonym;
2880 procedure Set_Generic_Renamings (Id : E; V : L) is
2882 Set_Elist23 (Id, V);
2883 end Set_Generic_Renamings;
2885 procedure Set_Handler_Records (Id : E; V : S) is
2888 end Set_Handler_Records;
2890 procedure Set_Has_Aliased_Components (Id : E; V : B := True) is
2892 pragma Assert (Base_Type (Id) = Id);
2893 Set_Flag135 (Id, V);
2894 end Set_Has_Aliased_Components;
2896 procedure Set_Has_Alignment_Clause (Id : E; V : B := True) is
2899 end Set_Has_Alignment_Clause;
2901 procedure Set_Has_All_Calls_Remote (Id : E; V : B := True) is
2904 end Set_Has_All_Calls_Remote;
2906 procedure Set_Has_Atomic_Components (Id : E; V : B := True) is
2908 pragma Assert (not Is_Type (Id) or else Base_Type (Id) = Id);
2910 end Set_Has_Atomic_Components;
2912 procedure Set_Has_Biased_Representation (Id : E; V : B := True) is
2915 ((V = False) or else (Is_Discrete_Type (Id) or Is_Object (Id)));
2916 Set_Flag139 (Id, V);
2917 end Set_Has_Biased_Representation;
2919 procedure Set_Has_Completion (Id : E; V : B := True) is
2922 end Set_Has_Completion;
2924 procedure Set_Has_Completion_In_Body (Id : E; V : B := True) is
2926 pragma Assert (Ekind (Id) = E_Incomplete_Type);
2928 end Set_Has_Completion_In_Body;
2930 procedure Set_Has_Complex_Representation (Id : E; V : B := True) is
2932 pragma Assert (Ekind (Id) = E_Record_Type);
2933 Set_Flag140 (Id, V);
2934 end Set_Has_Complex_Representation;
2936 procedure Set_Has_Component_Size_Clause (Id : E; V : B := True) is
2938 pragma Assert (Ekind (Id) = E_Array_Type);
2940 end Set_Has_Component_Size_Clause;
2942 procedure Set_Has_Contiguous_Rep (Id : E; V : B := True) is
2944 Set_Flag181 (Id, V);
2945 end Set_Has_Contiguous_Rep;
2947 procedure Set_Has_Controlled_Component (Id : E; V : B := True) is
2949 pragma Assert (Base_Type (Id) = Id);
2951 end Set_Has_Controlled_Component;
2953 procedure Set_Has_Controlling_Result (Id : E; V : B := True) is
2956 end Set_Has_Controlling_Result;
2958 procedure Set_Has_Convention_Pragma (Id : E; V : B := True) is
2960 Set_Flag119 (Id, V);
2961 end Set_Has_Convention_Pragma;
2963 procedure Set_Has_Delayed_Freeze (Id : E; V : B := True) is
2965 pragma Assert (Nkind (Id) in N_Entity);
2967 end Set_Has_Delayed_Freeze;
2969 procedure Set_Has_Discriminants (Id : E; V : B := True) is
2971 pragma Assert (Nkind (Id) in N_Entity);
2973 end Set_Has_Discriminants;
2975 procedure Set_Has_Enumeration_Rep_Clause (Id : E; V : B := True) is
2977 pragma Assert (Is_Enumeration_Type (Id));
2979 end Set_Has_Enumeration_Rep_Clause;
2981 procedure Set_Has_Exit (Id : E; V : B := True) is
2986 procedure Set_Has_External_Tag_Rep_Clause (Id : E; V : B := True) is
2988 pragma Assert (Is_Tagged_Type (Id));
2989 Set_Flag110 (Id, V);
2990 end Set_Has_External_Tag_Rep_Clause;
2992 procedure Set_Has_Forward_Instantiation (Id : E; V : B := True) is
2994 Set_Flag175 (Id, V);
2995 end Set_Has_Forward_Instantiation;
2997 procedure Set_Has_Fully_Qualified_Name (Id : E; V : B := True) is
2999 Set_Flag173 (Id, V);
3000 end Set_Has_Fully_Qualified_Name;
3002 procedure Set_Has_Gigi_Rep_Item (Id : E; V : B := True) is
3005 end Set_Has_Gigi_Rep_Item;
3007 procedure Set_Has_Homonym (Id : E; V : B := True) is
3010 end Set_Has_Homonym;
3012 procedure Set_Has_Machine_Radix_Clause (Id : E; V : B := True) is
3014 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
3016 end Set_Has_Machine_Radix_Clause;
3018 procedure Set_Has_Master_Entity (Id : E; V : B := True) is
3021 end Set_Has_Master_Entity;
3023 procedure Set_Has_Missing_Return (Id : E; V : B := True) is
3026 (Ekind (Id) = E_Function or else Ekind (Id) = E_Generic_Function);
3027 Set_Flag142 (Id, V);
3028 end Set_Has_Missing_Return;
3030 procedure Set_Has_Nested_Block_With_Handler (Id : E; V : B := True) is
3032 Set_Flag101 (Id, V);
3033 end Set_Has_Nested_Block_With_Handler;
3035 procedure Set_Has_Non_Standard_Rep (Id : E; V : B := True) is
3037 pragma Assert (Base_Type (Id) = Id);
3039 end Set_Has_Non_Standard_Rep;
3041 procedure Set_Has_Object_Size_Clause (Id : E; V : B := True) is
3043 pragma Assert (Is_Type (Id));
3044 Set_Flag172 (Id, V);
3045 end Set_Has_Object_Size_Clause;
3047 procedure Set_Has_Per_Object_Constraint (Id : E; V : B := True) is
3049 Set_Flag154 (Id, V);
3050 end Set_Has_Per_Object_Constraint;
3052 procedure Set_Has_Pragma_Controlled (Id : E; V : B := True) is
3054 pragma Assert (Is_Access_Type (Id));
3055 Set_Flag27 (Base_Type (Id), V);
3056 end Set_Has_Pragma_Controlled;
3058 procedure Set_Has_Pragma_Elaborate_Body (Id : E; V : B := True) is
3060 Set_Flag150 (Id, V);
3061 end Set_Has_Pragma_Elaborate_Body;
3063 procedure Set_Has_Pragma_Inline (Id : E; V : B := True) is
3065 Set_Flag157 (Id, V);
3066 end Set_Has_Pragma_Inline;
3068 procedure Set_Has_Pragma_Pack (Id : E; V : B := True) is
3070 pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id));
3071 pragma Assert (Id = Base_Type (Id));
3072 Set_Flag121 (Id, V);
3073 end Set_Has_Pragma_Pack;
3075 procedure Set_Has_Pragma_Pure_Function (Id : E; V : B := True) is
3077 pragma Assert (Is_Subprogram (Id));
3078 Set_Flag179 (Id, V);
3079 end Set_Has_Pragma_Pure_Function;
3081 procedure Set_Has_Pragma_Unreferenced (Id : E; V : B := True) is
3083 Set_Flag180 (Id, V);
3084 end Set_Has_Pragma_Unreferenced;
3086 procedure Set_Has_Primitive_Operations (Id : E; V : B := True) is
3088 pragma Assert (Id = Base_Type (Id));
3089 Set_Flag120 (Id, V);
3090 end Set_Has_Primitive_Operations;
3092 procedure Set_Has_Private_Declaration (Id : E; V : B := True) is
3094 Set_Flag155 (Id, V);
3095 end Set_Has_Private_Declaration;
3097 procedure Set_Has_Qualified_Name (Id : E; V : B := True) is
3099 Set_Flag161 (Id, V);
3100 end Set_Has_Qualified_Name;
3102 procedure Set_Has_Record_Rep_Clause (Id : E; V : B := True) is
3104 pragma Assert (Id = Base_Type (Id));
3106 end Set_Has_Record_Rep_Clause;
3108 procedure Set_Has_Recursive_Call (Id : E; V : B := True) is
3110 pragma Assert (Is_Subprogram (Id));
3111 Set_Flag143 (Id, V);
3112 end Set_Has_Recursive_Call;
3114 procedure Set_Has_Size_Clause (Id : E; V : B := True) is
3117 end Set_Has_Size_Clause;
3119 procedure Set_Has_Small_Clause (Id : E; V : B := True) is
3122 end Set_Has_Small_Clause;
3124 procedure Set_Has_Specified_Layout (Id : E; V : B := True) is
3126 pragma Assert (Id = Base_Type (Id));
3127 Set_Flag100 (Id, V);
3128 end Set_Has_Specified_Layout;
3130 procedure Set_Has_Storage_Size_Clause (Id : E; V : B := True) is
3132 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
3133 pragma Assert (Base_Type (Id) = Id);
3135 end Set_Has_Storage_Size_Clause;
3137 procedure Set_Has_Subprogram_Descriptor (Id : E; V : B := True) is
3140 end Set_Has_Subprogram_Descriptor;
3142 procedure Set_Has_Task (Id : E; V : B := True) is
3144 pragma Assert (Base_Type (Id) = Id);
3148 procedure Set_Has_Unchecked_Union (Id : E; V : B := True) is
3150 pragma Assert (Base_Type (Id) = Id);
3151 Set_Flag123 (Id, V);
3152 end Set_Has_Unchecked_Union;
3154 procedure Set_Has_Unknown_Discriminants (Id : E; V : B := True) is
3156 pragma Assert (Is_Type (Id));
3158 end Set_Has_Unknown_Discriminants;
3160 procedure Set_Has_Volatile_Components (Id : E; V : B := True) is
3162 pragma Assert (not Is_Type (Id) or else Base_Type (Id) = Id);
3164 end Set_Has_Volatile_Components;
3166 procedure Set_Has_Xref_Entry (Id : E; V : B := True) is
3168 Set_Flag182 (Id, V);
3169 end Set_Has_Xref_Entry;
3171 procedure Set_Hiding_Loop_Variable (Id : E; V : E) is
3173 pragma Assert (Ekind (Id) = E_Variable);
3175 end Set_Hiding_Loop_Variable;
3177 procedure Set_Homonym (Id : E; V : E) is
3179 pragma Assert (Id /= V);
3183 procedure Set_In_Package_Body (Id : E; V : B := True) is
3186 end Set_In_Package_Body;
3188 procedure Set_In_Private_Part (Id : E; V : B := True) is
3191 end Set_In_Private_Part;
3193 procedure Set_In_Use (Id : E; V : B := True) is
3195 pragma Assert (Nkind (Id) in N_Entity);
3199 procedure Set_Inner_Instances (Id : E; V : L) is
3201 Set_Elist23 (Id, V);
3202 end Set_Inner_Instances;
3204 procedure Set_Interface_Name (Id : E; V : N) is
3207 end Set_Interface_Name;
3209 procedure Set_Is_Abstract (Id : E; V : B := True) is
3212 end Set_Is_Abstract;
3214 procedure Set_Is_Access_Constant (Id : E; V : B := True) is
3216 pragma Assert (Is_Access_Type (Id));
3218 end Set_Is_Access_Constant;
3220 procedure Set_Is_Aliased (Id : E; V : B := True) is
3222 pragma Assert (Nkind (Id) in N_Entity);
3226 procedure Set_Is_AST_Entry (Id : E; V : B := True) is
3228 pragma Assert (Is_Entry (Id));
3229 Set_Flag132 (Id, V);
3230 end Set_Is_AST_Entry;
3232 procedure Set_Is_Asynchronous (Id : E; V : B := True) is
3235 (Ekind (Id) = E_Procedure or else Is_Type (Id));
3237 end Set_Is_Asynchronous;
3239 procedure Set_Is_Atomic (Id : E; V : B := True) is
3244 procedure Set_Is_Bit_Packed_Array (Id : E; V : B := True) is
3246 pragma Assert ((not V)
3247 or else (Is_Array_Type (Id) and then Id = Base_Type (Id)));
3249 Set_Flag122 (Id, V);
3250 end Set_Is_Bit_Packed_Array;
3252 procedure Set_Is_Called (Id : E; V : B := True) is
3255 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Function);
3256 Set_Flag102 (Id, V);
3259 procedure Set_Is_Character_Type (Id : E; V : B := True) is
3262 end Set_Is_Character_Type;
3264 procedure Set_Is_Child_Unit (Id : E; V : B := True) is
3267 end Set_Is_Child_Unit;
3269 procedure Set_Is_Class_Wide_Equivalent_Type (Id : E; V : B := True) is
3272 end Set_Is_Class_Wide_Equivalent_Type;
3274 procedure Set_Is_Compilation_Unit (Id : E; V : B := True) is
3276 Set_Flag149 (Id, V);
3277 end Set_Is_Compilation_Unit;
3279 procedure Set_Is_Completely_Hidden (Id : E; V : B := True) is
3281 pragma Assert (Ekind (Id) = E_Discriminant);
3282 Set_Flag103 (Id, V);
3283 end Set_Is_Completely_Hidden;
3285 procedure Set_Is_Concurrent_Record_Type (Id : E; V : B := True) is
3288 end Set_Is_Concurrent_Record_Type;
3290 procedure Set_Is_Constr_Subt_For_U_Nominal (Id : E; V : B := True) is
3293 end Set_Is_Constr_Subt_For_U_Nominal;
3295 procedure Set_Is_Constr_Subt_For_UN_Aliased (Id : E; V : B := True) is
3297 Set_Flag141 (Id, V);
3298 end Set_Is_Constr_Subt_For_UN_Aliased;
3300 procedure Set_Is_Constrained (Id : E; V : B := True) is
3302 pragma Assert (Nkind (Id) in N_Entity);
3304 end Set_Is_Constrained;
3306 procedure Set_Is_Constructor (Id : E; V : B := True) is
3309 end Set_Is_Constructor;
3311 procedure Set_Is_Controlled (Id : E; V : B := True) is
3313 pragma Assert (Id = Base_Type (Id));
3315 end Set_Is_Controlled;
3317 procedure Set_Is_Controlling_Formal (Id : E; V : B := True) is
3319 pragma Assert (Is_Formal (Id));
3321 end Set_Is_Controlling_Formal;
3323 procedure Set_Is_CPP_Class (Id : E; V : B := True) is
3326 end Set_Is_CPP_Class;
3328 procedure Set_Is_Discrim_SO_Function (Id : E; V : B := True) is
3330 Set_Flag176 (Id, V);
3331 end Set_Is_Discrim_SO_Function;
3333 procedure Set_Is_Dispatching_Operation (Id : E; V : B := True) is
3338 Is_Overloadable (Id)
3340 Ekind (Id) = E_Subprogram_Type);
3343 end Set_Is_Dispatching_Operation;
3345 procedure Set_Is_Eliminated (Id : E; V : B := True) is
3347 Set_Flag124 (Id, V);
3348 end Set_Is_Eliminated;
3350 procedure Set_Is_Entry_Formal (Id : E; V : B := True) is
3353 end Set_Is_Entry_Formal;
3355 procedure Set_Is_Exported (Id : E; V : B := True) is
3358 end Set_Is_Exported;
3360 procedure Set_Is_First_Subtype (Id : E; V : B := True) is
3363 end Set_Is_First_Subtype;
3365 procedure Set_Is_For_Access_Subtype (Id : E; V : B := True) is
3368 (Ekind (Id) = E_Record_Subtype
3370 Ekind (Id) = E_Private_Subtype);
3371 Set_Flag118 (Id, V);
3372 end Set_Is_For_Access_Subtype;
3374 procedure Set_Is_Formal_Subprogram (Id : E; V : B := True) is
3376 Set_Flag111 (Id, V);
3377 end Set_Is_Formal_Subprogram;
3379 procedure Set_Is_Frozen (Id : E; V : B := True) is
3381 pragma Assert (Nkind (Id) in N_Entity);
3385 procedure Set_Is_Generic_Actual_Type (Id : E; V : B := True) is
3387 pragma Assert (Is_Type (Id));
3389 end Set_Is_Generic_Actual_Type;
3391 procedure Set_Is_Generic_Instance (Id : E; V : B := True) is
3393 Set_Flag130 (Id, V);
3394 end Set_Is_Generic_Instance;
3396 procedure Set_Is_Generic_Type (Id : E; V : B := True) is
3398 pragma Assert (Nkind (Id) in N_Entity);
3400 end Set_Is_Generic_Type;
3402 procedure Set_Is_Hidden (Id : E; V : B := True) is
3407 procedure Set_Is_Hidden_Open_Scope (Id : E; V : B := True) is
3409 Set_Flag171 (Id, V);
3410 end Set_Is_Hidden_Open_Scope;
3412 procedure Set_Is_Immediately_Visible (Id : E; V : B := True) is
3414 pragma Assert (Nkind (Id) in N_Entity);
3416 end Set_Is_Immediately_Visible;
3418 procedure Set_Is_Imported (Id : E; V : B := True) is
3421 end Set_Is_Imported;
3423 procedure Set_Is_Inlined (Id : E; V : B := True) is
3428 procedure Set_Is_Instantiated (Id : E; V : B := True) is
3430 Set_Flag126 (Id, V);
3431 end Set_Is_Instantiated;
3433 procedure Set_Is_Internal (Id : E; V : B := True) is
3435 pragma Assert (Nkind (Id) in N_Entity);
3437 end Set_Is_Internal;
3439 procedure Set_Is_Interrupt_Handler (Id : E; V : B := True) is
3441 pragma Assert (Nkind (Id) in N_Entity);
3443 end Set_Is_Interrupt_Handler;
3445 procedure Set_Is_Intrinsic_Subprogram (Id : E; V : B := True) is
3448 end Set_Is_Intrinsic_Subprogram;
3450 procedure Set_Is_Itype (Id : E; V : B := True) is
3455 procedure Set_Is_Known_Non_Null (Id : E; V : B := True) is
3458 end Set_Is_Known_Non_Null;
3460 procedure Set_Is_Known_Valid (Id : E; V : B := True) is
3462 Set_Flag170 (Id, V);
3463 end Set_Is_Known_Valid;
3465 procedure Set_Is_Limited_Composite (Id : E; V : B := True) is
3467 pragma Assert (Is_Type (Id));
3468 Set_Flag106 (Id, V);
3469 end Set_Is_Limited_Composite;
3471 procedure Set_Is_Limited_Record (Id : E; V : B := True) is
3474 end Set_Is_Limited_Record;
3476 procedure Set_Is_Machine_Code_Subprogram (Id : E; V : B := True) is
3478 pragma Assert (Is_Subprogram (Id));
3479 Set_Flag137 (Id, V);
3480 end Set_Is_Machine_Code_Subprogram;
3482 procedure Set_Is_Non_Static_Subtype (Id : E; V : B := True) is
3484 pragma Assert (Is_Type (Id));
3485 Set_Flag109 (Id, V);
3486 end Set_Is_Non_Static_Subtype;
3488 procedure Set_Is_Null_Init_Proc (Id : E; V : B := True) is
3490 pragma Assert (Ekind (Id) = E_Procedure);
3491 Set_Flag178 (Id, V);
3492 end Set_Is_Null_Init_Proc;
3494 procedure Set_Is_Optional_Parameter (Id : E; V : B := True) is
3496 pragma Assert (Is_Formal (Id));
3497 Set_Flag134 (Id, V);
3498 end Set_Is_Optional_Parameter;
3500 procedure Set_Is_Overriding_Operation (Id : E; V : B := True) is
3502 pragma Assert (Is_Subprogram (Id));
3504 end Set_Is_Overriding_Operation;
3506 procedure Set_Is_Package_Body_Entity (Id : E; V : B := True) is
3508 Set_Flag160 (Id, V);
3509 end Set_Is_Package_Body_Entity;
3511 procedure Set_Is_Packed (Id : E; V : B := True) is
3513 pragma Assert (Base_Type (Id) = Id);
3517 procedure Set_Is_Packed_Array_Type (Id : E; V : B := True) is
3519 Set_Flag138 (Id, V);
3520 end Set_Is_Packed_Array_Type;
3522 procedure Set_Is_Potentially_Use_Visible (Id : E; V : B := True) is
3524 pragma Assert (Nkind (Id) in N_Entity);
3526 end Set_Is_Potentially_Use_Visible;
3528 procedure Set_Is_Preelaborated (Id : E; V : B := True) is
3531 end Set_Is_Preelaborated;
3533 procedure Set_Is_Private_Composite (Id : E; V : B := True) is
3535 pragma Assert (Is_Type (Id));
3536 Set_Flag107 (Id, V);
3537 end Set_Is_Private_Composite;
3539 procedure Set_Is_Private_Descendant (Id : E; V : B := True) is
3542 end Set_Is_Private_Descendant;
3544 procedure Set_Is_Public (Id : E; V : B := True) is
3546 pragma Assert (Nkind (Id) in N_Entity);
3550 procedure Set_Is_Pure (Id : E; V : B := True) is
3555 procedure Set_Is_Remote_Call_Interface (Id : E; V : B := True) is
3558 end Set_Is_Remote_Call_Interface;
3560 procedure Set_Is_Remote_Types (Id : E; V : B := True) is
3563 end Set_Is_Remote_Types;
3565 procedure Set_Is_Renaming_Of_Object (Id : E; V : B := True) is
3567 Set_Flag112 (Id, V);
3568 end Set_Is_Renaming_Of_Object;
3570 procedure Set_Is_Shared_Passive (Id : E; V : B := True) is
3573 end Set_Is_Shared_Passive;
3575 procedure Set_Is_Statically_Allocated (Id : E; V : B := True) is
3578 (Ekind (Id) = E_Exception
3579 or else Ekind (Id) = E_Variable
3580 or else Ekind (Id) = E_Constant
3581 or else Is_Type (Id)
3582 or else Ekind (Id) = E_Void);
3584 end Set_Is_Statically_Allocated;
3586 procedure Set_Is_Tag (Id : E; V : B := True) is
3588 pragma Assert (Nkind (Id) in N_Entity);
3592 procedure Set_Is_Tagged_Type (Id : E; V : B := True) is
3595 end Set_Is_Tagged_Type;
3597 procedure Set_Is_Thread_Body (Id : E; V : B := True) is
3600 end Set_Is_Thread_Body;
3602 procedure Set_Is_True_Constant (Id : E; V : B := True) is
3604 Set_Flag163 (Id, V);
3605 end Set_Is_True_Constant;
3607 procedure Set_Is_Unchecked_Union (Id : E; V : B := True) is
3609 pragma Assert (Base_Type (Id) = Id);
3610 Set_Flag117 (Id, V);
3611 end Set_Is_Unchecked_Union;
3613 procedure Set_Is_Unsigned_Type (Id : E; V : B := True) is
3615 pragma Assert (Is_Discrete_Or_Fixed_Point_Type (Id));
3616 Set_Flag144 (Id, V);
3617 end Set_Is_Unsigned_Type;
3619 procedure Set_Is_Valued_Procedure (Id : E; V : B := True) is
3621 pragma Assert (Ekind (Id) = E_Procedure);
3622 Set_Flag127 (Id, V);
3623 end Set_Is_Valued_Procedure;
3625 procedure Set_Is_Visible_Child_Unit (Id : E; V : B := True) is
3627 pragma Assert (Is_Child_Unit (Id));
3628 Set_Flag116 (Id, V);
3629 end Set_Is_Visible_Child_Unit;
3631 procedure Set_Is_VMS_Exception (Id : E; V : B := True) is
3633 pragma Assert (Ekind (Id) = E_Exception);
3634 Set_Flag133 (Id, V);
3635 end Set_Is_VMS_Exception;
3637 procedure Set_Is_Volatile (Id : E; V : B := True) is
3639 pragma Assert (Nkind (Id) in N_Entity);
3641 end Set_Is_Volatile;
3643 procedure Set_Kill_Elaboration_Checks (Id : E; V : B := True) is
3646 end Set_Kill_Elaboration_Checks;
3648 procedure Set_Kill_Range_Checks (Id : E; V : B := True) is
3651 end Set_Kill_Range_Checks;
3653 procedure Set_Kill_Tag_Checks (Id : E; V : B := True) is
3656 end Set_Kill_Tag_Checks;
3658 procedure Set_Last_Entity (Id : E; V : E) is
3661 end Set_Last_Entity;
3663 procedure Set_Limited_View (Id : E; V : E) is
3665 pragma Assert (Ekind (Id) = E_Package);
3667 end Set_Limited_View;
3669 procedure Set_Lit_Indexes (Id : E; V : E) is
3671 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
3673 end Set_Lit_Indexes;
3675 procedure Set_Lit_Strings (Id : E; V : E) is
3677 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
3679 end Set_Lit_Strings;
3681 procedure Set_Machine_Radix_10 (Id : E; V : B := True) is
3683 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
3685 end Set_Machine_Radix_10;
3687 procedure Set_Master_Id (Id : E; V : E) is
3692 procedure Set_Materialize_Entity (Id : E; V : B := True) is
3694 Set_Flag168 (Id, V);
3695 end Set_Materialize_Entity;
3697 procedure Set_Mechanism (Id : E; V : M) is
3699 pragma Assert (Ekind (Id) = E_Function or else Is_Formal (Id));
3700 Set_Uint8 (Id, UI_From_Int (V));
3703 procedure Set_Modulus (Id : E; V : U) is
3705 pragma Assert (Ekind (Id) = E_Modular_Integer_Type);
3709 procedure Set_Must_Be_On_Byte_Boundary (Id : E; V : B := True) is
3711 pragma Assert (Is_Type (Id));
3712 Set_Flag183 (Id, V);
3713 end Set_Must_Be_On_Byte_Boundary;
3715 procedure Set_Needs_Debug_Info (Id : E; V : B := True) is
3717 Set_Flag147 (Id, V);
3718 end Set_Needs_Debug_Info;
3720 procedure Set_Needs_No_Actuals (Id : E; V : B := True) is
3723 (Is_Overloadable (Id)
3724 or else Ekind (Id) = E_Subprogram_Type
3725 or else Ekind (Id) = E_Entry_Family);
3727 end Set_Needs_No_Actuals;
3729 procedure Set_Never_Set_In_Source (Id : E; V : B := True) is
3731 Set_Flag115 (Id, V);
3732 end Set_Never_Set_In_Source;
3734 procedure Set_Next_Inlined_Subprogram (Id : E; V : E) is
3737 end Set_Next_Inlined_Subprogram;
3739 procedure Set_No_Pool_Assigned (Id : E; V : B := True) is
3741 pragma Assert (Is_Access_Type (Id) and then Base_Type (Id) = Id);
3742 Set_Flag131 (Id, V);
3743 end Set_No_Pool_Assigned;
3745 procedure Set_No_Return (Id : E; V : B := True) is
3748 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Generic_Procedure);
3749 Set_Flag113 (Id, V);
3752 procedure Set_No_Strict_Aliasing (Id : E; V : B := True) is
3754 pragma Assert (Is_Access_Type (Id) and then Base_Type (Id) = Id);
3755 Set_Flag136 (Id, V);
3756 end Set_No_Strict_Aliasing;
3758 procedure Set_Non_Binary_Modulus (Id : E; V : B := True) is
3760 pragma Assert (Ekind (Id) = E_Modular_Integer_Type);
3762 end Set_Non_Binary_Modulus;
3764 procedure Set_Non_Limited_View (Id : E; V : E) is
3765 pragma Assert (False
3766 or else Ekind (Id) = E_Incomplete_Type);
3769 end Set_Non_Limited_View;
3771 procedure Set_Nonzero_Is_True (Id : E; V : B := True) is
3774 (Root_Type (Id) = Standard_Boolean
3775 and then Ekind (Id) = E_Enumeration_Type);
3776 Set_Flag162 (Id, V);
3777 end Set_Nonzero_Is_True;
3779 procedure Set_Normalized_First_Bit (Id : E; V : U) is
3782 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
3784 end Set_Normalized_First_Bit;
3786 procedure Set_Normalized_Position (Id : E; V : U) is
3789 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
3791 end Set_Normalized_Position;
3793 procedure Set_Normalized_Position_Max (Id : E; V : U) is
3796 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
3798 end Set_Normalized_Position_Max;
3800 procedure Set_Object_Ref (Id : E; V : E) is
3802 pragma Assert (Ekind (Id) = E_Protected_Body);
3806 procedure Set_Original_Access_Type (Id : E; V : E) is
3809 (Ekind (Id) = E_Access_Subprogram_Type
3810 or else Ekind (Id) = E_Access_Protected_Subprogram_Type);
3812 end Set_Original_Access_Type;
3814 procedure Set_Original_Array_Type (Id : E; V : E) is
3816 pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id));
3818 end Set_Original_Array_Type;
3820 procedure Set_Original_Record_Component (Id : E; V : E) is
3823 (Ekind (Id) = E_Void
3824 or else Ekind (Id) = E_Component
3825 or else Ekind (Id) = E_Discriminant);
3827 end Set_Original_Record_Component;
3829 procedure Set_Packed_Array_Type (Id : E; V : E) is
3831 pragma Assert (Is_Array_Type (Id));
3833 end Set_Packed_Array_Type;
3835 procedure Set_Parent_Subtype (Id : E; V : E) is
3837 pragma Assert (Ekind (Id) = E_Record_Type);
3839 end Set_Parent_Subtype;
3841 procedure Set_Primitive_Operations (Id : E; V : L) is
3843 pragma Assert (Is_Tagged_Type (Id));
3844 Set_Elist15 (Id, V);
3845 end Set_Primitive_Operations;
3847 procedure Set_Prival (Id : E; V : E) is
3849 pragma Assert (Is_Protected_Private (Id));
3853 procedure Set_Privals_Chain (Id : E; V : L) is
3855 pragma Assert (Is_Overloadable (Id)
3856 or else Ekind (Id) = E_Entry_Family);
3857 Set_Elist23 (Id, V);
3858 end Set_Privals_Chain;
3860 procedure Set_Private_Dependents (Id : E; V : L) is
3862 pragma Assert (Is_Incomplete_Or_Private_Type (Id));
3863 Set_Elist18 (Id, V);
3864 end Set_Private_Dependents;
3866 procedure Set_Private_View (Id : E; V : N) is
3868 pragma Assert (Is_Private_Type (Id));
3870 end Set_Private_View;
3872 procedure Set_Protected_Body_Subprogram (Id : E; V : E) is
3874 pragma Assert (Is_Subprogram (Id) or else Is_Entry (Id));
3876 end Set_Protected_Body_Subprogram;
3878 procedure Set_Protected_Formal (Id : E; V : E) is
3880 pragma Assert (Is_Formal (Id));
3882 end Set_Protected_Formal;
3884 procedure Set_Protected_Operation (Id : E; V : N) is
3886 pragma Assert (Is_Protected_Private (Id));
3888 end Set_Protected_Operation;
3890 procedure Set_Reachable (Id : E; V : B := True) is
3895 procedure Set_Referenced (Id : E; V : B := True) is
3897 Set_Flag156 (Id, V);
3900 procedure Set_Referenced_As_LHS (Id : E; V : B := True) is
3903 end Set_Referenced_As_LHS;
3905 procedure Set_Referenced_Object (Id : E; V : N) is
3907 pragma Assert (Is_Type (Id));
3909 end Set_Referenced_Object;
3911 procedure Set_Register_Exception_Call (Id : E; V : N) is
3913 pragma Assert (Ekind (Id) = E_Exception);
3915 end Set_Register_Exception_Call;
3917 procedure Set_Related_Array_Object (Id : E; V : E) is
3919 pragma Assert (Is_Array_Type (Id));
3921 end Set_Related_Array_Object;
3923 procedure Set_Related_Instance (Id : E; V : E) is
3926 (Ekind (Id) = E_Package or else Ekind (Id) = E_Package_Body);
3928 end Set_Related_Instance;
3930 procedure Set_Renamed_Entity (Id : E; V : N) is
3933 end Set_Renamed_Entity;
3935 procedure Set_Renamed_Object (Id : E; V : N) is
3938 end Set_Renamed_Object;
3940 procedure Set_Renaming_Map (Id : E; V : U) is
3943 end Set_Renaming_Map;
3945 procedure Set_Return_Present (Id : E; V : B := True) is
3948 end Set_Return_Present;
3950 procedure Set_Returns_By_Ref (Id : E; V : B := True) is
3953 end Set_Returns_By_Ref;
3955 procedure Set_Reverse_Bit_Order (Id : E; V : B := True) is
3958 (Is_Record_Type (Id) and then Id = Base_Type (Id));
3959 Set_Flag164 (Id, V);
3960 end Set_Reverse_Bit_Order;
3962 procedure Set_RM_Size (Id : E; V : U) is
3964 pragma Assert (Is_Type (Id));
3968 procedure Set_Scalar_Range (Id : E; V : N) is
3971 end Set_Scalar_Range;
3973 procedure Set_Scale_Value (Id : E; V : U) is
3976 end Set_Scale_Value;
3978 procedure Set_Scope_Depth_Value (Id : E; V : U) is
3980 pragma Assert (not Is_Record_Type (Id));
3982 end Set_Scope_Depth_Value;
3984 procedure Set_Sec_Stack_Needed_For_Return (Id : E; V : B := True) is
3986 Set_Flag167 (Id, V);
3987 end Set_Sec_Stack_Needed_For_Return;
3989 procedure Set_Shadow_Entities (Id : E; V : S) is
3992 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
3994 end Set_Shadow_Entities;
3996 procedure Set_Shared_Var_Assign_Proc (Id : E; V : E) is
3998 pragma Assert (Ekind (Id) = E_Variable);
4000 end Set_Shared_Var_Assign_Proc;
4002 procedure Set_Shared_Var_Read_Proc (Id : E; V : E) is
4004 pragma Assert (Ekind (Id) = E_Variable);
4006 end Set_Shared_Var_Read_Proc;
4008 procedure Set_Size_Check_Code (Id : E; V : N) is
4010 pragma Assert (Ekind (Id) = E_Constant or else Ekind (Id) = E_Variable);
4012 end Set_Size_Check_Code;
4014 procedure Set_Size_Depends_On_Discriminant (Id : E; V : B := True) is
4016 Set_Flag177 (Id, V);
4017 end Set_Size_Depends_On_Discriminant;
4019 procedure Set_Size_Known_At_Compile_Time (Id : E; V : B := True) is
4022 end Set_Size_Known_At_Compile_Time;
4024 procedure Set_Small_Value (Id : E; V : R) is
4026 pragma Assert (Is_Fixed_Point_Type (Id));
4027 Set_Ureal21 (Id, V);
4028 end Set_Small_Value;
4030 procedure Set_Spec_Entity (Id : E; V : E) is
4032 pragma Assert (Ekind (Id) = E_Package_Body or else Is_Formal (Id));
4034 end Set_Spec_Entity;
4036 procedure Set_Storage_Size_Variable (Id : E; V : E) is
4038 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
4039 pragma Assert (Base_Type (Id) = Id);
4041 end Set_Storage_Size_Variable;
4043 procedure Set_Stored_Constraint (Id : E; V : L) is
4045 pragma Assert (Nkind (Id) in N_Entity);
4046 Set_Elist23 (Id, V);
4047 end Set_Stored_Constraint;
4049 procedure Set_Strict_Alignment (Id : E; V : B := True) is
4051 pragma Assert (Base_Type (Id) = Id);
4052 Set_Flag145 (Id, V);
4053 end Set_Strict_Alignment;
4055 procedure Set_String_Literal_Length (Id : E; V : U) is
4057 pragma Assert (Ekind (Id) = E_String_Literal_Subtype);
4059 end Set_String_Literal_Length;
4061 procedure Set_String_Literal_Low_Bound (Id : E; V : N) is
4063 pragma Assert (Ekind (Id) = E_String_Literal_Subtype);
4065 end Set_String_Literal_Low_Bound;
4067 procedure Set_Suppress_Elaboration_Warnings (Id : E; V : B := True) is
4069 Set_Flag148 (Id, V);
4070 end Set_Suppress_Elaboration_Warnings;
4072 procedure Set_Suppress_Init_Proc (Id : E; V : B := True) is
4074 pragma Assert (Id = Base_Type (Id));
4075 Set_Flag105 (Id, V);
4076 end Set_Suppress_Init_Proc;
4078 procedure Set_Suppress_Style_Checks (Id : E; V : B := True) is
4080 Set_Flag165 (Id, V);
4081 end Set_Suppress_Style_Checks;
4083 procedure Set_Treat_As_Volatile (Id : E; V : B := True) is
4086 end Set_Treat_As_Volatile;
4088 procedure Set_Underlying_Full_View (Id : E; V : E) is
4090 pragma Assert (Ekind (Id) in Private_Kind);
4092 end Set_Underlying_Full_View;
4094 procedure Set_Unset_Reference (Id : E; V : N) is
4097 end Set_Unset_Reference;
4099 procedure Set_Uses_Sec_Stack (Id : E; V : B := True) is
4102 end Set_Uses_Sec_Stack;
4104 procedure Set_Vax_Float (Id : E; V : B := True) is
4106 pragma Assert (Id = Base_Type (Id));
4107 Set_Flag151 (Id, V);
4110 procedure Set_Warnings_Off (Id : E; V : B := True) is
4113 end Set_Warnings_Off;
4115 -----------------------------------
4116 -- Field Initialization Routines --
4117 -----------------------------------
4119 procedure Init_Alignment (Id : E) is
4121 Set_Uint14 (Id, Uint_0);
4124 procedure Init_Alignment (Id : E; V : Int) is
4126 Set_Uint14 (Id, UI_From_Int (V));
4129 procedure Init_Component_Bit_Offset (Id : E) is
4131 Set_Uint11 (Id, No_Uint);
4132 end Init_Component_Bit_Offset;
4134 procedure Init_Component_Bit_Offset (Id : E; V : Int) is
4136 Set_Uint11 (Id, UI_From_Int (V));
4137 end Init_Component_Bit_Offset;
4139 procedure Init_Component_Size (Id : E) is
4141 Set_Uint22 (Id, Uint_0);
4142 end Init_Component_Size;
4144 procedure Init_Component_Size (Id : E; V : Int) is
4146 Set_Uint22 (Id, UI_From_Int (V));
4147 end Init_Component_Size;
4149 procedure Init_Digits_Value (Id : E) is
4151 Set_Uint17 (Id, Uint_0);
4152 end Init_Digits_Value;
4154 procedure Init_Digits_Value (Id : E; V : Int) is
4156 Set_Uint17 (Id, UI_From_Int (V));
4157 end Init_Digits_Value;
4159 procedure Init_Esize (Id : E) is
4161 Set_Uint12 (Id, Uint_0);
4164 procedure Init_Esize (Id : E; V : Int) is
4166 Set_Uint12 (Id, UI_From_Int (V));
4169 procedure Init_Normalized_First_Bit (Id : E) is
4171 Set_Uint8 (Id, No_Uint);
4172 end Init_Normalized_First_Bit;
4174 procedure Init_Normalized_First_Bit (Id : E; V : Int) is
4176 Set_Uint8 (Id, UI_From_Int (V));
4177 end Init_Normalized_First_Bit;
4179 procedure Init_Normalized_Position (Id : E) is
4181 Set_Uint14 (Id, No_Uint);
4182 end Init_Normalized_Position;
4184 procedure Init_Normalized_Position (Id : E; V : Int) is
4186 Set_Uint14 (Id, UI_From_Int (V));
4187 end Init_Normalized_Position;
4189 procedure Init_Normalized_Position_Max (Id : E) is
4191 Set_Uint10 (Id, No_Uint);
4192 end Init_Normalized_Position_Max;
4194 procedure Init_Normalized_Position_Max (Id : E; V : Int) is
4196 Set_Uint10 (Id, UI_From_Int (V));
4197 end Init_Normalized_Position_Max;
4199 procedure Init_RM_Size (Id : E) is
4201 Set_Uint13 (Id, Uint_0);
4204 procedure Init_RM_Size (Id : E; V : Int) is
4206 Set_Uint13 (Id, UI_From_Int (V));
4209 -----------------------------
4210 -- Init_Component_Location --
4211 -----------------------------
4213 procedure Init_Component_Location (Id : E) is
4215 Set_Uint8 (Id, No_Uint); -- Normalized_First_Bit
4216 Set_Uint10 (Id, No_Uint); -- Normalized_Position_Max
4217 Set_Uint11 (Id, No_Uint); -- Component_First_Bit
4218 Set_Uint12 (Id, Uint_0); -- Esize
4219 Set_Uint14 (Id, No_Uint); -- Normalized_Position
4220 end Init_Component_Location;
4226 procedure Init_Size (Id : E; V : Int) is
4228 Set_Uint12 (Id, UI_From_Int (V)); -- Esize
4229 Set_Uint13 (Id, UI_From_Int (V)); -- RM_Size
4232 ---------------------
4233 -- Init_Size_Align --
4234 ---------------------
4236 procedure Init_Size_Align (Id : E) is
4238 Set_Uint12 (Id, Uint_0); -- Esize
4239 Set_Uint13 (Id, Uint_0); -- RM_Size
4240 Set_Uint14 (Id, Uint_0); -- Alignment
4241 end Init_Size_Align;
4243 ----------------------------------------------
4244 -- Type Representation Attribute Predicates --
4245 ----------------------------------------------
4247 function Known_Alignment (E : Entity_Id) return B is
4249 return Uint14 (E) /= Uint_0
4250 and then Uint14 (E) /= No_Uint;
4251 end Known_Alignment;
4253 function Known_Component_Bit_Offset (E : Entity_Id) return B is
4255 return Uint11 (E) /= No_Uint;
4256 end Known_Component_Bit_Offset;
4258 function Known_Component_Size (E : Entity_Id) return B is
4260 return Uint22 (Base_Type (E)) /= Uint_0
4261 and then Uint22 (Base_Type (E)) /= No_Uint;
4262 end Known_Component_Size;
4264 function Known_Esize (E : Entity_Id) return B is
4266 return Uint12 (E) /= Uint_0
4267 and then Uint12 (E) /= No_Uint;
4270 function Known_Normalized_First_Bit (E : Entity_Id) return B is
4272 return Uint8 (E) /= No_Uint;
4273 end Known_Normalized_First_Bit;
4275 function Known_Normalized_Position (E : Entity_Id) return B is
4277 return Uint14 (E) /= No_Uint;
4278 end Known_Normalized_Position;
4280 function Known_Normalized_Position_Max (E : Entity_Id) return B is
4282 return Uint10 (E) /= No_Uint;
4283 end Known_Normalized_Position_Max;
4285 function Known_RM_Size (E : Entity_Id) return B is
4287 return Uint13 (E) /= No_Uint
4288 and then (Uint13 (E) /= Uint_0
4289 or else Is_Discrete_Type (E)
4290 or else Is_Fixed_Point_Type (E));
4293 function Known_Static_Component_Bit_Offset (E : Entity_Id) return B is
4295 return Uint11 (E) /= No_Uint
4296 and then Uint11 (E) >= Uint_0;
4297 end Known_Static_Component_Bit_Offset;
4299 function Known_Static_Component_Size (E : Entity_Id) return B is
4301 return Uint22 (Base_Type (E)) > Uint_0;
4302 end Known_Static_Component_Size;
4304 function Known_Static_Esize (E : Entity_Id) return B is
4306 return Uint12 (E) > Uint_0;
4307 end Known_Static_Esize;
4309 function Known_Static_Normalized_First_Bit (E : Entity_Id) return B is
4311 return Uint8 (E) /= No_Uint
4312 and then Uint8 (E) >= Uint_0;
4313 end Known_Static_Normalized_First_Bit;
4315 function Known_Static_Normalized_Position (E : Entity_Id) return B is
4317 return Uint14 (E) /= No_Uint
4318 and then Uint14 (E) >= Uint_0;
4319 end Known_Static_Normalized_Position;
4321 function Known_Static_Normalized_Position_Max (E : Entity_Id) return B is
4323 return Uint10 (E) /= No_Uint
4324 and then Uint10 (E) >= Uint_0;
4325 end Known_Static_Normalized_Position_Max;
4327 function Known_Static_RM_Size (E : Entity_Id) return B is
4329 return Uint13 (E) > Uint_0
4330 or else Is_Discrete_Type (E)
4331 or else Is_Fixed_Point_Type (E);
4332 end Known_Static_RM_Size;
4334 function Unknown_Alignment (E : Entity_Id) return B is
4336 return Uint14 (E) = Uint_0
4337 or else Uint14 (E) = No_Uint;
4338 end Unknown_Alignment;
4340 function Unknown_Component_Bit_Offset (E : Entity_Id) return B is
4342 return Uint11 (E) = No_Uint;
4343 end Unknown_Component_Bit_Offset;
4345 function Unknown_Component_Size (E : Entity_Id) return B is
4347 return Uint22 (Base_Type (E)) = Uint_0
4349 Uint22 (Base_Type (E)) = No_Uint;
4350 end Unknown_Component_Size;
4352 function Unknown_Esize (E : Entity_Id) return B is
4354 return Uint12 (E) = No_Uint
4356 Uint12 (E) = Uint_0;
4359 function Unknown_Normalized_First_Bit (E : Entity_Id) return B is
4361 return Uint8 (E) = No_Uint;
4362 end Unknown_Normalized_First_Bit;
4364 function Unknown_Normalized_Position (E : Entity_Id) return B is
4366 return Uint14 (E) = No_Uint;
4367 end Unknown_Normalized_Position;
4369 function Unknown_Normalized_Position_Max (E : Entity_Id) return B is
4371 return Uint10 (E) = No_Uint;
4372 end Unknown_Normalized_Position_Max;
4374 function Unknown_RM_Size (E : Entity_Id) return B is
4376 return (Uint13 (E) = Uint_0
4377 and then not Is_Discrete_Type (E)
4378 and then not Is_Fixed_Point_Type (E))
4379 or else Uint13 (E) = No_Uint;
4380 end Unknown_RM_Size;
4382 --------------------
4383 -- Address_Clause --
4384 --------------------
4386 function Address_Clause (Id : E) return N is
4390 Ritem := First_Rep_Item (Id);
4391 while Present (Ritem) loop
4392 if Nkind (Ritem) = N_Attribute_Definition_Clause
4393 and then Chars (Ritem) = Name_Address
4397 Ritem := Next_Rep_Item (Ritem);
4404 ----------------------
4405 -- Alignment_Clause --
4406 ----------------------
4408 function Alignment_Clause (Id : E) return N is
4412 Ritem := First_Rep_Item (Id);
4413 while Present (Ritem) loop
4414 if Nkind (Ritem) = N_Attribute_Definition_Clause
4415 and then Chars (Ritem) = Name_Alignment
4419 Ritem := Next_Rep_Item (Ritem);
4424 end Alignment_Clause;
4426 ----------------------
4427 -- Ancestor_Subtype --
4428 ----------------------
4430 function Ancestor_Subtype (Id : E) return E is
4432 -- If this is first subtype, or is a base type, then there is no
4433 -- ancestor subtype, so we return Empty to indicate this fact.
4435 if Is_First_Subtype (Id)
4436 or else Id = Base_Type (Id)
4442 D : constant Node_Id := Declaration_Node (Id);
4445 -- If we have a subtype declaration, get the ancestor subtype
4447 if Nkind (D) = N_Subtype_Declaration then
4448 if Nkind (Subtype_Indication (D)) = N_Subtype_Indication then
4449 return Entity (Subtype_Mark (Subtype_Indication (D)));
4451 return Entity (Subtype_Indication (D));
4454 -- If not, then no subtype indication is available
4460 end Ancestor_Subtype;
4466 procedure Append_Entity (Id : Entity_Id; V : Entity_Id) is
4468 if Last_Entity (V) = Empty then
4469 Set_First_Entity (V, Id);
4471 Set_Next_Entity (Last_Entity (V), Id);
4474 Set_Next_Entity (Id, Empty);
4476 Set_Last_Entity (V, Id);
4483 function Base_Type (Id : E) return E is
4486 when E_Enumeration_Subtype |
4488 E_Signed_Integer_Subtype |
4489 E_Modular_Integer_Subtype |
4490 E_Floating_Point_Subtype |
4491 E_Ordinary_Fixed_Point_Subtype |
4492 E_Decimal_Fixed_Point_Subtype |
4497 E_Record_Subtype_With_Private |
4498 E_Limited_Private_Subtype |
4500 E_Protected_Subtype |
4502 E_String_Literal_Subtype |
4503 E_Class_Wide_Subtype =>
4511 -------------------------
4512 -- Component_Alignment --
4513 -------------------------
4515 -- Component Alignment is encoded using two flags, Flag128/129 as
4516 -- follows. Note that both flags False = Align_Default, so that the
4517 -- default initialization of flags to False initializes component
4518 -- alignment to the default value as required.
4520 -- Flag128 Flag129 Value
4521 -- ------- ------- -----
4522 -- False False Calign_Default
4523 -- False True Calign_Component_Size
4524 -- True False Calign_Component_Size_4
4525 -- True True Calign_Storage_Unit
4527 function Component_Alignment (Id : E) return C is
4528 BT : constant Node_Id := Base_Type (Id);
4531 pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id));
4533 if Flag128 (BT) then
4534 if Flag129 (BT) then
4535 return Calign_Storage_Unit;
4537 return Calign_Component_Size_4;
4541 if Flag129 (BT) then
4542 return Calign_Component_Size;
4544 return Calign_Default;
4547 end Component_Alignment;
4549 --------------------
4550 -- Constant_Value --
4551 --------------------
4553 function Constant_Value (Id : E) return N is
4554 D : constant Node_Id := Declaration_Node (Id);
4558 -- If we have no declaration node, then return no constant value.
4559 -- Not clear how this can happen, but it does sometimes ???
4560 -- To investigate, remove this check and compile discrim_po.adb.
4565 -- Normal case where a declaration node is present
4567 elsif Nkind (D) = N_Object_Renaming_Declaration then
4568 return Renamed_Object (Id);
4570 -- If this is a component declaration whose entity is constant, it
4571 -- is a prival within a protected function. It does not have
4572 -- a constant value.
4574 elsif Nkind (D) = N_Component_Declaration then
4577 -- If there is an expression, return it
4579 elsif Present (Expression (D)) then
4580 return (Expression (D));
4582 -- For a constant, see if we have a full view
4584 elsif Ekind (Id) = E_Constant
4585 and then Present (Full_View (Id))
4587 Full_D := Parent (Full_View (Id));
4589 -- The full view may have been rewritten as an object renaming.
4591 if Nkind (Full_D) = N_Object_Renaming_Declaration then
4592 return Name (Full_D);
4594 return Expression (Full_D);
4597 -- Otherwise we have no expression to return
4604 ----------------------
4605 -- Declaration_Node --
4606 ----------------------
4608 function Declaration_Node (Id : E) return N is
4612 if Ekind (Id) = E_Incomplete_Type
4613 and then Present (Full_View (Id))
4615 P := Parent (Full_View (Id));
4621 if Nkind (P) /= N_Selected_Component
4622 and then Nkind (P) /= N_Expanded_Name
4624 not (Nkind (P) = N_Defining_Program_Unit_Name
4625 and then Is_Child_Unit (Id))
4633 end Declaration_Node;
4635 ---------------------
4636 -- Designated_Type --
4637 ---------------------
4639 function Designated_Type (Id : E) return E is
4643 Desig_Type := Directly_Designated_Type (Id);
4645 if Ekind (Desig_Type) = E_Incomplete_Type
4646 and then Present (Full_View (Desig_Type))
4648 return Full_View (Desig_Type);
4650 elsif Is_Class_Wide_Type (Desig_Type)
4651 and then Ekind (Etype (Desig_Type)) = E_Incomplete_Type
4652 and then Present (Full_View (Etype (Desig_Type)))
4653 and then Present (Class_Wide_Type (Full_View (Etype (Desig_Type))))
4655 return Class_Wide_Type (Full_View (Etype (Desig_Type)));
4660 end Designated_Type;
4662 -----------------------------
4663 -- Enclosing_Dynamic_Scope --
4664 -----------------------------
4666 function Enclosing_Dynamic_Scope (Id : E) return E is
4670 -- The following test is an error defense against some syntax
4671 -- errors that can leave scopes very messed up.
4673 if Id = Standard_Standard then
4677 -- Normal case, search enclosing scopes
4680 while S /= Standard_Standard
4681 and then not Is_Dynamic_Scope (S)
4687 end Enclosing_Dynamic_Scope;
4689 ----------------------
4690 -- Entry_Index_Type --
4691 ----------------------
4693 function Entry_Index_Type (Id : E) return N is
4695 pragma Assert (Ekind (Id) = E_Entry_Family);
4696 return Etype (Discrete_Subtype_Definition (Parent (Id)));
4697 end Entry_Index_Type;
4699 ---------------------
4701 ---------------------
4703 function First_Component (Id : E) return E is
4708 (Is_Record_Type (Id) or else Is_Incomplete_Or_Private_Type (Id));
4710 Comp_Id := First_Entity (Id);
4711 while Present (Comp_Id) loop
4712 exit when Ekind (Comp_Id) = E_Component;
4713 Comp_Id := Next_Entity (Comp_Id);
4717 end First_Component;
4719 ------------------------
4720 -- First_Discriminant --
4721 ------------------------
4723 function First_Discriminant (Id : E) return E is
4728 (Has_Discriminants (Id)
4729 or else Has_Unknown_Discriminants (Id));
4731 Ent := First_Entity (Id);
4733 -- The discriminants are not necessarily contiguous, because access
4734 -- discriminants will generate itypes. They are not the first entities
4735 -- either, because tag and controller record must be ahead of them.
4737 if Chars (Ent) = Name_uTag then
4738 Ent := Next_Entity (Ent);
4741 if Chars (Ent) = Name_uController then
4742 Ent := Next_Entity (Ent);
4745 -- Skip all hidden stored discriminants if any.
4747 while Present (Ent) loop
4748 exit when Ekind (Ent) = E_Discriminant
4749 and then not Is_Completely_Hidden (Ent);
4751 Ent := Next_Entity (Ent);
4754 pragma Assert (Ekind (Ent) = E_Discriminant);
4757 end First_Discriminant;
4763 function First_Formal (Id : E) return E is
4768 (Is_Overloadable (Id)
4769 or else Ekind (Id) = E_Entry_Family
4770 or else Ekind (Id) = E_Subprogram_Body
4771 or else Ekind (Id) = E_Subprogram_Type);
4773 if Ekind (Id) = E_Enumeration_Literal then
4777 Formal := First_Entity (Id);
4779 if Present (Formal) and then Is_Formal (Formal) then
4787 -------------------------------
4788 -- First_Stored_Discriminant --
4789 -------------------------------
4791 function First_Stored_Discriminant (Id : E) return E is
4794 function Has_Completely_Hidden_Discriminant (Id : E) return Boolean;
4795 -- Scans the Discriminants to see whether any are Completely_Hidden
4796 -- (the mechanism for describing non-specified stored discriminants)
4798 ----------------------------------------
4799 -- Has_Completely_Hidden_Discriminant --
4800 ----------------------------------------
4802 function Has_Completely_Hidden_Discriminant (Id : E) return Boolean is
4803 Ent : Entity_Id := Id;
4806 pragma Assert (Ekind (Id) = E_Discriminant);
4808 while Present (Ent) and then Ekind (Ent) = E_Discriminant loop
4809 if Is_Completely_Hidden (Ent) then
4813 Ent := Next_Entity (Ent);
4817 end Has_Completely_Hidden_Discriminant;
4819 -- Start of processing for First_Stored_Discriminant
4823 (Has_Discriminants (Id)
4824 or else Has_Unknown_Discriminants (Id));
4826 Ent := First_Entity (Id);
4828 if Chars (Ent) = Name_uTag then
4829 Ent := Next_Entity (Ent);
4832 if Chars (Ent) = Name_uController then
4833 Ent := Next_Entity (Ent);
4836 if Has_Completely_Hidden_Discriminant (Ent) then
4838 while Present (Ent) loop
4839 exit when Is_Completely_Hidden (Ent);
4840 Ent := Next_Entity (Ent);
4845 pragma Assert (Ekind (Ent) = E_Discriminant);
4848 end First_Stored_Discriminant;
4854 function First_Subtype (Id : E) return E is
4855 B : constant Entity_Id := Base_Type (Id);
4856 F : constant Node_Id := Freeze_Node (B);
4860 -- If the base type has no freeze node, it is a type in standard,
4861 -- and always acts as its own first subtype unless it is one of
4862 -- the predefined integer types. If the type is formal, it is also
4863 -- a first subtype, and its base type has no freeze node. On the other
4864 -- hand, a subtype of a generic formal is not its own first_subtype.
4865 -- Its base type, if anonymous, is attached to the formal type decl.
4866 -- from which the first subtype is obtained.
4870 if B = Base_Type (Standard_Integer) then
4871 return Standard_Integer;
4873 elsif B = Base_Type (Standard_Long_Integer) then
4874 return Standard_Long_Integer;
4876 elsif B = Base_Type (Standard_Short_Short_Integer) then
4877 return Standard_Short_Short_Integer;
4879 elsif B = Base_Type (Standard_Short_Integer) then
4880 return Standard_Short_Integer;
4882 elsif B = Base_Type (Standard_Long_Long_Integer) then
4883 return Standard_Long_Long_Integer;
4885 elsif Is_Generic_Type (Id) then
4886 if Present (Parent (B)) then
4887 return Defining_Identifier (Parent (B));
4889 return Defining_Identifier (Associated_Node_For_Itype (B));
4896 -- Otherwise we check the freeze node, if it has a First_Subtype_Link
4897 -- then we use that link, otherwise (happens with some Itypes), we use
4898 -- the base type itself.
4901 Ent := First_Subtype_Link (F);
4903 if Present (Ent) then
4911 -------------------------------------
4912 -- Get_Attribute_Definition_Clause --
4913 -------------------------------------
4915 function Get_Attribute_Definition_Clause
4917 Id : Attribute_Id) return Node_Id
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
4944 N := First_Rep_Item (E);
4945 while Present (N) loop
4946 if Nkind (N) = N_Pragma and then Chars (N) = Nam then
4956 ------------------------
4957 -- Has_Attach_Handler --
4958 ------------------------
4960 function Has_Attach_Handler (Id : E) return B is
4964 pragma Assert (Is_Protected_Type (Id));
4966 Ritem := First_Rep_Item (Id);
4967 while Present (Ritem) loop
4968 if Nkind (Ritem) = N_Pragma
4969 and then Chars (Ritem) = Name_Attach_Handler
4973 Ritem := Next_Rep_Item (Ritem);
4978 end Has_Attach_Handler;
4980 -------------------------------------
4981 -- Has_Attribute_Definition_Clause --
4982 -------------------------------------
4984 function Has_Attribute_Definition_Clause
4986 Id : Attribute_Id) return Boolean
4989 return Present (Get_Attribute_Definition_Clause (E, Id));
4990 end Has_Attribute_Definition_Clause;
4996 function Has_Entries (Id : E) return B is
4997 Result : Boolean := False;
5001 pragma Assert (Is_Concurrent_Type (Id));
5003 Ent := First_Entity (Id);
5004 while Present (Ent) loop
5005 if Is_Entry (Ent) then
5010 Ent := Next_Entity (Ent);
5016 ----------------------------
5017 -- Has_Foreign_Convention --
5018 ----------------------------
5020 function Has_Foreign_Convention (Id : E) return B is
5022 return Convention (Id) >= Foreign_Convention'First;
5023 end Has_Foreign_Convention;
5025 ---------------------------
5026 -- Has_Interrupt_Handler --
5027 ---------------------------
5029 function Has_Interrupt_Handler (Id : E) return B is
5033 pragma Assert (Is_Protected_Type (Id));
5035 Ritem := First_Rep_Item (Id);
5036 while Present (Ritem) loop
5037 if Nkind (Ritem) = N_Pragma
5038 and then Chars (Ritem) = Name_Interrupt_Handler
5042 Ritem := Next_Rep_Item (Ritem);
5047 end Has_Interrupt_Handler;
5049 --------------------------
5050 -- Has_Private_Ancestor --
5051 --------------------------
5053 function Has_Private_Ancestor (Id : E) return B is
5054 R : constant Entity_Id := Root_Type (Id);
5055 T1 : Entity_Id := Id;
5059 if Is_Private_Type (T1) then
5069 end Has_Private_Ancestor;
5071 --------------------
5072 -- Has_Rep_Pragma --
5073 --------------------
5075 function Has_Rep_Pragma (E : Entity_Id; Nam : Name_Id) return Boolean is
5077 return Present (Get_Rep_Pragma (E, Nam));
5080 ------------------------------
5081 -- Implementation_Base_Type --
5082 ------------------------------
5084 function Implementation_Base_Type (Id : E) return E is
5089 Bastyp := Base_Type (Id);
5091 if Is_Incomplete_Or_Private_Type (Bastyp) then
5092 Imptyp := Underlying_Type (Bastyp);
5094 -- If we have an implementation type, then just return it,
5095 -- otherwise we return the Base_Type anyway. This can only
5096 -- happen in error situations and should avoid some error bombs.
5098 if Present (Imptyp) then
5099 return Base_Type (Imptyp);
5107 end Implementation_Base_Type;
5109 -----------------------
5110 -- Is_Always_Inlined --
5111 -----------------------
5113 function Is_Always_Inlined (Id : E) return B is
5117 Item := First_Rep_Item (Id);
5118 while Present (Item) loop
5119 if Nkind (Item) = N_Pragma
5120 and then Get_Pragma_Id (Chars (Item)) = Pragma_Inline_Always
5125 Next_Rep_Item (Item);
5129 end Is_Always_Inlined;
5131 ---------------------
5132 -- Is_Boolean_Type --
5133 ---------------------
5135 function Is_Boolean_Type (Id : E) return B is
5137 return Root_Type (Id) = Standard_Boolean;
5138 end Is_Boolean_Type;
5140 ---------------------
5141 -- Is_By_Copy_Type --
5142 ---------------------
5144 function Is_By_Copy_Type (Id : E) return B is
5146 -- If Id is a private type whose full declaration has not been seen,
5147 -- we assume for now that it is not a By_Copy type. Clearly this
5148 -- attribute should not be used before the type is frozen, but it is
5149 -- needed to build the associated record of a protected type. Another
5150 -- place where some lookahead for a full view is needed ???
5153 Is_Elementary_Type (Id)
5154 or else (Is_Private_Type (Id)
5155 and then Present (Underlying_Type (Id))
5156 and then Is_Elementary_Type (Underlying_Type (Id)));
5157 end Is_By_Copy_Type;
5159 --------------------------
5160 -- Is_By_Reference_Type --
5161 --------------------------
5163 function Is_By_Reference_Type (Id : E) return B is
5164 Btype : constant Entity_Id := Base_Type (Id);
5167 if Error_Posted (Id)
5168 or else Error_Posted (Btype)
5172 elsif Is_Private_Type (Btype) then
5174 Utyp : constant Entity_Id := Underlying_Type (Btype);
5180 return Is_By_Reference_Type (Utyp);
5184 elsif Is_Concurrent_Type (Btype) then
5187 elsif Is_Record_Type (Btype) then
5188 if Is_Limited_Record (Btype)
5189 or else Is_Tagged_Type (Btype)
5190 or else Is_Volatile (Btype)
5199 C := First_Component (Btype);
5200 while Present (C) loop
5201 if Is_By_Reference_Type (Etype (C))
5202 or else Is_Volatile (Etype (C))
5207 C := Next_Component (C);
5214 elsif Is_Array_Type (Btype) then
5217 or else Is_By_Reference_Type (Component_Type (Btype))
5218 or else Is_Volatile (Component_Type (Btype))
5219 or else Has_Volatile_Components (Btype);
5224 end Is_By_Reference_Type;
5226 ---------------------
5227 -- Is_Derived_Type --
5228 ---------------------
5230 function Is_Derived_Type (Id : E) return B is
5234 if Base_Type (Id) /= Root_Type (Id)
5235 and then not Is_Generic_Type (Id)
5236 and then not Is_Class_Wide_Type (Id)
5238 if not Is_Numeric_Type (Root_Type (Id)) then
5242 Par := Parent (First_Subtype (Id));
5244 return Present (Par)
5245 and then Nkind (Par) = N_Full_Type_Declaration
5246 and then Nkind (Type_Definition (Par))
5247 = N_Derived_Type_Definition;
5253 end Is_Derived_Type;
5255 ----------------------
5256 -- Is_Dynamic_Scope --
5257 ----------------------
5259 function Is_Dynamic_Scope (Id : E) return B is
5262 Ekind (Id) = E_Block
5264 Ekind (Id) = E_Function
5266 Ekind (Id) = E_Procedure
5268 Ekind (Id) = E_Subprogram_Body
5270 Ekind (Id) = E_Task_Type
5272 Ekind (Id) = E_Entry
5274 Ekind (Id) = E_Entry_Family;
5275 end Is_Dynamic_Scope;
5277 --------------------
5278 -- Is_Entity_Name --
5279 --------------------
5281 function Is_Entity_Name (N : Node_Id) return Boolean is
5282 Kind : constant Node_Kind := Nkind (N);
5285 -- Identifiers, operator symbols, expanded names are entity names
5287 return Kind = N_Identifier
5288 or else Kind = N_Operator_Symbol
5289 or else Kind = N_Expanded_Name
5291 -- Attribute references are entity names if they refer to an entity.
5292 -- Note that we don't do this by testing for the presence of the
5293 -- Entity field in the N_Attribute_Reference node, since it may not
5294 -- have been set yet.
5296 or else (Kind = N_Attribute_Reference
5297 and then Is_Entity_Attribute_Name (Attribute_Name (N)));
5300 ---------------------------
5301 -- Is_Indefinite_Subtype --
5302 ---------------------------
5304 function Is_Indefinite_Subtype (Id : Entity_Id) return B is
5305 K : constant Entity_Kind := Ekind (Id);
5308 if Is_Constrained (Id) then
5311 elsif K in Array_Kind
5312 or else K in Class_Wide_Kind
5313 or else Has_Unknown_Discriminants (Id)
5317 -- Known discriminants: indefinite if there are no default values
5319 elsif K in Record_Kind
5320 or else Is_Incomplete_Or_Private_Type (Id)
5321 or else Is_Concurrent_Type (Id)
5323 return (Has_Discriminants (Id)
5324 and then No (Discriminant_Default_Value (First_Discriminant (Id))));
5329 end Is_Indefinite_Subtype;
5331 ---------------------
5332 -- Is_Limited_Type --
5333 ---------------------
5335 function Is_Limited_Type (Id : E) return B is
5336 Btype : constant E := Base_Type (Id);
5339 if not Is_Type (Id) then
5342 elsif Ekind (Btype) = E_Limited_Private_Type
5343 or else Is_Limited_Composite (Btype)
5347 elsif Is_Concurrent_Type (Btype) then
5350 -- Otherwise we will look around to see if there is some other reason
5351 -- for it to be limited, except that if an error was posted on the
5352 -- entity, then just assume it is non-limited, because it can cause
5353 -- trouble to recurse into a murky erroneous entity!
5355 elsif Error_Posted (Id) then
5358 elsif Is_Record_Type (Btype) then
5359 if Is_Limited_Record (Root_Type (Btype)) then
5362 elsif Is_Class_Wide_Type (Btype) then
5363 return Is_Limited_Type (Root_Type (Btype));
5370 C := First_Component (Btype);
5371 while Present (C) loop
5372 if Is_Limited_Type (Etype (C)) then
5376 C := Next_Component (C);
5383 elsif Is_Array_Type (Btype) then
5384 return Is_Limited_Type (Component_Type (Btype));
5389 end Is_Limited_Type;
5395 function Is_Package (Id : E) return B is
5398 Ekind (Id) = E_Package
5400 Ekind (Id) = E_Generic_Package;
5403 --------------------------
5404 -- Is_Protected_Private --
5405 --------------------------
5407 function Is_Protected_Private (Id : E) return B is
5409 pragma Assert (Ekind (Id) = E_Component);
5410 return Is_Protected_Type (Scope (Id));
5411 end Is_Protected_Private;
5413 ------------------------------
5414 -- Is_Protected_Record_Type --
5415 ------------------------------
5417 function Is_Protected_Record_Type (Id : E) return B is
5420 Is_Concurrent_Record_Type (Id)
5421 and then Is_Protected_Type (Corresponding_Concurrent_Type (Id));
5422 end Is_Protected_Record_Type;
5424 ---------------------------------
5425 -- Is_Return_By_Reference_Type --
5426 ---------------------------------
5428 function Is_Return_By_Reference_Type (Id : E) return B is
5429 Btype : constant Entity_Id := Base_Type (Id);
5432 if Is_Private_Type (Btype) then
5434 Utyp : constant Entity_Id := Underlying_Type (Btype);
5440 return Is_Return_By_Reference_Type (Utyp);
5444 elsif Is_Concurrent_Type (Btype) then
5447 elsif Is_Record_Type (Btype) then
5448 if Is_Limited_Record (Btype) then
5451 elsif Is_Class_Wide_Type (Btype) then
5452 return Is_Return_By_Reference_Type (Root_Type (Btype));
5459 C := First_Component (Btype);
5460 while Present (C) loop
5461 if Is_Return_By_Reference_Type (Etype (C)) then
5465 C := Next_Component (C);
5472 elsif Is_Array_Type (Btype) then
5473 return Is_Return_By_Reference_Type (Component_Type (Btype));
5478 end Is_Return_By_Reference_Type;
5480 --------------------
5481 -- Is_String_Type --
5482 --------------------
5484 function Is_String_Type (Id : E) return B is
5486 return Ekind (Id) in String_Kind
5487 or else (Is_Array_Type (Id)
5488 and then Number_Dimensions (Id) = 1
5489 and then Is_Character_Type (Component_Type (Id)));
5492 -------------------------
5493 -- Is_Task_Record_Type --
5494 -------------------------
5496 function Is_Task_Record_Type (Id : E) return B is
5499 Is_Concurrent_Record_Type (Id)
5500 and then Is_Task_Type (Corresponding_Concurrent_Type (Id));
5501 end Is_Task_Record_Type;
5503 ------------------------
5504 -- Is_Wrapper_Package --
5505 ------------------------
5507 function Is_Wrapper_Package (Id : E) return B is
5509 return (Ekind (Id) = E_Package
5510 and then Present (Related_Instance (Id)));
5511 end Is_Wrapper_Package;
5513 --------------------
5514 -- Next_Component --
5515 --------------------
5517 function Next_Component (Id : E) return E is
5521 Comp_Id := Next_Entity (Id);
5522 while Present (Comp_Id) loop
5523 exit when Ekind (Comp_Id) = E_Component;
5524 Comp_Id := Next_Entity (Comp_Id);
5530 -----------------------
5531 -- Next_Discriminant --
5532 -----------------------
5534 -- This function actually implements both Next_Discriminant and
5535 -- Next_Stored_Discriminant by making sure that the Discriminant
5536 -- returned is of the same variety as Id.
5538 function Next_Discriminant (Id : E) return E is
5540 -- Derived Tagged types with private extensions look like this...
5542 -- E_Discriminant d1
5543 -- E_Discriminant d2
5545 -- E_Discriminant d1
5546 -- E_Discriminant d2
5549 -- so it is critical not to go past the leading discriminants.
5554 pragma Assert (Ekind (Id) = E_Discriminant);
5557 D := Next_Entity (D);
5559 or else (Ekind (D) /= E_Discriminant
5560 and then not Is_Itype (D))
5565 exit when Ekind (D) = E_Discriminant
5566 and then (Is_Completely_Hidden (D) = Is_Completely_Hidden (Id));
5570 end Next_Discriminant;
5576 function Next_Formal (Id : E) return E is
5580 -- Follow the chain of declared entities as long as the kind of
5581 -- the entity corresponds to a formal parameter. Skip internal
5582 -- entities that may have been created for implicit subtypes,
5583 -- in the process of analyzing default expressions.
5588 P := Next_Entity (P);
5590 if No (P) or else Is_Formal (P) then
5592 elsif not Is_Internal (P) then
5598 -----------------------------
5599 -- Next_Formal_With_Extras --
5600 -----------------------------
5602 function Next_Formal_With_Extras (Id : E) return E is
5604 if Present (Extra_Formal (Id)) then
5605 return Extra_Formal (Id);
5607 return Next_Formal (Id);
5609 end Next_Formal_With_Extras;
5615 function Next_Index (Id : Node_Id) return Node_Id is
5624 function Next_Literal (Id : E) return E is
5626 pragma Assert (Nkind (Id) in N_Entity);
5630 ------------------------------
5631 -- Next_Stored_Discriminant --
5632 ------------------------------
5634 function Next_Stored_Discriminant (Id : E) return E is
5636 -- See comment in Next_Discriminant
5638 return Next_Discriminant (Id);
5639 end Next_Stored_Discriminant;
5641 -----------------------
5642 -- Number_Dimensions --
5643 -----------------------
5645 function Number_Dimensions (Id : E) return Pos is
5650 if Ekind (Id) in String_Kind then
5655 T := First_Index (Id);
5656 while Present (T) loop
5663 end Number_Dimensions;
5665 --------------------------
5666 -- Number_Discriminants --
5667 --------------------------
5669 function Number_Discriminants (Id : E) return Pos is
5675 Discr := First_Discriminant (Id);
5676 while Present (Discr) loop
5678 Discr := Next_Discriminant (Discr);
5682 end Number_Discriminants;
5684 --------------------
5685 -- Number_Entries --
5686 --------------------
5688 function Number_Entries (Id : E) return Nat is
5693 pragma Assert (Is_Concurrent_Type (Id));
5696 Ent := First_Entity (Id);
5697 while Present (Ent) loop
5698 if Is_Entry (Ent) then
5702 Ent := Next_Entity (Ent);
5708 --------------------
5709 -- Number_Formals --
5710 --------------------
5712 function Number_Formals (Id : E) return Pos is
5718 Formal := First_Formal (Id);
5719 while Present (Formal) loop
5721 Formal := Next_Formal (Formal);
5727 --------------------
5728 -- Parameter_Mode --
5729 --------------------
5731 function Parameter_Mode (Id : E) return Formal_Kind is
5736 ---------------------
5737 -- Record_Rep_Item --
5738 ---------------------
5740 procedure Record_Rep_Item (E : Entity_Id; N : Node_Id) is
5742 Set_Next_Rep_Item (N, First_Rep_Item (E));
5743 Set_First_Rep_Item (E, N);
5744 end Record_Rep_Item;
5750 function Root_Type (Id : E) return E is
5754 pragma Assert (Nkind (Id) in N_Entity);
5756 T := Base_Type (Id);
5758 if Ekind (T) = E_Class_Wide_Type then
5770 -- Following test catches some error cases resulting from
5773 elsif No (Etyp) then
5776 elsif Is_Private_Type (T) and then Etyp = Full_View (T) then
5779 elsif Is_Private_Type (Etyp) and then Full_View (Etyp) = T then
5785 -- Return if there is a circularity in the inheritance chain.
5786 -- This happens in some error situations and we do not want
5787 -- to get stuck in this loop.
5789 if T = Base_Type (Id) then
5795 raise Program_Error;
5802 function Scope_Depth (Id : E) return Uint is
5807 while Is_Record_Type (Scop) loop
5808 Scop := Scope (Scop);
5811 return Scope_Depth_Value (Scop);
5814 ---------------------
5815 -- Scope_Depth_Set --
5816 ---------------------
5818 function Scope_Depth_Set (Id : E) return B is
5820 return not Is_Record_Type (Id)
5821 and then Field22 (Id) /= Union_Id (Empty);
5822 end Scope_Depth_Set;
5824 -----------------------------
5825 -- Set_Component_Alignment --
5826 -----------------------------
5828 -- Component Alignment is encoded using two flags, Flag128/129 as
5829 -- follows. Note that both flags False = Align_Default, so that the
5830 -- default initialization of flags to False initializes component
5831 -- alignment to the default value as required.
5833 -- Flag128 Flag129 Value
5834 -- ------- ------- -----
5835 -- False False Calign_Default
5836 -- False True Calign_Component_Size
5837 -- True False Calign_Component_Size_4
5838 -- True True Calign_Storage_Unit
5840 procedure Set_Component_Alignment (Id : E; V : C) is
5842 pragma Assert ((Is_Array_Type (Id) or else Is_Record_Type (Id))
5843 and then Id = Base_Type (Id));
5846 when Calign_Default =>
5847 Set_Flag128 (Id, False);
5848 Set_Flag129 (Id, False);
5850 when Calign_Component_Size =>
5851 Set_Flag128 (Id, False);
5852 Set_Flag129 (Id, True);
5854 when Calign_Component_Size_4 =>
5855 Set_Flag128 (Id, True);
5856 Set_Flag129 (Id, False);
5858 when Calign_Storage_Unit =>
5859 Set_Flag128 (Id, True);
5860 Set_Flag129 (Id, True);
5862 end Set_Component_Alignment;
5868 function Size_Clause (Id : E) return N is
5872 Ritem := First_Rep_Item (Id);
5873 while Present (Ritem) loop
5874 if Nkind (Ritem) = N_Attribute_Definition_Clause
5875 and then Chars (Ritem) = Name_Size
5879 Ritem := Next_Rep_Item (Ritem);
5890 function Subtype_Kind (K : Entity_Kind) return Entity_Kind is
5896 Kind := E_Access_Subtype;
5900 Kind := E_Array_Subtype;
5902 when E_Class_Wide_Type |
5903 E_Class_Wide_Subtype =>
5904 Kind := E_Class_Wide_Subtype;
5906 when E_Decimal_Fixed_Point_Type |
5907 E_Decimal_Fixed_Point_Subtype =>
5908 Kind := E_Decimal_Fixed_Point_Subtype;
5910 when E_Ordinary_Fixed_Point_Type |
5911 E_Ordinary_Fixed_Point_Subtype =>
5912 Kind := E_Ordinary_Fixed_Point_Subtype;
5914 when E_Private_Type |
5915 E_Private_Subtype =>
5916 Kind := E_Private_Subtype;
5918 when E_Limited_Private_Type |
5919 E_Limited_Private_Subtype =>
5920 Kind := E_Limited_Private_Subtype;
5922 when E_Record_Type_With_Private |
5923 E_Record_Subtype_With_Private =>
5924 Kind := E_Record_Subtype_With_Private;
5926 when E_Record_Type |
5928 Kind := E_Record_Subtype;
5930 when E_String_Type |
5932 Kind := E_String_Subtype;
5934 when Enumeration_Kind =>
5935 Kind := E_Enumeration_Subtype;
5938 Kind := E_Floating_Point_Subtype;
5940 when Signed_Integer_Kind =>
5941 Kind := E_Signed_Integer_Subtype;
5943 when Modular_Integer_Kind =>
5944 Kind := E_Modular_Integer_Subtype;
5946 when Protected_Kind =>
5947 Kind := E_Protected_Subtype;
5950 Kind := E_Task_Subtype;
5954 raise Program_Error;
5964 function Tag_Component (Id : E) return E is
5966 Typ : Entity_Id := Id;
5969 pragma Assert (Is_Tagged_Type (Typ));
5971 if Is_Class_Wide_Type (Typ) then
5972 Typ := Root_Type (Typ);
5975 if Is_Private_Type (Typ) then
5976 Typ := Underlying_Type (Typ);
5979 Comp := First_Entity (Typ);
5980 while Present (Comp) loop
5981 if Is_Tag (Comp) then
5985 Comp := Next_Entity (Comp);
5988 -- No tag component found
5993 ---------------------
5994 -- Type_High_Bound --
5995 ---------------------
5997 function Type_High_Bound (Id : E) return Node_Id is
5999 if Nkind (Scalar_Range (Id)) = N_Subtype_Indication then
6000 return High_Bound (Range_Expression (Constraint (Scalar_Range (Id))));
6002 return High_Bound (Scalar_Range (Id));
6004 end Type_High_Bound;
6006 --------------------
6007 -- Type_Low_Bound --
6008 --------------------
6010 function Type_Low_Bound (Id : E) return Node_Id is
6012 if Nkind (Scalar_Range (Id)) = N_Subtype_Indication then
6013 return Low_Bound (Range_Expression (Constraint (Scalar_Range (Id))));
6015 return Low_Bound (Scalar_Range (Id));
6019 ---------------------
6020 -- Underlying_Type --
6021 ---------------------
6023 function Underlying_Type (Id : E) return E is
6025 -- For record_with_private the underlying type is always the direct
6026 -- full view. Never try to take the full view of the parent it
6027 -- doesn't make sense.
6029 if Ekind (Id) = E_Record_Type_With_Private then
6030 return Full_View (Id);
6032 elsif Ekind (Id) in Incomplete_Or_Private_Kind then
6034 -- If we have an incomplete or private type with a full view,
6035 -- then we return the Underlying_Type of this full view
6037 if Present (Full_View (Id)) then
6038 if Id = Full_View (Id) then
6040 -- Previous error in declaration
6045 return Underlying_Type (Full_View (Id));
6048 -- Otherwise check for the case where we have a derived type or
6049 -- subtype, and if so get the Underlying_Type of the parent type.
6051 elsif Etype (Id) /= Id then
6052 return Underlying_Type (Etype (Id));
6054 -- Otherwise we have an incomplete or private type that has
6055 -- no full view, which means that we have not encountered the
6056 -- completion, so return Empty to indicate the underlying type
6057 -- is not yet known.
6063 -- For non-incomplete, non-private types, return the type itself
6064 -- Also for entities that are not types at all return the entity
6070 end Underlying_Type;
6072 ------------------------
6073 -- Write_Entity_Flags --
6074 ------------------------
6076 procedure Write_Entity_Flags (Id : Entity_Id; Prefix : String) is
6078 procedure W (Flag_Name : String; Flag : Boolean);
6079 -- Write out given flag if it is set
6081 procedure W (Flag_Name : String; Flag : Boolean) is
6085 Write_Str (Flag_Name);
6086 Write_Str (" = True");
6091 -- Start of processing for Write_Entity_Flags
6094 if (Is_Array_Type (Id) or else Is_Record_Type (Id))
6095 and then Base_Type (Id) = Id
6098 Write_Str ("Component_Alignment = ");
6100 case Component_Alignment (Id) is
6101 when Calign_Default =>
6102 Write_Str ("Calign_Default");
6104 when Calign_Component_Size =>
6105 Write_Str ("Calign_Component_Size");
6107 when Calign_Component_Size_4 =>
6108 Write_Str ("Calign_Component_Size_4");
6110 when Calign_Storage_Unit =>
6111 Write_Str ("Calign_Storage_Unit");
6117 W ("Address_Taken", Flag104 (Id));
6118 W ("Body_Needed_For_SAL", Flag40 (Id));
6119 W ("C_Pass_By_Copy", Flag125 (Id));
6120 W ("Can_Never_Be_Null", Flag38 (Id));
6121 W ("Checks_May_Be_Suppressed", Flag31 (Id));
6122 W ("Debug_Info_Off", Flag166 (Id));
6123 W ("Default_Expressions_Processed", Flag108 (Id));
6124 W ("Delay_Cleanups", Flag114 (Id));
6125 W ("Delay_Subprogram_Descriptors", Flag50 (Id));
6126 W ("Depends_On_Private", Flag14 (Id));
6127 W ("Discard_Names", Flag88 (Id));
6128 W ("Elaborate_All_Desirable", Flag146 (Id));
6129 W ("Elaboration_Entity_Required", Flag174 (Id));
6130 W ("Entry_Accepted", Flag152 (Id));
6131 W ("Finalize_Storage_Only", Flag158 (Id));
6132 W ("From_With_Type", Flag159 (Id));
6133 W ("Function_Returns_With_DSP", Flag169 (Id));
6134 W ("Has_Aliased_Components", Flag135 (Id));
6135 W ("Has_Alignment_Clause", Flag46 (Id));
6136 W ("Has_All_Calls_Remote", Flag79 (Id));
6137 W ("Has_Atomic_Components", Flag86 (Id));
6138 W ("Has_Biased_Representation", Flag139 (Id));
6139 W ("Has_Completion", Flag26 (Id));
6140 W ("Has_Completion_In_Body", Flag71 (Id));
6141 W ("Has_Complex_Representation", Flag140 (Id));
6142 W ("Has_Component_Size_Clause", Flag68 (Id));
6143 W ("Has_Contiguous_Rep", Flag181 (Id));
6144 W ("Has_Controlled_Component", Flag43 (Id));
6145 W ("Has_Controlling_Result", Flag98 (Id));
6146 W ("Has_Convention_Pragma", Flag119 (Id));
6147 W ("Has_Delayed_Freeze", Flag18 (Id));
6148 W ("Has_Discriminants", Flag5 (Id));
6149 W ("Has_Enumeration_Rep_Clause", Flag66 (Id));
6150 W ("Has_Exit", Flag47 (Id));
6151 W ("Has_External_Tag_Rep_Clause", Flag110 (Id));
6152 W ("Has_Forward_Instantiation", Flag175 (Id));
6153 W ("Has_Fully_Qualified_Name", Flag173 (Id));
6154 W ("Has_Gigi_Rep_Item", Flag82 (Id));
6155 W ("Has_Homonym", Flag56 (Id));
6156 W ("Has_Machine_Radix_Clause", Flag83 (Id));
6157 W ("Has_Master_Entity", Flag21 (Id));
6158 W ("Has_Missing_Return", Flag142 (Id));
6159 W ("Has_Nested_Block_With_Handler", Flag101 (Id));
6160 W ("Has_Non_Standard_Rep", Flag75 (Id));
6161 W ("Has_Object_Size_Clause", Flag172 (Id));
6162 W ("Has_Per_Object_Constraint", Flag154 (Id));
6163 W ("Has_Pragma_Controlled", Flag27 (Id));
6164 W ("Has_Pragma_Elaborate_Body", Flag150 (Id));
6165 W ("Has_Pragma_Inline", Flag157 (Id));
6166 W ("Has_Pragma_Pack", Flag121 (Id));
6167 W ("Has_Pragma_Pure_Function", Flag179 (Id));
6168 W ("Has_Pragma_Unreferenced", Flag180 (Id));
6169 W ("Has_Primitive_Operations", Flag120 (Id));
6170 W ("Has_Private_Declaration", Flag155 (Id));
6171 W ("Has_Qualified_Name", Flag161 (Id));
6172 W ("Has_Record_Rep_Clause", Flag65 (Id));
6173 W ("Has_Recursive_Call", Flag143 (Id));
6174 W ("Has_Size_Clause", Flag29 (Id));
6175 W ("Has_Small_Clause", Flag67 (Id));
6176 W ("Has_Specified_Layout", Flag100 (Id));
6177 W ("Has_Storage_Size_Clause", Flag23 (Id));
6178 W ("Has_Subprogram_Descriptor", Flag93 (Id));
6179 W ("Has_Task", Flag30 (Id));
6180 W ("Has_Unchecked_Union", Flag123 (Id));
6181 W ("Has_Unknown_Discriminants", Flag72 (Id));
6182 W ("Has_Volatile_Components", Flag87 (Id));
6183 W ("Has_Xref_Entry", Flag182 (Id));
6184 W ("In_Package_Body", Flag48 (Id));
6185 W ("In_Private_Part", Flag45 (Id));
6186 W ("In_Use", Flag8 (Id));
6187 W ("Is_AST_Entry", Flag132 (Id));
6188 W ("Is_Abstract", Flag19 (Id));
6189 W ("Is_Access_Constant", Flag69 (Id));
6190 W ("Is_Aliased", Flag15 (Id));
6191 W ("Is_Asynchronous", Flag81 (Id));
6192 W ("Is_Atomic", Flag85 (Id));
6193 W ("Is_Bit_Packed_Array", Flag122 (Id));
6194 W ("Is_CPP_Class", Flag74 (Id));
6195 W ("Is_Called", Flag102 (Id));
6196 W ("Is_Character_Type", Flag63 (Id));
6197 W ("Is_Child_Unit", Flag73 (Id));
6198 W ("Is_Class_Wide_Equivalent_Type", Flag35 (Id));
6199 W ("Is_Compilation_Unit", Flag149 (Id));
6200 W ("Is_Completely_Hidden", Flag103 (Id));
6201 W ("Is_Concurrent_Record_Type", Flag20 (Id));
6202 W ("Is_Constr_Subt_For_UN_Aliased", Flag141 (Id));
6203 W ("Is_Constr_Subt_For_U_Nominal", Flag80 (Id));
6204 W ("Is_Constrained", Flag12 (Id));
6205 W ("Is_Constructor", Flag76 (Id));
6206 W ("Is_Controlled", Flag42 (Id));
6207 W ("Is_Controlling_Formal", Flag97 (Id));
6208 W ("Is_Discrim_SO_Function", Flag176 (Id));
6209 W ("Is_Dispatching_Operation", Flag6 (Id));
6210 W ("Is_Eliminated", Flag124 (Id));
6211 W ("Is_Entry_Formal", Flag52 (Id));
6212 W ("Is_Exported", Flag99 (Id));
6213 W ("Is_First_Subtype", Flag70 (Id));
6214 W ("Is_For_Access_Subtype", Flag118 (Id));
6215 W ("Is_Formal_Subprogram", Flag111 (Id));
6216 W ("Is_Frozen", Flag4 (Id));
6217 W ("Is_Generic_Actual_Type", Flag94 (Id));
6218 W ("Is_Generic_Instance", Flag130 (Id));
6219 W ("Is_Generic_Type", Flag13 (Id));
6220 W ("Is_Hidden", Flag57 (Id));
6221 W ("Is_Hidden_Open_Scope", Flag171 (Id));
6222 W ("Is_Immediately_Visible", Flag7 (Id));
6223 W ("Is_Imported", Flag24 (Id));
6224 W ("Is_Inlined", Flag11 (Id));
6225 W ("Is_Instantiated", Flag126 (Id));
6226 W ("Is_Internal", Flag17 (Id));
6227 W ("Is_Interrupt_Handler", Flag89 (Id));
6228 W ("Is_Intrinsic_Subprogram", Flag64 (Id));
6229 W ("Is_Itype", Flag91 (Id));
6230 W ("Is_Known_Valid", Flag37 (Id));
6231 W ("Is_Known_Valid", Flag170 (Id));
6232 W ("Is_Limited_Composite", Flag106 (Id));
6233 W ("Is_Limited_Record", Flag25 (Id));
6234 W ("Is_Machine_Code_Subprogram", Flag137 (Id));
6235 W ("Is_Non_Static_Subtype", Flag109 (Id));
6236 W ("Is_Null_Init_Proc", Flag178 (Id));
6237 W ("Is_Optional_Parameter", Flag134 (Id));
6238 W ("Is_Overriding_Operation", Flag39 (Id));
6239 W ("Is_Package_Body_Entity", Flag160 (Id));
6240 W ("Is_Packed", Flag51 (Id));
6241 W ("Is_Packed_Array_Type", Flag138 (Id));
6242 W ("Is_Potentially_Use_Visible", Flag9 (Id));
6243 W ("Is_Preelaborated", Flag59 (Id));
6244 W ("Is_Private_Composite", Flag107 (Id));
6245 W ("Is_Private_Descendant", Flag53 (Id));
6246 W ("Is_Public", Flag10 (Id));
6247 W ("Is_Pure", Flag44 (Id));
6248 W ("Is_Remote_Call_Interface", Flag62 (Id));
6249 W ("Is_Remote_Types", Flag61 (Id));
6250 W ("Is_Renaming_Of_Object", Flag112 (Id));
6251 W ("Is_Shared_Passive", Flag60 (Id));
6252 W ("Is_Statically_Allocated", Flag28 (Id));
6253 W ("Is_Tag", Flag78 (Id));
6254 W ("Is_Tagged_Type", Flag55 (Id));
6255 W ("Is_Thread_Body", Flag77 (Id));
6256 W ("Is_True_Constant", Flag163 (Id));
6257 W ("Is_Unchecked_Union", Flag117 (Id));
6258 W ("Is_Unsigned_Type", Flag144 (Id));
6259 W ("Is_VMS_Exception", Flag133 (Id));
6260 W ("Is_Valued_Procedure", Flag127 (Id));
6261 W ("Is_Visible_Child_Unit", Flag116 (Id));
6262 W ("Is_Volatile", Flag16 (Id));
6263 W ("Kill_Elaboration_Checks", Flag32 (Id));
6264 W ("Kill_Range_Checks", Flag33 (Id));
6265 W ("Kill_Tag_Checks", Flag34 (Id));
6266 W ("Machine_Radix_10", Flag84 (Id));
6267 W ("Materialize_Entity", Flag168 (Id));
6268 W ("Must_Be_On_Byte_Boundary", Flag183 (Id));
6269 W ("Needs_Debug_Info", Flag147 (Id));
6270 W ("Needs_No_Actuals", Flag22 (Id));
6271 W ("Never_Set_In_Source", Flag115 (Id));
6272 W ("No_Pool_Assigned", Flag131 (Id));
6273 W ("No_Return", Flag113 (Id));
6274 W ("No_Strict_Aliasing", Flag136 (Id));
6275 W ("Non_Binary_Modulus", Flag58 (Id));
6276 W ("Nonzero_Is_True", Flag162 (Id));
6277 W ("Reachable", Flag49 (Id));
6278 W ("Referenced", Flag156 (Id));
6279 W ("Referenced_As_LHS", Flag36 (Id));
6280 W ("Return_Present", Flag54 (Id));
6281 W ("Returns_By_Ref", Flag90 (Id));
6282 W ("Reverse_Bit_Order", Flag164 (Id));
6283 W ("Sec_Stack_Needed_For_Return", Flag167 (Id));
6284 W ("Size_Depends_On_Discriminant", Flag177 (Id));
6285 W ("Size_Known_At_Compile_Time", Flag92 (Id));
6286 W ("Strict_Alignment", Flag145 (Id));
6287 W ("Suppress_Elaboration_Warnings", Flag148 (Id));
6288 W ("Suppress_Init_Proc", Flag105 (Id));
6289 W ("Suppress_Style_Checks", Flag165 (Id));
6290 W ("Treat_As_Volatile", Flag41 (Id));
6291 W ("Uses_Sec_Stack", Flag95 (Id));
6292 W ("Vax_Float", Flag151 (Id));
6293 W ("Warnings_Off", Flag96 (Id));
6294 end Write_Entity_Flags;
6296 -----------------------
6297 -- Write_Entity_Info --
6298 -----------------------
6300 procedure Write_Entity_Info (Id : Entity_Id; Prefix : String) is
6302 procedure Write_Attribute (Which : String; Nam : E);
6303 -- Write attribute value with given string name
6305 procedure Write_Kind (Id : Entity_Id);
6306 -- Write Ekind field of entity
6308 procedure Write_Attribute (Which : String; Nam : E) is
6312 Write_Int (Int (Nam));
6314 Write_Name (Chars (Nam));
6316 end Write_Attribute;
6318 procedure Write_Kind (Id : Entity_Id) is
6319 K : constant String := Entity_Kind'Image (Ekind (Id));
6323 Write_Str (" Kind ");
6325 if Is_Type (Id) and then Is_Tagged_Type (Id) then
6326 Write_Str ("TAGGED ");
6329 Write_Str (K (3 .. K'Length));
6332 if Is_Type (Id) and then Depends_On_Private (Id) then
6333 Write_Str ("Depends_On_Private ");
6337 -- Start of processing for Write_Entity_Info
6341 Write_Attribute ("Name ", Id);
6342 Write_Int (Int (Id));
6346 Write_Attribute (" Type ", Etype (Id));
6348 Write_Attribute (" Scope ", Scope (Id));
6353 when Discrete_Kind =>
6354 Write_Str ("Bounds: Id = ");
6356 if Present (Scalar_Range (Id)) then
6357 Write_Int (Int (Type_Low_Bound (Id)));
6358 Write_Str (" .. Id = ");
6359 Write_Int (Int (Type_High_Bound (Id)));
6361 Write_Str ("Empty");
6372 (" Component Type ", Component_Type (Id));
6375 Write_Str (" Indices ");
6377 Index := First_Index (Id);
6378 while Present (Index) loop
6379 Write_Attribute (" ", Etype (Index));
6380 Index := Next_Index (Index);
6388 (" Directly Designated Type ",
6389 Directly_Designated_Type (Id));
6392 when Overloadable_Kind =>
6393 if Present (Homonym (Id)) then
6394 Write_Str (" Homonym ");
6395 Write_Name (Chars (Homonym (Id)));
6397 Write_Int (Int (Homonym (Id)));
6404 if Ekind (Scope (Id)) in Record_Kind then
6406 " Original_Record_Component ",
6407 Original_Record_Component (Id));
6408 Write_Int (Int (Original_Record_Component (Id)));
6412 when others => null;
6414 end Write_Entity_Info;
6416 -----------------------
6417 -- Write_Field6_Name --
6418 -----------------------
6420 procedure Write_Field6_Name (Id : Entity_Id) is
6421 pragma Warnings (Off, Id);
6424 Write_Str ("First_Rep_Item");
6425 end Write_Field6_Name;
6427 -----------------------
6428 -- Write_Field7_Name --
6429 -----------------------
6431 procedure Write_Field7_Name (Id : Entity_Id) is
6432 pragma Warnings (Off, Id);
6435 Write_Str ("Freeze_Node");
6436 end Write_Field7_Name;
6438 -----------------------
6439 -- Write_Field8_Name --
6440 -----------------------
6442 procedure Write_Field8_Name (Id : Entity_Id) is
6447 Write_Str ("Normalized_First_Bit");
6451 E_Subprogram_Body =>
6452 Write_Str ("Mechanism");
6455 Write_Str ("Associated_Node_For_Itype");
6458 Write_Str ("Dependent_Instances");
6461 Write_Str ("Hiding_Loop_Variable");
6464 Write_Str ("Field8??");
6466 end Write_Field8_Name;
6468 -----------------------
6469 -- Write_Field9_Name --
6470 -----------------------
6472 procedure Write_Field9_Name (Id : Entity_Id) is
6476 Write_Str ("Class_Wide_Type");
6479 E_Generic_Function |
6481 E_Generic_Procedure |
6484 Write_Str ("Renaming_Map");
6487 Write_Str ("Current_Value");
6490 Write_Str ("Field9??");
6492 end Write_Field9_Name;
6494 ------------------------
6495 -- Write_Field10_Name --
6496 ------------------------
6498 procedure Write_Field10_Name (Id : Entity_Id) is
6502 Write_Str ("Referenced_Object");
6504 when E_In_Parameter |
6506 Write_Str ("Discriminal_Link");
6512 Write_Str ("Handler_Records");
6516 Write_Str ("Normalized_Position_Max");
6519 Write_Str ("Field10??");
6521 end Write_Field10_Name;
6523 ------------------------
6524 -- Write_Field11_Name --
6525 ------------------------
6527 procedure Write_Field11_Name (Id : Entity_Id) is
6531 Write_Str ("Entry_Component");
6535 Write_Str ("Component_Bit_Offset");
6538 Write_Str ("Full_View");
6540 when E_Enumeration_Literal =>
6541 Write_Str ("Enumeration_Pos");
6544 Write_Str ("Block_Node");
6550 Write_Str ("Protected_Body_Subprogram");
6552 when E_Generic_Package =>
6553 Write_Str ("Generic_Homonym");
6556 Write_Str ("Full_View");
6559 Write_Str ("Field11??");
6561 end Write_Field11_Name;
6563 ------------------------
6564 -- Write_Field12_Name --
6565 ------------------------
6567 procedure Write_Field12_Name (Id : Entity_Id) is
6571 Write_Str ("Barrier_Function");
6573 when E_Enumeration_Literal =>
6574 Write_Str ("Enumeration_Rep");
6581 E_In_Out_Parameter |
6585 Write_Str ("Esize");
6589 Write_Str ("Next_Inlined_Subprogram");
6592 Write_Str ("Associated_Formal_Package");
6595 Write_Str ("Field12??");
6597 end Write_Field12_Name;
6599 ------------------------
6600 -- Write_Field13_Name --
6601 ------------------------
6603 procedure Write_Field13_Name (Id : Entity_Id) is
6607 Write_Str ("RM_Size");
6611 Write_Str ("Component_Clause");
6613 when E_Enumeration_Literal =>
6614 Write_Str ("Debug_Renaming_Link");
6617 if not Comes_From_Source (Id)
6619 Chars (Id) = Name_Op_Ne
6621 Write_Str ("Corresponding_Equality");
6623 elsif Comes_From_Source (Id) then
6624 Write_Str ("Elaboration_Entity");
6627 Write_Str ("Field13??");
6632 Write_Str ("Extra_Accessibility");
6636 Generic_Unit_Kind =>
6637 Write_Str ("Elaboration_Entity");
6640 Write_Str ("Field13??");
6642 end Write_Field13_Name;
6644 -----------------------
6645 -- Write_Field14_Name --
6646 -----------------------
6648 procedure Write_Field14_Name (Id : Entity_Id) is
6656 Write_Str ("Alignment");
6660 Write_Str ("Normalized_Position");
6664 Write_Str ("First_Optional_Parameter");
6667 E_Generic_Package =>
6668 Write_Str ("Shadow_Entities");
6671 Write_Str ("Field14??");
6673 end Write_Field14_Name;
6675 ------------------------
6676 -- Write_Field15_Name --
6677 ------------------------
6679 procedure Write_Field15_Name (Id : Entity_Id) is
6684 Write_Str ("Storage_Size_Variable");
6686 when Class_Wide_Kind |
6690 Write_Str ("Primitive_Operations");
6693 Write_Str ("DT_Entry_Count");
6695 when Decimal_Fixed_Point_Kind =>
6696 Write_Str ("Scale_Value");
6698 when E_Discriminant =>
6699 Write_Str ("Discriminant_Number");
6702 Write_Str ("Extra_Formal");
6706 Write_Str ("DT_Position");
6709 Write_Str ("Entry_Parameters_Type");
6711 when Enumeration_Kind =>
6712 Write_Str ("Lit_Indexes");
6716 Write_Str ("Related_Instance");
6718 when E_Protected_Type =>
6719 Write_Str ("Entry_Bodies_Array");
6721 when E_String_Literal_Subtype =>
6722 Write_Str ("String_Literal_Low_Bound");
6725 Write_Str ("Shared_Var_Read_Proc");
6728 Write_Str ("Field15??");
6730 end Write_Field15_Name;
6732 ------------------------
6733 -- Write_Field16_Name --
6734 ------------------------
6736 procedure Write_Field16_Name (Id : Entity_Id) is
6740 Write_Str ("Entry_Formal");
6744 Write_Str ("DTC_Entity");
6749 Write_Str ("First_Private_Entity");
6751 when E_Record_Type |
6752 E_Record_Type_With_Private =>
6753 Write_Str ("Access_Disp_Table");
6755 when E_String_Literal_Subtype =>
6756 Write_Str ("String_Literal_Length");
6758 when Enumeration_Kind =>
6759 Write_Str ("Lit_Strings");
6763 Write_Str ("Unset_Reference");
6765 when E_Record_Subtype |
6766 E_Class_Wide_Subtype =>
6767 Write_Str ("Cloned_Subtype");
6770 Write_Str ("Field16??");
6772 end Write_Field16_Name;
6774 ------------------------
6775 -- Write_Field17_Name --
6776 ------------------------
6778 procedure Write_Field17_Name (Id : Entity_Id) is
6782 Write_Str ("Digits_Value");
6785 Write_Str ("Prival");
6787 when E_Discriminant =>
6788 Write_Str ("Discriminal");
6797 E_Generic_Function |
6799 E_Generic_Procedure |
6808 E_Subprogram_Type =>
6809 Write_Str ("First_Entity");
6812 Write_Str ("First_Index");
6814 when E_Protected_Body =>
6815 Write_Str ("Object_Ref");
6817 when Enumeration_Kind =>
6818 Write_Str ("First_Literal");
6821 Write_Str ("Master_Id");
6823 when Modular_Integer_Kind =>
6824 Write_Str ("Modulus");
6828 E_Generic_In_Out_Parameter |
6830 Write_Str ("Actual_Subtype");
6832 when E_Incomplete_Type =>
6833 Write_Str ("Non-limited view");
6836 Write_Str ("Field17??");
6838 end Write_Field17_Name;
6840 -----------------------
6841 -- Write_Field18_Name --
6842 -----------------------
6844 procedure Write_Field18_Name (Id : Entity_Id) is
6847 when E_Enumeration_Literal |
6851 Write_Str ("Alias");
6853 when E_Record_Type =>
6854 Write_Str ("Corresponding_Concurrent_Type");
6856 when E_Entry_Index_Parameter =>
6857 Write_Str ("Entry_Index_Constant");
6859 when E_Class_Wide_Subtype |
6860 E_Access_Protected_Subprogram_Type |
6861 E_Access_Subprogram_Type |
6863 Write_Str ("Equivalent_Type");
6865 when Fixed_Point_Kind =>
6866 Write_Str ("Delta_Value");
6870 Write_Str ("Renamed_Object");
6874 E_Generic_Function |
6875 E_Generic_Procedure |
6876 E_Generic_Package =>
6877 Write_Str ("Renamed_Entity");
6879 when Incomplete_Or_Private_Kind =>
6880 Write_Str ("Private_Dependents");
6882 when Concurrent_Kind =>
6883 Write_Str ("Corresponding_Record_Type");
6888 Write_Str ("Enclosing_Scope");
6891 Write_Str ("Field18??");
6893 end Write_Field18_Name;
6895 -----------------------
6896 -- Write_Field19_Name --
6897 -----------------------
6899 procedure Write_Field19_Name (Id : Entity_Id) is
6904 Write_Str ("Related_Array_Object");
6911 Write_Str ("Finalization_Chain_Entity");
6913 when E_Constant | E_Variable =>
6914 Write_Str ("Size_Check_Code");
6916 when E_Discriminant =>
6917 Write_Str ("Corresponding_Discriminant");
6920 E_Generic_Package =>
6921 Write_Str ("Body_Entity");
6923 when E_Package_Body |
6925 Write_Str ("Spec_Entity");
6927 when Private_Kind =>
6928 Write_Str ("Underlying_Full_View");
6930 when E_Record_Type =>
6931 Write_Str ("Parent_Subtype");
6934 Write_Str ("Field19??");
6936 end Write_Field19_Name;
6938 -----------------------
6939 -- Write_Field20_Name --
6940 -----------------------
6942 procedure Write_Field20_Name (Id : Entity_Id) is
6946 Write_Str ("Component_Type");
6948 when E_In_Parameter |
6949 E_Generic_In_Parameter =>
6950 Write_Str ("Default_Value");
6953 Write_Str ("Directly_Designated_Type");
6956 Write_Str ("Discriminant_Checking_Func");
6958 when E_Discriminant =>
6959 Write_Str ("Discriminant_Default_Value");
6968 E_Generic_Function |
6970 E_Generic_Procedure |
6979 E_Subprogram_Type =>
6981 Write_Str ("Last_Entity");
6984 Write_Str ("Scalar_Range");
6987 Write_Str ("Register_Exception_Call");
6990 Write_Str ("Field20??");
6992 end Write_Field20_Name;
6994 -----------------------
6995 -- Write_Field21_Name --
6996 -----------------------
6998 procedure Write_Field21_Name (Id : Entity_Id) is
7004 E_Generic_Function |
7006 E_Generic_Procedure |
7008 Write_Str ("Interface_Name");
7010 when Concurrent_Kind |
7011 Incomplete_Or_Private_Kind |
7015 Write_Str ("Discriminant_Constraint");
7018 Write_Str ("Accept_Address");
7020 when Fixed_Point_Kind =>
7021 Write_Str ("Small_Value");
7023 when E_In_Parameter =>
7024 Write_Str ("Default_Expr_Function");
7027 Modular_Integer_Kind =>
7028 Write_Str ("Original_Array_Type");
7030 when E_Access_Subprogram_Type |
7031 E_Access_Protected_Subprogram_Type =>
7032 Write_Str ("Original_Access_Type");
7035 Write_Str ("Field21??");
7037 end Write_Field21_Name;
7039 -----------------------
7040 -- Write_Field22_Name --
7041 -----------------------
7043 procedure Write_Field22_Name (Id : Entity_Id) is
7047 Write_Str ("Associated_Storage_Pool");
7050 Write_Str ("Component_Size");
7054 Write_Str ("Original_Record_Component");
7056 when E_Enumeration_Literal =>
7057 Write_Str ("Enumeration_Rep_Expr");
7060 Write_Str ("Exception_Code");
7063 Write_Str ("Protected_Formal");
7065 when E_Record_Type =>
7066 Write_Str ("Corresponding_Remote_Type");
7076 E_Generic_Function |
7077 E_Generic_Procedure |
7082 Write_Str ("Scope_Depth_Value");
7084 when E_Record_Type_With_Private |
7085 E_Record_Subtype_With_Private |
7088 E_Limited_Private_Type |
7089 E_Limited_Private_Subtype =>
7090 Write_Str ("Private_View");
7093 Write_Str ("Shared_Var_Assign_Proc");
7096 Write_Str ("Field22??");
7098 end Write_Field22_Name;
7100 ------------------------
7101 -- Write_Field23_Name --
7102 ------------------------
7104 procedure Write_Field23_Name (Id : Entity_Id) is
7108 Write_Str ("Associated_Final_Chain");
7111 Write_Str ("Packed_Array_Type");
7114 Write_Str ("Entry_Cancel_Parameter");
7117 Write_Str ("Protected_Operation");
7119 when E_Discriminant =>
7120 Write_Str ("CR_Discriminant");
7122 when E_Enumeration_Type =>
7123 Write_Str ("Enum_Pos_To_Rep");
7127 Write_Str ("Extra_Constrained");
7129 when E_Generic_Function |
7131 E_Generic_Procedure =>
7132 Write_Str ("Inner_Instances");
7134 when Concurrent_Kind |
7135 Incomplete_Or_Private_Kind |
7139 Write_Str ("Stored_Constraint");
7143 Write_Str ("Generic_Renamings");
7146 if Is_Generic_Instance (Id) then
7147 Write_Str ("Generic_Renamings");
7149 Write_Str ("Limited Views");
7152 -- What about Privals_Chain for protected operations ???
7155 Write_Str ("Privals_Chain");
7158 Write_Str ("Field23??");
7160 end Write_Field23_Name;
7162 -------------------------
7163 -- Iterator Procedures --
7164 -------------------------
7166 procedure Proc_Next_Component (N : in out Node_Id) is
7168 N := Next_Component (N);
7169 end Proc_Next_Component;
7171 procedure Proc_Next_Discriminant (N : in out Node_Id) is
7173 N := Next_Discriminant (N);
7174 end Proc_Next_Discriminant;
7176 procedure Proc_Next_Formal (N : in out Node_Id) is
7178 N := Next_Formal (N);
7179 end Proc_Next_Formal;
7181 procedure Proc_Next_Formal_With_Extras (N : in out Node_Id) is
7183 N := Next_Formal_With_Extras (N);
7184 end Proc_Next_Formal_With_Extras;
7186 procedure Proc_Next_Index (N : in out Node_Id) is
7188 N := Next_Index (N);
7189 end Proc_Next_Index;
7191 procedure Proc_Next_Inlined_Subprogram (N : in out Node_Id) is
7193 N := Next_Inlined_Subprogram (N);
7194 end Proc_Next_Inlined_Subprogram;
7196 procedure Proc_Next_Literal (N : in out Node_Id) is
7198 N := Next_Literal (N);
7199 end Proc_Next_Literal;
7201 procedure Proc_Next_Stored_Discriminant (N : in out Node_Id) is
7203 N := Next_Stored_Discriminant (N);
7204 end Proc_Next_Stored_Discriminant;