1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
32 ------------------------------------------------------------------------------
34 pragma Style_Checks (All_Checks);
35 -- Turn off subprogram ordering, not used for this unit
37 with Atree; use Atree;
38 with Namet; use Namet;
39 with Nlists; use Nlists;
40 with Sinfo; use Sinfo;
41 with Stand; use Stand;
42 with Output; use Output;
46 use Atree.Unchecked_Access;
47 -- This is one of the packages that is allowed direct untyped access to
48 -- the fields in a node, since it provides the next level abstraction
49 -- which incorporates appropriate checks.
51 ----------------------------------------------
52 -- Usage of Fields in Defining Entity Nodes --
53 ----------------------------------------------
55 -- Four of these fields are defined in Sinfo, since they in are the
56 -- base part of the node. The access routines for these fields and
57 -- the corresponding set procedures are defined in Sinfo. These fields
58 -- are present in all entities. Note that Homonym is also in the base
59 -- part of the node, but has access routines that are more properly
60 -- part of Einfo, which is why they are defined here.
67 -- Remaining fields are present only in extended nodes (i.e. entities)
69 -- The following fields are present in all entities
72 -- First_Rep_Item Node6
75 -- The usage of each field (and the entity kinds to which it applies)
76 -- depends on the particular field (see Einfo spec for details).
78 -- Associated_Node_For_Itype Node8
79 -- Dependent_Instances Elist8
80 -- Hiding_Loop_Variable Node8
81 -- Mechanism Uint8 (but returns Mechanism_Type)
82 -- Normalized_First_Bit Uint8
84 -- Class_Wide_Type Node9
85 -- Current_Value Node9
88 -- Discriminal_Link Node10
89 -- Handler_Records List10
90 -- Normalized_Position_Max Uint10
91 -- Referenced_Object Node10
93 -- Component_Bit_Offset Uint11
95 -- Entry_Component Node11
96 -- Enumeration_Pos Uint11
97 -- Generic_Homonym Node11
98 -- Protected_Body_Subprogram Node11
101 -- Barrier_Function Node12
102 -- Enumeration_Rep Uint12
104 -- Next_Inlined_Subprogram Node12
106 -- Corresponding_Equality Node13
107 -- Component_Clause Node13
108 -- Debug_Renaming_Link Node13
109 -- Elaboration_Entity Node13
110 -- Extra_Accessibility Node13
114 -- First_Optional_Parameter Node14
115 -- Normalized_Position Uint14
116 -- Shadow_Entities List14
118 -- Discriminant_Number Uint15
119 -- DT_Position Uint15
120 -- DT_Entry_Count Uint15
121 -- Entry_Bodies_Array Node15
122 -- Entry_Parameters_Type Node15
123 -- Extra_Formal Node15
124 -- Lit_Indexes Node15
125 -- Primitive_Operations Elist15
126 -- Related_Instance Node15
127 -- Scale_Value Uint15
128 -- Storage_Size_Variable Node15
129 -- String_Literal_Low_Bound Node15
130 -- Shared_Var_Read_Proc Node15
132 -- Access_Disp_Table Node16
133 -- Cloned_Subtype Node16
135 -- Entry_Formal Node16
136 -- First_Private_Entity Node16
137 -- Lit_Strings Node16
138 -- String_Literal_Length Uint16
139 -- Unset_Reference Node16
141 -- Actual_Subtype Node17
142 -- Digits_Value Uint17
143 -- Discriminal Node17
144 -- First_Entity Node17
145 -- First_Index Node17
146 -- First_Literal Node17
149 -- Non_Limited_View Node17
154 -- Corresponding_Concurrent_Type Node18
155 -- Corresponding_Record_Type Node18
156 -- Delta_Value Ureal18
157 -- Enclosing_Scope Node18
158 -- Equivalent_Type Node18
159 -- Private_Dependents Elist18
160 -- Renamed_Entity Node18
161 -- Renamed_Object Node18
163 -- Body_Entity Node19
164 -- Corresponding_Discriminant Node19
165 -- Finalization_Chain_Entity Node19
166 -- Parent_Subtype Node19
167 -- Related_Array_Object Node19
168 -- Size_Check_Code Node19
169 -- Spec_Entity Node19
170 -- Underlying_Full_View Node19
172 -- Component_Type Node20
173 -- Default_Value Node20
174 -- Directly_Designated_Type Node20
175 -- Discriminant_Checking_Func Node20
176 -- Discriminant_Default_Value Node20
177 -- Last_Entity Node20
178 -- Register_Exception_Call Node20
179 -- Scalar_Range Node20
181 -- Accept_Address Elist21
182 -- Default_Expr_Function Node21
183 -- Discriminant_Constraint Elist21
184 -- Interface_Name Node21
185 -- Original_Array_Type Node21
186 -- Small_Value Ureal21
188 -- Associated_Storage_Pool Node22
189 -- Component_Size Uint22
190 -- Corresponding_Remote_Type Node22
191 -- Enumeration_Rep_Expr Node22
192 -- Exception_Code Uint22
193 -- Original_Record_Component Node22
194 -- Private_View Node22
195 -- Protected_Formal Node22
196 -- Scope_Depth_Value Uint22
197 -- Shared_Var_Assign_Proc Node22
199 -- Associated_Final_Chain Node23
200 -- CR_Discriminant Node23
201 -- Stored_Constraint Elist23
202 -- Entry_Cancel_Parameter Node23
203 -- Extra_Constrained Node23
204 -- Generic_Renamings Elist23
205 -- Inner_Instances Elist23
206 -- Enum_Pos_To_Rep Node23
207 -- Packed_Array_Type Node23
208 -- Limited_View Node23
209 -- Privals_Chain Elist23
210 -- Protected_Operation Node23
212 ---------------------------------------------
213 -- Usage of Flags in Defining Entity Nodes --
214 ---------------------------------------------
216 -- All flags are unique, there is no overlaying, so each flag is physically
217 -- present in every entity. However, for many of the flags, it only makes
218 -- sense for them to be set true for certain subsets of entity kinds. See
219 -- the spec of Einfo for further details.
221 -- Note: Flag1-Flag3 are absent from this list, since these flag positions
222 -- are used for the flags Analyzed, Comes_From_Source, and Error_Posted,
223 -- which are common to all nodes, including entity nodes.
226 -- Has_Discriminants Flag5
227 -- Is_Dispatching_Operation Flag6
228 -- Is_Immediately_Visible Flag7
230 -- Is_Potentially_Use_Visible Flag9
234 -- Is_Constrained Flag12
235 -- Is_Generic_Type Flag13
236 -- Depends_On_Private Flag14
238 -- Is_Volatile Flag16
239 -- Is_Internal Flag17
240 -- Has_Delayed_Freeze Flag18
241 -- Is_Abstract Flag19
242 -- Is_Concurrent_Record_Type Flag20
244 -- Has_Master_Entity Flag21
245 -- Needs_No_Actuals Flag22
246 -- Has_Storage_Size_Clause Flag23
247 -- Is_Imported Flag24
248 -- Is_Limited_Record Flag25
249 -- Has_Completion Flag26
250 -- Has_Pragma_Controlled Flag27
251 -- Is_Statically_Allocated Flag28
252 -- Has_Size_Clause Flag29
255 -- Checks_May_Be_Suppressed Flag31
256 -- Kill_Elaboration_Checks Flag32
257 -- Kill_Range_Checks Flag33
258 -- Kill_Tag_Checks Flag34
259 -- Is_Class_Wide_Equivalent_Type Flag35
260 -- Referenced_As_LHS Flag36
261 -- Is_Known_Non_Null Flag37
262 -- Can_Never_Be_Null Flag38
263 -- Is_Overriding_Operation Flag39
264 -- Body_Needed_For_SAL Flag40
266 -- Treat_As_Volatile Flag41
267 -- Is_Controlled Flag42
268 -- Has_Controlled_Component Flag43
270 -- In_Private_Part Flag45
271 -- Has_Alignment_Clause Flag46
273 -- In_Package_Body Flag48
275 -- Delay_Subprogram_Descriptors Flag50
278 -- Is_Entry_Formal Flag52
279 -- Is_Private_Descendant Flag53
280 -- Return_Present Flag54
281 -- Is_Tagged_Type Flag55
282 -- Has_Homonym Flag56
284 -- Non_Binary_Modulus Flag58
285 -- Is_Preelaborated Flag59
286 -- Is_Shared_Passive Flag60
288 -- Is_Remote_Types Flag61
289 -- Is_Remote_Call_Interface Flag62
290 -- Is_Character_Type Flag63
291 -- Is_Intrinsic_Subprogram Flag64
292 -- Has_Record_Rep_Clause Flag65
293 -- Has_Enumeration_Rep_Clause Flag66
294 -- Has_Small_Clause Flag67
295 -- Has_Component_Size_Clause Flag68
296 -- Is_Access_Constant Flag69
297 -- Is_First_Subtype Flag70
299 -- Has_Completion_In_Body Flag71
300 -- Has_Unknown_Discriminants Flag72
301 -- Is_Child_Unit Flag73
302 -- Is_CPP_Class Flag74
303 -- Has_Non_Standard_Rep Flag75
304 -- Is_Constructor Flag76
305 -- Is_Thread_Body Flag77
307 -- Has_All_Calls_Remote Flag79
308 -- Is_Constr_Subt_For_U_Nominal Flag80
310 -- Is_Asynchronous Flag81
311 -- Has_Gigi_Rep_Item Flag82
312 -- Has_Machine_Radix_Clause Flag83
313 -- Machine_Radix_10 Flag84
315 -- Has_Atomic_Components Flag86
316 -- Has_Volatile_Components Flag87
317 -- Discard_Names Flag88
318 -- Is_Interrupt_Handler Flag89
319 -- Returns_By_Ref Flag90
322 -- Size_Known_At_Compile_Time Flag92
323 -- Has_Subprogram_Descriptor Flag93
324 -- Is_Generic_Actual_Type Flag94
325 -- Uses_Sec_Stack Flag95
326 -- Warnings_Off Flag96
327 -- Is_Controlling_Formal Flag97
328 -- Has_Controlling_Result Flag98
329 -- Is_Exported Flag99
330 -- Has_Specified_Layout Flag100
332 -- Has_Nested_Block_With_Handler Flag101
334 -- Is_Completely_Hidden Flag103
335 -- Address_Taken Flag104
336 -- Suppress_Init_Proc Flag105
337 -- Is_Limited_Composite Flag106
338 -- Is_Private_Composite Flag107
339 -- Default_Expressions_Processed Flag108
340 -- Is_Non_Static_Subtype Flag109
341 -- Has_External_Tag_Rep_Clause Flag110
343 -- Is_Formal_Subprogram Flag111
344 -- Is_Renaming_Of_Object Flag112
346 -- Delay_Cleanups Flag114
347 -- Never_Set_In_Source Flag115
348 -- Is_Visible_Child_Unit Flag116
349 -- Is_Unchecked_Union Flag117
350 -- Is_For_Access_Subtype Flag118
351 -- Has_Convention_Pragma Flag119
352 -- Has_Primitive_Operations Flag120
354 -- Has_Pragma_Pack Flag121
355 -- Is_Bit_Packed_Array Flag122
356 -- Has_Unchecked_Union Flag123
357 -- Is_Eliminated Flag124
358 -- C_Pass_By_Copy Flag125
359 -- Is_Instantiated Flag126
360 -- Is_Valued_Procedure Flag127
361 -- (used for Component_Alignment) Flag128
362 -- (used for Component_Alignment) Flag129
363 -- Is_Generic_Instance Flag130
365 -- No_Pool_Assigned Flag131
366 -- Is_AST_Entry Flag132
367 -- Is_VMS_Exception Flag133
368 -- Is_Optional_Parameter Flag134
369 -- Has_Aliased_Components Flag135
370 -- No_Strict_Aliasing Flag136
371 -- Is_Machine_Code_Subprogram Flag137
372 -- Is_Packed_Array_Type Flag138
373 -- Has_Biased_Representation Flag139
374 -- Has_Complex_Representation Flag140
376 -- Is_Constr_Subt_For_UN_Aliased Flag141
377 -- Has_Missing_Return Flag142
378 -- Has_Recursive_Call Flag143
379 -- Is_Unsigned_Type Flag144
380 -- Strict_Alignment Flag145
381 -- Elaborate_All_Desirable Flag146
382 -- Needs_Debug_Info Flag147
383 -- Suppress_Elaboration_Warnings Flag148
384 -- Is_Compilation_Unit Flag149
385 -- Has_Pragma_Elaborate_Body Flag150
388 -- Entry_Accepted Flag152
389 -- Is_Psected Flag153
390 -- Has_Per_Object_Constraint Flag154
391 -- Has_Private_Declaration Flag155
392 -- Referenced Flag156
393 -- Has_Pragma_Inline Flag157
394 -- Finalize_Storage_Only Flag158
395 -- From_With_Type Flag159
396 -- Is_Package_Body_Entity Flag160
398 -- Has_Qualified_Name Flag161
399 -- Nonzero_Is_True Flag162
400 -- Is_True_Constant Flag163
401 -- Reverse_Bit_Order Flag164
402 -- Suppress_Style_Checks Flag165
403 -- Debug_Info_Off Flag166
404 -- Sec_Stack_Needed_For_Return Flag167
405 -- Materialize_Entity Flag168
406 -- Function_Returns_With_DSP Flag169
407 -- Is_Known_Valid Flag170
409 -- Is_Hidden_Open_Scope Flag171
410 -- Has_Object_Size_Clause Flag172
411 -- Has_Fully_Qualified_Name Flag173
412 -- Elaboration_Entity_Required Flag174
413 -- Has_Forward_Instantiation Flag175
414 -- Is_Discrim_SO_Function Flag176
415 -- Size_Depends_On_Discriminant Flag177
416 -- Is_Null_Init_Proc Flag178
417 -- Has_Pragma_Pure_Function Flag179
418 -- Has_Pragma_Unreferenced Flag180
420 -- Has_Contiguous_Rep Flag181
421 -- Has_Xref_Entry Flag182
423 -- Remaining flags are currently unused and available
427 --------------------------------
428 -- Attribute Access Functions --
429 --------------------------------
431 function Accept_Address (Id : E) return L is
436 function Access_Disp_Table (Id : E) return E is
438 pragma Assert (Is_Tagged_Type (Id));
439 return Node16 (Implementation_Base_Type (Id));
440 end Access_Disp_Table;
442 function Actual_Subtype (Id : E) return E is
445 (Ekind (Id) = E_Constant
446 or else Ekind (Id) = E_Variable
447 or else Ekind (Id) = E_Generic_In_Out_Parameter
448 or else Ekind (Id) in E_In_Parameter .. E_In_Out_Parameter);
452 function Address_Taken (Id : E) return B is
457 function Alias (Id : E) return E is
460 (Is_Overloadable (Id) or else Ekind (Id) = E_Subprogram_Type);
464 function Alignment (Id : E) return U is
466 pragma Assert (Is_Type (Id)
467 or else Is_Formal (Id)
468 or else Ekind (Id) = E_Loop_Parameter
469 or else Ekind (Id) = E_Constant
470 or else Ekind (Id) = E_Exception
471 or else Ekind (Id) = E_Variable);
475 function Associated_Final_Chain (Id : E) return E is
477 pragma Assert (Is_Access_Type (Id));
479 end Associated_Final_Chain;
481 function Associated_Formal_Package (Id : E) return E is
483 pragma Assert (Ekind (Id) = E_Package);
485 end Associated_Formal_Package;
487 function Associated_Node_For_Itype (Id : E) return N is
490 end Associated_Node_For_Itype;
492 function Associated_Storage_Pool (Id : E) return E is
494 pragma Assert (Is_Access_Type (Id));
495 return Node22 (Root_Type (Id));
496 end Associated_Storage_Pool;
498 function Barrier_Function (Id : E) return N is
500 pragma Assert (Is_Entry (Id));
502 end Barrier_Function;
504 function Block_Node (Id : E) return N is
506 pragma Assert (Ekind (Id) = E_Block);
510 function Body_Entity (Id : E) return E is
513 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
517 function Body_Needed_For_SAL (Id : E) return B is
520 (Ekind (Id) = E_Package
521 or else Is_Subprogram (Id)
522 or else Is_Generic_Unit (Id));
524 end Body_Needed_For_SAL;
526 function C_Pass_By_Copy (Id : E) return B is
528 pragma Assert (Is_Record_Type (Id));
529 return Flag125 (Implementation_Base_Type (Id));
532 function Can_Never_Be_Null (Id : E) return B is
535 end Can_Never_Be_Null;
537 function Checks_May_Be_Suppressed (Id : E) return B is
540 end Checks_May_Be_Suppressed;
542 function Class_Wide_Type (Id : E) return E is
544 pragma Assert (Is_Type (Id));
548 function Cloned_Subtype (Id : E) return E is
551 (Ekind (Id) = E_Record_Subtype
552 or else Ekind (Id) = E_Class_Wide_Subtype);
556 function Component_Bit_Offset (Id : E) return U is
559 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
561 end Component_Bit_Offset;
563 function Component_Clause (Id : E) return N is
566 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
568 end Component_Clause;
570 function Component_Size (Id : E) return U is
572 pragma Assert (Is_Array_Type (Id));
573 return Uint22 (Implementation_Base_Type (Id));
576 function Component_Type (Id : E) return E is
578 return Node20 (Implementation_Base_Type (Id));
581 function Corresponding_Concurrent_Type (Id : E) return E is
583 pragma Assert (Ekind (Id) = E_Record_Type);
585 end Corresponding_Concurrent_Type;
587 function Corresponding_Discriminant (Id : E) return E is
589 pragma Assert (Ekind (Id) = E_Discriminant);
591 end Corresponding_Discriminant;
593 function Corresponding_Equality (Id : E) return E is
596 (Ekind (Id) = E_Function
597 and then not Comes_From_Source (Id)
598 and then Chars (Id) = Name_Op_Ne);
600 end Corresponding_Equality;
602 function Corresponding_Record_Type (Id : E) return E is
604 pragma Assert (Is_Concurrent_Type (Id));
606 end Corresponding_Record_Type;
608 function Corresponding_Remote_Type (Id : E) return E is
611 end Corresponding_Remote_Type;
613 function Current_Value (Id : E) return N is
615 pragma Assert (Ekind (Id) in Object_Kind);
619 function CR_Discriminant (Id : E) return E is
624 function Debug_Info_Off (Id : E) return B is
629 function Debug_Renaming_Link (Id : E) return E is
632 end Debug_Renaming_Link;
634 function Default_Expr_Function (Id : E) return E is
636 pragma Assert (Is_Formal (Id));
638 end Default_Expr_Function;
640 function Default_Expressions_Processed (Id : E) return B is
643 end Default_Expressions_Processed;
645 function Default_Value (Id : E) return N is
647 pragma Assert (Is_Formal (Id));
651 function Delay_Cleanups (Id : E) return B is
656 function Delay_Subprogram_Descriptors (Id : E) return B is
659 end Delay_Subprogram_Descriptors;
661 function Delta_Value (Id : E) return R is
663 pragma Assert (Is_Fixed_Point_Type (Id));
667 function Dependent_Instances (Id : E) return L is
669 pragma Assert (Is_Generic_Instance (Id));
671 end Dependent_Instances;
673 function Depends_On_Private (Id : E) return B is
675 pragma Assert (Nkind (Id) in N_Entity);
677 end Depends_On_Private;
679 function Digits_Value (Id : E) return U is
682 (Is_Floating_Point_Type (Id)
683 or else Is_Decimal_Fixed_Point_Type (Id));
687 function Directly_Designated_Type (Id : E) return E is
690 end Directly_Designated_Type;
692 function Discard_Names (Id : E) return B is
697 function Discriminal (Id : E) return E is
699 pragma Assert (Ekind (Id) = E_Discriminant);
703 function Discriminal_Link (Id : E) return N is
706 end Discriminal_Link;
708 function Discriminant_Checking_Func (Id : E) return E is
710 pragma Assert (Ekind (Id) = E_Component);
712 end Discriminant_Checking_Func;
714 function Discriminant_Constraint (Id : E) return L is
716 pragma Assert (Is_Composite_Type (Id) and then Has_Discriminants (Id));
718 end Discriminant_Constraint;
720 function Discriminant_Default_Value (Id : E) return N is
722 pragma Assert (Ekind (Id) = E_Discriminant);
724 end Discriminant_Default_Value;
726 function Discriminant_Number (Id : E) return U is
728 pragma Assert (Ekind (Id) = E_Discriminant);
730 end Discriminant_Number;
732 function DT_Entry_Count (Id : E) return U is
734 pragma Assert (Ekind (Id) = E_Component and then Is_Tag (Id));
738 function DT_Position (Id : E) return U is
741 ((Ekind (Id) = E_Function
742 or else Ekind (Id) = E_Procedure)
743 and then Present (DTC_Entity (Id)));
747 function DTC_Entity (Id : E) return E is
750 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
754 function Elaborate_All_Desirable (Id : E) return B is
757 end Elaborate_All_Desirable;
759 function Elaboration_Entity (Id : E) return E is
764 Ekind (Id) = E_Package
766 Is_Generic_Unit (Id));
768 end Elaboration_Entity;
770 function Elaboration_Entity_Required (Id : E) return B is
775 Ekind (Id) = E_Package
777 Is_Generic_Unit (Id));
779 end Elaboration_Entity_Required;
781 function Enclosing_Scope (Id : E) return E is
786 function Entry_Accepted (Id : E) return B is
788 pragma Assert (Is_Entry (Id));
792 function Entry_Bodies_Array (Id : E) return E is
795 end Entry_Bodies_Array;
797 function Entry_Cancel_Parameter (Id : E) return E is
800 end Entry_Cancel_Parameter;
802 function Entry_Component (Id : E) return E is
807 function Entry_Formal (Id : E) return E is
812 function Entry_Index_Constant (Id : E) return N is
814 pragma Assert (Ekind (Id) = E_Entry_Index_Parameter);
816 end Entry_Index_Constant;
818 function Entry_Parameters_Type (Id : E) return E is
821 end Entry_Parameters_Type;
823 function Enum_Pos_To_Rep (Id : E) return E is
825 pragma Assert (Ekind (Id) = E_Enumeration_Type);
829 function Enumeration_Pos (Id : E) return Uint is
831 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
835 function Enumeration_Rep (Id : E) return U is
837 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
841 function Enumeration_Rep_Expr (Id : E) return N is
843 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
845 end Enumeration_Rep_Expr;
847 function Equivalent_Type (Id : E) return E is
850 (Ekind (Id) = E_Class_Wide_Subtype or else
851 Ekind (Id) = E_Access_Protected_Subprogram_Type or else
852 Ekind (Id) = E_Access_Subprogram_Type or else
853 Ekind (Id) = E_Exception_Type);
857 function Esize (Id : E) return Uint is
862 function Exception_Code (Id : E) return Uint is
864 pragma Assert (Ekind (Id) = E_Exception);
868 function Extra_Accessibility (Id : E) return E is
870 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
872 end Extra_Accessibility;
874 function Extra_Constrained (Id : E) return E is
876 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
878 end Extra_Constrained;
880 function Extra_Formal (Id : E) return E is
885 function Finalization_Chain_Entity (Id : E) return E is
888 end Finalization_Chain_Entity;
890 function Finalize_Storage_Only (Id : E) return B is
892 pragma Assert (Is_Type (Id));
893 return Flag158 (Base_Type (Id));
894 end Finalize_Storage_Only;
896 function First_Entity (Id : E) return E is
901 function First_Index (Id : E) return N is
906 function First_Literal (Id : E) return E is
911 function First_Optional_Parameter (Id : E) return E is
914 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
916 end First_Optional_Parameter;
918 function First_Private_Entity (Id : E) return E is
921 end First_Private_Entity;
923 function First_Rep_Item (Id : E) return E is
928 function Freeze_Node (Id : E) return N is
933 function From_With_Type (Id : E) return B is
938 function Full_View (Id : E) return E is
940 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Constant);
944 function Function_Returns_With_DSP (Id : E) return B is
947 (Is_Subprogram (Id) or else Ekind (Id) = E_Subprogram_Type);
949 end Function_Returns_With_DSP;
951 function Generic_Homonym (Id : E) return E is
953 pragma Assert (Ekind (Id) = E_Generic_Package);
957 function Generic_Renamings (Id : E) return L is
960 end Generic_Renamings;
962 function Handler_Records (Id : E) return S is
967 function Has_Aliased_Components (Id : E) return B is
969 return Flag135 (Implementation_Base_Type (Id));
970 end Has_Aliased_Components;
972 function Has_Alignment_Clause (Id : E) return B is
975 end Has_Alignment_Clause;
977 function Has_All_Calls_Remote (Id : E) return B is
980 end Has_All_Calls_Remote;
982 function Has_Atomic_Components (Id : E) return B is
984 return Flag86 (Implementation_Base_Type (Id));
985 end Has_Atomic_Components;
987 function Has_Biased_Representation (Id : E) return B is
990 end Has_Biased_Representation;
992 function Has_Completion (Id : E) return B is
997 function Has_Completion_In_Body (Id : E) return B is
999 pragma Assert (Is_Type (Id));
1001 end Has_Completion_In_Body;
1003 function Has_Complex_Representation (Id : E) return B is
1005 pragma Assert (Is_Type (Id));
1006 return Flag140 (Implementation_Base_Type (Id));
1007 end Has_Complex_Representation;
1009 function Has_Component_Size_Clause (Id : E) return B is
1011 pragma Assert (Is_Array_Type (Id));
1012 return Flag68 (Implementation_Base_Type (Id));
1013 end Has_Component_Size_Clause;
1015 function Has_Controlled_Component (Id : E) return B is
1017 return Flag43 (Base_Type (Id));
1018 end Has_Controlled_Component;
1020 function Has_Contiguous_Rep (Id : E) return B is
1022 return Flag181 (Id);
1023 end Has_Contiguous_Rep;
1025 function Has_Controlling_Result (Id : E) return B is
1028 end Has_Controlling_Result;
1030 function Has_Convention_Pragma (Id : E) return B is
1032 return Flag119 (Id);
1033 end Has_Convention_Pragma;
1035 function Has_Delayed_Freeze (Id : E) return B is
1037 pragma Assert (Nkind (Id) in N_Entity);
1039 end Has_Delayed_Freeze;
1041 function Has_Discriminants (Id : E) return B is
1043 pragma Assert (Nkind (Id) in N_Entity);
1045 end Has_Discriminants;
1047 function Has_Enumeration_Rep_Clause (Id : E) return B is
1049 pragma Assert (Is_Enumeration_Type (Id));
1051 end Has_Enumeration_Rep_Clause;
1053 function Has_Exit (Id : E) return B is
1058 function Has_External_Tag_Rep_Clause (Id : E) return B is
1060 pragma Assert (Is_Tagged_Type (Id));
1061 return Flag110 (Id);
1062 end Has_External_Tag_Rep_Clause;
1064 function Has_Forward_Instantiation (Id : E) return B is
1066 return Flag175 (Id);
1067 end Has_Forward_Instantiation;
1069 function Has_Fully_Qualified_Name (Id : E) return B is
1071 return Flag173 (Id);
1072 end Has_Fully_Qualified_Name;
1074 function Has_Gigi_Rep_Item (Id : E) return B is
1077 end Has_Gigi_Rep_Item;
1079 function Has_Homonym (Id : E) return B is
1084 function Has_Machine_Radix_Clause (Id : E) return B is
1086 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
1088 end Has_Machine_Radix_Clause;
1090 function Has_Master_Entity (Id : E) return B is
1093 end Has_Master_Entity;
1095 function Has_Missing_Return (Id : E) return B is
1098 (Ekind (Id) = E_Function or else Ekind (Id) = E_Generic_Function);
1099 return Flag142 (Id);
1100 end Has_Missing_Return;
1102 function Has_Nested_Block_With_Handler (Id : E) return B is
1104 return Flag101 (Id);
1105 end Has_Nested_Block_With_Handler;
1107 function Has_Non_Standard_Rep (Id : E) return B is
1109 return Flag75 (Implementation_Base_Type (Id));
1110 end Has_Non_Standard_Rep;
1112 function Has_Object_Size_Clause (Id : E) return B is
1114 pragma Assert (Is_Type (Id));
1115 return Flag172 (Id);
1116 end Has_Object_Size_Clause;
1118 function Has_Per_Object_Constraint (Id : E) return B is
1120 return Flag154 (Id);
1121 end Has_Per_Object_Constraint;
1123 function Has_Pragma_Controlled (Id : E) return B is
1125 pragma Assert (Is_Access_Type (Id));
1126 return Flag27 (Implementation_Base_Type (Id));
1127 end Has_Pragma_Controlled;
1129 function Has_Pragma_Elaborate_Body (Id : E) return B is
1131 return Flag150 (Id);
1132 end Has_Pragma_Elaborate_Body;
1134 function Has_Pragma_Inline (Id : E) return B is
1136 return Flag157 (Id);
1137 end Has_Pragma_Inline;
1139 function Has_Pragma_Pack (Id : E) return B is
1141 pragma Assert (Is_Record_Type (Id) or else Is_Array_Type (Id));
1142 return Flag121 (Implementation_Base_Type (Id));
1143 end Has_Pragma_Pack;
1145 function Has_Pragma_Pure_Function (Id : E) return B is
1147 pragma Assert (Is_Subprogram (Id));
1148 return Flag179 (Id);
1149 end Has_Pragma_Pure_Function;
1151 function Has_Pragma_Unreferenced (Id : E) return B is
1153 return Flag180 (Id);
1154 end Has_Pragma_Unreferenced;
1156 function Has_Primitive_Operations (Id : E) return B is
1158 pragma Assert (Is_Type (Id));
1159 return Flag120 (Base_Type (Id));
1160 end Has_Primitive_Operations;
1162 function Has_Private_Declaration (Id : E) return B is
1164 return Flag155 (Id);
1165 end Has_Private_Declaration;
1167 function Has_Qualified_Name (Id : E) return B is
1169 return Flag161 (Id);
1170 end Has_Qualified_Name;
1172 function Has_Record_Rep_Clause (Id : E) return B is
1174 pragma Assert (Is_Record_Type (Id));
1175 return Flag65 (Implementation_Base_Type (Id));
1176 end Has_Record_Rep_Clause;
1178 function Has_Recursive_Call (Id : E) return B is
1180 pragma Assert (Is_Subprogram (Id));
1181 return Flag143 (Id);
1182 end Has_Recursive_Call;
1184 function Has_Size_Clause (Id : E) return B is
1187 end Has_Size_Clause;
1189 function Has_Small_Clause (Id : E) return B is
1192 end Has_Small_Clause;
1194 function Has_Specified_Layout (Id : E) return B is
1196 pragma Assert (Is_Type (Id));
1197 return Flag100 (Implementation_Base_Type (Id));
1198 end Has_Specified_Layout;
1200 function Has_Storage_Size_Clause (Id : E) return B is
1202 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
1203 return Flag23 (Implementation_Base_Type (Id));
1204 end Has_Storage_Size_Clause;
1206 function Has_Subprogram_Descriptor (Id : E) return B is
1209 end Has_Subprogram_Descriptor;
1211 function Has_Task (Id : E) return B is
1213 return Flag30 (Base_Type (Id));
1216 function Has_Unchecked_Union (Id : E) return B is
1218 return Flag123 (Base_Type (Id));
1219 end Has_Unchecked_Union;
1221 function Has_Unknown_Discriminants (Id : E) return B is
1223 pragma Assert (Is_Type (Id));
1225 end Has_Unknown_Discriminants;
1227 function Has_Volatile_Components (Id : E) return B is
1229 return Flag87 (Implementation_Base_Type (Id));
1230 end Has_Volatile_Components;
1232 function Has_Xref_Entry (Id : E) return B is
1234 return Flag182 (Implementation_Base_Type (Id));
1237 function Hiding_Loop_Variable (Id : E) return E is
1239 pragma Assert (Ekind (Id) = E_Variable);
1241 end Hiding_Loop_Variable;
1243 function Homonym (Id : E) return E is
1248 function In_Package_Body (Id : E) return B is
1251 end In_Package_Body;
1253 function In_Private_Part (Id : E) return B is
1256 end In_Private_Part;
1258 function In_Use (Id : E) return B is
1260 pragma Assert (Nkind (Id) in N_Entity);
1264 function Inner_Instances (Id : E) return L is
1266 return Elist23 (Id);
1267 end Inner_Instances;
1269 function Interface_Name (Id : E) return N is
1274 function Is_Abstract (Id : E) return B is
1279 function Is_Access_Constant (Id : E) return B is
1281 pragma Assert (Is_Access_Type (Id));
1283 end Is_Access_Constant;
1285 function Is_Aliased (Id : E) return B is
1287 pragma Assert (Nkind (Id) in N_Entity);
1291 function Is_AST_Entry (Id : E) return B is
1293 pragma Assert (Is_Entry (Id));
1294 return Flag132 (Id);
1297 function Is_Asynchronous (Id : E) return B is
1300 (Ekind (Id) = E_Procedure or else Is_Type (Id));
1302 end Is_Asynchronous;
1304 function Is_Atomic (Id : E) return B is
1309 function Is_Bit_Packed_Array (Id : E) return B is
1311 return Flag122 (Implementation_Base_Type (Id));
1312 end Is_Bit_Packed_Array;
1314 function Is_Called (Id : E) return B is
1317 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Function);
1318 return Flag102 (Id);
1321 function Is_Character_Type (Id : E) return B is
1324 end Is_Character_Type;
1326 function Is_Child_Unit (Id : E) return B is
1331 function Is_Class_Wide_Equivalent_Type (Id : E) return B is
1334 end Is_Class_Wide_Equivalent_Type;
1336 function Is_Compilation_Unit (Id : E) return B is
1338 return Flag149 (Id);
1339 end Is_Compilation_Unit;
1341 function Is_Completely_Hidden (Id : E) return B is
1343 pragma Assert (Ekind (Id) = E_Discriminant);
1344 return Flag103 (Id);
1345 end Is_Completely_Hidden;
1347 function Is_Constr_Subt_For_U_Nominal (Id : E) return B is
1350 end Is_Constr_Subt_For_U_Nominal;
1352 function Is_Constr_Subt_For_UN_Aliased (Id : E) return B is
1354 return Flag141 (Id);
1355 end Is_Constr_Subt_For_UN_Aliased;
1357 function Is_Constrained (Id : E) return B is
1359 pragma Assert (Nkind (Id) in N_Entity);
1363 function Is_Constructor (Id : E) return B is
1368 function Is_Controlled (Id : E) return B is
1370 return Flag42 (Base_Type (Id));
1373 function Is_Controlling_Formal (Id : E) return B is
1375 pragma Assert (Is_Formal (Id));
1377 end Is_Controlling_Formal;
1379 function Is_CPP_Class (Id : E) return B is
1384 function Is_Discrim_SO_Function (Id : E) return B is
1386 return Flag176 (Id);
1387 end Is_Discrim_SO_Function;
1389 function Is_Dispatching_Operation (Id : E) return B is
1391 pragma Assert (Nkind (Id) in N_Entity);
1393 end Is_Dispatching_Operation;
1395 function Is_Eliminated (Id : E) return B is
1397 return Flag124 (Id);
1400 function Is_Entry_Formal (Id : E) return B is
1403 end Is_Entry_Formal;
1405 function Is_Exported (Id : E) return B is
1410 function Is_First_Subtype (Id : E) return B is
1413 end Is_First_Subtype;
1415 function Is_For_Access_Subtype (Id : E) return B is
1418 (Ekind (Id) = E_Record_Subtype
1420 Ekind (Id) = E_Private_Subtype);
1421 return Flag118 (Id);
1422 end Is_For_Access_Subtype;
1424 function Is_Formal_Subprogram (Id : E) return B is
1426 return Flag111 (Id);
1427 end Is_Formal_Subprogram;
1429 function Is_Frozen (Id : E) return B is
1434 function Is_Generic_Actual_Type (Id : E) return B is
1436 pragma Assert (Is_Type (Id));
1438 end Is_Generic_Actual_Type;
1440 function Is_Generic_Instance (Id : E) return B is
1442 return Flag130 (Id);
1443 end Is_Generic_Instance;
1445 function Is_Generic_Type (Id : E) return B is
1447 pragma Assert (Nkind (Id) in N_Entity);
1449 end Is_Generic_Type;
1451 function Is_Hidden (Id : E) return B is
1456 function Is_Hidden_Open_Scope (Id : E) return B is
1458 return Flag171 (Id);
1459 end Is_Hidden_Open_Scope;
1461 function Is_Immediately_Visible (Id : E) return B is
1463 pragma Assert (Nkind (Id) in N_Entity);
1465 end Is_Immediately_Visible;
1467 function Is_Imported (Id : E) return B is
1472 function Is_Inlined (Id : E) return B is
1477 function Is_Instantiated (Id : E) return B is
1479 return Flag126 (Id);
1480 end Is_Instantiated;
1482 function Is_Internal (Id : E) return B is
1484 pragma Assert (Nkind (Id) in N_Entity);
1488 function Is_Interrupt_Handler (Id : E) return B is
1490 pragma Assert (Nkind (Id) in N_Entity);
1492 end Is_Interrupt_Handler;
1494 function Is_Intrinsic_Subprogram (Id : E) return B is
1497 end Is_Intrinsic_Subprogram;
1499 function Is_Itype (Id : E) return B is
1504 function Is_Known_Non_Null (Id : E) return B is
1507 end Is_Known_Non_Null;
1509 function Is_Known_Valid (Id : E) return B is
1511 return Flag170 (Id);
1514 function Is_Limited_Composite (Id : E) return B is
1516 return Flag106 (Id);
1517 end Is_Limited_Composite;
1519 function Is_Limited_Record (Id : E) return B is
1522 end Is_Limited_Record;
1524 function Is_Machine_Code_Subprogram (Id : E) return B is
1526 pragma Assert (Is_Subprogram (Id));
1527 return Flag137 (Id);
1528 end Is_Machine_Code_Subprogram;
1530 function Is_Non_Static_Subtype (Id : E) return B is
1532 pragma Assert (Is_Type (Id));
1533 return Flag109 (Id);
1534 end Is_Non_Static_Subtype;
1536 function Is_Null_Init_Proc (Id : E) return B is
1538 pragma Assert (Ekind (Id) = E_Procedure);
1539 return Flag178 (Id);
1540 end Is_Null_Init_Proc;
1542 function Is_Optional_Parameter (Id : E) return B is
1544 pragma Assert (Is_Formal (Id));
1545 return Flag134 (Id);
1546 end Is_Optional_Parameter;
1548 function Is_Overriding_Operation (Id : E) return B is
1550 pragma Assert (Is_Subprogram (Id));
1552 end Is_Overriding_Operation;
1554 function Is_Package_Body_Entity (Id : E) return B is
1556 return Flag160 (Id);
1557 end Is_Package_Body_Entity;
1559 function Is_Packed (Id : E) return B is
1561 return Flag51 (Implementation_Base_Type (Id));
1564 function Is_Packed_Array_Type (Id : E) return B is
1566 return Flag138 (Id);
1567 end Is_Packed_Array_Type;
1569 function Is_Potentially_Use_Visible (Id : E) return B is
1571 pragma Assert (Nkind (Id) in N_Entity);
1573 end Is_Potentially_Use_Visible;
1575 function Is_Preelaborated (Id : E) return B is
1578 end Is_Preelaborated;
1580 function Is_Private_Composite (Id : E) return B is
1582 pragma Assert (Is_Type (Id));
1583 return Flag107 (Id);
1584 end Is_Private_Composite;
1586 function Is_Private_Descendant (Id : E) return B is
1589 end Is_Private_Descendant;
1591 function Is_Psected (Id : E) return B is
1593 return Flag153 (Id);
1596 function Is_Public (Id : E) return B is
1598 pragma Assert (Nkind (Id) in N_Entity);
1602 function Is_Pure (Id : E) return B is
1607 function Is_Remote_Call_Interface (Id : E) return B is
1610 end Is_Remote_Call_Interface;
1612 function Is_Remote_Types (Id : E) return B is
1615 end Is_Remote_Types;
1617 function Is_Renaming_Of_Object (Id : E) return B is
1619 return Flag112 (Id);
1620 end Is_Renaming_Of_Object;
1622 function Is_Shared_Passive (Id : E) return B is
1625 end Is_Shared_Passive;
1627 function Is_Statically_Allocated (Id : E) return B is
1630 end Is_Statically_Allocated;
1632 function Is_Tag (Id : E) return B is
1634 pragma Assert (Nkind (Id) in N_Entity);
1638 function Is_Tagged_Type (Id : E) return B is
1643 function Is_Thread_Body (Id : E) return B is
1648 function Is_True_Constant (Id : E) return B is
1650 return Flag163 (Id);
1651 end Is_True_Constant;
1653 function Is_Unchecked_Union (Id : E) return B is
1655 return Flag117 (Id);
1656 end Is_Unchecked_Union;
1658 function Is_Unsigned_Type (Id : E) return B is
1660 pragma Assert (Is_Type (Id));
1661 return Flag144 (Id);
1662 end Is_Unsigned_Type;
1664 function Is_Valued_Procedure (Id : E) return B is
1666 pragma Assert (Ekind (Id) = E_Procedure);
1667 return Flag127 (Id);
1668 end Is_Valued_Procedure;
1670 function Is_Visible_Child_Unit (Id : E) return B is
1672 pragma Assert (Is_Child_Unit (Id));
1673 return Flag116 (Id);
1674 end Is_Visible_Child_Unit;
1676 function Is_VMS_Exception (Id : E) return B is
1678 return Flag133 (Id);
1679 end Is_VMS_Exception;
1681 function Is_Volatile (Id : E) return B is
1683 pragma Assert (Nkind (Id) in N_Entity);
1684 if Is_Type (Id) then
1685 return Flag16 (Base_Type (Id));
1691 function Kill_Elaboration_Checks (Id : E) return B is
1694 end Kill_Elaboration_Checks;
1696 function Kill_Range_Checks (Id : E) return B is
1699 end Kill_Range_Checks;
1701 function Kill_Tag_Checks (Id : E) return B is
1704 end Kill_Tag_Checks;
1706 function Last_Entity (Id : E) return E is
1711 function Limited_View (Id : E) return E is
1713 pragma Assert (Ekind (Id) = E_Package);
1717 function Lit_Indexes (Id : E) return E is
1719 pragma Assert (Is_Enumeration_Type (Id));
1723 function Lit_Strings (Id : E) return E is
1725 pragma Assert (Is_Enumeration_Type (Id));
1729 function Machine_Radix_10 (Id : E) return B is
1731 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
1733 end Machine_Radix_10;
1735 function Master_Id (Id : E) return E is
1740 function Materialize_Entity (Id : E) return B is
1742 return Flag168 (Id);
1743 end Materialize_Entity;
1745 function Mechanism (Id : E) return M is
1747 pragma Assert (Ekind (Id) = E_Function or else Is_Formal (Id));
1748 return UI_To_Int (Uint8 (Id));
1751 function Modulus (Id : E) return Uint is
1753 pragma Assert (Is_Modular_Integer_Type (Id));
1754 return Uint17 (Base_Type (Id));
1757 function Needs_Debug_Info (Id : E) return B is
1759 return Flag147 (Id);
1760 end Needs_Debug_Info;
1762 function Needs_No_Actuals (Id : E) return B is
1765 (Is_Overloadable (Id)
1766 or else Ekind (Id) = E_Subprogram_Type
1767 or else Ekind (Id) = E_Entry_Family);
1769 end Needs_No_Actuals;
1771 function Never_Set_In_Source (Id : E) return B is
1773 return Flag115 (Id);
1774 end Never_Set_In_Source;
1776 function Next_Inlined_Subprogram (Id : E) return E is
1779 end Next_Inlined_Subprogram;
1781 function No_Pool_Assigned (Id : E) return B is
1783 pragma Assert (Is_Access_Type (Id));
1784 return Flag131 (Root_Type (Id));
1785 end No_Pool_Assigned;
1787 function No_Return (Id : E) return B is
1791 or else Ekind (Id) = E_Procedure
1792 or else Ekind (Id) = E_Generic_Procedure);
1793 return Flag113 (Id);
1796 function No_Strict_Aliasing (Id : E) return B is
1798 pragma Assert (Is_Access_Type (Id));
1799 return Flag136 (Base_Type (Id));
1800 end No_Strict_Aliasing;
1802 function Non_Binary_Modulus (Id : E) return B is
1804 pragma Assert (Is_Modular_Integer_Type (Id));
1805 return Flag58 (Base_Type (Id));
1806 end Non_Binary_Modulus;
1808 function Non_Limited_View (Id : E) return E is
1810 pragma Assert (False
1811 or else Ekind (Id) = E_Incomplete_Type);
1813 end Non_Limited_View;
1815 function Nonzero_Is_True (Id : E) return B is
1817 pragma Assert (Root_Type (Id) = Standard_Boolean);
1818 return Flag162 (Base_Type (Id));
1819 end Nonzero_Is_True;
1821 function Normalized_First_Bit (Id : E) return U is
1824 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
1826 end Normalized_First_Bit;
1828 function Normalized_Position (Id : E) return U is
1831 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
1833 end Normalized_Position;
1835 function Normalized_Position_Max (Id : E) return U is
1838 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
1840 end Normalized_Position_Max;
1842 function Object_Ref (Id : E) return E is
1844 pragma Assert (Ekind (Id) = E_Protected_Body);
1848 function Original_Access_Type (Id : E) return E is
1851 (Ekind (Id) = E_Access_Subprogram_Type
1852 or else Ekind (Id) = E_Access_Protected_Subprogram_Type);
1854 end Original_Access_Type;
1856 function Original_Array_Type (Id : E) return E is
1858 pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id));
1860 end Original_Array_Type;
1862 function Original_Record_Component (Id : E) return E is
1865 (Ekind (Id) = E_Void
1866 or else Ekind (Id) = E_Component
1867 or else Ekind (Id) = E_Discriminant);
1869 end Original_Record_Component;
1871 function Packed_Array_Type (Id : E) return E is
1873 pragma Assert (Is_Array_Type (Id));
1875 end Packed_Array_Type;
1877 function Parent_Subtype (Id : E) return E is
1879 pragma Assert (Ekind (Id) = E_Record_Type);
1883 function Primitive_Operations (Id : E) return L is
1885 pragma Assert (Is_Tagged_Type (Id));
1886 return Elist15 (Id);
1887 end Primitive_Operations;
1889 function Prival (Id : E) return E is
1891 pragma Assert (Is_Protected_Private (Id));
1895 function Privals_Chain (Id : E) return L is
1897 pragma Assert (Is_Overloadable (Id)
1898 or else Ekind (Id) = E_Entry_Family);
1899 return Elist23 (Id);
1902 function Private_Dependents (Id : E) return L is
1904 pragma Assert (Is_Incomplete_Or_Private_Type (Id));
1905 return Elist18 (Id);
1906 end Private_Dependents;
1908 function Private_View (Id : E) return N is
1910 pragma Assert (Is_Private_Type (Id));
1914 function Protected_Body_Subprogram (Id : E) return E is
1916 pragma Assert (Is_Subprogram (Id) or else Is_Entry (Id));
1918 end Protected_Body_Subprogram;
1920 function Protected_Formal (Id : E) return E is
1922 pragma Assert (Is_Formal (Id));
1924 end Protected_Formal;
1926 function Protected_Operation (Id : E) return N is
1928 pragma Assert (Is_Protected_Private (Id));
1930 end Protected_Operation;
1932 function Reachable (Id : E) return B is
1937 function Referenced (Id : E) return B is
1939 return Flag156 (Id);
1942 function Referenced_As_LHS (Id : E) return B is
1945 end Referenced_As_LHS;
1947 function Referenced_Object (Id : E) return N is
1949 pragma Assert (Is_Type (Id));
1951 end Referenced_Object;
1953 function Register_Exception_Call (Id : E) return N is
1955 pragma Assert (Ekind (Id) = E_Exception);
1957 end Register_Exception_Call;
1959 function Related_Array_Object (Id : E) return E is
1961 pragma Assert (Is_Array_Type (Id));
1963 end Related_Array_Object;
1965 function Related_Instance (Id : E) return E is
1968 (Ekind (Id) = E_Package or else Ekind (Id) = E_Package_Body);
1970 end Related_Instance;
1972 function Renamed_Entity (Id : E) return N is
1977 function Renamed_Object (Id : E) return N is
1982 function Renaming_Map (Id : E) return U is
1987 function Return_Present (Id : E) return B is
1992 function Returns_By_Ref (Id : E) return B is
1997 function Reverse_Bit_Order (Id : E) return B is
1999 pragma Assert (Is_Record_Type (Id));
2000 return Flag164 (Base_Type (Id));
2001 end Reverse_Bit_Order;
2003 function RM_Size (Id : E) return U is
2005 pragma Assert (Is_Type (Id));
2009 function Scalar_Range (Id : E) return N is
2014 function Scale_Value (Id : E) return U is
2019 function Scope_Depth_Value (Id : E) return U is
2022 end Scope_Depth_Value;
2024 function Sec_Stack_Needed_For_Return (Id : E) return B is
2026 return Flag167 (Id);
2027 end Sec_Stack_Needed_For_Return;
2029 function Shadow_Entities (Id : E) return S is
2032 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
2034 end Shadow_Entities;
2036 function Shared_Var_Assign_Proc (Id : E) return E is
2038 pragma Assert (Ekind (Id) = E_Variable);
2040 end Shared_Var_Assign_Proc;
2042 function Shared_Var_Read_Proc (Id : E) return E is
2044 pragma Assert (Ekind (Id) = E_Variable);
2046 end Shared_Var_Read_Proc;
2048 function Size_Check_Code (Id : E) return N is
2050 pragma Assert (Ekind (Id) = E_Constant or else Ekind (Id) = E_Variable);
2052 end Size_Check_Code;
2054 function Size_Depends_On_Discriminant (Id : E) return B is
2056 return Flag177 (Id);
2057 end Size_Depends_On_Discriminant;
2059 function Size_Known_At_Compile_Time (Id : E) return B is
2062 end Size_Known_At_Compile_Time;
2064 function Small_Value (Id : E) return R is
2066 pragma Assert (Is_Fixed_Point_Type (Id));
2067 return Ureal21 (Id);
2070 function Spec_Entity (Id : E) return E is
2073 (Ekind (Id) = E_Package_Body or else Is_Formal (Id));
2077 function Storage_Size_Variable (Id : E) return E is
2079 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
2080 return Node15 (Implementation_Base_Type (Id));
2081 end Storage_Size_Variable;
2083 function Stored_Constraint (Id : E) return L is
2086 (Is_Composite_Type (Id) and then not Is_Array_Type (Id));
2087 return Elist23 (Id);
2088 end Stored_Constraint;
2090 function Strict_Alignment (Id : E) return B is
2092 return Flag145 (Implementation_Base_Type (Id));
2093 end Strict_Alignment;
2095 function String_Literal_Length (Id : E) return U is
2098 end String_Literal_Length;
2100 function String_Literal_Low_Bound (Id : E) return N is
2103 end String_Literal_Low_Bound;
2105 function Suppress_Elaboration_Warnings (Id : E) return B is
2107 return Flag148 (Id);
2108 end Suppress_Elaboration_Warnings;
2110 function Suppress_Init_Proc (Id : E) return B is
2112 return Flag105 (Base_Type (Id));
2113 end Suppress_Init_Proc;
2115 function Suppress_Style_Checks (Id : E) return B is
2117 return Flag165 (Id);
2118 end Suppress_Style_Checks;
2120 function Treat_As_Volatile (Id : E) return B is
2123 end Treat_As_Volatile;
2125 function Underlying_Full_View (Id : E) return E is
2127 pragma Assert (Ekind (Id) in Private_Kind);
2129 end Underlying_Full_View;
2131 function Unset_Reference (Id : E) return N is
2134 end Unset_Reference;
2136 function Uses_Sec_Stack (Id : E) return B is
2141 function Vax_Float (Id : E) return B is
2143 return Flag151 (Base_Type (Id));
2146 function Warnings_Off (Id : E) return B is
2151 ------------------------------
2152 -- Classification Functions --
2153 ------------------------------
2155 function Is_Access_Type (Id : E) return B is
2157 return Ekind (Id) in Access_Kind;
2160 function Is_Array_Type (Id : E) return B is
2162 return Ekind (Id) in Array_Kind;
2165 function Is_Class_Wide_Type (Id : E) return B is
2167 return Ekind (Id) in Class_Wide_Kind;
2168 end Is_Class_Wide_Type;
2170 function Is_Composite_Type (Id : E) return B is
2172 return Ekind (Id) in Composite_Kind;
2173 end Is_Composite_Type;
2175 function Is_Concurrent_Body (Id : E) return B is
2177 return Ekind (Id) in
2178 Concurrent_Body_Kind;
2179 end Is_Concurrent_Body;
2181 function Is_Concurrent_Record_Type (Id : E) return B is
2184 end Is_Concurrent_Record_Type;
2186 function Is_Concurrent_Type (Id : E) return B is
2188 return Ekind (Id) in Concurrent_Kind;
2189 end Is_Concurrent_Type;
2191 function Is_Decimal_Fixed_Point_Type (Id : E) return B is
2193 return Ekind (Id) in
2194 Decimal_Fixed_Point_Kind;
2195 end Is_Decimal_Fixed_Point_Type;
2197 function Is_Digits_Type (Id : E) return B is
2199 return Ekind (Id) in Digits_Kind;
2202 function Is_Discrete_Or_Fixed_Point_Type (Id : E) return B is
2204 return Ekind (Id) in Discrete_Or_Fixed_Point_Kind;
2205 end Is_Discrete_Or_Fixed_Point_Type;
2207 function Is_Discrete_Type (Id : E) return B is
2209 return Ekind (Id) in Discrete_Kind;
2210 end Is_Discrete_Type;
2212 function Is_Elementary_Type (Id : E) return B is
2214 return Ekind (Id) in Elementary_Kind;
2215 end Is_Elementary_Type;
2217 function Is_Entry (Id : E) return B is
2219 return Ekind (Id) in Entry_Kind;
2222 function Is_Enumeration_Type (Id : E) return B is
2224 return Ekind (Id) in
2226 end Is_Enumeration_Type;
2228 function Is_Fixed_Point_Type (Id : E) return B is
2230 return Ekind (Id) in
2232 end Is_Fixed_Point_Type;
2234 function Is_Floating_Point_Type (Id : E) return B is
2236 return Ekind (Id) in Float_Kind;
2237 end Is_Floating_Point_Type;
2239 function Is_Formal (Id : E) return B is
2241 return Ekind (Id) in Formal_Kind;
2244 function Is_Generic_Subprogram (Id : E) return B is
2246 return Ekind (Id) in Generic_Subprogram_Kind;
2247 end Is_Generic_Subprogram;
2249 function Is_Generic_Unit (Id : E) return B is
2251 return Ekind (Id) in Generic_Unit_Kind;
2252 end Is_Generic_Unit;
2254 function Is_Incomplete_Or_Private_Type (Id : E) return B is
2256 return Ekind (Id) in
2257 Incomplete_Or_Private_Kind;
2258 end Is_Incomplete_Or_Private_Type;
2260 function Is_Integer_Type (Id : E) return B is
2262 return Ekind (Id) in Integer_Kind;
2263 end Is_Integer_Type;
2265 function Is_Modular_Integer_Type (Id : E) return B is
2267 return Ekind (Id) in
2268 Modular_Integer_Kind;
2269 end Is_Modular_Integer_Type;
2271 function Is_Named_Number (Id : E) return B is
2273 return Ekind (Id) in Named_Kind;
2274 end Is_Named_Number;
2276 function Is_Numeric_Type (Id : E) return B is
2278 return Ekind (Id) in Numeric_Kind;
2279 end Is_Numeric_Type;
2281 function Is_Object (Id : E) return B is
2283 return Ekind (Id) in Object_Kind;
2286 function Is_Ordinary_Fixed_Point_Type (Id : E) return B is
2288 return Ekind (Id) in
2289 Ordinary_Fixed_Point_Kind;
2290 end Is_Ordinary_Fixed_Point_Type;
2292 function Is_Overloadable (Id : E) return B is
2294 return Ekind (Id) in Overloadable_Kind;
2295 end Is_Overloadable;
2297 function Is_Private_Type (Id : E) return B is
2299 return Ekind (Id) in Private_Kind;
2300 end Is_Private_Type;
2302 function Is_Protected_Type (Id : E) return B is
2304 return Ekind (Id) in Protected_Kind;
2305 end Is_Protected_Type;
2307 function Is_Real_Type (Id : E) return B is
2309 return Ekind (Id) in Real_Kind;
2312 function Is_Record_Type (Id : E) return B is
2314 return Ekind (Id) in Record_Kind;
2317 function Is_Scalar_Type (Id : E) return B is
2319 return Ekind (Id) in Scalar_Kind;
2322 function Is_Signed_Integer_Type (Id : E) return B is
2324 return Ekind (Id) in
2325 Signed_Integer_Kind;
2326 end Is_Signed_Integer_Type;
2328 function Is_Subprogram (Id : E) return B is
2330 return Ekind (Id) in Subprogram_Kind;
2333 function Is_Task_Type (Id : E) return B is
2335 return Ekind (Id) in Task_Kind;
2338 function Is_Type (Id : E) return B is
2340 return Ekind (Id) in Type_Kind;
2343 ------------------------------
2344 -- Attribute Set Procedures --
2345 ------------------------------
2347 procedure Set_Accept_Address (Id : E; V : L) is
2349 Set_Elist21 (Id, V);
2350 end Set_Accept_Address;
2352 procedure Set_Access_Disp_Table (Id : E; V : E) is
2354 pragma Assert (Is_Tagged_Type (Id) and then Id = Base_Type (Id));
2356 end Set_Access_Disp_Table;
2358 procedure Set_Associated_Final_Chain (Id : E; V : E) is
2360 pragma Assert (Is_Access_Type (Id));
2362 end Set_Associated_Final_Chain;
2364 procedure Set_Associated_Formal_Package (Id : E; V : E) is
2367 end Set_Associated_Formal_Package;
2369 procedure Set_Associated_Node_For_Itype (Id : E; V : E) is
2372 end Set_Associated_Node_For_Itype;
2374 procedure Set_Associated_Storage_Pool (Id : E; V : E) is
2376 pragma Assert (Is_Access_Type (Id) and then Id = Base_Type (Id));
2378 end Set_Associated_Storage_Pool;
2380 procedure Set_Actual_Subtype (Id : E; V : E) is
2383 (Ekind (Id) = E_Constant
2384 or else Ekind (Id) = E_Variable
2385 or else Ekind (Id) = E_Generic_In_Out_Parameter
2386 or else Ekind (Id) in E_In_Parameter .. E_In_Out_Parameter);
2388 end Set_Actual_Subtype;
2390 procedure Set_Address_Taken (Id : E; V : B := True) is
2392 Set_Flag104 (Id, V);
2393 end Set_Address_Taken;
2395 procedure Set_Alias (Id : E; V : E) is
2398 (Is_Overloadable (Id) or else Ekind (Id) = E_Subprogram_Type);
2402 procedure Set_Alignment (Id : E; V : U) is
2404 pragma Assert (Is_Type (Id)
2405 or else Is_Formal (Id)
2406 or else Ekind (Id) = E_Loop_Parameter
2407 or else Ekind (Id) = E_Constant
2408 or else Ekind (Id) = E_Exception
2409 or else Ekind (Id) = E_Variable);
2413 procedure Set_Barrier_Function (Id : E; V : N) is
2415 pragma Assert (Is_Entry (Id));
2417 end Set_Barrier_Function;
2419 procedure Set_Block_Node (Id : E; V : N) is
2421 pragma Assert (Ekind (Id) = E_Block);
2425 procedure Set_Body_Entity (Id : E; V : E) is
2428 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
2430 end Set_Body_Entity;
2432 procedure Set_Body_Needed_For_SAL (Id : E; V : B := True) is
2435 (Ekind (Id) = E_Package
2436 or else Is_Subprogram (Id)
2437 or else Is_Generic_Unit (Id));
2439 end Set_Body_Needed_For_SAL;
2441 procedure Set_C_Pass_By_Copy (Id : E; V : B := True) is
2443 pragma Assert (Is_Record_Type (Id) and then Id = Base_Type (Id));
2444 Set_Flag125 (Id, V);
2445 end Set_C_Pass_By_Copy;
2447 procedure Set_Can_Never_Be_Null (Id : E; V : B := True) is
2450 end Set_Can_Never_Be_Null;
2452 procedure Set_Checks_May_Be_Suppressed (Id : E; V : B := True) is
2455 end Set_Checks_May_Be_Suppressed;
2457 procedure Set_Class_Wide_Type (Id : E; V : E) is
2459 pragma Assert (Is_Type (Id));
2461 end Set_Class_Wide_Type;
2463 procedure Set_Cloned_Subtype (Id : E; V : E) is
2466 (Ekind (Id) = E_Record_Subtype
2467 or else Ekind (Id) = E_Class_Wide_Subtype);
2469 end Set_Cloned_Subtype;
2471 procedure Set_Component_Bit_Offset (Id : E; V : U) is
2474 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
2476 end Set_Component_Bit_Offset;
2478 procedure Set_Component_Clause (Id : E; V : N) is
2481 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
2483 end Set_Component_Clause;
2485 procedure Set_Component_Size (Id : E; V : U) is
2487 pragma Assert (Is_Array_Type (Id) and then Id = Base_Type (Id));
2489 end Set_Component_Size;
2491 procedure Set_Component_Type (Id : E; V : E) is
2493 pragma Assert (Is_Array_Type (Id) and then Id = Base_Type (Id));
2495 end Set_Component_Type;
2497 procedure Set_Corresponding_Concurrent_Type (Id : E; V : E) is
2500 (Ekind (Id) = E_Record_Type and then Is_Concurrent_Type (V));
2502 end Set_Corresponding_Concurrent_Type;
2504 procedure Set_Corresponding_Discriminant (Id : E; V : E) is
2506 pragma Assert (Ekind (Id) = E_Discriminant);
2508 end Set_Corresponding_Discriminant;
2510 procedure Set_Corresponding_Equality (Id : E; V : E) is
2513 (Ekind (Id) = E_Function
2514 and then not Comes_From_Source (Id)
2515 and then Chars (Id) = Name_Op_Ne);
2517 end Set_Corresponding_Equality;
2519 procedure Set_Corresponding_Record_Type (Id : E; V : E) is
2521 pragma Assert (Is_Concurrent_Type (Id));
2523 end Set_Corresponding_Record_Type;
2525 procedure Set_Corresponding_Remote_Type (Id : E; V : E) is
2528 end Set_Corresponding_Remote_Type;
2530 procedure Set_Current_Value (Id : E; V : E) is
2532 pragma Assert (Ekind (Id) in Object_Kind or else Ekind (Id) = E_Void);
2534 end Set_Current_Value;
2536 procedure Set_CR_Discriminant (Id : E; V : E) is
2539 end Set_CR_Discriminant;
2541 procedure Set_Debug_Info_Off (Id : E; V : B := True) is
2543 Set_Flag166 (Id, V);
2544 end Set_Debug_Info_Off;
2546 procedure Set_Debug_Renaming_Link (Id : E; V : E) is
2549 end Set_Debug_Renaming_Link;
2551 procedure Set_Default_Expr_Function (Id : E; V : E) is
2553 pragma Assert (Is_Formal (Id));
2555 end Set_Default_Expr_Function;
2557 procedure Set_Default_Expressions_Processed (Id : E; V : B := True) is
2559 Set_Flag108 (Id, V);
2560 end Set_Default_Expressions_Processed;
2562 procedure Set_Default_Value (Id : E; V : N) is
2564 pragma Assert (Is_Formal (Id));
2566 end Set_Default_Value;
2568 procedure Set_Delay_Cleanups (Id : E; V : B := True) is
2572 or else Is_Task_Type (Id)
2573 or else Ekind (Id) = E_Block);
2574 Set_Flag114 (Id, V);
2575 end Set_Delay_Cleanups;
2577 procedure Set_Delay_Subprogram_Descriptors (Id : E; V : B := True) is
2581 or else Ekind (Id) = E_Package
2582 or else Ekind (Id) = E_Package_Body);
2584 end Set_Delay_Subprogram_Descriptors;
2586 procedure Set_Delta_Value (Id : E; V : R) is
2588 pragma Assert (Is_Fixed_Point_Type (Id));
2589 Set_Ureal18 (Id, V);
2590 end Set_Delta_Value;
2592 procedure Set_Dependent_Instances (Id : E; V : L) is
2594 pragma Assert (Is_Generic_Instance (Id));
2596 end Set_Dependent_Instances;
2598 procedure Set_Depends_On_Private (Id : E; V : B := True) is
2600 pragma Assert (Nkind (Id) in N_Entity);
2602 end Set_Depends_On_Private;
2604 procedure Set_Digits_Value (Id : E; V : U) is
2607 (Is_Floating_Point_Type (Id)
2608 or else Is_Decimal_Fixed_Point_Type (Id));
2610 end Set_Digits_Value;
2612 procedure Set_Directly_Designated_Type (Id : E; V : E) is
2615 end Set_Directly_Designated_Type;
2617 procedure Set_Discard_Names (Id : E; V : B := True) is
2620 end Set_Discard_Names;
2622 procedure Set_Discriminal (Id : E; V : E) is
2624 pragma Assert (Ekind (Id) = E_Discriminant);
2626 end Set_Discriminal;
2628 procedure Set_Discriminal_Link (Id : E; V : E) is
2631 end Set_Discriminal_Link;
2633 procedure Set_Discriminant_Checking_Func (Id : E; V : E) is
2635 pragma Assert (Ekind (Id) = E_Component);
2637 end Set_Discriminant_Checking_Func;
2639 procedure Set_Discriminant_Constraint (Id : E; V : L) is
2641 pragma Assert (Nkind (Id) in N_Entity);
2642 Set_Elist21 (Id, V);
2643 end Set_Discriminant_Constraint;
2645 procedure Set_Discriminant_Default_Value (Id : E; V : N) is
2648 end Set_Discriminant_Default_Value;
2650 procedure Set_Discriminant_Number (Id : E; V : U) is
2653 end Set_Discriminant_Number;
2655 procedure Set_DT_Entry_Count (Id : E; V : U) is
2657 pragma Assert (Ekind (Id) = E_Component);
2659 end Set_DT_Entry_Count;
2661 procedure Set_DT_Position (Id : E; V : U) is
2663 pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2665 end Set_DT_Position;
2667 procedure Set_DTC_Entity (Id : E; V : E) is
2670 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2674 procedure Set_Elaborate_All_Desirable (Id : E; V : B := True) is
2676 Set_Flag146 (Id, V);
2677 end Set_Elaborate_All_Desirable;
2679 procedure Set_Elaboration_Entity (Id : E; V : E) is
2684 Ekind (Id) = E_Package
2686 Is_Generic_Unit (Id));
2688 end Set_Elaboration_Entity;
2690 procedure Set_Elaboration_Entity_Required (Id : E; V : B := True) is
2695 Ekind (Id) = E_Package
2697 Is_Generic_Unit (Id));
2698 Set_Flag174 (Id, V);
2699 end Set_Elaboration_Entity_Required;
2701 procedure Set_Enclosing_Scope (Id : E; V : E) is
2704 end Set_Enclosing_Scope;
2706 procedure Set_Entry_Accepted (Id : E; V : B := True) is
2708 pragma Assert (Is_Entry (Id));
2709 Set_Flag152 (Id, V);
2710 end Set_Entry_Accepted;
2712 procedure Set_Entry_Bodies_Array (Id : E; V : E) is
2715 end Set_Entry_Bodies_Array;
2717 procedure Set_Entry_Cancel_Parameter (Id : E; V : E) is
2720 end Set_Entry_Cancel_Parameter;
2722 procedure Set_Entry_Component (Id : E; V : E) is
2725 end Set_Entry_Component;
2727 procedure Set_Entry_Formal (Id : E; V : E) is
2730 end Set_Entry_Formal;
2732 procedure Set_Entry_Index_Constant (Id : E; V : E) is
2734 pragma Assert (Ekind (Id) = E_Entry_Index_Parameter);
2736 end Set_Entry_Index_Constant;
2738 procedure Set_Entry_Parameters_Type (Id : E; V : E) is
2741 end Set_Entry_Parameters_Type;
2743 procedure Set_Enum_Pos_To_Rep (Id : E; V : E) is
2745 pragma Assert (Ekind (Id) = E_Enumeration_Type);
2747 end Set_Enum_Pos_To_Rep;
2749 procedure Set_Enumeration_Pos (Id : E; V : U) is
2751 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2753 end Set_Enumeration_Pos;
2755 procedure Set_Enumeration_Rep (Id : E; V : U) is
2757 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2759 end Set_Enumeration_Rep;
2761 procedure Set_Enumeration_Rep_Expr (Id : E; V : N) is
2763 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2765 end Set_Enumeration_Rep_Expr;
2767 procedure Set_Equivalent_Type (Id : E; V : E) is
2770 (Ekind (Id) = E_Class_Wide_Type or else
2771 Ekind (Id) = E_Class_Wide_Subtype or else
2772 Ekind (Id) = E_Access_Protected_Subprogram_Type or else
2773 Ekind (Id) = E_Access_Subprogram_Type or else
2774 Ekind (Id) = E_Exception_Type);
2776 end Set_Equivalent_Type;
2778 procedure Set_Esize (Id : E; V : U) is
2783 procedure Set_Exception_Code (Id : E; V : U) is
2785 pragma Assert (Ekind (Id) = E_Exception);
2787 end Set_Exception_Code;
2789 procedure Set_Extra_Accessibility (Id : E; V : E) is
2791 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
2793 end Set_Extra_Accessibility;
2795 procedure Set_Extra_Constrained (Id : E; V : E) is
2797 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
2799 end Set_Extra_Constrained;
2801 procedure Set_Extra_Formal (Id : E; V : E) is
2804 end Set_Extra_Formal;
2806 procedure Set_Finalization_Chain_Entity (Id : E; V : E) is
2809 end Set_Finalization_Chain_Entity;
2811 procedure Set_Finalize_Storage_Only (Id : E; V : B := True) is
2813 pragma Assert (Is_Type (Id) and then Id = Base_Type (Id));
2814 Set_Flag158 (Id, V);
2815 end Set_Finalize_Storage_Only;
2817 procedure Set_First_Entity (Id : E; V : E) is
2820 end Set_First_Entity;
2822 procedure Set_First_Index (Id : E; V : N) is
2825 end Set_First_Index;
2827 procedure Set_First_Literal (Id : E; V : E) is
2830 end Set_First_Literal;
2832 procedure Set_First_Optional_Parameter (Id : E; V : E) is
2835 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2837 end Set_First_Optional_Parameter;
2839 procedure Set_First_Private_Entity (Id : E; V : E) is
2841 pragma Assert (Nkind (Id) in N_Entity);
2843 end Set_First_Private_Entity;
2845 procedure Set_First_Rep_Item (Id : E; V : N) is
2848 end Set_First_Rep_Item;
2850 procedure Set_Freeze_Node (Id : E; V : N) is
2853 end Set_Freeze_Node;
2855 procedure Set_From_With_Type (Id : E; V : B := True) is
2859 or else Ekind (Id) = E_Package);
2860 Set_Flag159 (Id, V);
2861 end Set_From_With_Type;
2863 procedure Set_Full_View (Id : E; V : E) is
2865 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Constant);
2869 procedure Set_Function_Returns_With_DSP (Id : E; V : B := True) is
2872 (Is_Subprogram (Id) or else Ekind (Id) = E_Subprogram_Type);
2873 Set_Flag169 (Id, V);
2874 end Set_Function_Returns_With_DSP;
2876 procedure Set_Generic_Homonym (Id : E; V : E) is
2879 end Set_Generic_Homonym;
2881 procedure Set_Generic_Renamings (Id : E; V : L) is
2883 Set_Elist23 (Id, V);
2884 end Set_Generic_Renamings;
2886 procedure Set_Handler_Records (Id : E; V : S) is
2889 end Set_Handler_Records;
2891 procedure Set_Has_Aliased_Components (Id : E; V : B := True) is
2893 pragma Assert (Base_Type (Id) = Id);
2894 Set_Flag135 (Id, V);
2895 end Set_Has_Aliased_Components;
2897 procedure Set_Has_Alignment_Clause (Id : E; V : B := True) is
2900 end Set_Has_Alignment_Clause;
2902 procedure Set_Has_All_Calls_Remote (Id : E; V : B := True) is
2905 end Set_Has_All_Calls_Remote;
2907 procedure Set_Has_Atomic_Components (Id : E; V : B := True) is
2909 pragma Assert (not Is_Type (Id) or else Base_Type (Id) = Id);
2911 end Set_Has_Atomic_Components;
2913 procedure Set_Has_Biased_Representation (Id : E; V : B := True) is
2916 ((V = False) or else (Is_Discrete_Type (Id) or Is_Object (Id)));
2917 Set_Flag139 (Id, V);
2918 end Set_Has_Biased_Representation;
2920 procedure Set_Has_Completion (Id : E; V : B := True) is
2923 end Set_Has_Completion;
2925 procedure Set_Has_Completion_In_Body (Id : E; V : B := True) is
2927 pragma Assert (Ekind (Id) = E_Incomplete_Type);
2929 end Set_Has_Completion_In_Body;
2931 procedure Set_Has_Complex_Representation (Id : E; V : B := True) is
2933 pragma Assert (Ekind (Id) = E_Record_Type);
2934 Set_Flag140 (Id, V);
2935 end Set_Has_Complex_Representation;
2937 procedure Set_Has_Component_Size_Clause (Id : E; V : B := True) is
2939 pragma Assert (Ekind (Id) = E_Array_Type);
2941 end Set_Has_Component_Size_Clause;
2943 procedure Set_Has_Contiguous_Rep (Id : E; V : B := True) is
2945 Set_Flag181 (Id, V);
2946 end Set_Has_Contiguous_Rep;
2948 procedure Set_Has_Controlled_Component (Id : E; V : B := True) is
2950 pragma Assert (Base_Type (Id) = Id);
2952 end Set_Has_Controlled_Component;
2954 procedure Set_Has_Controlling_Result (Id : E; V : B := True) is
2957 end Set_Has_Controlling_Result;
2959 procedure Set_Has_Convention_Pragma (Id : E; V : B := True) is
2961 Set_Flag119 (Id, V);
2962 end Set_Has_Convention_Pragma;
2964 procedure Set_Has_Delayed_Freeze (Id : E; V : B := True) is
2966 pragma Assert (Nkind (Id) in N_Entity);
2968 end Set_Has_Delayed_Freeze;
2970 procedure Set_Has_Discriminants (Id : E; V : B := True) is
2972 pragma Assert (Nkind (Id) in N_Entity);
2974 end Set_Has_Discriminants;
2976 procedure Set_Has_Enumeration_Rep_Clause (Id : E; V : B := True) is
2978 pragma Assert (Is_Enumeration_Type (Id));
2980 end Set_Has_Enumeration_Rep_Clause;
2982 procedure Set_Has_Exit (Id : E; V : B := True) is
2987 procedure Set_Has_External_Tag_Rep_Clause (Id : E; V : B := True) is
2989 pragma Assert (Is_Tagged_Type (Id));
2990 Set_Flag110 (Id, V);
2991 end Set_Has_External_Tag_Rep_Clause;
2993 procedure Set_Has_Forward_Instantiation (Id : E; V : B := True) is
2995 Set_Flag175 (Id, V);
2996 end Set_Has_Forward_Instantiation;
2998 procedure Set_Has_Fully_Qualified_Name (Id : E; V : B := True) is
3000 Set_Flag173 (Id, V);
3001 end Set_Has_Fully_Qualified_Name;
3003 procedure Set_Has_Gigi_Rep_Item (Id : E; V : B := True) is
3006 end Set_Has_Gigi_Rep_Item;
3008 procedure Set_Has_Homonym (Id : E; V : B := True) is
3011 end Set_Has_Homonym;
3013 procedure Set_Has_Machine_Radix_Clause (Id : E; V : B := True) is
3015 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
3017 end Set_Has_Machine_Radix_Clause;
3019 procedure Set_Has_Master_Entity (Id : E; V : B := True) is
3022 end Set_Has_Master_Entity;
3024 procedure Set_Has_Missing_Return (Id : E; V : B := True) is
3027 (Ekind (Id) = E_Function or else Ekind (Id) = E_Generic_Function);
3028 Set_Flag142 (Id, V);
3029 end Set_Has_Missing_Return;
3031 procedure Set_Has_Nested_Block_With_Handler (Id : E; V : B := True) is
3033 Set_Flag101 (Id, V);
3034 end Set_Has_Nested_Block_With_Handler;
3036 procedure Set_Has_Non_Standard_Rep (Id : E; V : B := True) is
3038 pragma Assert (Base_Type (Id) = Id);
3040 end Set_Has_Non_Standard_Rep;
3042 procedure Set_Has_Object_Size_Clause (Id : E; V : B := True) is
3044 pragma Assert (Is_Type (Id));
3045 Set_Flag172 (Id, V);
3046 end Set_Has_Object_Size_Clause;
3048 procedure Set_Has_Per_Object_Constraint (Id : E; V : B := True) is
3050 Set_Flag154 (Id, V);
3051 end Set_Has_Per_Object_Constraint;
3053 procedure Set_Has_Pragma_Controlled (Id : E; V : B := True) is
3055 pragma Assert (Is_Access_Type (Id));
3056 Set_Flag27 (Base_Type (Id), V);
3057 end Set_Has_Pragma_Controlled;
3059 procedure Set_Has_Pragma_Elaborate_Body (Id : E; V : B := True) is
3061 Set_Flag150 (Id, V);
3062 end Set_Has_Pragma_Elaborate_Body;
3064 procedure Set_Has_Pragma_Inline (Id : E; V : B := True) is
3066 Set_Flag157 (Id, V);
3067 end Set_Has_Pragma_Inline;
3069 procedure Set_Has_Pragma_Pack (Id : E; V : B := True) is
3071 pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id));
3072 pragma Assert (Id = Base_Type (Id));
3073 Set_Flag121 (Id, V);
3074 end Set_Has_Pragma_Pack;
3076 procedure Set_Has_Pragma_Pure_Function (Id : E; V : B := True) is
3078 pragma Assert (Is_Subprogram (Id));
3079 Set_Flag179 (Id, V);
3080 end Set_Has_Pragma_Pure_Function;
3082 procedure Set_Has_Pragma_Unreferenced (Id : E; V : B := True) is
3084 Set_Flag180 (Id, V);
3085 end Set_Has_Pragma_Unreferenced;
3087 procedure Set_Has_Primitive_Operations (Id : E; V : B := True) is
3089 pragma Assert (Id = Base_Type (Id));
3090 Set_Flag120 (Id, V);
3091 end Set_Has_Primitive_Operations;
3093 procedure Set_Has_Private_Declaration (Id : E; V : B := True) is
3095 Set_Flag155 (Id, V);
3096 end Set_Has_Private_Declaration;
3098 procedure Set_Has_Qualified_Name (Id : E; V : B := True) is
3100 Set_Flag161 (Id, V);
3101 end Set_Has_Qualified_Name;
3103 procedure Set_Has_Record_Rep_Clause (Id : E; V : B := True) is
3105 pragma Assert (Id = Base_Type (Id));
3107 end Set_Has_Record_Rep_Clause;
3109 procedure Set_Has_Recursive_Call (Id : E; V : B := True) is
3111 pragma Assert (Is_Subprogram (Id));
3112 Set_Flag143 (Id, V);
3113 end Set_Has_Recursive_Call;
3115 procedure Set_Has_Size_Clause (Id : E; V : B := True) is
3118 end Set_Has_Size_Clause;
3120 procedure Set_Has_Small_Clause (Id : E; V : B := True) is
3123 end Set_Has_Small_Clause;
3125 procedure Set_Has_Specified_Layout (Id : E; V : B := True) is
3127 pragma Assert (Id = Base_Type (Id));
3128 Set_Flag100 (Id, V);
3129 end Set_Has_Specified_Layout;
3131 procedure Set_Has_Storage_Size_Clause (Id : E; V : B := True) is
3133 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
3134 pragma Assert (Base_Type (Id) = Id);
3136 end Set_Has_Storage_Size_Clause;
3138 procedure Set_Has_Subprogram_Descriptor (Id : E; V : B := True) is
3141 end Set_Has_Subprogram_Descriptor;
3143 procedure Set_Has_Task (Id : E; V : B := True) is
3145 pragma Assert (Base_Type (Id) = Id);
3149 procedure Set_Has_Unchecked_Union (Id : E; V : B := True) is
3151 pragma Assert (Base_Type (Id) = Id);
3152 Set_Flag123 (Id, V);
3153 end Set_Has_Unchecked_Union;
3155 procedure Set_Has_Unknown_Discriminants (Id : E; V : B := True) is
3157 pragma Assert (Is_Type (Id));
3159 end Set_Has_Unknown_Discriminants;
3161 procedure Set_Has_Volatile_Components (Id : E; V : B := True) is
3163 pragma Assert (not Is_Type (Id) or else Base_Type (Id) = Id);
3165 end Set_Has_Volatile_Components;
3167 procedure Set_Has_Xref_Entry (Id : E; V : B := True) is
3169 Set_Flag182 (Id, V);
3170 end Set_Has_Xref_Entry;
3172 procedure Set_Hiding_Loop_Variable (Id : E; V : E) is
3174 pragma Assert (Ekind (Id) = E_Variable);
3176 end Set_Hiding_Loop_Variable;
3178 procedure Set_Homonym (Id : E; V : E) is
3180 pragma Assert (Id /= V);
3184 procedure Set_In_Package_Body (Id : E; V : B := True) is
3187 end Set_In_Package_Body;
3189 procedure Set_In_Private_Part (Id : E; V : B := True) is
3192 end Set_In_Private_Part;
3194 procedure Set_In_Use (Id : E; V : B := True) is
3196 pragma Assert (Nkind (Id) in N_Entity);
3200 procedure Set_Inner_Instances (Id : E; V : L) is
3202 Set_Elist23 (Id, V);
3203 end Set_Inner_Instances;
3205 procedure Set_Interface_Name (Id : E; V : N) is
3208 end Set_Interface_Name;
3210 procedure Set_Is_Abstract (Id : E; V : B := True) is
3213 end Set_Is_Abstract;
3215 procedure Set_Is_Access_Constant (Id : E; V : B := True) is
3217 pragma Assert (Is_Access_Type (Id));
3219 end Set_Is_Access_Constant;
3221 procedure Set_Is_Aliased (Id : E; V : B := True) is
3223 pragma Assert (Nkind (Id) in N_Entity);
3227 procedure Set_Is_AST_Entry (Id : E; V : B := True) is
3229 pragma Assert (Is_Entry (Id));
3230 Set_Flag132 (Id, V);
3231 end Set_Is_AST_Entry;
3233 procedure Set_Is_Asynchronous (Id : E; V : B := True) is
3236 (Ekind (Id) = E_Procedure or else Is_Type (Id));
3238 end Set_Is_Asynchronous;
3240 procedure Set_Is_Atomic (Id : E; V : B := True) is
3245 procedure Set_Is_Bit_Packed_Array (Id : E; V : B := True) is
3247 pragma Assert ((not V)
3248 or else (Is_Array_Type (Id) and then Id = Base_Type (Id)));
3250 Set_Flag122 (Id, V);
3251 end Set_Is_Bit_Packed_Array;
3253 procedure Set_Is_Called (Id : E; V : B := True) is
3256 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Function);
3257 Set_Flag102 (Id, V);
3260 procedure Set_Is_Character_Type (Id : E; V : B := True) is
3263 end Set_Is_Character_Type;
3265 procedure Set_Is_Child_Unit (Id : E; V : B := True) is
3268 end Set_Is_Child_Unit;
3270 procedure Set_Is_Class_Wide_Equivalent_Type (Id : E; V : B := True) is
3273 end Set_Is_Class_Wide_Equivalent_Type;
3275 procedure Set_Is_Compilation_Unit (Id : E; V : B := True) is
3277 Set_Flag149 (Id, V);
3278 end Set_Is_Compilation_Unit;
3280 procedure Set_Is_Completely_Hidden (Id : E; V : B := True) is
3282 pragma Assert (Ekind (Id) = E_Discriminant);
3283 Set_Flag103 (Id, V);
3284 end Set_Is_Completely_Hidden;
3286 procedure Set_Is_Concurrent_Record_Type (Id : E; V : B := True) is
3289 end Set_Is_Concurrent_Record_Type;
3291 procedure Set_Is_Constr_Subt_For_U_Nominal (Id : E; V : B := True) is
3294 end Set_Is_Constr_Subt_For_U_Nominal;
3296 procedure Set_Is_Constr_Subt_For_UN_Aliased (Id : E; V : B := True) is
3298 Set_Flag141 (Id, V);
3299 end Set_Is_Constr_Subt_For_UN_Aliased;
3301 procedure Set_Is_Constrained (Id : E; V : B := True) is
3303 pragma Assert (Nkind (Id) in N_Entity);
3305 end Set_Is_Constrained;
3307 procedure Set_Is_Constructor (Id : E; V : B := True) is
3310 end Set_Is_Constructor;
3312 procedure Set_Is_Controlled (Id : E; V : B := True) is
3314 pragma Assert (Id = Base_Type (Id));
3316 end Set_Is_Controlled;
3318 procedure Set_Is_Controlling_Formal (Id : E; V : B := True) is
3320 pragma Assert (Is_Formal (Id));
3322 end Set_Is_Controlling_Formal;
3324 procedure Set_Is_CPP_Class (Id : E; V : B := True) is
3327 end Set_Is_CPP_Class;
3329 procedure Set_Is_Discrim_SO_Function (Id : E; V : B := True) is
3331 Set_Flag176 (Id, V);
3332 end Set_Is_Discrim_SO_Function;
3334 procedure Set_Is_Dispatching_Operation (Id : E; V : B := True) is
3339 Is_Overloadable (Id)
3341 Ekind (Id) = E_Subprogram_Type);
3344 end Set_Is_Dispatching_Operation;
3346 procedure Set_Is_Eliminated (Id : E; V : B := True) is
3348 Set_Flag124 (Id, V);
3349 end Set_Is_Eliminated;
3351 procedure Set_Is_Entry_Formal (Id : E; V : B := True) is
3354 end Set_Is_Entry_Formal;
3356 procedure Set_Is_Exported (Id : E; V : B := True) is
3359 end Set_Is_Exported;
3361 procedure Set_Is_First_Subtype (Id : E; V : B := True) is
3364 end Set_Is_First_Subtype;
3366 procedure Set_Is_For_Access_Subtype (Id : E; V : B := True) is
3369 (Ekind (Id) = E_Record_Subtype
3371 Ekind (Id) = E_Private_Subtype);
3372 Set_Flag118 (Id, V);
3373 end Set_Is_For_Access_Subtype;
3375 procedure Set_Is_Formal_Subprogram (Id : E; V : B := True) is
3377 Set_Flag111 (Id, V);
3378 end Set_Is_Formal_Subprogram;
3380 procedure Set_Is_Frozen (Id : E; V : B := True) is
3382 pragma Assert (Nkind (Id) in N_Entity);
3386 procedure Set_Is_Generic_Actual_Type (Id : E; V : B := True) is
3388 pragma Assert (Is_Type (Id));
3390 end Set_Is_Generic_Actual_Type;
3392 procedure Set_Is_Generic_Instance (Id : E; V : B := True) is
3394 Set_Flag130 (Id, V);
3395 end Set_Is_Generic_Instance;
3397 procedure Set_Is_Generic_Type (Id : E; V : B := True) is
3399 pragma Assert (Nkind (Id) in N_Entity);
3401 end Set_Is_Generic_Type;
3403 procedure Set_Is_Hidden (Id : E; V : B := True) is
3408 procedure Set_Is_Hidden_Open_Scope (Id : E; V : B := True) is
3410 Set_Flag171 (Id, V);
3411 end Set_Is_Hidden_Open_Scope;
3413 procedure Set_Is_Immediately_Visible (Id : E; V : B := True) is
3415 pragma Assert (Nkind (Id) in N_Entity);
3417 end Set_Is_Immediately_Visible;
3419 procedure Set_Is_Imported (Id : E; V : B := True) is
3422 end Set_Is_Imported;
3424 procedure Set_Is_Inlined (Id : E; V : B := True) is
3429 procedure Set_Is_Instantiated (Id : E; V : B := True) is
3431 Set_Flag126 (Id, V);
3432 end Set_Is_Instantiated;
3434 procedure Set_Is_Internal (Id : E; V : B := True) is
3436 pragma Assert (Nkind (Id) in N_Entity);
3438 end Set_Is_Internal;
3440 procedure Set_Is_Interrupt_Handler (Id : E; V : B := True) is
3442 pragma Assert (Nkind (Id) in N_Entity);
3444 end Set_Is_Interrupt_Handler;
3446 procedure Set_Is_Intrinsic_Subprogram (Id : E; V : B := True) is
3449 end Set_Is_Intrinsic_Subprogram;
3451 procedure Set_Is_Itype (Id : E; V : B := True) is
3456 procedure Set_Is_Known_Non_Null (Id : E; V : B := True) is
3459 end Set_Is_Known_Non_Null;
3461 procedure Set_Is_Known_Valid (Id : E; V : B := True) is
3463 Set_Flag170 (Id, V);
3464 end Set_Is_Known_Valid;
3466 procedure Set_Is_Limited_Composite (Id : E; V : B := True) is
3468 pragma Assert (Is_Type (Id));
3469 Set_Flag106 (Id, V);
3470 end Set_Is_Limited_Composite;
3472 procedure Set_Is_Limited_Record (Id : E; V : B := True) is
3475 end Set_Is_Limited_Record;
3477 procedure Set_Is_Machine_Code_Subprogram (Id : E; V : B := True) is
3479 pragma Assert (Is_Subprogram (Id));
3480 Set_Flag137 (Id, V);
3481 end Set_Is_Machine_Code_Subprogram;
3483 procedure Set_Is_Non_Static_Subtype (Id : E; V : B := True) is
3485 pragma Assert (Is_Type (Id));
3486 Set_Flag109 (Id, V);
3487 end Set_Is_Non_Static_Subtype;
3489 procedure Set_Is_Null_Init_Proc (Id : E; V : B := True) is
3491 pragma Assert (Ekind (Id) = E_Procedure);
3492 Set_Flag178 (Id, V);
3493 end Set_Is_Null_Init_Proc;
3495 procedure Set_Is_Optional_Parameter (Id : E; V : B := True) is
3497 pragma Assert (Is_Formal (Id));
3498 Set_Flag134 (Id, V);
3499 end Set_Is_Optional_Parameter;
3501 procedure Set_Is_Overriding_Operation (Id : E; V : B := True) is
3503 pragma Assert (Is_Subprogram (Id));
3505 end Set_Is_Overriding_Operation;
3507 procedure Set_Is_Package_Body_Entity (Id : E; V : B := True) is
3509 Set_Flag160 (Id, V);
3510 end Set_Is_Package_Body_Entity;
3512 procedure Set_Is_Packed (Id : E; V : B := True) is
3514 pragma Assert (Base_Type (Id) = Id);
3518 procedure Set_Is_Packed_Array_Type (Id : E; V : B := True) is
3520 Set_Flag138 (Id, V);
3521 end Set_Is_Packed_Array_Type;
3523 procedure Set_Is_Potentially_Use_Visible (Id : E; V : B := True) is
3525 pragma Assert (Nkind (Id) in N_Entity);
3527 end Set_Is_Potentially_Use_Visible;
3529 procedure Set_Is_Preelaborated (Id : E; V : B := True) is
3532 end Set_Is_Preelaborated;
3534 procedure Set_Is_Private_Composite (Id : E; V : B := True) is
3536 pragma Assert (Is_Type (Id));
3537 Set_Flag107 (Id, V);
3538 end Set_Is_Private_Composite;
3540 procedure Set_Is_Private_Descendant (Id : E; V : B := True) is
3543 end Set_Is_Private_Descendant;
3545 procedure Set_Is_Psected (Id : E; V : B := True) is
3547 Set_Flag153 (Id, V);
3550 procedure Set_Is_Public (Id : E; V : B := True) is
3552 pragma Assert (Nkind (Id) in N_Entity);
3556 procedure Set_Is_Pure (Id : E; V : B := True) is
3561 procedure Set_Is_Remote_Call_Interface (Id : E; V : B := True) is
3564 end Set_Is_Remote_Call_Interface;
3566 procedure Set_Is_Remote_Types (Id : E; V : B := True) is
3569 end Set_Is_Remote_Types;
3571 procedure Set_Is_Renaming_Of_Object (Id : E; V : B := True) is
3573 Set_Flag112 (Id, V);
3574 end Set_Is_Renaming_Of_Object;
3576 procedure Set_Is_Shared_Passive (Id : E; V : B := True) is
3579 end Set_Is_Shared_Passive;
3581 procedure Set_Is_Statically_Allocated (Id : E; V : B := True) is
3584 (Ekind (Id) = E_Exception
3585 or else Ekind (Id) = E_Variable
3586 or else Ekind (Id) = E_Constant
3587 or else Is_Type (Id)
3588 or else Ekind (Id) = E_Void);
3590 end Set_Is_Statically_Allocated;
3592 procedure Set_Is_Tag (Id : E; V : B := True) is
3594 pragma Assert (Nkind (Id) in N_Entity);
3598 procedure Set_Is_Tagged_Type (Id : E; V : B := True) is
3601 end Set_Is_Tagged_Type;
3603 procedure Set_Is_Thread_Body (Id : E; V : B := True) is
3606 end Set_Is_Thread_Body;
3608 procedure Set_Is_True_Constant (Id : E; V : B := True) is
3610 Set_Flag163 (Id, V);
3611 end Set_Is_True_Constant;
3613 procedure Set_Is_Unchecked_Union (Id : E; V : B := True) is
3615 pragma Assert (Base_Type (Id) = Id);
3616 Set_Flag117 (Id, V);
3617 end Set_Is_Unchecked_Union;
3619 procedure Set_Is_Unsigned_Type (Id : E; V : B := True) is
3621 pragma Assert (Is_Discrete_Or_Fixed_Point_Type (Id));
3622 Set_Flag144 (Id, V);
3623 end Set_Is_Unsigned_Type;
3625 procedure Set_Is_Valued_Procedure (Id : E; V : B := True) is
3627 pragma Assert (Ekind (Id) = E_Procedure);
3628 Set_Flag127 (Id, V);
3629 end Set_Is_Valued_Procedure;
3631 procedure Set_Is_Visible_Child_Unit (Id : E; V : B := True) is
3633 pragma Assert (Is_Child_Unit (Id));
3634 Set_Flag116 (Id, V);
3635 end Set_Is_Visible_Child_Unit;
3637 procedure Set_Is_VMS_Exception (Id : E; V : B := True) is
3639 pragma Assert (Ekind (Id) = E_Exception);
3640 Set_Flag133 (Id, V);
3641 end Set_Is_VMS_Exception;
3643 procedure Set_Is_Volatile (Id : E; V : B := True) is
3645 pragma Assert (Nkind (Id) in N_Entity);
3647 end Set_Is_Volatile;
3649 procedure Set_Kill_Elaboration_Checks (Id : E; V : B := True) is
3652 end Set_Kill_Elaboration_Checks;
3654 procedure Set_Kill_Range_Checks (Id : E; V : B := True) is
3657 end Set_Kill_Range_Checks;
3659 procedure Set_Kill_Tag_Checks (Id : E; V : B := True) is
3662 end Set_Kill_Tag_Checks;
3664 procedure Set_Last_Entity (Id : E; V : E) is
3667 end Set_Last_Entity;
3669 procedure Set_Limited_View (Id : E; V : E) is
3671 pragma Assert (Ekind (Id) = E_Package);
3673 end Set_Limited_View;
3675 procedure Set_Lit_Indexes (Id : E; V : E) is
3677 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
3679 end Set_Lit_Indexes;
3681 procedure Set_Lit_Strings (Id : E; V : E) is
3683 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
3685 end Set_Lit_Strings;
3687 procedure Set_Machine_Radix_10 (Id : E; V : B := True) is
3689 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
3691 end Set_Machine_Radix_10;
3693 procedure Set_Master_Id (Id : E; V : E) is
3698 procedure Set_Materialize_Entity (Id : E; V : B := True) is
3700 Set_Flag168 (Id, V);
3701 end Set_Materialize_Entity;
3703 procedure Set_Mechanism (Id : E; V : M) is
3705 pragma Assert (Ekind (Id) = E_Function or else Is_Formal (Id));
3706 Set_Uint8 (Id, UI_From_Int (V));
3709 procedure Set_Modulus (Id : E; V : U) is
3711 pragma Assert (Ekind (Id) = E_Modular_Integer_Type);
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
4671 while S /= Standard_Standard
4672 and then not Is_Dynamic_Scope (S)
4678 end Enclosing_Dynamic_Scope;
4680 ----------------------
4681 -- Entry_Index_Type --
4682 ----------------------
4684 function Entry_Index_Type (Id : E) return N is
4686 pragma Assert (Ekind (Id) = E_Entry_Family);
4687 return Etype (Discrete_Subtype_Definition (Parent (Id)));
4688 end Entry_Index_Type;
4690 ---------------------
4692 ---------------------
4694 function First_Component (Id : E) return E is
4699 (Is_Record_Type (Id) or else Is_Incomplete_Or_Private_Type (Id));
4701 Comp_Id := First_Entity (Id);
4702 while Present (Comp_Id) loop
4703 exit when Ekind (Comp_Id) = E_Component;
4704 Comp_Id := Next_Entity (Comp_Id);
4708 end First_Component;
4710 ------------------------
4711 -- First_Discriminant --
4712 ------------------------
4714 function First_Discriminant (Id : E) return E is
4719 (Has_Discriminants (Id)
4720 or else Has_Unknown_Discriminants (Id));
4722 Ent := First_Entity (Id);
4724 -- The discriminants are not necessarily contiguous, because access
4725 -- discriminants will generate itypes. They are not the first entities
4726 -- either, because tag and controller record must be ahead of them.
4728 if Chars (Ent) = Name_uTag then
4729 Ent := Next_Entity (Ent);
4732 if Chars (Ent) = Name_uController then
4733 Ent := Next_Entity (Ent);
4736 -- Skip all hidden stored discriminants if any.
4738 while Present (Ent) loop
4739 exit when Ekind (Ent) = E_Discriminant
4740 and then not Is_Completely_Hidden (Ent);
4742 Ent := Next_Entity (Ent);
4745 pragma Assert (Ekind (Ent) = E_Discriminant);
4748 end First_Discriminant;
4754 function First_Formal (Id : E) return E is
4759 (Is_Overloadable (Id)
4760 or else Ekind (Id) = E_Entry_Family
4761 or else Ekind (Id) = E_Subprogram_Body
4762 or else Ekind (Id) = E_Subprogram_Type);
4764 if Ekind (Id) = E_Enumeration_Literal then
4768 Formal := First_Entity (Id);
4770 if Present (Formal) and then Is_Formal (Formal) then
4778 -------------------------------
4779 -- First_Stored_Discriminant --
4780 -------------------------------
4782 function First_Stored_Discriminant (Id : E) return E is
4785 function Has_Completely_Hidden_Discriminant (Id : E) return Boolean;
4786 -- Scans the Discriminants to see whether any are Completely_Hidden
4787 -- (the mechanism for describing non-specified stored discriminants)
4789 function Has_Completely_Hidden_Discriminant (Id : E) return Boolean is
4790 Ent : Entity_Id := Id;
4793 pragma Assert (Ekind (Id) = E_Discriminant);
4795 while Present (Ent) and then Ekind (Ent) = E_Discriminant loop
4797 if Is_Completely_Hidden (Ent) then
4801 Ent := Next_Entity (Ent);
4805 end Has_Completely_Hidden_Discriminant;
4807 -- Start of processing for First_Stored_Discriminant
4811 (Has_Discriminants (Id)
4812 or else Has_Unknown_Discriminants (Id));
4814 Ent := First_Entity (Id);
4816 if Chars (Ent) = Name_uTag then
4817 Ent := Next_Entity (Ent);
4820 if Chars (Ent) = Name_uController then
4821 Ent := Next_Entity (Ent);
4824 if Has_Completely_Hidden_Discriminant (Ent) then
4826 while Present (Ent) loop
4827 exit when Is_Completely_Hidden (Ent);
4828 Ent := Next_Entity (Ent);
4833 pragma Assert (Ekind (Ent) = E_Discriminant);
4836 end First_Stored_Discriminant;
4842 function First_Subtype (Id : E) return E is
4843 B : constant Entity_Id := Base_Type (Id);
4844 F : constant Node_Id := Freeze_Node (B);
4848 -- If the base type has no freeze node, it is a type in standard,
4849 -- and always acts as its own first subtype unless it is one of
4850 -- the predefined integer types. If the type is formal, it is also
4851 -- a first subtype, and its base type has no freeze node. On the other
4852 -- hand, a subtype of a generic formal is not its own first_subtype.
4853 -- Its base type, if anonymous, is attached to the formal type decl.
4854 -- from which the first subtype is obtained.
4858 if B = Base_Type (Standard_Integer) then
4859 return Standard_Integer;
4861 elsif B = Base_Type (Standard_Long_Integer) then
4862 return Standard_Long_Integer;
4864 elsif B = Base_Type (Standard_Short_Short_Integer) then
4865 return Standard_Short_Short_Integer;
4867 elsif B = Base_Type (Standard_Short_Integer) then
4868 return Standard_Short_Integer;
4870 elsif B = Base_Type (Standard_Long_Long_Integer) then
4871 return Standard_Long_Long_Integer;
4873 elsif Is_Generic_Type (Id) then
4874 if Present (Parent (B)) then
4875 return Defining_Identifier (Parent (B));
4877 return Defining_Identifier (Associated_Node_For_Itype (B));
4884 -- Otherwise we check the freeze node, if it has a First_Subtype_Link
4885 -- then we use that link, otherwise (happens with some Itypes), we use
4886 -- the base type itself.
4889 Ent := First_Subtype_Link (F);
4891 if Present (Ent) then
4899 -------------------------------------
4900 -- Get_Attribute_Definition_Clause --
4901 -------------------------------------
4903 function Get_Attribute_Definition_Clause
4911 N := First_Rep_Item (E);
4912 while Present (N) loop
4913 if Nkind (N) = N_Attribute_Definition_Clause
4914 and then Get_Attribute_Id (Chars (N)) = Id
4923 end Get_Attribute_Definition_Clause;
4925 --------------------
4926 -- Get_Rep_Pragma --
4927 --------------------
4929 function Get_Rep_Pragma (E : Entity_Id; Nam : Name_Id) return Node_Id is
4934 N := First_Rep_Item (E);
4936 while Present (N) loop
4937 if Nkind (N) = N_Pragma and then Chars (N) = Nam then
4939 if Nam = Name_Stream_Convert then
4941 -- For tagged types this pragma is not inherited, so we
4942 -- must verify that it is defined for the given type and
4945 Typ := Entity (Expression
4946 (First (Pragma_Argument_Associations (N))));
4948 if not Is_Tagged_Type (E)
4950 or else (Is_Private_Type (Typ)
4951 and then E = Full_View (Typ))
4969 ------------------------
4970 -- Has_Attach_Handler --
4971 ------------------------
4973 function Has_Attach_Handler (Id : E) return B is
4977 pragma Assert (Is_Protected_Type (Id));
4979 Ritem := First_Rep_Item (Id);
4980 while Present (Ritem) loop
4981 if Nkind (Ritem) = N_Pragma
4982 and then Chars (Ritem) = Name_Attach_Handler
4986 Ritem := Next_Rep_Item (Ritem);
4991 end Has_Attach_Handler;
4997 function Has_Entries (Id : E) return B is
4998 Result : Boolean := False;
5002 pragma Assert (Is_Concurrent_Type (Id));
5003 Ent := First_Entity (Id);
5005 while Present (Ent) loop
5006 if Is_Entry (Ent) then
5011 Ent := Next_Entity (Ent);
5017 ----------------------------
5018 -- Has_Foreign_Convention --
5019 ----------------------------
5021 function Has_Foreign_Convention (Id : E) return B is
5023 return Convention (Id) >= Foreign_Convention'First;
5024 end Has_Foreign_Convention;
5026 ---------------------------
5027 -- Has_Interrupt_Handler --
5028 ---------------------------
5030 function Has_Interrupt_Handler (Id : E) return B is
5034 pragma Assert (Is_Protected_Type (Id));
5036 Ritem := First_Rep_Item (Id);
5037 while Present (Ritem) loop
5038 if Nkind (Ritem) = N_Pragma
5039 and then Chars (Ritem) = Name_Interrupt_Handler
5043 Ritem := Next_Rep_Item (Ritem);
5048 end Has_Interrupt_Handler;
5050 --------------------------
5051 -- Has_Private_Ancestor --
5052 --------------------------
5054 function Has_Private_Ancestor (Id : E) return B is
5055 R : constant Entity_Id := Root_Type (Id);
5056 T1 : Entity_Id := Id;
5060 if Is_Private_Type (T1) then
5070 end Has_Private_Ancestor;
5072 ------------------------------
5073 -- Implementation_Base_Type --
5074 ------------------------------
5076 function Implementation_Base_Type (Id : E) return E is
5081 Bastyp := Base_Type (Id);
5083 if Is_Incomplete_Or_Private_Type (Bastyp) then
5084 Imptyp := Underlying_Type (Bastyp);
5086 -- If we have an implementation type, then just return it,
5087 -- otherwise we return the Base_Type anyway. This can only
5088 -- happen in error situations and should avoid some error bombs.
5090 if Present (Imptyp) then
5091 return Base_Type (Imptyp);
5099 end Implementation_Base_Type;
5101 -----------------------
5102 -- Is_Always_Inlined --
5103 -----------------------
5105 function Is_Always_Inlined (Id : E) return B is
5109 Item := First_Rep_Item (Id);
5111 while Present (Item) loop
5112 if Nkind (Item) = N_Pragma
5113 and then Get_Pragma_Id (Chars (Item)) = Pragma_Inline_Always
5118 Next_Rep_Item (Item);
5122 end Is_Always_Inlined;
5124 ---------------------
5125 -- Is_Boolean_Type --
5126 ---------------------
5128 function Is_Boolean_Type (Id : E) return B is
5130 return Root_Type (Id) = Standard_Boolean;
5131 end Is_Boolean_Type;
5133 ---------------------
5134 -- Is_By_Copy_Type --
5135 ---------------------
5137 function Is_By_Copy_Type (Id : E) return B is
5139 -- If Id is a private type whose full declaration has not been seen,
5140 -- we assume for now that it is not a By_Copy type. Clearly this
5141 -- attribute should not be used before the type is frozen, but it is
5142 -- needed to build the associated record of a protected type. Another
5143 -- place where some lookahead for a full view is needed ???
5146 Is_Elementary_Type (Id)
5147 or else (Is_Private_Type (Id)
5148 and then Present (Underlying_Type (Id))
5149 and then Is_Elementary_Type (Underlying_Type (Id)));
5150 end Is_By_Copy_Type;
5152 --------------------------
5153 -- Is_By_Reference_Type --
5154 --------------------------
5156 function Is_By_Reference_Type (Id : E) return B is
5157 Btype : constant Entity_Id := Base_Type (Id);
5160 if Error_Posted (Id)
5161 or else Error_Posted (Btype)
5165 elsif Is_Private_Type (Btype) then
5167 Utyp : constant Entity_Id := Underlying_Type (Btype);
5173 return Is_By_Reference_Type (Utyp);
5177 elsif Is_Concurrent_Type (Btype) then
5180 elsif Is_Record_Type (Btype) then
5181 if Is_Limited_Record (Btype)
5182 or else Is_Tagged_Type (Btype)
5183 or else Is_Volatile (Btype)
5189 C : Entity_Id := First_Component (Btype);
5192 while Present (C) loop
5193 if Is_By_Reference_Type (Etype (C))
5194 or else Is_Volatile (Etype (C))
5199 C := Next_Component (C);
5206 elsif Is_Array_Type (Btype) then
5209 or else Is_By_Reference_Type (Component_Type (Btype))
5210 or else Is_Volatile (Component_Type (Btype))
5211 or else Has_Volatile_Components (Btype);
5216 end Is_By_Reference_Type;
5218 ---------------------
5219 -- Is_Derived_Type --
5220 ---------------------
5222 function Is_Derived_Type (Id : E) return B is
5226 if Base_Type (Id) /= Root_Type (Id)
5227 and then not Is_Generic_Type (Id)
5228 and then not Is_Class_Wide_Type (Id)
5230 if not Is_Numeric_Type (Root_Type (Id)) then
5234 Par := Parent (First_Subtype (Id));
5236 return Present (Par)
5237 and then Nkind (Par) = N_Full_Type_Declaration
5238 and then Nkind (Type_Definition (Par))
5239 = N_Derived_Type_Definition;
5245 end Is_Derived_Type;
5247 ----------------------
5248 -- Is_Dynamic_Scope --
5249 ----------------------
5251 function Is_Dynamic_Scope (Id : E) return B is
5254 Ekind (Id) = E_Block
5256 Ekind (Id) = E_Function
5258 Ekind (Id) = E_Procedure
5260 Ekind (Id) = E_Subprogram_Body
5262 Ekind (Id) = E_Task_Type
5264 Ekind (Id) = E_Entry
5266 Ekind (Id) = E_Entry_Family;
5267 end Is_Dynamic_Scope;
5269 --------------------
5270 -- Is_Entity_Name --
5271 --------------------
5273 function Is_Entity_Name (N : Node_Id) return Boolean is
5274 Kind : constant Node_Kind := Nkind (N);
5277 -- Identifiers, operator symbols, expanded names are entity names
5279 return Kind = N_Identifier
5280 or else Kind = N_Operator_Symbol
5281 or else Kind = N_Expanded_Name
5283 -- Attribute references are entity names if they refer to an entity.
5284 -- Note that we don't do this by testing for the presence of the
5285 -- Entity field in the N_Attribute_Reference node, since it may not
5286 -- have been set yet.
5288 or else (Kind = N_Attribute_Reference
5289 and then Is_Entity_Attribute_Name (Attribute_Name (N)));
5292 ---------------------------
5293 -- Is_Indefinite_Subtype --
5294 ---------------------------
5296 function Is_Indefinite_Subtype (Id : Entity_Id) return B is
5297 K : constant Entity_Kind := Ekind (Id);
5300 if Is_Constrained (Id) then
5303 elsif K in Array_Kind
5304 or else K in Class_Wide_Kind
5305 or else Has_Unknown_Discriminants (Id)
5309 -- Known discriminants: indefinite if there are no default values
5311 elsif K in Record_Kind
5312 or else Is_Incomplete_Or_Private_Type (Id)
5313 or else Is_Concurrent_Type (Id)
5315 return (Has_Discriminants (Id)
5316 and then No (Discriminant_Default_Value (First_Discriminant (Id))));
5321 end Is_Indefinite_Subtype;
5323 ---------------------
5324 -- Is_Limited_Type --
5325 ---------------------
5327 function Is_Limited_Type (Id : E) return B is
5328 Btype : constant E := Base_Type (Id);
5331 if not Is_Type (Id) then
5334 elsif Ekind (Btype) = E_Limited_Private_Type
5335 or else Is_Limited_Composite (Btype)
5339 elsif Is_Concurrent_Type (Btype) then
5342 -- Otherwise we will look around to see if there is some other reason
5343 -- for it to be limited, except that if an error was posted on the
5344 -- entity, then just assume it is non-limited, because it can cause
5345 -- trouble to recurse into a murky erroneous entity!
5347 elsif Error_Posted (Id) then
5350 elsif Is_Record_Type (Btype) then
5351 if Is_Limited_Record (Root_Type (Btype)) then
5354 elsif Is_Class_Wide_Type (Btype) then
5355 return Is_Limited_Type (Root_Type (Btype));
5359 C : E := First_Component (Btype);
5362 while Present (C) loop
5363 if Is_Limited_Type (Etype (C)) then
5367 C := Next_Component (C);
5374 elsif Is_Array_Type (Btype) then
5375 return Is_Limited_Type (Component_Type (Btype));
5380 end Is_Limited_Type;
5386 function Is_Package (Id : E) return B is
5389 Ekind (Id) = E_Package
5391 Ekind (Id) = E_Generic_Package;
5394 --------------------------
5395 -- Is_Protected_Private --
5396 --------------------------
5398 function Is_Protected_Private (Id : E) return B is
5400 pragma Assert (Ekind (Id) = E_Component);
5401 return Is_Protected_Type (Scope (Id));
5402 end Is_Protected_Private;
5404 ------------------------------
5405 -- Is_Protected_Record_Type --
5406 ------------------------------
5408 function Is_Protected_Record_Type (Id : E) return B is
5411 Is_Concurrent_Record_Type (Id)
5412 and then Is_Protected_Type (Corresponding_Concurrent_Type (Id));
5413 end Is_Protected_Record_Type;
5415 ---------------------------------
5416 -- Is_Return_By_Reference_Type --
5417 ---------------------------------
5419 function Is_Return_By_Reference_Type (Id : E) return B is
5420 Btype : constant Entity_Id := Base_Type (Id);
5423 if Is_Private_Type (Btype) then
5425 Utyp : constant Entity_Id := Underlying_Type (Btype);
5431 return Is_Return_By_Reference_Type (Utyp);
5435 elsif Is_Concurrent_Type (Btype) then
5438 elsif Is_Record_Type (Btype) then
5439 if Is_Limited_Record (Btype) then
5442 elsif Is_Class_Wide_Type (Btype) then
5443 return Is_Return_By_Reference_Type (Root_Type (Btype));
5447 C : Entity_Id := First_Component (Btype);
5450 while Present (C) loop
5451 if Is_Return_By_Reference_Type (Etype (C)) then
5455 C := Next_Component (C);
5462 elsif Is_Array_Type (Btype) then
5463 return Is_Return_By_Reference_Type (Component_Type (Btype));
5468 end Is_Return_By_Reference_Type;
5470 --------------------
5471 -- Is_String_Type --
5472 --------------------
5474 function Is_String_Type (Id : E) return B is
5476 return Ekind (Id) in String_Kind
5477 or else (Is_Array_Type (Id)
5478 and then Number_Dimensions (Id) = 1
5479 and then Is_Character_Type (Component_Type (Id)));
5482 -------------------------
5483 -- Is_Task_Record_Type --
5484 -------------------------
5486 function Is_Task_Record_Type (Id : E) return B is
5489 Is_Concurrent_Record_Type (Id)
5490 and then Is_Task_Type (Corresponding_Concurrent_Type (Id));
5491 end Is_Task_Record_Type;
5493 ------------------------
5494 -- Is_Wrapper_Package --
5495 ------------------------
5497 function Is_Wrapper_Package (Id : E) return B is
5499 return (Ekind (Id) = E_Package
5500 and then Present (Related_Instance (Id)));
5501 end Is_Wrapper_Package;
5503 --------------------
5504 -- Next_Component --
5505 --------------------
5507 function Next_Component (Id : E) return E is
5511 Comp_Id := Next_Entity (Id);
5513 while Present (Comp_Id) loop
5514 exit when Ekind (Comp_Id) = E_Component;
5515 Comp_Id := Next_Entity (Comp_Id);
5521 -----------------------
5522 -- Next_Discriminant --
5523 -----------------------
5525 -- This function actually implements both Next_Discriminant and
5526 -- Next_Stored_Discriminant by making sure that the Discriminant
5527 -- returned is of the same variety as Id.
5529 function Next_Discriminant (Id : E) return E is
5531 -- Derived Tagged types with private extensions look like this...
5533 -- E_Discriminant d1
5534 -- E_Discriminant d2
5536 -- E_Discriminant d1
5537 -- E_Discriminant d2
5540 -- so it is critical not to go past the leading discriminants.
5545 pragma Assert (Ekind (Id) = E_Discriminant);
5548 D := Next_Entity (D);
5550 or else (Ekind (D) /= E_Discriminant
5551 and then not Is_Itype (D))
5556 exit when Ekind (D) = E_Discriminant
5557 and then (Is_Completely_Hidden (D) = Is_Completely_Hidden (Id));
5561 end Next_Discriminant;
5567 function Next_Formal (Id : E) return E is
5571 -- Follow the chain of declared entities as long as the kind of
5572 -- the entity corresponds to a formal parameter. Skip internal
5573 -- entities that may have been created for implicit subtypes,
5574 -- in the process of analyzing default expressions.
5579 P := Next_Entity (P);
5581 if No (P) or else Is_Formal (P) then
5583 elsif not Is_Internal (P) then
5589 -----------------------------
5590 -- Next_Formal_With_Extras --
5591 -----------------------------
5593 function Next_Formal_With_Extras (Id : E) return E is
5595 if Present (Extra_Formal (Id)) then
5596 return Extra_Formal (Id);
5598 return Next_Formal (Id);
5600 end Next_Formal_With_Extras;
5606 function Next_Index (Id : Node_Id) return Node_Id is
5615 function Next_Literal (Id : E) return E is
5617 pragma Assert (Nkind (Id) in N_Entity);
5621 ------------------------------
5622 -- Next_Stored_Discriminant --
5623 ------------------------------
5625 function Next_Stored_Discriminant (Id : E) return E is
5627 -- See comment in Next_Discriminant
5629 return Next_Discriminant (Id);
5630 end Next_Stored_Discriminant;
5632 -----------------------
5633 -- Number_Dimensions --
5634 -----------------------
5636 function Number_Dimensions (Id : E) return Pos is
5641 if Ekind (Id) in String_Kind then
5646 T := First_Index (Id);
5648 while Present (T) loop
5655 end Number_Dimensions;
5657 --------------------------
5658 -- Number_Discriminants --
5659 --------------------------
5661 function Number_Discriminants (Id : E) return Pos is
5667 Discr := First_Discriminant (Id);
5669 while Present (Discr) loop
5671 Discr := Next_Discriminant (Discr);
5675 end Number_Discriminants;
5677 --------------------
5678 -- Number_Entries --
5679 --------------------
5681 function Number_Entries (Id : E) return Nat is
5686 pragma Assert (Is_Concurrent_Type (Id));
5688 Ent := First_Entity (Id);
5690 while Present (Ent) loop
5691 if Is_Entry (Ent) then
5695 Ent := Next_Entity (Ent);
5701 --------------------
5702 -- Number_Formals --
5703 --------------------
5705 function Number_Formals (Id : E) return Pos is
5711 Formal := First_Formal (Id);
5713 while Present (Formal) loop
5715 Formal := Next_Formal (Formal);
5721 --------------------
5722 -- Parameter_Mode --
5723 --------------------
5725 function Parameter_Mode (Id : E) return Formal_Kind is
5734 function Root_Type (Id : E) return E is
5738 pragma Assert (Nkind (Id) in N_Entity);
5740 T := Base_Type (Id);
5742 if Ekind (T) = E_Class_Wide_Type then
5754 -- Following test catches some error cases resulting from
5757 elsif No (Etyp) then
5760 elsif Is_Private_Type (T) and then Etyp = Full_View (T) then
5763 elsif Is_Private_Type (Etyp) and then Full_View (Etyp) = T then
5769 -- Return if there is a circularity in the inheritance chain.
5770 -- This happens in some error situations and we do not want
5771 -- to get stuck in this loop.
5773 if T = Base_Type (Id) then
5779 raise Program_Error;
5786 function Scope_Depth (Id : E) return Uint is
5787 Scop : Entity_Id := Id;
5790 while Is_Record_Type (Scop) loop
5791 Scop := Scope (Scop);
5794 return Scope_Depth_Value (Scop);
5797 ---------------------
5798 -- Scope_Depth_Set --
5799 ---------------------
5801 function Scope_Depth_Set (Id : E) return B is
5803 return not Is_Record_Type (Id)
5804 and then Field22 (Id) /= Union_Id (Empty);
5805 end Scope_Depth_Set;
5807 -----------------------------
5808 -- Set_Component_Alignment --
5809 -----------------------------
5811 -- Component Alignment is encoded using two flags, Flag128/129 as
5812 -- follows. Note that both flags False = Align_Default, so that the
5813 -- default initialization of flags to False initializes component
5814 -- alignment to the default value as required.
5816 -- Flag128 Flag129 Value
5817 -- ------- ------- -----
5818 -- False False Calign_Default
5819 -- False True Calign_Component_Size
5820 -- True False Calign_Component_Size_4
5821 -- True True Calign_Storage_Unit
5823 procedure Set_Component_Alignment (Id : E; V : C) is
5825 pragma Assert ((Is_Array_Type (Id) or else Is_Record_Type (Id))
5826 and then Id = Base_Type (Id));
5829 when Calign_Default =>
5830 Set_Flag128 (Id, False);
5831 Set_Flag129 (Id, False);
5833 when Calign_Component_Size =>
5834 Set_Flag128 (Id, False);
5835 Set_Flag129 (Id, True);
5837 when Calign_Component_Size_4 =>
5838 Set_Flag128 (Id, True);
5839 Set_Flag129 (Id, False);
5841 when Calign_Storage_Unit =>
5842 Set_Flag128 (Id, True);
5843 Set_Flag129 (Id, True);
5845 end Set_Component_Alignment;
5851 function Size_Clause (Id : E) return N is
5855 Ritem := First_Rep_Item (Id);
5856 while Present (Ritem) loop
5857 if Nkind (Ritem) = N_Attribute_Definition_Clause
5858 and then Chars (Ritem) = Name_Size
5862 Ritem := Next_Rep_Item (Ritem);
5873 function Subtype_Kind (K : Entity_Kind) return Entity_Kind is
5879 Kind := E_Access_Subtype;
5883 Kind := E_Array_Subtype;
5885 when E_Class_Wide_Type |
5886 E_Class_Wide_Subtype =>
5887 Kind := E_Class_Wide_Subtype;
5889 when E_Decimal_Fixed_Point_Type |
5890 E_Decimal_Fixed_Point_Subtype =>
5891 Kind := E_Decimal_Fixed_Point_Subtype;
5893 when E_Ordinary_Fixed_Point_Type |
5894 E_Ordinary_Fixed_Point_Subtype =>
5895 Kind := E_Ordinary_Fixed_Point_Subtype;
5897 when E_Private_Type |
5898 E_Private_Subtype =>
5899 Kind := E_Private_Subtype;
5901 when E_Limited_Private_Type |
5902 E_Limited_Private_Subtype =>
5903 Kind := E_Limited_Private_Subtype;
5905 when E_Record_Type_With_Private |
5906 E_Record_Subtype_With_Private =>
5907 Kind := E_Record_Subtype_With_Private;
5909 when E_Record_Type |
5911 Kind := E_Record_Subtype;
5913 when E_String_Type |
5915 Kind := E_String_Subtype;
5917 when Enumeration_Kind =>
5918 Kind := E_Enumeration_Subtype;
5921 Kind := E_Floating_Point_Subtype;
5923 when Signed_Integer_Kind =>
5924 Kind := E_Signed_Integer_Subtype;
5926 when Modular_Integer_Kind =>
5927 Kind := E_Modular_Integer_Subtype;
5929 when Protected_Kind =>
5930 Kind := E_Protected_Subtype;
5933 Kind := E_Task_Subtype;
5937 raise Program_Error;
5947 function Tag_Component (Id : E) return E is
5949 Typ : Entity_Id := Id;
5952 pragma Assert (Is_Tagged_Type (Typ));
5954 if Is_Class_Wide_Type (Typ) then
5955 Typ := Root_Type (Typ);
5958 if Is_Private_Type (Typ) then
5959 Typ := Underlying_Type (Typ);
5962 Comp := First_Entity (Typ);
5963 while Present (Comp) loop
5964 if Is_Tag (Comp) then
5968 Comp := Next_Entity (Comp);
5971 -- No tag component found
5976 ---------------------
5977 -- Type_High_Bound --
5978 ---------------------
5980 function Type_High_Bound (Id : E) return Node_Id is
5982 if Nkind (Scalar_Range (Id)) = N_Subtype_Indication then
5983 return High_Bound (Range_Expression (Constraint (Scalar_Range (Id))));
5985 return High_Bound (Scalar_Range (Id));
5987 end Type_High_Bound;
5989 --------------------
5990 -- Type_Low_Bound --
5991 --------------------
5993 function Type_Low_Bound (Id : E) return Node_Id is
5995 if Nkind (Scalar_Range (Id)) = N_Subtype_Indication then
5996 return Low_Bound (Range_Expression (Constraint (Scalar_Range (Id))));
5998 return Low_Bound (Scalar_Range (Id));
6002 ---------------------
6003 -- Underlying_Type --
6004 ---------------------
6006 function Underlying_Type (Id : E) return E is
6008 -- For record_with_private the underlying type is always the direct
6009 -- full view. Never try to take the full view of the parent it
6010 -- doesn't make sense.
6012 if Ekind (Id) = E_Record_Type_With_Private then
6013 return Full_View (Id);
6015 elsif Ekind (Id) in Incomplete_Or_Private_Kind then
6017 -- If we have an incomplete or private type with a full view,
6018 -- then we return the Underlying_Type of this full view
6020 if Present (Full_View (Id)) then
6021 if Id = Full_View (Id) then
6023 -- Previous error in declaration
6028 return Underlying_Type (Full_View (Id));
6031 -- Otherwise check for the case where we have a derived type or
6032 -- subtype, and if so get the Underlying_Type of the parent type.
6034 elsif Etype (Id) /= Id then
6035 return Underlying_Type (Etype (Id));
6037 -- Otherwise we have an incomplete or private type that has
6038 -- no full view, which means that we have not encountered the
6039 -- completion, so return Empty to indicate the underlying type
6040 -- is not yet known.
6046 -- For non-incomplete, non-private types, return the type itself
6047 -- Also for entities that are not types at all return the entity
6053 end Underlying_Type;
6055 ------------------------
6056 -- Write_Entity_Flags --
6057 ------------------------
6059 procedure Write_Entity_Flags (Id : Entity_Id; Prefix : String) is
6061 procedure W (Flag_Name : String; Flag : Boolean);
6062 -- Write out given flag if it is set
6064 procedure W (Flag_Name : String; Flag : Boolean) is
6068 Write_Str (Flag_Name);
6069 Write_Str (" = True");
6074 -- Start of processing for Write_Entity_Flags
6077 if (Is_Array_Type (Id) or else Is_Record_Type (Id))
6078 and then Base_Type (Id) = Id
6081 Write_Str ("Component_Alignment = ");
6083 case Component_Alignment (Id) is
6084 when Calign_Default =>
6085 Write_Str ("Calign_Default");
6087 when Calign_Component_Size =>
6088 Write_Str ("Calign_Component_Size");
6090 when Calign_Component_Size_4 =>
6091 Write_Str ("Calign_Component_Size_4");
6093 when Calign_Storage_Unit =>
6094 Write_Str ("Calign_Storage_Unit");
6100 W ("Address_Taken", Flag104 (Id));
6101 W ("Body_Needed_For_SAL", Flag40 (Id));
6102 W ("C_Pass_By_Copy", Flag125 (Id));
6103 W ("Can_Never_Be_Null", Flag38 (Id));
6104 W ("Checks_May_Be_Suppressed", Flag31 (Id));
6105 W ("Debug_Info_Off", Flag166 (Id));
6106 W ("Default_Expressions_Processed", Flag108 (Id));
6107 W ("Delay_Cleanups", Flag114 (Id));
6108 W ("Delay_Subprogram_Descriptors", Flag50 (Id));
6109 W ("Depends_On_Private", Flag14 (Id));
6110 W ("Discard_Names", Flag88 (Id));
6111 W ("Elaborate_All_Desirable", Flag146 (Id));
6112 W ("Elaboration_Entity_Required", Flag174 (Id));
6113 W ("Entry_Accepted", Flag152 (Id));
6114 W ("Finalize_Storage_Only", Flag158 (Id));
6115 W ("From_With_Type", Flag159 (Id));
6116 W ("Function_Returns_With_DSP", Flag169 (Id));
6117 W ("Has_Aliased_Components", Flag135 (Id));
6118 W ("Has_Alignment_Clause", Flag46 (Id));
6119 W ("Has_All_Calls_Remote", Flag79 (Id));
6120 W ("Has_Atomic_Components", Flag86 (Id));
6121 W ("Has_Biased_Representation", Flag139 (Id));
6122 W ("Has_Completion", Flag26 (Id));
6123 W ("Has_Completion_In_Body", Flag71 (Id));
6124 W ("Has_Complex_Representation", Flag140 (Id));
6125 W ("Has_Component_Size_Clause", Flag68 (Id));
6126 W ("Has_Contiguous_Rep", Flag181 (Id));
6127 W ("Has_Controlled_Component", Flag43 (Id));
6128 W ("Has_Controlling_Result", Flag98 (Id));
6129 W ("Has_Convention_Pragma", Flag119 (Id));
6130 W ("Has_Delayed_Freeze", Flag18 (Id));
6131 W ("Has_Discriminants", Flag5 (Id));
6132 W ("Has_Enumeration_Rep_Clause", Flag66 (Id));
6133 W ("Has_Exit", Flag47 (Id));
6134 W ("Has_External_Tag_Rep_Clause", Flag110 (Id));
6135 W ("Has_Forward_Instantiation", Flag175 (Id));
6136 W ("Has_Fully_Qualified_Name", Flag173 (Id));
6137 W ("Has_Gigi_Rep_Item", Flag82 (Id));
6138 W ("Has_Homonym", Flag56 (Id));
6139 W ("Has_Machine_Radix_Clause", Flag83 (Id));
6140 W ("Has_Master_Entity", Flag21 (Id));
6141 W ("Has_Missing_Return", Flag142 (Id));
6142 W ("Has_Nested_Block_With_Handler", Flag101 (Id));
6143 W ("Has_Non_Standard_Rep", Flag75 (Id));
6144 W ("Has_Object_Size_Clause", Flag172 (Id));
6145 W ("Has_Per_Object_Constraint", Flag154 (Id));
6146 W ("Has_Pragma_Controlled", Flag27 (Id));
6147 W ("Has_Pragma_Elaborate_Body", Flag150 (Id));
6148 W ("Has_Pragma_Inline", Flag157 (Id));
6149 W ("Has_Pragma_Pack", Flag121 (Id));
6150 W ("Has_Pragma_Pure_Function", Flag179 (Id));
6151 W ("Has_Pragma_Unreferenced", Flag180 (Id));
6152 W ("Has_Primitive_Operations", Flag120 (Id));
6153 W ("Has_Private_Declaration", Flag155 (Id));
6154 W ("Has_Qualified_Name", Flag161 (Id));
6155 W ("Has_Record_Rep_Clause", Flag65 (Id));
6156 W ("Has_Recursive_Call", Flag143 (Id));
6157 W ("Has_Size_Clause", Flag29 (Id));
6158 W ("Has_Small_Clause", Flag67 (Id));
6159 W ("Has_Specified_Layout", Flag100 (Id));
6160 W ("Has_Storage_Size_Clause", Flag23 (Id));
6161 W ("Has_Subprogram_Descriptor", Flag93 (Id));
6162 W ("Has_Task", Flag30 (Id));
6163 W ("Has_Unchecked_Union", Flag123 (Id));
6164 W ("Has_Unknown_Discriminants", Flag72 (Id));
6165 W ("Has_Volatile_Components", Flag87 (Id));
6166 W ("Has_Xref_Entry", Flag182 (Id));
6167 W ("In_Package_Body", Flag48 (Id));
6168 W ("In_Private_Part", Flag45 (Id));
6169 W ("In_Use", Flag8 (Id));
6170 W ("Is_AST_Entry", Flag132 (Id));
6171 W ("Is_Abstract", Flag19 (Id));
6172 W ("Is_Access_Constant", Flag69 (Id));
6173 W ("Is_Aliased", Flag15 (Id));
6174 W ("Is_Asynchronous", Flag81 (Id));
6175 W ("Is_Atomic", Flag85 (Id));
6176 W ("Is_Bit_Packed_Array", Flag122 (Id));
6177 W ("Is_CPP_Class", Flag74 (Id));
6178 W ("Is_Called", Flag102 (Id));
6179 W ("Is_Character_Type", Flag63 (Id));
6180 W ("Is_Child_Unit", Flag73 (Id));
6181 W ("Is_Class_Wide_Equivalent_Type", Flag35 (Id));
6182 W ("Is_Compilation_Unit", Flag149 (Id));
6183 W ("Is_Completely_Hidden", Flag103 (Id));
6184 W ("Is_Concurrent_Record_Type", Flag20 (Id));
6185 W ("Is_Constr_Subt_For_UN_Aliased", Flag141 (Id));
6186 W ("Is_Constr_Subt_For_U_Nominal", Flag80 (Id));
6187 W ("Is_Constrained", Flag12 (Id));
6188 W ("Is_Constructor", Flag76 (Id));
6189 W ("Is_Controlled", Flag42 (Id));
6190 W ("Is_Controlling_Formal", Flag97 (Id));
6191 W ("Is_Discrim_SO_Function", Flag176 (Id));
6192 W ("Is_Dispatching_Operation", Flag6 (Id));
6193 W ("Is_Eliminated", Flag124 (Id));
6194 W ("Is_Entry_Formal", Flag52 (Id));
6195 W ("Is_Exported", Flag99 (Id));
6196 W ("Is_First_Subtype", Flag70 (Id));
6197 W ("Is_For_Access_Subtype", Flag118 (Id));
6198 W ("Is_Formal_Subprogram", Flag111 (Id));
6199 W ("Is_Frozen", Flag4 (Id));
6200 W ("Is_Generic_Actual_Type", Flag94 (Id));
6201 W ("Is_Generic_Instance", Flag130 (Id));
6202 W ("Is_Generic_Type", Flag13 (Id));
6203 W ("Is_Hidden", Flag57 (Id));
6204 W ("Is_Hidden_Open_Scope", Flag171 (Id));
6205 W ("Is_Immediately_Visible", Flag7 (Id));
6206 W ("Is_Imported", Flag24 (Id));
6207 W ("Is_Inlined", Flag11 (Id));
6208 W ("Is_Instantiated", Flag126 (Id));
6209 W ("Is_Internal", Flag17 (Id));
6210 W ("Is_Interrupt_Handler", Flag89 (Id));
6211 W ("Is_Intrinsic_Subprogram", Flag64 (Id));
6212 W ("Is_Itype", Flag91 (Id));
6213 W ("Is_Known_Valid", Flag37 (Id));
6214 W ("Is_Known_Valid", Flag170 (Id));
6215 W ("Is_Limited_Composite", Flag106 (Id));
6216 W ("Is_Limited_Record", Flag25 (Id));
6217 W ("Is_Machine_Code_Subprogram", Flag137 (Id));
6218 W ("Is_Non_Static_Subtype", Flag109 (Id));
6219 W ("Is_Null_Init_Proc", Flag178 (Id));
6220 W ("Is_Optional_Parameter", Flag134 (Id));
6221 W ("Is_Overriding_Operation", Flag39 (Id));
6222 W ("Is_Package_Body_Entity", Flag160 (Id));
6223 W ("Is_Packed", Flag51 (Id));
6224 W ("Is_Packed_Array_Type", Flag138 (Id));
6225 W ("Is_Potentially_Use_Visible", Flag9 (Id));
6226 W ("Is_Preelaborated", Flag59 (Id));
6227 W ("Is_Private_Composite", Flag107 (Id));
6228 W ("Is_Private_Descendant", Flag53 (Id));
6229 W ("Is_Psected", Flag153 (Id));
6230 W ("Is_Public", Flag10 (Id));
6231 W ("Is_Pure", Flag44 (Id));
6232 W ("Is_Remote_Call_Interface", Flag62 (Id));
6233 W ("Is_Remote_Types", Flag61 (Id));
6234 W ("Is_Renaming_Of_Object", Flag112 (Id));
6235 W ("Is_Shared_Passive", Flag60 (Id));
6236 W ("Is_Statically_Allocated", Flag28 (Id));
6237 W ("Is_Tag", Flag78 (Id));
6238 W ("Is_Tagged_Type", Flag55 (Id));
6239 W ("Is_Thread_Body", Flag77 (Id));
6240 W ("Is_True_Constant", Flag163 (Id));
6241 W ("Is_Unchecked_Union", Flag117 (Id));
6242 W ("Is_Unsigned_Type", Flag144 (Id));
6243 W ("Is_VMS_Exception", Flag133 (Id));
6244 W ("Is_Valued_Procedure", Flag127 (Id));
6245 W ("Is_Visible_Child_Unit", Flag116 (Id));
6246 W ("Is_Volatile", Flag16 (Id));
6247 W ("Kill_Elaboration_Checks", Flag32 (Id));
6248 W ("Kill_Range_Checks", Flag33 (Id));
6249 W ("Kill_Tag_Checks", Flag34 (Id));
6250 W ("Machine_Radix_10", Flag84 (Id));
6251 W ("Materialize_Entity", Flag168 (Id));
6252 W ("Needs_Debug_Info", Flag147 (Id));
6253 W ("Needs_No_Actuals", Flag22 (Id));
6254 W ("Never_Set_In_Source", Flag115 (Id));
6255 W ("No_Pool_Assigned", Flag131 (Id));
6256 W ("No_Return", Flag113 (Id));
6257 W ("No_Strict_Aliasing", Flag136 (Id));
6258 W ("Non_Binary_Modulus", Flag58 (Id));
6259 W ("Nonzero_Is_True", Flag162 (Id));
6260 W ("Reachable", Flag49 (Id));
6261 W ("Referenced", Flag156 (Id));
6262 W ("Referenced_As_LHS", Flag36 (Id));
6263 W ("Return_Present", Flag54 (Id));
6264 W ("Returns_By_Ref", Flag90 (Id));
6265 W ("Reverse_Bit_Order", Flag164 (Id));
6266 W ("Sec_Stack_Needed_For_Return", Flag167 (Id));
6267 W ("Size_Depends_On_Discriminant", Flag177 (Id));
6268 W ("Size_Known_At_Compile_Time", Flag92 (Id));
6269 W ("Strict_Alignment", Flag145 (Id));
6270 W ("Suppress_Elaboration_Warnings", Flag148 (Id));
6271 W ("Suppress_Init_Proc", Flag105 (Id));
6272 W ("Suppress_Style_Checks", Flag165 (Id));
6273 W ("Treat_As_Volatile", Flag41 (Id));
6274 W ("Uses_Sec_Stack", Flag95 (Id));
6275 W ("Vax_Float", Flag151 (Id));
6276 W ("Warnings_Off", Flag96 (Id));
6277 end Write_Entity_Flags;
6279 -----------------------
6280 -- Write_Entity_Info --
6281 -----------------------
6283 procedure Write_Entity_Info (Id : Entity_Id; Prefix : String) is
6285 procedure Write_Attribute (Which : String; Nam : E);
6286 -- Write attribute value with given string name
6288 procedure Write_Kind (Id : Entity_Id);
6289 -- Write Ekind field of entity
6291 procedure Write_Attribute (Which : String; Nam : E) is
6295 Write_Int (Int (Nam));
6297 Write_Name (Chars (Nam));
6299 end Write_Attribute;
6301 procedure Write_Kind (Id : Entity_Id) is
6302 K : constant String := Entity_Kind'Image (Ekind (Id));
6306 Write_Str (" Kind ");
6308 if Is_Type (Id) and then Is_Tagged_Type (Id) then
6309 Write_Str ("TAGGED ");
6312 Write_Str (K (3 .. K'Length));
6315 if Is_Type (Id) and then Depends_On_Private (Id) then
6316 Write_Str ("Depends_On_Private ");
6320 -- Start of processing for Write_Entity_Info
6324 Write_Attribute ("Name ", Id);
6325 Write_Int (Int (Id));
6329 Write_Attribute (" Type ", Etype (Id));
6331 Write_Attribute (" Scope ", Scope (Id));
6336 when Discrete_Kind =>
6337 Write_Str ("Bounds: Id = ");
6339 if Present (Scalar_Range (Id)) then
6340 Write_Int (Int (Type_Low_Bound (Id)));
6341 Write_Str (" .. Id = ");
6342 Write_Int (Int (Type_High_Bound (Id)));
6344 Write_Str ("Empty");
6354 Write_Attribute (" Component Type ",
6355 Component_Type (Id));
6358 Write_Str (" Indices ");
6360 Index := First_Index (Id);
6362 while Present (Index) loop
6363 Write_Attribute (" ", Etype (Index));
6364 Index := Next_Index (Index);
6372 (" Directly Designated Type ",
6373 Directly_Designated_Type (Id));
6376 when Overloadable_Kind =>
6377 if Present (Homonym (Id)) then
6378 Write_Str (" Homonym ");
6379 Write_Name (Chars (Homonym (Id)));
6381 Write_Int (Int (Homonym (Id)));
6388 if Ekind (Scope (Id)) in Record_Kind then
6390 " Original_Record_Component ",
6391 Original_Record_Component (Id));
6392 Write_Int (Int (Original_Record_Component (Id)));
6396 when others => null;
6398 end Write_Entity_Info;
6400 -----------------------
6401 -- Write_Field6_Name --
6402 -----------------------
6404 procedure Write_Field6_Name (Id : Entity_Id) is
6405 pragma Warnings (Off, Id);
6408 Write_Str ("First_Rep_Item");
6409 end Write_Field6_Name;
6411 -----------------------
6412 -- Write_Field7_Name --
6413 -----------------------
6415 procedure Write_Field7_Name (Id : Entity_Id) is
6416 pragma Warnings (Off, Id);
6419 Write_Str ("Freeze_Node");
6420 end Write_Field7_Name;
6422 -----------------------
6423 -- Write_Field8_Name --
6424 -----------------------
6426 procedure Write_Field8_Name (Id : Entity_Id) is
6431 Write_Str ("Normalized_First_Bit");
6435 E_Subprogram_Body =>
6436 Write_Str ("Mechanism");
6439 Write_Str ("Associated_Node_For_Itype");
6442 Write_Str ("Dependent_Instances");
6445 Write_Str ("Hiding_Loop_Variable");
6448 Write_Str ("Field8??");
6450 end Write_Field8_Name;
6452 -----------------------
6453 -- Write_Field9_Name --
6454 -----------------------
6456 procedure Write_Field9_Name (Id : Entity_Id) is
6460 Write_Str ("Class_Wide_Type");
6463 E_Generic_Function |
6465 E_Generic_Procedure |
6468 Write_Str ("Renaming_Map");
6471 Write_Str ("Current_Value");
6474 Write_Str ("Field9??");
6476 end Write_Field9_Name;
6478 ------------------------
6479 -- Write_Field10_Name --
6480 ------------------------
6482 procedure Write_Field10_Name (Id : Entity_Id) is
6486 Write_Str ("Referenced_Object");
6488 when E_In_Parameter |
6490 Write_Str ("Discriminal_Link");
6496 Write_Str ("Handler_Records");
6500 Write_Str ("Normalized_Position_Max");
6503 Write_Str ("Field10??");
6505 end Write_Field10_Name;
6507 ------------------------
6508 -- Write_Field11_Name --
6509 ------------------------
6511 procedure Write_Field11_Name (Id : Entity_Id) is
6515 Write_Str ("Entry_Component");
6519 Write_Str ("Component_Bit_Offset");
6522 Write_Str ("Full_View");
6524 when E_Enumeration_Literal =>
6525 Write_Str ("Enumeration_Pos");
6528 Write_Str ("Block_Node");
6534 Write_Str ("Protected_Body_Subprogram");
6536 when E_Generic_Package =>
6537 Write_Str ("Generic_Homonym");
6540 Write_Str ("Full_View");
6543 Write_Str ("Field11??");
6545 end Write_Field11_Name;
6547 ------------------------
6548 -- Write_Field12_Name --
6549 ------------------------
6551 procedure Write_Field12_Name (Id : Entity_Id) is
6555 Write_Str ("Barrier_Function");
6557 when E_Enumeration_Literal =>
6558 Write_Str ("Enumeration_Rep");
6565 E_In_Out_Parameter |
6569 Write_Str ("Esize");
6573 Write_Str ("Next_Inlined_Subprogram");
6576 Write_Str ("Associated_Formal_Package");
6579 Write_Str ("Field12??");
6581 end Write_Field12_Name;
6583 ------------------------
6584 -- Write_Field13_Name --
6585 ------------------------
6587 procedure Write_Field13_Name (Id : Entity_Id) is
6591 Write_Str ("RM_Size");
6595 Write_Str ("Component_Clause");
6597 when E_Enumeration_Literal =>
6598 Write_Str ("Debug_Renaming_Link");
6601 if not Comes_From_Source (Id)
6603 Chars (Id) = Name_Op_Ne
6605 Write_Str ("Corresponding_Equality");
6607 elsif Comes_From_Source (Id) then
6608 Write_Str ("Elaboration_Entity");
6611 Write_Str ("Field13??");
6616 Write_Str ("Extra_Accessibility");
6620 Generic_Unit_Kind =>
6621 Write_Str ("Elaboration_Entity");
6624 Write_Str ("Field13??");
6626 end Write_Field13_Name;
6628 -----------------------
6629 -- Write_Field14_Name --
6630 -----------------------
6632 procedure Write_Field14_Name (Id : Entity_Id) is
6640 Write_Str ("Alignment");
6644 Write_Str ("Normalized_Position");
6648 Write_Str ("First_Optional_Parameter");
6651 E_Generic_Package =>
6652 Write_Str ("Shadow_Entities");
6655 Write_Str ("Field14??");
6657 end Write_Field14_Name;
6659 ------------------------
6660 -- Write_Field15_Name --
6661 ------------------------
6663 procedure Write_Field15_Name (Id : Entity_Id) is
6668 Write_Str ("Storage_Size_Variable");
6670 when Class_Wide_Kind |
6674 Write_Str ("Primitive_Operations");
6677 Write_Str ("DT_Entry_Count");
6679 when Decimal_Fixed_Point_Kind =>
6680 Write_Str ("Scale_Value");
6682 when E_Discriminant =>
6683 Write_Str ("Discriminant_Number");
6686 Write_Str ("Extra_Formal");
6690 Write_Str ("DT_Position");
6693 Write_Str ("Entry_Parameters_Type");
6695 when Enumeration_Kind =>
6696 Write_Str ("Lit_Indexes");
6700 Write_Str ("Related_Instance");
6702 when E_Protected_Type =>
6703 Write_Str ("Entry_Bodies_Array");
6705 when E_String_Literal_Subtype =>
6706 Write_Str ("String_Literal_Low_Bound");
6709 Write_Str ("Shared_Var_Read_Proc");
6712 Write_Str ("Field15??");
6714 end Write_Field15_Name;
6716 ------------------------
6717 -- Write_Field16_Name --
6718 ------------------------
6720 procedure Write_Field16_Name (Id : Entity_Id) is
6724 Write_Str ("Entry_Formal");
6728 Write_Str ("DTC_Entity");
6733 Write_Str ("First_Private_Entity");
6735 when E_Record_Type |
6736 E_Record_Type_With_Private =>
6737 Write_Str ("Access_Disp_Table");
6739 when E_String_Literal_Subtype =>
6740 Write_Str ("String_Literal_Length");
6742 when Enumeration_Kind =>
6743 Write_Str ("Lit_Strings");
6747 Write_Str ("Unset_Reference");
6749 when E_Record_Subtype |
6750 E_Class_Wide_Subtype =>
6751 Write_Str ("Cloned_Subtype");
6754 Write_Str ("Field16??");
6756 end Write_Field16_Name;
6758 ------------------------
6759 -- Write_Field17_Name --
6760 ------------------------
6762 procedure Write_Field17_Name (Id : Entity_Id) is
6766 Write_Str ("Digits_Value");
6769 Write_Str ("Prival");
6771 when E_Discriminant =>
6772 Write_Str ("Discriminal");
6781 E_Generic_Function |
6783 E_Generic_Procedure |
6792 E_Subprogram_Type =>
6793 Write_Str ("First_Entity");
6796 Write_Str ("First_Index");
6798 when E_Protected_Body =>
6799 Write_Str ("Object_Ref");
6801 when Enumeration_Kind =>
6802 Write_Str ("First_Literal");
6805 Write_Str ("Master_Id");
6807 when Modular_Integer_Kind =>
6808 Write_Str ("Modulus");
6812 E_Generic_In_Out_Parameter |
6814 Write_Str ("Actual_Subtype");
6816 when E_Incomplete_Type =>
6817 Write_Str ("Non-limited view");
6820 Write_Str ("Field17??");
6822 end Write_Field17_Name;
6824 -----------------------
6825 -- Write_Field18_Name --
6826 -----------------------
6828 procedure Write_Field18_Name (Id : Entity_Id) is
6831 when E_Enumeration_Literal |
6835 Write_Str ("Alias");
6837 when E_Record_Type =>
6838 Write_Str ("Corresponding_Concurrent_Type");
6840 when E_Entry_Index_Parameter =>
6841 Write_Str ("Entry_Index_Constant");
6843 when E_Class_Wide_Subtype |
6844 E_Access_Protected_Subprogram_Type |
6845 E_Access_Subprogram_Type |
6847 Write_Str ("Equivalent_Type");
6849 when Fixed_Point_Kind =>
6850 Write_Str ("Delta_Value");
6854 Write_Str ("Renamed_Object");
6858 E_Generic_Function |
6859 E_Generic_Procedure |
6860 E_Generic_Package =>
6861 Write_Str ("Renamed_Entity");
6863 when Incomplete_Or_Private_Kind =>
6864 Write_Str ("Private_Dependents");
6866 when Concurrent_Kind =>
6867 Write_Str ("Corresponding_Record_Type");
6872 Write_Str ("Enclosing_Scope");
6875 Write_Str ("Field18??");
6877 end Write_Field18_Name;
6879 -----------------------
6880 -- Write_Field19_Name --
6881 -----------------------
6883 procedure Write_Field19_Name (Id : Entity_Id) is
6888 Write_Str ("Related_Array_Object");
6895 Write_Str ("Finalization_Chain_Entity");
6897 when E_Constant | E_Variable =>
6898 Write_Str ("Size_Check_Code");
6900 when E_Discriminant =>
6901 Write_Str ("Corresponding_Discriminant");
6904 E_Generic_Package =>
6905 Write_Str ("Body_Entity");
6907 when E_Package_Body |
6909 Write_Str ("Spec_Entity");
6911 when Private_Kind =>
6912 Write_Str ("Underlying_Full_View");
6914 when E_Record_Type =>
6915 Write_Str ("Parent_Subtype");
6918 Write_Str ("Field19??");
6920 end Write_Field19_Name;
6922 -----------------------
6923 -- Write_Field20_Name --
6924 -----------------------
6926 procedure Write_Field20_Name (Id : Entity_Id) is
6930 Write_Str ("Component_Type");
6932 when E_In_Parameter |
6933 E_Generic_In_Parameter =>
6934 Write_Str ("Default_Value");
6937 Write_Str ("Directly_Designated_Type");
6940 Write_Str ("Discriminant_Checking_Func");
6942 when E_Discriminant =>
6943 Write_Str ("Discriminant_Default_Value");
6952 E_Generic_Function |
6954 E_Generic_Procedure |
6963 E_Subprogram_Type =>
6965 Write_Str ("Last_Entity");
6968 Write_Str ("Scalar_Range");
6971 Write_Str ("Register_Exception_Call");
6974 Write_Str ("Field20??");
6976 end Write_Field20_Name;
6978 -----------------------
6979 -- Write_Field21_Name --
6980 -----------------------
6982 procedure Write_Field21_Name (Id : Entity_Id) is
6988 E_Generic_Function |
6990 E_Generic_Procedure |
6992 Write_Str ("Interface_Name");
6994 when Concurrent_Kind |
6995 Incomplete_Or_Private_Kind |
6999 Write_Str ("Discriminant_Constraint");
7002 Write_Str ("Accept_Address");
7004 when Fixed_Point_Kind =>
7005 Write_Str ("Small_Value");
7007 when E_In_Parameter =>
7008 Write_Str ("Default_Expr_Function");
7011 Modular_Integer_Kind =>
7012 Write_Str ("Original_Array_Type");
7014 when E_Access_Subprogram_Type |
7015 E_Access_Protected_Subprogram_Type =>
7016 Write_Str ("Original_Access_Type");
7019 Write_Str ("Field21??");
7021 end Write_Field21_Name;
7023 -----------------------
7024 -- Write_Field22_Name --
7025 -----------------------
7027 procedure Write_Field22_Name (Id : Entity_Id) is
7031 Write_Str ("Associated_Storage_Pool");
7034 Write_Str ("Component_Size");
7038 Write_Str ("Original_Record_Component");
7040 when E_Enumeration_Literal =>
7041 Write_Str ("Enumeration_Rep_Expr");
7044 Write_Str ("Exception_Code");
7047 Write_Str ("Protected_Formal");
7049 when E_Record_Type =>
7050 Write_Str ("Corresponding_Remote_Type");
7060 E_Generic_Function |
7061 E_Generic_Procedure |
7066 Write_Str ("Scope_Depth_Value");
7068 when E_Record_Type_With_Private |
7069 E_Record_Subtype_With_Private |
7072 E_Limited_Private_Type |
7073 E_Limited_Private_Subtype =>
7074 Write_Str ("Private_View");
7077 Write_Str ("Shared_Var_Assign_Proc");
7080 Write_Str ("Field22??");
7082 end Write_Field22_Name;
7084 ------------------------
7085 -- Write_Field23_Name --
7086 ------------------------
7088 procedure Write_Field23_Name (Id : Entity_Id) is
7092 Write_Str ("Associated_Final_Chain");
7095 Write_Str ("Packed_Array_Type");
7098 Write_Str ("Entry_Cancel_Parameter");
7101 Write_Str ("Protected_Operation");
7103 when E_Discriminant =>
7104 Write_Str ("CR_Discriminant");
7106 when E_Enumeration_Type =>
7107 Write_Str ("Enum_Pos_To_Rep");
7111 Write_Str ("Extra_Constrained");
7113 when E_Generic_Function |
7115 E_Generic_Procedure =>
7116 Write_Str ("Inner_Instances");
7118 when Concurrent_Kind |
7119 Incomplete_Or_Private_Kind |
7123 Write_Str ("Stored_Constraint");
7127 Write_Str ("Generic_Renamings");
7130 if Is_Generic_Instance (Id) then
7131 Write_Str ("Generic_Renamings");
7133 Write_Str ("Limited Views");
7136 -- What about Privals_Chain for protected operations ???
7139 Write_Str ("Privals_Chain");
7142 Write_Str ("Field23??");
7144 end Write_Field23_Name;
7146 -------------------------
7147 -- Iterator Procedures --
7148 -------------------------
7150 procedure Proc_Next_Component (N : in out Node_Id) is
7152 N := Next_Component (N);
7153 end Proc_Next_Component;
7155 procedure Proc_Next_Discriminant (N : in out Node_Id) is
7157 N := Next_Discriminant (N);
7158 end Proc_Next_Discriminant;
7160 procedure Proc_Next_Formal (N : in out Node_Id) is
7162 N := Next_Formal (N);
7163 end Proc_Next_Formal;
7165 procedure Proc_Next_Formal_With_Extras (N : in out Node_Id) is
7167 N := Next_Formal_With_Extras (N);
7168 end Proc_Next_Formal_With_Extras;
7170 procedure Proc_Next_Index (N : in out Node_Id) is
7172 N := Next_Index (N);
7173 end Proc_Next_Index;
7175 procedure Proc_Next_Inlined_Subprogram (N : in out Node_Id) is
7177 N := Next_Inlined_Subprogram (N);
7178 end Proc_Next_Inlined_Subprogram;
7180 procedure Proc_Next_Literal (N : in out Node_Id) is
7182 N := Next_Literal (N);
7183 end Proc_Next_Literal;
7185 procedure Proc_Next_Stored_Discriminant (N : in out Node_Id) is
7187 N := Next_Stored_Discriminant (N);
7188 end Proc_Next_Stored_Discriminant;