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_Views Elist23
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_Views (Id : E) return L is
1713 pragma Assert (Ekind (Id) = E_Package);
1714 return Elist23 (Id);
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_Array_Type (Id : E) return E is
1850 pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id));
1852 end Original_Array_Type;
1854 function Original_Record_Component (Id : E) return E is
1857 (Ekind (Id) = E_Void
1858 or else Ekind (Id) = E_Component
1859 or else Ekind (Id) = E_Discriminant);
1861 end Original_Record_Component;
1863 function Packed_Array_Type (Id : E) return E is
1865 pragma Assert (Is_Array_Type (Id));
1867 end Packed_Array_Type;
1869 function Parent_Subtype (Id : E) return E is
1871 pragma Assert (Ekind (Id) = E_Record_Type);
1875 function Primitive_Operations (Id : E) return L is
1877 pragma Assert (Is_Tagged_Type (Id));
1878 return Elist15 (Id);
1879 end Primitive_Operations;
1881 function Prival (Id : E) return E is
1883 pragma Assert (Is_Protected_Private (Id));
1887 function Privals_Chain (Id : E) return L is
1889 pragma Assert (Is_Overloadable (Id)
1890 or else Ekind (Id) = E_Entry_Family);
1891 return Elist23 (Id);
1894 function Private_Dependents (Id : E) return L is
1896 pragma Assert (Is_Incomplete_Or_Private_Type (Id));
1897 return Elist18 (Id);
1898 end Private_Dependents;
1900 function Private_View (Id : E) return N is
1902 pragma Assert (Is_Private_Type (Id));
1906 function Protected_Body_Subprogram (Id : E) return E is
1908 pragma Assert (Is_Subprogram (Id) or else Is_Entry (Id));
1910 end Protected_Body_Subprogram;
1912 function Protected_Formal (Id : E) return E is
1914 pragma Assert (Is_Formal (Id));
1916 end Protected_Formal;
1918 function Protected_Operation (Id : E) return N is
1920 pragma Assert (Is_Protected_Private (Id));
1922 end Protected_Operation;
1924 function Reachable (Id : E) return B is
1929 function Referenced (Id : E) return B is
1931 return Flag156 (Id);
1934 function Referenced_As_LHS (Id : E) return B is
1937 end Referenced_As_LHS;
1939 function Referenced_Object (Id : E) return N is
1941 pragma Assert (Is_Type (Id));
1943 end Referenced_Object;
1945 function Register_Exception_Call (Id : E) return N is
1947 pragma Assert (Ekind (Id) = E_Exception);
1949 end Register_Exception_Call;
1951 function Related_Array_Object (Id : E) return E is
1953 pragma Assert (Is_Array_Type (Id));
1955 end Related_Array_Object;
1957 function Related_Instance (Id : E) return E is
1960 (Ekind (Id) = E_Package or else Ekind (Id) = E_Package_Body);
1962 end Related_Instance;
1964 function Renamed_Entity (Id : E) return N is
1969 function Renamed_Object (Id : E) return N is
1974 function Renaming_Map (Id : E) return U is
1979 function Return_Present (Id : E) return B is
1984 function Returns_By_Ref (Id : E) return B is
1989 function Reverse_Bit_Order (Id : E) return B is
1991 pragma Assert (Is_Record_Type (Id));
1992 return Flag164 (Base_Type (Id));
1993 end Reverse_Bit_Order;
1995 function RM_Size (Id : E) return U is
1997 pragma Assert (Is_Type (Id));
2001 function Scalar_Range (Id : E) return N is
2006 function Scale_Value (Id : E) return U is
2011 function Scope_Depth_Value (Id : E) return U is
2014 end Scope_Depth_Value;
2016 function Sec_Stack_Needed_For_Return (Id : E) return B is
2018 return Flag167 (Id);
2019 end Sec_Stack_Needed_For_Return;
2021 function Shadow_Entities (Id : E) return S is
2024 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
2026 end Shadow_Entities;
2028 function Shared_Var_Assign_Proc (Id : E) return E is
2030 pragma Assert (Ekind (Id) = E_Variable);
2032 end Shared_Var_Assign_Proc;
2034 function Shared_Var_Read_Proc (Id : E) return E is
2036 pragma Assert (Ekind (Id) = E_Variable);
2038 end Shared_Var_Read_Proc;
2040 function Size_Check_Code (Id : E) return N is
2042 pragma Assert (Ekind (Id) = E_Constant or else Ekind (Id) = E_Variable);
2044 end Size_Check_Code;
2046 function Size_Depends_On_Discriminant (Id : E) return B is
2048 return Flag177 (Id);
2049 end Size_Depends_On_Discriminant;
2051 function Size_Known_At_Compile_Time (Id : E) return B is
2054 end Size_Known_At_Compile_Time;
2056 function Small_Value (Id : E) return R is
2058 pragma Assert (Is_Fixed_Point_Type (Id));
2059 return Ureal21 (Id);
2062 function Spec_Entity (Id : E) return E is
2065 (Ekind (Id) = E_Package_Body or else Is_Formal (Id));
2069 function Storage_Size_Variable (Id : E) return E is
2071 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
2072 return Node15 (Implementation_Base_Type (Id));
2073 end Storage_Size_Variable;
2075 function Stored_Constraint (Id : E) return L is
2078 (Is_Composite_Type (Id) and then not Is_Array_Type (Id));
2079 return Elist23 (Id);
2080 end Stored_Constraint;
2082 function Strict_Alignment (Id : E) return B is
2084 return Flag145 (Implementation_Base_Type (Id));
2085 end Strict_Alignment;
2087 function String_Literal_Length (Id : E) return U is
2090 end String_Literal_Length;
2092 function String_Literal_Low_Bound (Id : E) return N is
2095 end String_Literal_Low_Bound;
2097 function Suppress_Elaboration_Warnings (Id : E) return B is
2099 return Flag148 (Id);
2100 end Suppress_Elaboration_Warnings;
2102 function Suppress_Init_Proc (Id : E) return B is
2104 return Flag105 (Base_Type (Id));
2105 end Suppress_Init_Proc;
2107 function Suppress_Style_Checks (Id : E) return B is
2109 return Flag165 (Id);
2110 end Suppress_Style_Checks;
2112 function Treat_As_Volatile (Id : E) return B is
2115 end Treat_As_Volatile;
2117 function Underlying_Full_View (Id : E) return E is
2119 pragma Assert (Ekind (Id) in Private_Kind);
2121 end Underlying_Full_View;
2123 function Unset_Reference (Id : E) return N is
2126 end Unset_Reference;
2128 function Uses_Sec_Stack (Id : E) return B is
2133 function Vax_Float (Id : E) return B is
2135 return Flag151 (Base_Type (Id));
2138 function Warnings_Off (Id : E) return B is
2143 ------------------------------
2144 -- Classification Functions --
2145 ------------------------------
2147 function Is_Access_Type (Id : E) return B is
2149 return Ekind (Id) in Access_Kind;
2152 function Is_Array_Type (Id : E) return B is
2154 return Ekind (Id) in Array_Kind;
2157 function Is_Class_Wide_Type (Id : E) return B is
2159 return Ekind (Id) in Class_Wide_Kind;
2160 end Is_Class_Wide_Type;
2162 function Is_Composite_Type (Id : E) return B is
2164 return Ekind (Id) in Composite_Kind;
2165 end Is_Composite_Type;
2167 function Is_Concurrent_Body (Id : E) return B is
2169 return Ekind (Id) in
2170 Concurrent_Body_Kind;
2171 end Is_Concurrent_Body;
2173 function Is_Concurrent_Record_Type (Id : E) return B is
2176 end Is_Concurrent_Record_Type;
2178 function Is_Concurrent_Type (Id : E) return B is
2180 return Ekind (Id) in Concurrent_Kind;
2181 end Is_Concurrent_Type;
2183 function Is_Decimal_Fixed_Point_Type (Id : E) return B is
2185 return Ekind (Id) in
2186 Decimal_Fixed_Point_Kind;
2187 end Is_Decimal_Fixed_Point_Type;
2189 function Is_Digits_Type (Id : E) return B is
2191 return Ekind (Id) in Digits_Kind;
2194 function Is_Discrete_Or_Fixed_Point_Type (Id : E) return B is
2196 return Ekind (Id) in Discrete_Or_Fixed_Point_Kind;
2197 end Is_Discrete_Or_Fixed_Point_Type;
2199 function Is_Discrete_Type (Id : E) return B is
2201 return Ekind (Id) in Discrete_Kind;
2202 end Is_Discrete_Type;
2204 function Is_Elementary_Type (Id : E) return B is
2206 return Ekind (Id) in Elementary_Kind;
2207 end Is_Elementary_Type;
2209 function Is_Entry (Id : E) return B is
2211 return Ekind (Id) in Entry_Kind;
2214 function Is_Enumeration_Type (Id : E) return B is
2216 return Ekind (Id) in
2218 end Is_Enumeration_Type;
2220 function Is_Fixed_Point_Type (Id : E) return B is
2222 return Ekind (Id) in
2224 end Is_Fixed_Point_Type;
2226 function Is_Floating_Point_Type (Id : E) return B is
2228 return Ekind (Id) in Float_Kind;
2229 end Is_Floating_Point_Type;
2231 function Is_Formal (Id : E) return B is
2233 return Ekind (Id) in Formal_Kind;
2236 function Is_Generic_Subprogram (Id : E) return B is
2238 return Ekind (Id) in Generic_Subprogram_Kind;
2239 end Is_Generic_Subprogram;
2241 function Is_Generic_Unit (Id : E) return B is
2243 return Ekind (Id) in Generic_Unit_Kind;
2244 end Is_Generic_Unit;
2246 function Is_Incomplete_Or_Private_Type (Id : E) return B is
2248 return Ekind (Id) in
2249 Incomplete_Or_Private_Kind;
2250 end Is_Incomplete_Or_Private_Type;
2252 function Is_Integer_Type (Id : E) return B is
2254 return Ekind (Id) in Integer_Kind;
2255 end Is_Integer_Type;
2257 function Is_Modular_Integer_Type (Id : E) return B is
2259 return Ekind (Id) in
2260 Modular_Integer_Kind;
2261 end Is_Modular_Integer_Type;
2263 function Is_Named_Number (Id : E) return B is
2265 return Ekind (Id) in Named_Kind;
2266 end Is_Named_Number;
2268 function Is_Numeric_Type (Id : E) return B is
2270 return Ekind (Id) in Numeric_Kind;
2271 end Is_Numeric_Type;
2273 function Is_Object (Id : E) return B is
2275 return Ekind (Id) in Object_Kind;
2278 function Is_Ordinary_Fixed_Point_Type (Id : E) return B is
2280 return Ekind (Id) in
2281 Ordinary_Fixed_Point_Kind;
2282 end Is_Ordinary_Fixed_Point_Type;
2284 function Is_Overloadable (Id : E) return B is
2286 return Ekind (Id) in Overloadable_Kind;
2287 end Is_Overloadable;
2289 function Is_Private_Type (Id : E) return B is
2291 return Ekind (Id) in Private_Kind;
2292 end Is_Private_Type;
2294 function Is_Protected_Type (Id : E) return B is
2296 return Ekind (Id) in Protected_Kind;
2297 end Is_Protected_Type;
2299 function Is_Real_Type (Id : E) return B is
2301 return Ekind (Id) in Real_Kind;
2304 function Is_Record_Type (Id : E) return B is
2306 return Ekind (Id) in Record_Kind;
2309 function Is_Scalar_Type (Id : E) return B is
2311 return Ekind (Id) in Scalar_Kind;
2314 function Is_Signed_Integer_Type (Id : E) return B is
2316 return Ekind (Id) in
2317 Signed_Integer_Kind;
2318 end Is_Signed_Integer_Type;
2320 function Is_Subprogram (Id : E) return B is
2322 return Ekind (Id) in Subprogram_Kind;
2325 function Is_Task_Type (Id : E) return B is
2327 return Ekind (Id) in Task_Kind;
2330 function Is_Type (Id : E) return B is
2332 return Ekind (Id) in Type_Kind;
2335 ------------------------------
2336 -- Attribute Set Procedures --
2337 ------------------------------
2339 procedure Set_Accept_Address (Id : E; V : L) is
2341 Set_Elist21 (Id, V);
2342 end Set_Accept_Address;
2344 procedure Set_Access_Disp_Table (Id : E; V : E) is
2346 pragma Assert (Is_Tagged_Type (Id) and then Id = Base_Type (Id));
2348 end Set_Access_Disp_Table;
2350 procedure Set_Associated_Final_Chain (Id : E; V : E) is
2352 pragma Assert (Is_Access_Type (Id));
2354 end Set_Associated_Final_Chain;
2356 procedure Set_Associated_Formal_Package (Id : E; V : E) is
2359 end Set_Associated_Formal_Package;
2361 procedure Set_Associated_Node_For_Itype (Id : E; V : E) is
2364 end Set_Associated_Node_For_Itype;
2366 procedure Set_Associated_Storage_Pool (Id : E; V : E) is
2368 pragma Assert (Is_Access_Type (Id) and then Id = Base_Type (Id));
2370 end Set_Associated_Storage_Pool;
2372 procedure Set_Actual_Subtype (Id : E; V : E) is
2375 (Ekind (Id) = E_Constant
2376 or else Ekind (Id) = E_Variable
2377 or else Ekind (Id) = E_Generic_In_Out_Parameter
2378 or else Ekind (Id) in E_In_Parameter .. E_In_Out_Parameter);
2380 end Set_Actual_Subtype;
2382 procedure Set_Address_Taken (Id : E; V : B := True) is
2384 Set_Flag104 (Id, V);
2385 end Set_Address_Taken;
2387 procedure Set_Alias (Id : E; V : E) is
2390 (Is_Overloadable (Id) or else Ekind (Id) = E_Subprogram_Type);
2394 procedure Set_Alignment (Id : E; V : U) is
2396 pragma Assert (Is_Type (Id)
2397 or else Is_Formal (Id)
2398 or else Ekind (Id) = E_Loop_Parameter
2399 or else Ekind (Id) = E_Constant
2400 or else Ekind (Id) = E_Exception
2401 or else Ekind (Id) = E_Variable);
2405 procedure Set_Barrier_Function (Id : E; V : N) is
2407 pragma Assert (Is_Entry (Id));
2409 end Set_Barrier_Function;
2411 procedure Set_Block_Node (Id : E; V : N) is
2413 pragma Assert (Ekind (Id) = E_Block);
2417 procedure Set_Body_Entity (Id : E; V : E) is
2420 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
2422 end Set_Body_Entity;
2424 procedure Set_Body_Needed_For_SAL (Id : E; V : B := True) is
2427 (Ekind (Id) = E_Package
2428 or else Is_Subprogram (Id)
2429 or else Is_Generic_Unit (Id));
2431 end Set_Body_Needed_For_SAL;
2433 procedure Set_C_Pass_By_Copy (Id : E; V : B := True) is
2435 pragma Assert (Is_Record_Type (Id) and then Id = Base_Type (Id));
2436 Set_Flag125 (Id, V);
2437 end Set_C_Pass_By_Copy;
2439 procedure Set_Can_Never_Be_Null (Id : E; V : B := True) is
2442 end Set_Can_Never_Be_Null;
2444 procedure Set_Checks_May_Be_Suppressed (Id : E; V : B := True) is
2447 end Set_Checks_May_Be_Suppressed;
2449 procedure Set_Class_Wide_Type (Id : E; V : E) is
2451 pragma Assert (Is_Type (Id));
2453 end Set_Class_Wide_Type;
2455 procedure Set_Cloned_Subtype (Id : E; V : E) is
2458 (Ekind (Id) = E_Record_Subtype
2459 or else Ekind (Id) = E_Class_Wide_Subtype);
2461 end Set_Cloned_Subtype;
2463 procedure Set_Component_Bit_Offset (Id : E; V : U) is
2466 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
2468 end Set_Component_Bit_Offset;
2470 procedure Set_Component_Clause (Id : E; V : N) is
2473 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
2475 end Set_Component_Clause;
2477 procedure Set_Component_Size (Id : E; V : U) is
2479 pragma Assert (Is_Array_Type (Id) and then Id = Base_Type (Id));
2481 end Set_Component_Size;
2483 procedure Set_Component_Type (Id : E; V : E) is
2485 pragma Assert (Is_Array_Type (Id) and then Id = Base_Type (Id));
2487 end Set_Component_Type;
2489 procedure Set_Corresponding_Concurrent_Type (Id : E; V : E) is
2492 (Ekind (Id) = E_Record_Type and then Is_Concurrent_Type (V));
2494 end Set_Corresponding_Concurrent_Type;
2496 procedure Set_Corresponding_Discriminant (Id : E; V : E) is
2498 pragma Assert (Ekind (Id) = E_Discriminant);
2500 end Set_Corresponding_Discriminant;
2502 procedure Set_Corresponding_Equality (Id : E; V : E) is
2505 (Ekind (Id) = E_Function
2506 and then not Comes_From_Source (Id)
2507 and then Chars (Id) = Name_Op_Ne);
2509 end Set_Corresponding_Equality;
2511 procedure Set_Corresponding_Record_Type (Id : E; V : E) is
2513 pragma Assert (Is_Concurrent_Type (Id));
2515 end Set_Corresponding_Record_Type;
2517 procedure Set_Corresponding_Remote_Type (Id : E; V : E) is
2520 end Set_Corresponding_Remote_Type;
2522 procedure Set_Current_Value (Id : E; V : E) is
2524 pragma Assert (Ekind (Id) in Object_Kind or else Ekind (Id) = E_Void);
2526 end Set_Current_Value;
2528 procedure Set_CR_Discriminant (Id : E; V : E) is
2531 end Set_CR_Discriminant;
2533 procedure Set_Debug_Info_Off (Id : E; V : B := True) is
2535 Set_Flag166 (Id, V);
2536 end Set_Debug_Info_Off;
2538 procedure Set_Debug_Renaming_Link (Id : E; V : E) is
2541 end Set_Debug_Renaming_Link;
2543 procedure Set_Default_Expr_Function (Id : E; V : E) is
2545 pragma Assert (Is_Formal (Id));
2547 end Set_Default_Expr_Function;
2549 procedure Set_Default_Expressions_Processed (Id : E; V : B := True) is
2551 Set_Flag108 (Id, V);
2552 end Set_Default_Expressions_Processed;
2554 procedure Set_Default_Value (Id : E; V : N) is
2556 pragma Assert (Is_Formal (Id));
2558 end Set_Default_Value;
2560 procedure Set_Delay_Cleanups (Id : E; V : B := True) is
2564 or else Is_Task_Type (Id)
2565 or else Ekind (Id) = E_Block);
2566 Set_Flag114 (Id, V);
2567 end Set_Delay_Cleanups;
2569 procedure Set_Delay_Subprogram_Descriptors (Id : E; V : B := True) is
2573 or else Ekind (Id) = E_Package
2574 or else Ekind (Id) = E_Package_Body);
2576 end Set_Delay_Subprogram_Descriptors;
2578 procedure Set_Delta_Value (Id : E; V : R) is
2580 pragma Assert (Is_Fixed_Point_Type (Id));
2581 Set_Ureal18 (Id, V);
2582 end Set_Delta_Value;
2584 procedure Set_Dependent_Instances (Id : E; V : L) is
2586 pragma Assert (Is_Generic_Instance (Id));
2588 end Set_Dependent_Instances;
2590 procedure Set_Depends_On_Private (Id : E; V : B := True) is
2592 pragma Assert (Nkind (Id) in N_Entity);
2594 end Set_Depends_On_Private;
2596 procedure Set_Digits_Value (Id : E; V : U) is
2599 (Is_Floating_Point_Type (Id)
2600 or else Is_Decimal_Fixed_Point_Type (Id));
2602 end Set_Digits_Value;
2604 procedure Set_Directly_Designated_Type (Id : E; V : E) is
2607 end Set_Directly_Designated_Type;
2609 procedure Set_Discard_Names (Id : E; V : B := True) is
2612 end Set_Discard_Names;
2614 procedure Set_Discriminal (Id : E; V : E) is
2616 pragma Assert (Ekind (Id) = E_Discriminant);
2618 end Set_Discriminal;
2620 procedure Set_Discriminal_Link (Id : E; V : E) is
2623 end Set_Discriminal_Link;
2625 procedure Set_Discriminant_Checking_Func (Id : E; V : E) is
2627 pragma Assert (Ekind (Id) = E_Component);
2629 end Set_Discriminant_Checking_Func;
2631 procedure Set_Discriminant_Constraint (Id : E; V : L) is
2633 pragma Assert (Nkind (Id) in N_Entity);
2634 Set_Elist21 (Id, V);
2635 end Set_Discriminant_Constraint;
2637 procedure Set_Discriminant_Default_Value (Id : E; V : N) is
2640 end Set_Discriminant_Default_Value;
2642 procedure Set_Discriminant_Number (Id : E; V : U) is
2645 end Set_Discriminant_Number;
2647 procedure Set_DT_Entry_Count (Id : E; V : U) is
2649 pragma Assert (Ekind (Id) = E_Component);
2651 end Set_DT_Entry_Count;
2653 procedure Set_DT_Position (Id : E; V : U) is
2655 pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2657 end Set_DT_Position;
2659 procedure Set_DTC_Entity (Id : E; V : E) is
2662 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2666 procedure Set_Elaborate_All_Desirable (Id : E; V : B := True) is
2668 Set_Flag146 (Id, V);
2669 end Set_Elaborate_All_Desirable;
2671 procedure Set_Elaboration_Entity (Id : E; V : E) is
2676 Ekind (Id) = E_Package
2678 Is_Generic_Unit (Id));
2680 end Set_Elaboration_Entity;
2682 procedure Set_Elaboration_Entity_Required (Id : E; V : B := True) is
2687 Ekind (Id) = E_Package
2689 Is_Generic_Unit (Id));
2690 Set_Flag174 (Id, V);
2691 end Set_Elaboration_Entity_Required;
2693 procedure Set_Enclosing_Scope (Id : E; V : E) is
2696 end Set_Enclosing_Scope;
2698 procedure Set_Entry_Accepted (Id : E; V : B := True) is
2700 pragma Assert (Is_Entry (Id));
2701 Set_Flag152 (Id, V);
2702 end Set_Entry_Accepted;
2704 procedure Set_Entry_Bodies_Array (Id : E; V : E) is
2707 end Set_Entry_Bodies_Array;
2709 procedure Set_Entry_Cancel_Parameter (Id : E; V : E) is
2712 end Set_Entry_Cancel_Parameter;
2714 procedure Set_Entry_Component (Id : E; V : E) is
2717 end Set_Entry_Component;
2719 procedure Set_Entry_Formal (Id : E; V : E) is
2722 end Set_Entry_Formal;
2724 procedure Set_Entry_Index_Constant (Id : E; V : E) is
2726 pragma Assert (Ekind (Id) = E_Entry_Index_Parameter);
2728 end Set_Entry_Index_Constant;
2730 procedure Set_Entry_Parameters_Type (Id : E; V : E) is
2733 end Set_Entry_Parameters_Type;
2735 procedure Set_Enum_Pos_To_Rep (Id : E; V : E) is
2737 pragma Assert (Ekind (Id) = E_Enumeration_Type);
2739 end Set_Enum_Pos_To_Rep;
2741 procedure Set_Enumeration_Pos (Id : E; V : U) is
2743 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2745 end Set_Enumeration_Pos;
2747 procedure Set_Enumeration_Rep (Id : E; V : U) is
2749 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2751 end Set_Enumeration_Rep;
2753 procedure Set_Enumeration_Rep_Expr (Id : E; V : N) is
2755 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2757 end Set_Enumeration_Rep_Expr;
2759 procedure Set_Equivalent_Type (Id : E; V : E) is
2762 (Ekind (Id) = E_Class_Wide_Type or else
2763 Ekind (Id) = E_Class_Wide_Subtype or else
2764 Ekind (Id) = E_Access_Protected_Subprogram_Type or else
2765 Ekind (Id) = E_Access_Subprogram_Type or else
2766 Ekind (Id) = E_Exception_Type);
2768 end Set_Equivalent_Type;
2770 procedure Set_Esize (Id : E; V : U) is
2775 procedure Set_Exception_Code (Id : E; V : U) is
2777 pragma Assert (Ekind (Id) = E_Exception);
2779 end Set_Exception_Code;
2781 procedure Set_Extra_Accessibility (Id : E; V : E) is
2783 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
2785 end Set_Extra_Accessibility;
2787 procedure Set_Extra_Constrained (Id : E; V : E) is
2789 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
2791 end Set_Extra_Constrained;
2793 procedure Set_Extra_Formal (Id : E; V : E) is
2796 end Set_Extra_Formal;
2798 procedure Set_Finalization_Chain_Entity (Id : E; V : E) is
2801 end Set_Finalization_Chain_Entity;
2803 procedure Set_Finalize_Storage_Only (Id : E; V : B := True) is
2805 pragma Assert (Is_Type (Id) and then Id = Base_Type (Id));
2806 Set_Flag158 (Id, V);
2807 end Set_Finalize_Storage_Only;
2809 procedure Set_First_Entity (Id : E; V : E) is
2812 end Set_First_Entity;
2814 procedure Set_First_Index (Id : E; V : N) is
2817 end Set_First_Index;
2819 procedure Set_First_Literal (Id : E; V : E) is
2822 end Set_First_Literal;
2824 procedure Set_First_Optional_Parameter (Id : E; V : E) is
2827 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2829 end Set_First_Optional_Parameter;
2831 procedure Set_First_Private_Entity (Id : E; V : E) is
2833 pragma Assert (Nkind (Id) in N_Entity);
2835 end Set_First_Private_Entity;
2837 procedure Set_First_Rep_Item (Id : E; V : N) is
2840 end Set_First_Rep_Item;
2842 procedure Set_Freeze_Node (Id : E; V : N) is
2845 end Set_Freeze_Node;
2847 procedure Set_From_With_Type (Id : E; V : B := True) is
2851 or else Ekind (Id) = E_Package);
2852 Set_Flag159 (Id, V);
2853 end Set_From_With_Type;
2855 procedure Set_Full_View (Id : E; V : E) is
2857 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Constant);
2861 procedure Set_Function_Returns_With_DSP (Id : E; V : B := True) is
2864 (Is_Subprogram (Id) or else Ekind (Id) = E_Subprogram_Type);
2865 Set_Flag169 (Id, V);
2866 end Set_Function_Returns_With_DSP;
2868 procedure Set_Generic_Homonym (Id : E; V : E) is
2871 end Set_Generic_Homonym;
2873 procedure Set_Generic_Renamings (Id : E; V : L) is
2875 Set_Elist23 (Id, V);
2876 end Set_Generic_Renamings;
2878 procedure Set_Handler_Records (Id : E; V : S) is
2881 end Set_Handler_Records;
2883 procedure Set_Has_Aliased_Components (Id : E; V : B := True) is
2885 pragma Assert (Base_Type (Id) = Id);
2886 Set_Flag135 (Id, V);
2887 end Set_Has_Aliased_Components;
2889 procedure Set_Has_Alignment_Clause (Id : E; V : B := True) is
2892 end Set_Has_Alignment_Clause;
2894 procedure Set_Has_All_Calls_Remote (Id : E; V : B := True) is
2897 end Set_Has_All_Calls_Remote;
2899 procedure Set_Has_Atomic_Components (Id : E; V : B := True) is
2901 pragma Assert (not Is_Type (Id) or else Base_Type (Id) = Id);
2903 end Set_Has_Atomic_Components;
2905 procedure Set_Has_Biased_Representation (Id : E; V : B := True) is
2908 ((V = False) or else (Is_Discrete_Type (Id) or Is_Object (Id)));
2909 Set_Flag139 (Id, V);
2910 end Set_Has_Biased_Representation;
2912 procedure Set_Has_Completion (Id : E; V : B := True) is
2915 end Set_Has_Completion;
2917 procedure Set_Has_Completion_In_Body (Id : E; V : B := True) is
2919 pragma Assert (Ekind (Id) = E_Incomplete_Type);
2921 end Set_Has_Completion_In_Body;
2923 procedure Set_Has_Complex_Representation (Id : E; V : B := True) is
2925 pragma Assert (Ekind (Id) = E_Record_Type);
2926 Set_Flag140 (Id, V);
2927 end Set_Has_Complex_Representation;
2929 procedure Set_Has_Component_Size_Clause (Id : E; V : B := True) is
2931 pragma Assert (Ekind (Id) = E_Array_Type);
2933 end Set_Has_Component_Size_Clause;
2935 procedure Set_Has_Contiguous_Rep (Id : E; V : B := True) is
2937 Set_Flag181 (Id, V);
2938 end Set_Has_Contiguous_Rep;
2940 procedure Set_Has_Controlled_Component (Id : E; V : B := True) is
2942 pragma Assert (Base_Type (Id) = Id);
2944 end Set_Has_Controlled_Component;
2946 procedure Set_Has_Controlling_Result (Id : E; V : B := True) is
2949 end Set_Has_Controlling_Result;
2951 procedure Set_Has_Convention_Pragma (Id : E; V : B := True) is
2953 Set_Flag119 (Id, V);
2954 end Set_Has_Convention_Pragma;
2956 procedure Set_Has_Delayed_Freeze (Id : E; V : B := True) is
2958 pragma Assert (Nkind (Id) in N_Entity);
2960 end Set_Has_Delayed_Freeze;
2962 procedure Set_Has_Discriminants (Id : E; V : B := True) is
2964 pragma Assert (Nkind (Id) in N_Entity);
2966 end Set_Has_Discriminants;
2968 procedure Set_Has_Enumeration_Rep_Clause (Id : E; V : B := True) is
2970 pragma Assert (Is_Enumeration_Type (Id));
2972 end Set_Has_Enumeration_Rep_Clause;
2974 procedure Set_Has_Exit (Id : E; V : B := True) is
2979 procedure Set_Has_External_Tag_Rep_Clause (Id : E; V : B := True) is
2981 pragma Assert (Is_Tagged_Type (Id));
2982 Set_Flag110 (Id, V);
2983 end Set_Has_External_Tag_Rep_Clause;
2985 procedure Set_Has_Forward_Instantiation (Id : E; V : B := True) is
2987 Set_Flag175 (Id, V);
2988 end Set_Has_Forward_Instantiation;
2990 procedure Set_Has_Fully_Qualified_Name (Id : E; V : B := True) is
2992 Set_Flag173 (Id, V);
2993 end Set_Has_Fully_Qualified_Name;
2995 procedure Set_Has_Gigi_Rep_Item (Id : E; V : B := True) is
2998 end Set_Has_Gigi_Rep_Item;
3000 procedure Set_Has_Homonym (Id : E; V : B := True) is
3003 end Set_Has_Homonym;
3005 procedure Set_Has_Machine_Radix_Clause (Id : E; V : B := True) is
3007 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
3009 end Set_Has_Machine_Radix_Clause;
3011 procedure Set_Has_Master_Entity (Id : E; V : B := True) is
3014 end Set_Has_Master_Entity;
3016 procedure Set_Has_Missing_Return (Id : E; V : B := True) is
3019 (Ekind (Id) = E_Function or else Ekind (Id) = E_Generic_Function);
3020 Set_Flag142 (Id, V);
3021 end Set_Has_Missing_Return;
3023 procedure Set_Has_Nested_Block_With_Handler (Id : E; V : B := True) is
3025 Set_Flag101 (Id, V);
3026 end Set_Has_Nested_Block_With_Handler;
3028 procedure Set_Has_Non_Standard_Rep (Id : E; V : B := True) is
3030 pragma Assert (Base_Type (Id) = Id);
3032 end Set_Has_Non_Standard_Rep;
3034 procedure Set_Has_Object_Size_Clause (Id : E; V : B := True) is
3036 pragma Assert (Is_Type (Id));
3037 Set_Flag172 (Id, V);
3038 end Set_Has_Object_Size_Clause;
3040 procedure Set_Has_Per_Object_Constraint (Id : E; V : B := True) is
3042 Set_Flag154 (Id, V);
3043 end Set_Has_Per_Object_Constraint;
3045 procedure Set_Has_Pragma_Controlled (Id : E; V : B := True) is
3047 pragma Assert (Is_Access_Type (Id));
3048 Set_Flag27 (Base_Type (Id), V);
3049 end Set_Has_Pragma_Controlled;
3051 procedure Set_Has_Pragma_Elaborate_Body (Id : E; V : B := True) is
3053 Set_Flag150 (Id, V);
3054 end Set_Has_Pragma_Elaborate_Body;
3056 procedure Set_Has_Pragma_Inline (Id : E; V : B := True) is
3058 Set_Flag157 (Id, V);
3059 end Set_Has_Pragma_Inline;
3061 procedure Set_Has_Pragma_Pack (Id : E; V : B := True) is
3063 pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id));
3064 pragma Assert (Id = Base_Type (Id));
3065 Set_Flag121 (Id, V);
3066 end Set_Has_Pragma_Pack;
3068 procedure Set_Has_Pragma_Pure_Function (Id : E; V : B := True) is
3070 pragma Assert (Is_Subprogram (Id));
3071 Set_Flag179 (Id, V);
3072 end Set_Has_Pragma_Pure_Function;
3074 procedure Set_Has_Pragma_Unreferenced (Id : E; V : B := True) is
3076 Set_Flag180 (Id, V);
3077 end Set_Has_Pragma_Unreferenced;
3079 procedure Set_Has_Primitive_Operations (Id : E; V : B := True) is
3081 pragma Assert (Id = Base_Type (Id));
3082 Set_Flag120 (Id, V);
3083 end Set_Has_Primitive_Operations;
3085 procedure Set_Has_Private_Declaration (Id : E; V : B := True) is
3087 Set_Flag155 (Id, V);
3088 end Set_Has_Private_Declaration;
3090 procedure Set_Has_Qualified_Name (Id : E; V : B := True) is
3092 Set_Flag161 (Id, V);
3093 end Set_Has_Qualified_Name;
3095 procedure Set_Has_Record_Rep_Clause (Id : E; V : B := True) is
3097 pragma Assert (Id = Base_Type (Id));
3099 end Set_Has_Record_Rep_Clause;
3101 procedure Set_Has_Recursive_Call (Id : E; V : B := True) is
3103 pragma Assert (Is_Subprogram (Id));
3104 Set_Flag143 (Id, V);
3105 end Set_Has_Recursive_Call;
3107 procedure Set_Has_Size_Clause (Id : E; V : B := True) is
3110 end Set_Has_Size_Clause;
3112 procedure Set_Has_Small_Clause (Id : E; V : B := True) is
3115 end Set_Has_Small_Clause;
3117 procedure Set_Has_Specified_Layout (Id : E; V : B := True) is
3119 pragma Assert (Id = Base_Type (Id));
3120 Set_Flag100 (Id, V);
3121 end Set_Has_Specified_Layout;
3123 procedure Set_Has_Storage_Size_Clause (Id : E; V : B := True) is
3125 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
3126 pragma Assert (Base_Type (Id) = Id);
3128 end Set_Has_Storage_Size_Clause;
3130 procedure Set_Has_Subprogram_Descriptor (Id : E; V : B := True) is
3133 end Set_Has_Subprogram_Descriptor;
3135 procedure Set_Has_Task (Id : E; V : B := True) is
3137 pragma Assert (Base_Type (Id) = Id);
3141 procedure Set_Has_Unchecked_Union (Id : E; V : B := True) is
3143 pragma Assert (Base_Type (Id) = Id);
3144 Set_Flag123 (Id, V);
3145 end Set_Has_Unchecked_Union;
3147 procedure Set_Has_Unknown_Discriminants (Id : E; V : B := True) is
3149 pragma Assert (Is_Type (Id));
3151 end Set_Has_Unknown_Discriminants;
3153 procedure Set_Has_Volatile_Components (Id : E; V : B := True) is
3155 pragma Assert (not Is_Type (Id) or else Base_Type (Id) = Id);
3157 end Set_Has_Volatile_Components;
3159 procedure Set_Has_Xref_Entry (Id : E; V : B := True) is
3161 Set_Flag182 (Id, V);
3162 end Set_Has_Xref_Entry;
3164 procedure Set_Hiding_Loop_Variable (Id : E; V : E) is
3166 pragma Assert (Ekind (Id) = E_Variable);
3168 end Set_Hiding_Loop_Variable;
3170 procedure Set_Homonym (Id : E; V : E) is
3172 pragma Assert (Id /= V);
3176 procedure Set_In_Package_Body (Id : E; V : B := True) is
3179 end Set_In_Package_Body;
3181 procedure Set_In_Private_Part (Id : E; V : B := True) is
3184 end Set_In_Private_Part;
3186 procedure Set_In_Use (Id : E; V : B := True) is
3188 pragma Assert (Nkind (Id) in N_Entity);
3192 procedure Set_Inner_Instances (Id : E; V : L) is
3194 Set_Elist23 (Id, V);
3195 end Set_Inner_Instances;
3197 procedure Set_Interface_Name (Id : E; V : N) is
3200 end Set_Interface_Name;
3202 procedure Set_Is_Abstract (Id : E; V : B := True) is
3205 end Set_Is_Abstract;
3207 procedure Set_Is_Access_Constant (Id : E; V : B := True) is
3209 pragma Assert (Is_Access_Type (Id));
3211 end Set_Is_Access_Constant;
3213 procedure Set_Is_Aliased (Id : E; V : B := True) is
3215 pragma Assert (Nkind (Id) in N_Entity);
3219 procedure Set_Is_AST_Entry (Id : E; V : B := True) is
3221 pragma Assert (Is_Entry (Id));
3222 Set_Flag132 (Id, V);
3223 end Set_Is_AST_Entry;
3225 procedure Set_Is_Asynchronous (Id : E; V : B := True) is
3228 (Ekind (Id) = E_Procedure or else Is_Type (Id));
3230 end Set_Is_Asynchronous;
3232 procedure Set_Is_Atomic (Id : E; V : B := True) is
3237 procedure Set_Is_Bit_Packed_Array (Id : E; V : B := True) is
3239 pragma Assert ((not V)
3240 or else (Is_Array_Type (Id) and then Id = Base_Type (Id)));
3242 Set_Flag122 (Id, V);
3243 end Set_Is_Bit_Packed_Array;
3245 procedure Set_Is_Called (Id : E; V : B := True) is
3248 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Function);
3249 Set_Flag102 (Id, V);
3252 procedure Set_Is_Character_Type (Id : E; V : B := True) is
3255 end Set_Is_Character_Type;
3257 procedure Set_Is_Child_Unit (Id : E; V : B := True) is
3260 end Set_Is_Child_Unit;
3262 procedure Set_Is_Class_Wide_Equivalent_Type (Id : E; V : B := True) is
3265 end Set_Is_Class_Wide_Equivalent_Type;
3267 procedure Set_Is_Compilation_Unit (Id : E; V : B := True) is
3269 Set_Flag149 (Id, V);
3270 end Set_Is_Compilation_Unit;
3272 procedure Set_Is_Completely_Hidden (Id : E; V : B := True) is
3274 pragma Assert (Ekind (Id) = E_Discriminant);
3275 Set_Flag103 (Id, V);
3276 end Set_Is_Completely_Hidden;
3278 procedure Set_Is_Concurrent_Record_Type (Id : E; V : B := True) is
3281 end Set_Is_Concurrent_Record_Type;
3283 procedure Set_Is_Constr_Subt_For_U_Nominal (Id : E; V : B := True) is
3286 end Set_Is_Constr_Subt_For_U_Nominal;
3288 procedure Set_Is_Constr_Subt_For_UN_Aliased (Id : E; V : B := True) is
3290 Set_Flag141 (Id, V);
3291 end Set_Is_Constr_Subt_For_UN_Aliased;
3293 procedure Set_Is_Constrained (Id : E; V : B := True) is
3295 pragma Assert (Nkind (Id) in N_Entity);
3297 end Set_Is_Constrained;
3299 procedure Set_Is_Constructor (Id : E; V : B := True) is
3302 end Set_Is_Constructor;
3304 procedure Set_Is_Controlled (Id : E; V : B := True) is
3306 pragma Assert (Id = Base_Type (Id));
3308 end Set_Is_Controlled;
3310 procedure Set_Is_Controlling_Formal (Id : E; V : B := True) is
3312 pragma Assert (Is_Formal (Id));
3314 end Set_Is_Controlling_Formal;
3316 procedure Set_Is_CPP_Class (Id : E; V : B := True) is
3319 end Set_Is_CPP_Class;
3321 procedure Set_Is_Discrim_SO_Function (Id : E; V : B := True) is
3323 Set_Flag176 (Id, V);
3324 end Set_Is_Discrim_SO_Function;
3326 procedure Set_Is_Dispatching_Operation (Id : E; V : B := True) is
3331 Is_Overloadable (Id)
3333 Ekind (Id) = E_Subprogram_Type);
3336 end Set_Is_Dispatching_Operation;
3338 procedure Set_Is_Eliminated (Id : E; V : B := True) is
3340 Set_Flag124 (Id, V);
3341 end Set_Is_Eliminated;
3343 procedure Set_Is_Entry_Formal (Id : E; V : B := True) is
3346 end Set_Is_Entry_Formal;
3348 procedure Set_Is_Exported (Id : E; V : B := True) is
3351 end Set_Is_Exported;
3353 procedure Set_Is_First_Subtype (Id : E; V : B := True) is
3356 end Set_Is_First_Subtype;
3358 procedure Set_Is_For_Access_Subtype (Id : E; V : B := True) is
3361 (Ekind (Id) = E_Record_Subtype
3363 Ekind (Id) = E_Private_Subtype);
3364 Set_Flag118 (Id, V);
3365 end Set_Is_For_Access_Subtype;
3367 procedure Set_Is_Formal_Subprogram (Id : E; V : B := True) is
3369 Set_Flag111 (Id, V);
3370 end Set_Is_Formal_Subprogram;
3372 procedure Set_Is_Frozen (Id : E; V : B := True) is
3374 pragma Assert (Nkind (Id) in N_Entity);
3378 procedure Set_Is_Generic_Actual_Type (Id : E; V : B := True) is
3380 pragma Assert (Is_Type (Id));
3382 end Set_Is_Generic_Actual_Type;
3384 procedure Set_Is_Generic_Instance (Id : E; V : B := True) is
3386 Set_Flag130 (Id, V);
3387 end Set_Is_Generic_Instance;
3389 procedure Set_Is_Generic_Type (Id : E; V : B := True) is
3391 pragma Assert (Nkind (Id) in N_Entity);
3393 end Set_Is_Generic_Type;
3395 procedure Set_Is_Hidden (Id : E; V : B := True) is
3400 procedure Set_Is_Hidden_Open_Scope (Id : E; V : B := True) is
3402 Set_Flag171 (Id, V);
3403 end Set_Is_Hidden_Open_Scope;
3405 procedure Set_Is_Immediately_Visible (Id : E; V : B := True) is
3407 pragma Assert (Nkind (Id) in N_Entity);
3409 end Set_Is_Immediately_Visible;
3411 procedure Set_Is_Imported (Id : E; V : B := True) is
3414 end Set_Is_Imported;
3416 procedure Set_Is_Inlined (Id : E; V : B := True) is
3421 procedure Set_Is_Instantiated (Id : E; V : B := True) is
3423 Set_Flag126 (Id, V);
3424 end Set_Is_Instantiated;
3426 procedure Set_Is_Internal (Id : E; V : B := True) is
3428 pragma Assert (Nkind (Id) in N_Entity);
3430 end Set_Is_Internal;
3432 procedure Set_Is_Interrupt_Handler (Id : E; V : B := True) is
3434 pragma Assert (Nkind (Id) in N_Entity);
3436 end Set_Is_Interrupt_Handler;
3438 procedure Set_Is_Intrinsic_Subprogram (Id : E; V : B := True) is
3441 end Set_Is_Intrinsic_Subprogram;
3443 procedure Set_Is_Itype (Id : E; V : B := True) is
3448 procedure Set_Is_Known_Non_Null (Id : E; V : B := True) is
3451 end Set_Is_Known_Non_Null;
3453 procedure Set_Is_Known_Valid (Id : E; V : B := True) is
3455 Set_Flag170 (Id, V);
3456 end Set_Is_Known_Valid;
3458 procedure Set_Is_Limited_Composite (Id : E; V : B := True) is
3460 pragma Assert (Is_Type (Id));
3461 Set_Flag106 (Id, V);
3462 end Set_Is_Limited_Composite;
3464 procedure Set_Is_Limited_Record (Id : E; V : B := True) is
3467 end Set_Is_Limited_Record;
3469 procedure Set_Is_Machine_Code_Subprogram (Id : E; V : B := True) is
3471 pragma Assert (Is_Subprogram (Id));
3472 Set_Flag137 (Id, V);
3473 end Set_Is_Machine_Code_Subprogram;
3475 procedure Set_Is_Non_Static_Subtype (Id : E; V : B := True) is
3477 pragma Assert (Is_Type (Id));
3478 Set_Flag109 (Id, V);
3479 end Set_Is_Non_Static_Subtype;
3481 procedure Set_Is_Null_Init_Proc (Id : E; V : B := True) is
3483 pragma Assert (Ekind (Id) = E_Procedure);
3484 Set_Flag178 (Id, V);
3485 end Set_Is_Null_Init_Proc;
3487 procedure Set_Is_Optional_Parameter (Id : E; V : B := True) is
3489 pragma Assert (Is_Formal (Id));
3490 Set_Flag134 (Id, V);
3491 end Set_Is_Optional_Parameter;
3493 procedure Set_Is_Overriding_Operation (Id : E; V : B := True) is
3495 pragma Assert (Is_Subprogram (Id));
3497 end Set_Is_Overriding_Operation;
3499 procedure Set_Is_Package_Body_Entity (Id : E; V : B := True) is
3501 Set_Flag160 (Id, V);
3502 end Set_Is_Package_Body_Entity;
3504 procedure Set_Is_Packed (Id : E; V : B := True) is
3506 pragma Assert (Base_Type (Id) = Id);
3510 procedure Set_Is_Packed_Array_Type (Id : E; V : B := True) is
3512 Set_Flag138 (Id, V);
3513 end Set_Is_Packed_Array_Type;
3515 procedure Set_Is_Potentially_Use_Visible (Id : E; V : B := True) is
3517 pragma Assert (Nkind (Id) in N_Entity);
3519 end Set_Is_Potentially_Use_Visible;
3521 procedure Set_Is_Preelaborated (Id : E; V : B := True) is
3524 end Set_Is_Preelaborated;
3526 procedure Set_Is_Private_Composite (Id : E; V : B := True) is
3528 pragma Assert (Is_Type (Id));
3529 Set_Flag107 (Id, V);
3530 end Set_Is_Private_Composite;
3532 procedure Set_Is_Private_Descendant (Id : E; V : B := True) is
3535 end Set_Is_Private_Descendant;
3537 procedure Set_Is_Psected (Id : E; V : B := True) is
3539 Set_Flag153 (Id, V);
3542 procedure Set_Is_Public (Id : E; V : B := True) is
3544 pragma Assert (Nkind (Id) in N_Entity);
3548 procedure Set_Is_Pure (Id : E; V : B := True) is
3553 procedure Set_Is_Remote_Call_Interface (Id : E; V : B := True) is
3556 end Set_Is_Remote_Call_Interface;
3558 procedure Set_Is_Remote_Types (Id : E; V : B := True) is
3561 end Set_Is_Remote_Types;
3563 procedure Set_Is_Renaming_Of_Object (Id : E; V : B := True) is
3565 Set_Flag112 (Id, V);
3566 end Set_Is_Renaming_Of_Object;
3568 procedure Set_Is_Shared_Passive (Id : E; V : B := True) is
3571 end Set_Is_Shared_Passive;
3573 procedure Set_Is_Statically_Allocated (Id : E; V : B := True) is
3576 (Ekind (Id) = E_Exception
3577 or else Ekind (Id) = E_Variable
3578 or else Ekind (Id) = E_Constant
3579 or else Is_Type (Id)
3580 or else Ekind (Id) = E_Void);
3582 end Set_Is_Statically_Allocated;
3584 procedure Set_Is_Tag (Id : E; V : B := True) is
3586 pragma Assert (Nkind (Id) in N_Entity);
3590 procedure Set_Is_Tagged_Type (Id : E; V : B := True) is
3593 end Set_Is_Tagged_Type;
3595 procedure Set_Is_Thread_Body (Id : E; V : B := True) is
3598 end Set_Is_Thread_Body;
3600 procedure Set_Is_True_Constant (Id : E; V : B := True) is
3602 Set_Flag163 (Id, V);
3603 end Set_Is_True_Constant;
3605 procedure Set_Is_Unchecked_Union (Id : E; V : B := True) is
3607 pragma Assert (Base_Type (Id) = Id);
3608 Set_Flag117 (Id, V);
3609 end Set_Is_Unchecked_Union;
3611 procedure Set_Is_Unsigned_Type (Id : E; V : B := True) is
3613 pragma Assert (Is_Discrete_Or_Fixed_Point_Type (Id));
3614 Set_Flag144 (Id, V);
3615 end Set_Is_Unsigned_Type;
3617 procedure Set_Is_Valued_Procedure (Id : E; V : B := True) is
3619 pragma Assert (Ekind (Id) = E_Procedure);
3620 Set_Flag127 (Id, V);
3621 end Set_Is_Valued_Procedure;
3623 procedure Set_Is_Visible_Child_Unit (Id : E; V : B := True) is
3625 pragma Assert (Is_Child_Unit (Id));
3626 Set_Flag116 (Id, V);
3627 end Set_Is_Visible_Child_Unit;
3629 procedure Set_Is_VMS_Exception (Id : E; V : B := True) is
3631 pragma Assert (Ekind (Id) = E_Exception);
3632 Set_Flag133 (Id, V);
3633 end Set_Is_VMS_Exception;
3635 procedure Set_Is_Volatile (Id : E; V : B := True) is
3637 pragma Assert (Nkind (Id) in N_Entity);
3639 end Set_Is_Volatile;
3641 procedure Set_Kill_Elaboration_Checks (Id : E; V : B := True) is
3644 end Set_Kill_Elaboration_Checks;
3646 procedure Set_Kill_Range_Checks (Id : E; V : B := True) is
3649 end Set_Kill_Range_Checks;
3651 procedure Set_Kill_Tag_Checks (Id : E; V : B := True) is
3654 end Set_Kill_Tag_Checks;
3656 procedure Set_Last_Entity (Id : E; V : E) is
3659 end Set_Last_Entity;
3661 procedure Set_Limited_Views (Id : E; V : L) is
3663 pragma Assert (Ekind (Id) = E_Package);
3664 Set_Elist23 (Id, V);
3665 end Set_Limited_Views;
3667 procedure Set_Lit_Indexes (Id : E; V : E) is
3669 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
3671 end Set_Lit_Indexes;
3673 procedure Set_Lit_Strings (Id : E; V : E) is
3675 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
3677 end Set_Lit_Strings;
3679 procedure Set_Machine_Radix_10 (Id : E; V : B := True) is
3681 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
3683 end Set_Machine_Radix_10;
3685 procedure Set_Master_Id (Id : E; V : E) is
3690 procedure Set_Materialize_Entity (Id : E; V : B := True) is
3692 Set_Flag168 (Id, V);
3693 end Set_Materialize_Entity;
3695 procedure Set_Mechanism (Id : E; V : M) is
3697 pragma Assert (Ekind (Id) = E_Function or else Is_Formal (Id));
3698 Set_Uint8 (Id, UI_From_Int (V));
3701 procedure Set_Modulus (Id : E; V : U) is
3703 pragma Assert (Ekind (Id) = E_Modular_Integer_Type);
3707 procedure Set_Needs_Debug_Info (Id : E; V : B := True) is
3709 Set_Flag147 (Id, V);
3710 end Set_Needs_Debug_Info;
3712 procedure Set_Needs_No_Actuals (Id : E; V : B := True) is
3715 (Is_Overloadable (Id)
3716 or else Ekind (Id) = E_Subprogram_Type
3717 or else Ekind (Id) = E_Entry_Family);
3719 end Set_Needs_No_Actuals;
3721 procedure Set_Never_Set_In_Source (Id : E; V : B := True) is
3723 Set_Flag115 (Id, V);
3724 end Set_Never_Set_In_Source;
3726 procedure Set_Next_Inlined_Subprogram (Id : E; V : E) is
3729 end Set_Next_Inlined_Subprogram;
3731 procedure Set_No_Pool_Assigned (Id : E; V : B := True) is
3733 pragma Assert (Is_Access_Type (Id) and then Base_Type (Id) = Id);
3734 Set_Flag131 (Id, V);
3735 end Set_No_Pool_Assigned;
3737 procedure Set_No_Return (Id : E; V : B := True) is
3740 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Generic_Procedure);
3741 Set_Flag113 (Id, V);
3744 procedure Set_No_Strict_Aliasing (Id : E; V : B := True) is
3746 pragma Assert (Is_Access_Type (Id) and then Base_Type (Id) = Id);
3747 Set_Flag136 (Id, V);
3748 end Set_No_Strict_Aliasing;
3751 procedure Set_Non_Binary_Modulus (Id : E; V : B := True) is
3753 pragma Assert (Ekind (Id) = E_Modular_Integer_Type);
3755 end Set_Non_Binary_Modulus;
3757 procedure Set_Non_Limited_View (Id : E; V : E) is
3758 pragma Assert (False
3759 or else Ekind (Id) = E_Incomplete_Type);
3762 end Set_Non_Limited_View;
3764 procedure Set_Nonzero_Is_True (Id : E; V : B := True) is
3767 (Root_Type (Id) = Standard_Boolean
3768 and then Ekind (Id) = E_Enumeration_Type);
3769 Set_Flag162 (Id, V);
3770 end Set_Nonzero_Is_True;
3772 procedure Set_Normalized_First_Bit (Id : E; V : U) is
3775 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
3777 end Set_Normalized_First_Bit;
3779 procedure Set_Normalized_Position (Id : E; V : U) is
3782 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
3784 end Set_Normalized_Position;
3786 procedure Set_Normalized_Position_Max (Id : E; V : U) is
3789 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
3791 end Set_Normalized_Position_Max;
3793 procedure Set_Object_Ref (Id : E; V : E) is
3795 pragma Assert (Ekind (Id) = E_Protected_Body);
3799 procedure Set_Original_Array_Type (Id : E; V : E) is
3801 pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id));
3803 end Set_Original_Array_Type;
3805 procedure Set_Original_Record_Component (Id : E; V : E) is
3808 (Ekind (Id) = E_Void
3809 or else Ekind (Id) = E_Component
3810 or else Ekind (Id) = E_Discriminant);
3812 end Set_Original_Record_Component;
3814 procedure Set_Packed_Array_Type (Id : E; V : E) is
3816 pragma Assert (Is_Array_Type (Id));
3818 end Set_Packed_Array_Type;
3820 procedure Set_Parent_Subtype (Id : E; V : E) is
3822 pragma Assert (Ekind (Id) = E_Record_Type);
3824 end Set_Parent_Subtype;
3826 procedure Set_Primitive_Operations (Id : E; V : L) is
3828 pragma Assert (Is_Tagged_Type (Id));
3829 Set_Elist15 (Id, V);
3830 end Set_Primitive_Operations;
3832 procedure Set_Prival (Id : E; V : E) is
3834 pragma Assert (Is_Protected_Private (Id));
3838 procedure Set_Privals_Chain (Id : E; V : L) is
3840 pragma Assert (Is_Overloadable (Id)
3841 or else Ekind (Id) = E_Entry_Family);
3842 Set_Elist23 (Id, V);
3843 end Set_Privals_Chain;
3845 procedure Set_Private_Dependents (Id : E; V : L) is
3847 pragma Assert (Is_Incomplete_Or_Private_Type (Id));
3848 Set_Elist18 (Id, V);
3849 end Set_Private_Dependents;
3851 procedure Set_Private_View (Id : E; V : N) is
3853 pragma Assert (Is_Private_Type (Id));
3855 end Set_Private_View;
3857 procedure Set_Protected_Body_Subprogram (Id : E; V : E) is
3859 pragma Assert (Is_Subprogram (Id) or else Is_Entry (Id));
3861 end Set_Protected_Body_Subprogram;
3863 procedure Set_Protected_Formal (Id : E; V : E) is
3865 pragma Assert (Is_Formal (Id));
3867 end Set_Protected_Formal;
3869 procedure Set_Protected_Operation (Id : E; V : N) is
3871 pragma Assert (Is_Protected_Private (Id));
3873 end Set_Protected_Operation;
3875 procedure Set_Reachable (Id : E; V : B := True) is
3880 procedure Set_Referenced (Id : E; V : B := True) is
3882 Set_Flag156 (Id, V);
3885 procedure Set_Referenced_As_LHS (Id : E; V : B := True) is
3888 end Set_Referenced_As_LHS;
3890 procedure Set_Referenced_Object (Id : E; V : N) is
3892 pragma Assert (Is_Type (Id));
3894 end Set_Referenced_Object;
3896 procedure Set_Register_Exception_Call (Id : E; V : N) is
3898 pragma Assert (Ekind (Id) = E_Exception);
3900 end Set_Register_Exception_Call;
3902 procedure Set_Related_Array_Object (Id : E; V : E) is
3904 pragma Assert (Is_Array_Type (Id));
3906 end Set_Related_Array_Object;
3908 procedure Set_Related_Instance (Id : E; V : E) is
3911 (Ekind (Id) = E_Package or else Ekind (Id) = E_Package_Body);
3913 end Set_Related_Instance;
3915 procedure Set_Renamed_Entity (Id : E; V : N) is
3918 end Set_Renamed_Entity;
3920 procedure Set_Renamed_Object (Id : E; V : N) is
3923 end Set_Renamed_Object;
3925 procedure Set_Renaming_Map (Id : E; V : U) is
3928 end Set_Renaming_Map;
3930 procedure Set_Return_Present (Id : E; V : B := True) is
3933 end Set_Return_Present;
3935 procedure Set_Returns_By_Ref (Id : E; V : B := True) is
3938 end Set_Returns_By_Ref;
3940 procedure Set_Reverse_Bit_Order (Id : E; V : B := True) is
3943 (Is_Record_Type (Id) and then Id = Base_Type (Id));
3944 Set_Flag164 (Id, V);
3945 end Set_Reverse_Bit_Order;
3947 procedure Set_RM_Size (Id : E; V : U) is
3949 pragma Assert (Is_Type (Id));
3953 procedure Set_Scalar_Range (Id : E; V : N) is
3956 end Set_Scalar_Range;
3958 procedure Set_Scale_Value (Id : E; V : U) is
3961 end Set_Scale_Value;
3963 procedure Set_Scope_Depth_Value (Id : E; V : U) is
3965 pragma Assert (not Is_Record_Type (Id));
3967 end Set_Scope_Depth_Value;
3969 procedure Set_Sec_Stack_Needed_For_Return (Id : E; V : B := True) is
3971 Set_Flag167 (Id, V);
3972 end Set_Sec_Stack_Needed_For_Return;
3974 procedure Set_Shadow_Entities (Id : E; V : S) is
3977 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
3979 end Set_Shadow_Entities;
3981 procedure Set_Shared_Var_Assign_Proc (Id : E; V : E) is
3983 pragma Assert (Ekind (Id) = E_Variable);
3985 end Set_Shared_Var_Assign_Proc;
3987 procedure Set_Shared_Var_Read_Proc (Id : E; V : E) is
3989 pragma Assert (Ekind (Id) = E_Variable);
3991 end Set_Shared_Var_Read_Proc;
3993 procedure Set_Size_Check_Code (Id : E; V : N) is
3995 pragma Assert (Ekind (Id) = E_Constant or else Ekind (Id) = E_Variable);
3997 end Set_Size_Check_Code;
3999 procedure Set_Size_Depends_On_Discriminant (Id : E; V : B := True) is
4001 Set_Flag177 (Id, V);
4002 end Set_Size_Depends_On_Discriminant;
4004 procedure Set_Size_Known_At_Compile_Time (Id : E; V : B := True) is
4007 end Set_Size_Known_At_Compile_Time;
4009 procedure Set_Small_Value (Id : E; V : R) is
4011 pragma Assert (Is_Fixed_Point_Type (Id));
4012 Set_Ureal21 (Id, V);
4013 end Set_Small_Value;
4015 procedure Set_Spec_Entity (Id : E; V : E) is
4017 pragma Assert (Ekind (Id) = E_Package_Body or else Is_Formal (Id));
4019 end Set_Spec_Entity;
4021 procedure Set_Storage_Size_Variable (Id : E; V : E) is
4023 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
4024 pragma Assert (Base_Type (Id) = Id);
4026 end Set_Storage_Size_Variable;
4028 procedure Set_Stored_Constraint (Id : E; V : L) is
4030 pragma Assert (Nkind (Id) in N_Entity);
4031 Set_Elist23 (Id, V);
4032 end Set_Stored_Constraint;
4034 procedure Set_Strict_Alignment (Id : E; V : B := True) is
4036 pragma Assert (Base_Type (Id) = Id);
4037 Set_Flag145 (Id, V);
4038 end Set_Strict_Alignment;
4040 procedure Set_String_Literal_Length (Id : E; V : U) is
4042 pragma Assert (Ekind (Id) = E_String_Literal_Subtype);
4044 end Set_String_Literal_Length;
4046 procedure Set_String_Literal_Low_Bound (Id : E; V : N) is
4048 pragma Assert (Ekind (Id) = E_String_Literal_Subtype);
4050 end Set_String_Literal_Low_Bound;
4052 procedure Set_Suppress_Elaboration_Warnings (Id : E; V : B := True) is
4054 Set_Flag148 (Id, V);
4055 end Set_Suppress_Elaboration_Warnings;
4057 procedure Set_Suppress_Init_Proc (Id : E; V : B := True) is
4059 pragma Assert (Id = Base_Type (Id));
4060 Set_Flag105 (Id, V);
4061 end Set_Suppress_Init_Proc;
4063 procedure Set_Suppress_Style_Checks (Id : E; V : B := True) is
4065 Set_Flag165 (Id, V);
4066 end Set_Suppress_Style_Checks;
4068 procedure Set_Treat_As_Volatile (Id : E; V : B := True) is
4071 end Set_Treat_As_Volatile;
4073 procedure Set_Underlying_Full_View (Id : E; V : E) is
4075 pragma Assert (Ekind (Id) in Private_Kind);
4077 end Set_Underlying_Full_View;
4079 procedure Set_Unset_Reference (Id : E; V : N) is
4082 end Set_Unset_Reference;
4084 procedure Set_Uses_Sec_Stack (Id : E; V : B := True) is
4087 end Set_Uses_Sec_Stack;
4089 procedure Set_Vax_Float (Id : E; V : B := True) is
4091 pragma Assert (Id = Base_Type (Id));
4092 Set_Flag151 (Id, V);
4095 procedure Set_Warnings_Off (Id : E; V : B := True) is
4098 end Set_Warnings_Off;
4100 -----------------------------------
4101 -- Field Initialization Routines --
4102 -----------------------------------
4104 procedure Init_Alignment (Id : E) is
4106 Set_Uint14 (Id, Uint_0);
4109 procedure Init_Alignment (Id : E; V : Int) is
4111 Set_Uint14 (Id, UI_From_Int (V));
4114 procedure Init_Component_Bit_Offset (Id : E) is
4116 Set_Uint11 (Id, No_Uint);
4117 end Init_Component_Bit_Offset;
4119 procedure Init_Component_Bit_Offset (Id : E; V : Int) is
4121 Set_Uint11 (Id, UI_From_Int (V));
4122 end Init_Component_Bit_Offset;
4124 procedure Init_Component_Size (Id : E) is
4126 Set_Uint22 (Id, Uint_0);
4127 end Init_Component_Size;
4129 procedure Init_Component_Size (Id : E; V : Int) is
4131 Set_Uint22 (Id, UI_From_Int (V));
4132 end Init_Component_Size;
4134 procedure Init_Digits_Value (Id : E) is
4136 Set_Uint17 (Id, Uint_0);
4137 end Init_Digits_Value;
4139 procedure Init_Digits_Value (Id : E; V : Int) is
4141 Set_Uint17 (Id, UI_From_Int (V));
4142 end Init_Digits_Value;
4144 procedure Init_Esize (Id : E) is
4146 Set_Uint12 (Id, Uint_0);
4149 procedure Init_Esize (Id : E; V : Int) is
4151 Set_Uint12 (Id, UI_From_Int (V));
4154 procedure Init_Normalized_First_Bit (Id : E) is
4156 Set_Uint8 (Id, No_Uint);
4157 end Init_Normalized_First_Bit;
4159 procedure Init_Normalized_First_Bit (Id : E; V : Int) is
4161 Set_Uint8 (Id, UI_From_Int (V));
4162 end Init_Normalized_First_Bit;
4164 procedure Init_Normalized_Position (Id : E) is
4166 Set_Uint14 (Id, No_Uint);
4167 end Init_Normalized_Position;
4169 procedure Init_Normalized_Position (Id : E; V : Int) is
4171 Set_Uint14 (Id, UI_From_Int (V));
4172 end Init_Normalized_Position;
4174 procedure Init_Normalized_Position_Max (Id : E) is
4176 Set_Uint10 (Id, No_Uint);
4177 end Init_Normalized_Position_Max;
4179 procedure Init_Normalized_Position_Max (Id : E; V : Int) is
4181 Set_Uint10 (Id, UI_From_Int (V));
4182 end Init_Normalized_Position_Max;
4184 procedure Init_RM_Size (Id : E) is
4186 Set_Uint13 (Id, Uint_0);
4189 procedure Init_RM_Size (Id : E; V : Int) is
4191 Set_Uint13 (Id, UI_From_Int (V));
4194 -----------------------------
4195 -- Init_Component_Location --
4196 -----------------------------
4198 procedure Init_Component_Location (Id : E) is
4200 Set_Uint8 (Id, No_Uint); -- Normalized_First_Bit
4201 Set_Uint10 (Id, No_Uint); -- Normalized_Position_Max
4202 Set_Uint11 (Id, No_Uint); -- Component_First_Bit
4203 Set_Uint12 (Id, Uint_0); -- Esize
4204 Set_Uint14 (Id, No_Uint); -- Normalized_Position
4205 end Init_Component_Location;
4211 procedure Init_Size (Id : E; V : Int) is
4213 Set_Uint12 (Id, UI_From_Int (V)); -- Esize
4214 Set_Uint13 (Id, UI_From_Int (V)); -- RM_Size
4217 ---------------------
4218 -- Init_Size_Align --
4219 ---------------------
4221 procedure Init_Size_Align (Id : E) is
4223 Set_Uint12 (Id, Uint_0); -- Esize
4224 Set_Uint13 (Id, Uint_0); -- RM_Size
4225 Set_Uint14 (Id, Uint_0); -- Alignment
4226 end Init_Size_Align;
4228 ----------------------------------------------
4229 -- Type Representation Attribute Predicates --
4230 ----------------------------------------------
4232 function Known_Alignment (E : Entity_Id) return B is
4234 return Uint14 (E) /= Uint_0
4235 and then Uint14 (E) /= No_Uint;
4236 end Known_Alignment;
4238 function Known_Component_Bit_Offset (E : Entity_Id) return B is
4240 return Uint11 (E) /= No_Uint;
4241 end Known_Component_Bit_Offset;
4243 function Known_Component_Size (E : Entity_Id) return B is
4245 return Uint22 (Base_Type (E)) /= Uint_0
4246 and then Uint22 (Base_Type (E)) /= No_Uint;
4247 end Known_Component_Size;
4249 function Known_Esize (E : Entity_Id) return B is
4251 return Uint12 (E) /= Uint_0
4252 and then Uint12 (E) /= No_Uint;
4255 function Known_Normalized_First_Bit (E : Entity_Id) return B is
4257 return Uint8 (E) /= No_Uint;
4258 end Known_Normalized_First_Bit;
4260 function Known_Normalized_Position (E : Entity_Id) return B is
4262 return Uint14 (E) /= No_Uint;
4263 end Known_Normalized_Position;
4265 function Known_Normalized_Position_Max (E : Entity_Id) return B is
4267 return Uint10 (E) /= No_Uint;
4268 end Known_Normalized_Position_Max;
4270 function Known_RM_Size (E : Entity_Id) return B is
4272 return Uint13 (E) /= No_Uint
4273 and then (Uint13 (E) /= Uint_0
4274 or else Is_Discrete_Type (E)
4275 or else Is_Fixed_Point_Type (E));
4278 function Known_Static_Component_Bit_Offset (E : Entity_Id) return B is
4280 return Uint11 (E) /= No_Uint
4281 and then Uint11 (E) >= Uint_0;
4282 end Known_Static_Component_Bit_Offset;
4284 function Known_Static_Component_Size (E : Entity_Id) return B is
4286 return Uint22 (Base_Type (E)) > Uint_0;
4287 end Known_Static_Component_Size;
4289 function Known_Static_Esize (E : Entity_Id) return B is
4291 return Uint12 (E) > Uint_0;
4292 end Known_Static_Esize;
4294 function Known_Static_Normalized_First_Bit (E : Entity_Id) return B is
4296 return Uint8 (E) /= No_Uint
4297 and then Uint8 (E) >= Uint_0;
4298 end Known_Static_Normalized_First_Bit;
4300 function Known_Static_Normalized_Position (E : Entity_Id) return B is
4302 return Uint14 (E) /= No_Uint
4303 and then Uint14 (E) >= Uint_0;
4304 end Known_Static_Normalized_Position;
4306 function Known_Static_Normalized_Position_Max (E : Entity_Id) return B is
4308 return Uint10 (E) /= No_Uint
4309 and then Uint10 (E) >= Uint_0;
4310 end Known_Static_Normalized_Position_Max;
4312 function Known_Static_RM_Size (E : Entity_Id) return B is
4314 return Uint13 (E) > Uint_0
4315 or else Is_Discrete_Type (E)
4316 or else Is_Fixed_Point_Type (E);
4317 end Known_Static_RM_Size;
4319 function Unknown_Alignment (E : Entity_Id) return B is
4321 return Uint14 (E) = Uint_0
4322 or else Uint14 (E) = No_Uint;
4323 end Unknown_Alignment;
4325 function Unknown_Component_Bit_Offset (E : Entity_Id) return B is
4327 return Uint11 (E) = No_Uint;
4328 end Unknown_Component_Bit_Offset;
4330 function Unknown_Component_Size (E : Entity_Id) return B is
4332 return Uint22 (Base_Type (E)) = Uint_0
4334 Uint22 (Base_Type (E)) = No_Uint;
4335 end Unknown_Component_Size;
4337 function Unknown_Esize (E : Entity_Id) return B is
4339 return Uint12 (E) = No_Uint
4341 Uint12 (E) = Uint_0;
4344 function Unknown_Normalized_First_Bit (E : Entity_Id) return B is
4346 return Uint8 (E) = No_Uint;
4347 end Unknown_Normalized_First_Bit;
4349 function Unknown_Normalized_Position (E : Entity_Id) return B is
4351 return Uint14 (E) = No_Uint;
4352 end Unknown_Normalized_Position;
4354 function Unknown_Normalized_Position_Max (E : Entity_Id) return B is
4356 return Uint10 (E) = No_Uint;
4357 end Unknown_Normalized_Position_Max;
4359 function Unknown_RM_Size (E : Entity_Id) return B is
4361 return (Uint13 (E) = Uint_0
4362 and then not Is_Discrete_Type (E)
4363 and then not Is_Fixed_Point_Type (E))
4364 or else Uint13 (E) = No_Uint;
4365 end Unknown_RM_Size;
4367 --------------------
4368 -- Address_Clause --
4369 --------------------
4371 function Address_Clause (Id : E) return N is
4375 Ritem := First_Rep_Item (Id);
4376 while Present (Ritem) loop
4377 if Nkind (Ritem) = N_Attribute_Definition_Clause
4378 and then Chars (Ritem) = Name_Address
4382 Ritem := Next_Rep_Item (Ritem);
4389 ----------------------
4390 -- Alignment_Clause --
4391 ----------------------
4393 function Alignment_Clause (Id : E) return N is
4397 Ritem := First_Rep_Item (Id);
4398 while Present (Ritem) loop
4399 if Nkind (Ritem) = N_Attribute_Definition_Clause
4400 and then Chars (Ritem) = Name_Alignment
4404 Ritem := Next_Rep_Item (Ritem);
4409 end Alignment_Clause;
4411 ----------------------
4412 -- Ancestor_Subtype --
4413 ----------------------
4415 function Ancestor_Subtype (Id : E) return E is
4417 -- If this is first subtype, or is a base type, then there is no
4418 -- ancestor subtype, so we return Empty to indicate this fact.
4420 if Is_First_Subtype (Id)
4421 or else Id = Base_Type (Id)
4427 D : constant Node_Id := Declaration_Node (Id);
4430 -- If we have a subtype declaration, get the ancestor subtype
4432 if Nkind (D) = N_Subtype_Declaration then
4433 if Nkind (Subtype_Indication (D)) = N_Subtype_Indication then
4434 return Entity (Subtype_Mark (Subtype_Indication (D)));
4436 return Entity (Subtype_Indication (D));
4439 -- If not, then no subtype indication is available
4445 end Ancestor_Subtype;
4451 procedure Append_Entity (Id : Entity_Id; V : Entity_Id) is
4453 if Last_Entity (V) = Empty then
4454 Set_First_Entity (V, Id);
4456 Set_Next_Entity (Last_Entity (V), Id);
4459 Set_Next_Entity (Id, Empty);
4461 Set_Last_Entity (V, Id);
4468 function Base_Type (Id : E) return E is
4471 when E_Enumeration_Subtype |
4473 E_Signed_Integer_Subtype |
4474 E_Modular_Integer_Subtype |
4475 E_Floating_Point_Subtype |
4476 E_Ordinary_Fixed_Point_Subtype |
4477 E_Decimal_Fixed_Point_Subtype |
4482 E_Record_Subtype_With_Private |
4483 E_Limited_Private_Subtype |
4485 E_Protected_Subtype |
4487 E_String_Literal_Subtype |
4488 E_Class_Wide_Subtype =>
4496 -------------------------
4497 -- Component_Alignment --
4498 -------------------------
4500 -- Component Alignment is encoded using two flags, Flag128/129 as
4501 -- follows. Note that both flags False = Align_Default, so that the
4502 -- default initialization of flags to False initializes component
4503 -- alignment to the default value as required.
4505 -- Flag128 Flag129 Value
4506 -- ------- ------- -----
4507 -- False False Calign_Default
4508 -- False True Calign_Component_Size
4509 -- True False Calign_Component_Size_4
4510 -- True True Calign_Storage_Unit
4512 function Component_Alignment (Id : E) return C is
4513 BT : constant Node_Id := Base_Type (Id);
4516 pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id));
4518 if Flag128 (BT) then
4519 if Flag129 (BT) then
4520 return Calign_Storage_Unit;
4522 return Calign_Component_Size_4;
4526 if Flag129 (BT) then
4527 return Calign_Component_Size;
4529 return Calign_Default;
4532 end Component_Alignment;
4534 --------------------
4535 -- Constant_Value --
4536 --------------------
4538 function Constant_Value (Id : E) return N is
4539 D : constant Node_Id := Declaration_Node (Id);
4543 -- If we have no declaration node, then return no constant value.
4544 -- Not clear how this can happen, but it does sometimes ???
4545 -- To investigate, remove this check and compile discrim_po.adb.
4550 -- Normal case where a declaration node is present
4552 elsif Nkind (D) = N_Object_Renaming_Declaration then
4553 return Renamed_Object (Id);
4555 -- If this is a component declaration whose entity is constant, it
4556 -- is a prival within a protected function. It does not have
4557 -- a constant value.
4559 elsif Nkind (D) = N_Component_Declaration then
4562 -- If there is an expression, return it
4564 elsif Present (Expression (D)) then
4565 return (Expression (D));
4567 -- For a constant, see if we have a full view
4569 elsif Ekind (Id) = E_Constant
4570 and then Present (Full_View (Id))
4572 Full_D := Parent (Full_View (Id));
4574 -- The full view may have been rewritten as an object renaming.
4576 if Nkind (Full_D) = N_Object_Renaming_Declaration then
4577 return Name (Full_D);
4579 return Expression (Full_D);
4582 -- Otherwise we have no expression to return
4589 ----------------------
4590 -- Declaration_Node --
4591 ----------------------
4593 function Declaration_Node (Id : E) return N is
4597 if Ekind (Id) = E_Incomplete_Type
4598 and then Present (Full_View (Id))
4600 P := Parent (Full_View (Id));
4606 if Nkind (P) /= N_Selected_Component
4607 and then Nkind (P) /= N_Expanded_Name
4609 not (Nkind (P) = N_Defining_Program_Unit_Name
4610 and then Is_Child_Unit (Id))
4618 end Declaration_Node;
4620 ---------------------
4621 -- Designated_Type --
4622 ---------------------
4624 function Designated_Type (Id : E) return E is
4628 Desig_Type := Directly_Designated_Type (Id);
4630 if Ekind (Desig_Type) = E_Incomplete_Type
4631 and then Present (Full_View (Desig_Type))
4633 return Full_View (Desig_Type);
4635 elsif Is_Class_Wide_Type (Desig_Type)
4636 and then Ekind (Etype (Desig_Type)) = E_Incomplete_Type
4637 and then Present (Full_View (Etype (Desig_Type)))
4638 and then Present (Class_Wide_Type (Full_View (Etype (Desig_Type))))
4640 return Class_Wide_Type (Full_View (Etype (Desig_Type)));
4645 end Designated_Type;
4647 -----------------------------
4648 -- Enclosing_Dynamic_Scope --
4649 -----------------------------
4651 function Enclosing_Dynamic_Scope (Id : E) return E is
4656 while S /= Standard_Standard
4657 and then not Is_Dynamic_Scope (S)
4663 end Enclosing_Dynamic_Scope;
4665 ----------------------
4666 -- Entry_Index_Type --
4667 ----------------------
4669 function Entry_Index_Type (Id : E) return N is
4671 pragma Assert (Ekind (Id) = E_Entry_Family);
4672 return Etype (Discrete_Subtype_Definition (Parent (Id)));
4673 end Entry_Index_Type;
4675 ---------------------
4677 ---------------------
4679 function First_Component (Id : E) return E is
4684 (Is_Record_Type (Id) or else Is_Incomplete_Or_Private_Type (Id));
4686 Comp_Id := First_Entity (Id);
4687 while Present (Comp_Id) loop
4688 exit when Ekind (Comp_Id) = E_Component;
4689 Comp_Id := Next_Entity (Comp_Id);
4693 end First_Component;
4695 ------------------------
4696 -- First_Discriminant --
4697 ------------------------
4699 function First_Discriminant (Id : E) return E is
4704 (Has_Discriminants (Id)
4705 or else Has_Unknown_Discriminants (Id));
4707 Ent := First_Entity (Id);
4709 -- The discriminants are not necessarily contiguous, because access
4710 -- discriminants will generate itypes. They are not the first entities
4711 -- either, because tag and controller record must be ahead of them.
4713 if Chars (Ent) = Name_uTag then
4714 Ent := Next_Entity (Ent);
4717 if Chars (Ent) = Name_uController then
4718 Ent := Next_Entity (Ent);
4721 -- Skip all hidden stored discriminants if any.
4723 while Present (Ent) loop
4724 exit when Ekind (Ent) = E_Discriminant
4725 and then not Is_Completely_Hidden (Ent);
4727 Ent := Next_Entity (Ent);
4730 pragma Assert (Ekind (Ent) = E_Discriminant);
4733 end First_Discriminant;
4739 function First_Formal (Id : E) return E is
4744 (Is_Overloadable (Id)
4745 or else Ekind (Id) = E_Entry_Family
4746 or else Ekind (Id) = E_Subprogram_Body
4747 or else Ekind (Id) = E_Subprogram_Type);
4749 if Ekind (Id) = E_Enumeration_Literal then
4753 Formal := First_Entity (Id);
4755 if Present (Formal) and then Is_Formal (Formal) then
4763 -------------------------------
4764 -- First_Stored_Discriminant --
4765 -------------------------------
4767 function First_Stored_Discriminant (Id : E) return E is
4770 function Has_Completely_Hidden_Discriminant (Id : E) return Boolean;
4771 -- Scans the Discriminants to see whether any are Completely_Hidden
4772 -- (the mechanism for describing non-specified stored discriminants)
4774 function Has_Completely_Hidden_Discriminant (Id : E) return Boolean is
4775 Ent : Entity_Id := Id;
4778 pragma Assert (Ekind (Id) = E_Discriminant);
4780 while Present (Ent) and then Ekind (Ent) = E_Discriminant loop
4782 if Is_Completely_Hidden (Ent) then
4786 Ent := Next_Entity (Ent);
4790 end Has_Completely_Hidden_Discriminant;
4792 -- Start of processing for First_Stored_Discriminant
4796 (Has_Discriminants (Id)
4797 or else Has_Unknown_Discriminants (Id));
4799 Ent := First_Entity (Id);
4801 if Chars (Ent) = Name_uTag then
4802 Ent := Next_Entity (Ent);
4805 if Chars (Ent) = Name_uController then
4806 Ent := Next_Entity (Ent);
4809 if Has_Completely_Hidden_Discriminant (Ent) then
4811 while Present (Ent) loop
4812 exit when Is_Completely_Hidden (Ent);
4813 Ent := Next_Entity (Ent);
4818 pragma Assert (Ekind (Ent) = E_Discriminant);
4821 end First_Stored_Discriminant;
4827 function First_Subtype (Id : E) return E is
4828 B : constant Entity_Id := Base_Type (Id);
4829 F : constant Node_Id := Freeze_Node (B);
4833 -- If the base type has no freeze node, it is a type in standard,
4834 -- and always acts as its own first subtype unless it is one of
4835 -- the predefined integer types. If the type is formal, it is also
4836 -- a first subtype, and its base type has no freeze node. On the other
4837 -- hand, a subtype of a generic formal is not its own first_subtype.
4838 -- Its base type, if anonymous, is attached to the formal type decl.
4839 -- from which the first subtype is obtained.
4843 if B = Base_Type (Standard_Integer) then
4844 return Standard_Integer;
4846 elsif B = Base_Type (Standard_Long_Integer) then
4847 return Standard_Long_Integer;
4849 elsif B = Base_Type (Standard_Short_Short_Integer) then
4850 return Standard_Short_Short_Integer;
4852 elsif B = Base_Type (Standard_Short_Integer) then
4853 return Standard_Short_Integer;
4855 elsif B = Base_Type (Standard_Long_Long_Integer) then
4856 return Standard_Long_Long_Integer;
4858 elsif Is_Generic_Type (Id) then
4859 if Present (Parent (B)) then
4860 return Defining_Identifier (Parent (B));
4862 return Defining_Identifier (Associated_Node_For_Itype (B));
4869 -- Otherwise we check the freeze node, if it has a First_Subtype_Link
4870 -- then we use that link, otherwise (happens with some Itypes), we use
4871 -- the base type itself.
4874 Ent := First_Subtype_Link (F);
4876 if Present (Ent) then
4884 -------------------------------------
4885 -- Get_Attribute_Definition_Clause --
4886 -------------------------------------
4888 function Get_Attribute_Definition_Clause
4896 N := First_Rep_Item (E);
4897 while Present (N) loop
4898 if Nkind (N) = N_Attribute_Definition_Clause
4899 and then Get_Attribute_Id (Chars (N)) = Id
4908 end Get_Attribute_Definition_Clause;
4910 --------------------
4911 -- Get_Rep_Pragma --
4912 --------------------
4914 function Get_Rep_Pragma (E : Entity_Id; Nam : Name_Id) return Node_Id is
4919 N := First_Rep_Item (E);
4921 while Present (N) loop
4922 if Nkind (N) = N_Pragma and then Chars (N) = Nam then
4924 if Nam = Name_Stream_Convert then
4926 -- For tagged types this pragma is not inherited, so we
4927 -- must verify that it is defined for the given type and
4930 Typ := Entity (Expression
4931 (First (Pragma_Argument_Associations (N))));
4933 if not Is_Tagged_Type (E)
4935 or else (Is_Private_Type (Typ)
4936 and then E = Full_View (Typ))
4954 ------------------------
4955 -- Has_Attach_Handler --
4956 ------------------------
4958 function Has_Attach_Handler (Id : E) return B is
4962 pragma Assert (Is_Protected_Type (Id));
4964 Ritem := First_Rep_Item (Id);
4965 while Present (Ritem) loop
4966 if Nkind (Ritem) = N_Pragma
4967 and then Chars (Ritem) = Name_Attach_Handler
4971 Ritem := Next_Rep_Item (Ritem);
4976 end Has_Attach_Handler;
4982 function Has_Entries (Id : E) return B is
4983 Result : Boolean := False;
4987 pragma Assert (Is_Concurrent_Type (Id));
4988 Ent := First_Entity (Id);
4990 while Present (Ent) loop
4991 if Is_Entry (Ent) then
4996 Ent := Next_Entity (Ent);
5002 ----------------------------
5003 -- Has_Foreign_Convention --
5004 ----------------------------
5006 function Has_Foreign_Convention (Id : E) return B is
5008 return Convention (Id) >= Foreign_Convention'First;
5009 end Has_Foreign_Convention;
5011 ---------------------------
5012 -- Has_Interrupt_Handler --
5013 ---------------------------
5015 function Has_Interrupt_Handler (Id : E) return B is
5019 pragma Assert (Is_Protected_Type (Id));
5021 Ritem := First_Rep_Item (Id);
5022 while Present (Ritem) loop
5023 if Nkind (Ritem) = N_Pragma
5024 and then Chars (Ritem) = Name_Interrupt_Handler
5028 Ritem := Next_Rep_Item (Ritem);
5033 end Has_Interrupt_Handler;
5035 --------------------------
5036 -- Has_Private_Ancestor --
5037 --------------------------
5039 function Has_Private_Ancestor (Id : E) return B is
5040 R : constant Entity_Id := Root_Type (Id);
5041 T1 : Entity_Id := Id;
5045 if Is_Private_Type (T1) then
5055 end Has_Private_Ancestor;
5057 ------------------------------
5058 -- Implementation_Base_Type --
5059 ------------------------------
5061 function Implementation_Base_Type (Id : E) return E is
5066 Bastyp := Base_Type (Id);
5068 if Is_Incomplete_Or_Private_Type (Bastyp) then
5069 Imptyp := Underlying_Type (Bastyp);
5071 -- If we have an implementation type, then just return it,
5072 -- otherwise we return the Base_Type anyway. This can only
5073 -- happen in error situations and should avoid some error bombs.
5075 if Present (Imptyp) then
5076 return Base_Type (Imptyp);
5084 end Implementation_Base_Type;
5086 -----------------------
5087 -- Is_Always_Inlined --
5088 -----------------------
5090 function Is_Always_Inlined (Id : E) return B is
5094 Item := First_Rep_Item (Id);
5096 while Present (Item) loop
5097 if Nkind (Item) = N_Pragma
5098 and then Get_Pragma_Id (Chars (Item)) = Pragma_Inline_Always
5103 Next_Rep_Item (Item);
5107 end Is_Always_Inlined;
5109 ---------------------
5110 -- Is_Boolean_Type --
5111 ---------------------
5113 function Is_Boolean_Type (Id : E) return B is
5115 return Root_Type (Id) = Standard_Boolean;
5116 end Is_Boolean_Type;
5118 ---------------------
5119 -- Is_By_Copy_Type --
5120 ---------------------
5122 function Is_By_Copy_Type (Id : E) return B is
5124 -- If Id is a private type whose full declaration has not been seen,
5125 -- we assume for now that it is not a By_Copy type. Clearly this
5126 -- attribute should not be used before the type is frozen, but it is
5127 -- needed to build the associated record of a protected type. Another
5128 -- place where some lookahead for a full view is needed ???
5131 Is_Elementary_Type (Id)
5132 or else (Is_Private_Type (Id)
5133 and then Present (Underlying_Type (Id))
5134 and then Is_Elementary_Type (Underlying_Type (Id)));
5135 end Is_By_Copy_Type;
5137 --------------------------
5138 -- Is_By_Reference_Type --
5139 --------------------------
5141 function Is_By_Reference_Type (Id : E) return B is
5142 Btype : constant Entity_Id := Base_Type (Id);
5145 if Error_Posted (Id)
5146 or else Error_Posted (Btype)
5150 elsif Is_Private_Type (Btype) then
5152 Utyp : constant Entity_Id := Underlying_Type (Btype);
5158 return Is_By_Reference_Type (Utyp);
5162 elsif Is_Concurrent_Type (Btype) then
5165 elsif Is_Record_Type (Btype) then
5166 if Is_Limited_Record (Btype)
5167 or else Is_Tagged_Type (Btype)
5168 or else Is_Volatile (Btype)
5174 C : Entity_Id := First_Component (Btype);
5177 while Present (C) loop
5178 if Is_By_Reference_Type (Etype (C))
5179 or else Is_Volatile (Etype (C))
5184 C := Next_Component (C);
5191 elsif Is_Array_Type (Btype) then
5194 or else Is_By_Reference_Type (Component_Type (Btype))
5195 or else Is_Volatile (Component_Type (Btype))
5196 or else Has_Volatile_Components (Btype);
5201 end Is_By_Reference_Type;
5203 ---------------------
5204 -- Is_Derived_Type --
5205 ---------------------
5207 function Is_Derived_Type (Id : E) return B is
5211 if Base_Type (Id) /= Root_Type (Id)
5212 and then not Is_Generic_Type (Id)
5213 and then not Is_Class_Wide_Type (Id)
5215 if not Is_Numeric_Type (Root_Type (Id)) then
5219 Par := Parent (First_Subtype (Id));
5221 return Present (Par)
5222 and then Nkind (Par) = N_Full_Type_Declaration
5223 and then Nkind (Type_Definition (Par))
5224 = N_Derived_Type_Definition;
5230 end Is_Derived_Type;
5232 ----------------------
5233 -- Is_Dynamic_Scope --
5234 ----------------------
5236 function Is_Dynamic_Scope (Id : E) return B is
5239 Ekind (Id) = E_Block
5241 Ekind (Id) = E_Function
5243 Ekind (Id) = E_Procedure
5245 Ekind (Id) = E_Subprogram_Body
5247 Ekind (Id) = E_Task_Type
5249 Ekind (Id) = E_Entry
5251 Ekind (Id) = E_Entry_Family;
5252 end Is_Dynamic_Scope;
5254 --------------------
5255 -- Is_Entity_Name --
5256 --------------------
5258 function Is_Entity_Name (N : Node_Id) return Boolean is
5259 Kind : constant Node_Kind := Nkind (N);
5262 -- Identifiers, operator symbols, expanded names are entity names
5264 return Kind = N_Identifier
5265 or else Kind = N_Operator_Symbol
5266 or else Kind = N_Expanded_Name
5268 -- Attribute references are entity names if they refer to an entity.
5269 -- Note that we don't do this by testing for the presence of the
5270 -- Entity field in the N_Attribute_Reference node, since it may not
5271 -- have been set yet.
5273 or else (Kind = N_Attribute_Reference
5274 and then Is_Entity_Attribute_Name (Attribute_Name (N)));
5277 ---------------------------
5278 -- Is_Indefinite_Subtype --
5279 ---------------------------
5281 function Is_Indefinite_Subtype (Id : Entity_Id) return B is
5282 K : constant Entity_Kind := Ekind (Id);
5285 if Is_Constrained (Id) then
5288 elsif K in Array_Kind
5289 or else K in Class_Wide_Kind
5290 or else Has_Unknown_Discriminants (Id)
5294 -- Known discriminants: indefinite if there are no default values
5296 elsif K in Record_Kind
5297 or else Is_Incomplete_Or_Private_Type (Id)
5298 or else Is_Concurrent_Type (Id)
5300 return (Has_Discriminants (Id)
5301 and then No (Discriminant_Default_Value (First_Discriminant (Id))));
5306 end Is_Indefinite_Subtype;
5308 ---------------------
5309 -- Is_Limited_Type --
5310 ---------------------
5312 function Is_Limited_Type (Id : E) return B is
5313 Btype : constant E := Base_Type (Id);
5316 if not Is_Type (Id) then
5319 elsif Ekind (Btype) = E_Limited_Private_Type
5320 or else Is_Limited_Composite (Btype)
5324 elsif Is_Concurrent_Type (Btype) then
5327 -- Otherwise we will look around to see if there is some other reason
5328 -- for it to be limited, except that if an error was posted on the
5329 -- entity, then just assume it is non-limited, because it can cause
5330 -- trouble to recurse into a murky erroneous entity!
5332 elsif Error_Posted (Id) then
5335 elsif Is_Record_Type (Btype) then
5336 if Is_Limited_Record (Root_Type (Btype)) then
5339 elsif Is_Class_Wide_Type (Btype) then
5340 return Is_Limited_Type (Root_Type (Btype));
5344 C : E := First_Component (Btype);
5347 while Present (C) loop
5348 if Is_Limited_Type (Etype (C)) then
5352 C := Next_Component (C);
5359 elsif Is_Array_Type (Btype) then
5360 return Is_Limited_Type (Component_Type (Btype));
5365 end Is_Limited_Type;
5371 function Is_Package (Id : E) return B is
5374 Ekind (Id) = E_Package
5376 Ekind (Id) = E_Generic_Package;
5379 --------------------------
5380 -- Is_Protected_Private --
5381 --------------------------
5383 function Is_Protected_Private (Id : E) return B is
5385 pragma Assert (Ekind (Id) = E_Component);
5386 return Is_Protected_Type (Scope (Id));
5387 end Is_Protected_Private;
5389 ------------------------------
5390 -- Is_Protected_Record_Type --
5391 ------------------------------
5393 function Is_Protected_Record_Type (Id : E) return B is
5396 Is_Concurrent_Record_Type (Id)
5397 and then Is_Protected_Type (Corresponding_Concurrent_Type (Id));
5398 end Is_Protected_Record_Type;
5400 ---------------------------------
5401 -- Is_Return_By_Reference_Type --
5402 ---------------------------------
5404 function Is_Return_By_Reference_Type (Id : E) return B is
5405 Btype : constant Entity_Id := Base_Type (Id);
5408 if Is_Private_Type (Btype) then
5410 Utyp : constant Entity_Id := Underlying_Type (Btype);
5416 return Is_Return_By_Reference_Type (Utyp);
5420 elsif Is_Concurrent_Type (Btype) then
5423 elsif Is_Record_Type (Btype) then
5424 if Is_Limited_Record (Btype) then
5427 elsif Is_Class_Wide_Type (Btype) then
5428 return Is_Return_By_Reference_Type (Root_Type (Btype));
5432 C : Entity_Id := First_Component (Btype);
5435 while Present (C) loop
5436 if Is_Return_By_Reference_Type (Etype (C)) then
5440 C := Next_Component (C);
5447 elsif Is_Array_Type (Btype) then
5448 return Is_Return_By_Reference_Type (Component_Type (Btype));
5453 end Is_Return_By_Reference_Type;
5455 --------------------
5456 -- Is_String_Type --
5457 --------------------
5459 function Is_String_Type (Id : E) return B is
5461 return Ekind (Id) in String_Kind
5462 or else (Is_Array_Type (Id)
5463 and then Number_Dimensions (Id) = 1
5464 and then Is_Character_Type (Component_Type (Id)));
5467 -------------------------
5468 -- Is_Task_Record_Type --
5469 -------------------------
5471 function Is_Task_Record_Type (Id : E) return B is
5474 Is_Concurrent_Record_Type (Id)
5475 and then Is_Task_Type (Corresponding_Concurrent_Type (Id));
5476 end Is_Task_Record_Type;
5478 ------------------------
5479 -- Is_Wrapper_Package --
5480 ------------------------
5482 function Is_Wrapper_Package (Id : E) return B is
5484 return (Ekind (Id) = E_Package
5485 and then Present (Related_Instance (Id)));
5486 end Is_Wrapper_Package;
5488 --------------------
5489 -- Next_Component --
5490 --------------------
5492 function Next_Component (Id : E) return E is
5496 Comp_Id := Next_Entity (Id);
5498 while Present (Comp_Id) loop
5499 exit when Ekind (Comp_Id) = E_Component;
5500 Comp_Id := Next_Entity (Comp_Id);
5506 -----------------------
5507 -- Next_Discriminant --
5508 -----------------------
5510 -- This function actually implements both Next_Discriminant and
5511 -- Next_Stored_Discriminant by making sure that the Discriminant
5512 -- returned is of the same variety as Id.
5514 function Next_Discriminant (Id : E) return E is
5516 -- Derived Tagged types with private extensions look like this...
5518 -- E_Discriminant d1
5519 -- E_Discriminant d2
5521 -- E_Discriminant d1
5522 -- E_Discriminant d2
5525 -- so it is critical not to go past the leading discriminants.
5530 pragma Assert (Ekind (Id) = E_Discriminant);
5533 D := Next_Entity (D);
5535 or else (Ekind (D) /= E_Discriminant
5536 and then not Is_Itype (D))
5541 exit when Ekind (D) = E_Discriminant
5542 and then (Is_Completely_Hidden (D) = Is_Completely_Hidden (Id));
5546 end Next_Discriminant;
5552 function Next_Formal (Id : E) return E is
5556 -- Follow the chain of declared entities as long as the kind of
5557 -- the entity corresponds to a formal parameter. Skip internal
5558 -- entities that may have been created for implicit subtypes,
5559 -- in the process of analyzing default expressions.
5564 P := Next_Entity (P);
5566 if No (P) or else Is_Formal (P) then
5568 elsif not Is_Internal (P) then
5574 -----------------------------
5575 -- Next_Formal_With_Extras --
5576 -----------------------------
5578 function Next_Formal_With_Extras (Id : E) return E is
5580 if Present (Extra_Formal (Id)) then
5581 return Extra_Formal (Id);
5583 return Next_Formal (Id);
5585 end Next_Formal_With_Extras;
5591 function Next_Index (Id : Node_Id) return Node_Id is
5600 function Next_Literal (Id : E) return E is
5602 pragma Assert (Nkind (Id) in N_Entity);
5606 ------------------------------
5607 -- Next_Stored_Discriminant --
5608 ------------------------------
5610 function Next_Stored_Discriminant (Id : E) return E is
5612 -- See comment in Next_Discriminant
5614 return Next_Discriminant (Id);
5615 end Next_Stored_Discriminant;
5617 -----------------------
5618 -- Number_Dimensions --
5619 -----------------------
5621 function Number_Dimensions (Id : E) return Pos is
5626 if Ekind (Id) in String_Kind then
5631 T := First_Index (Id);
5633 while Present (T) loop
5640 end Number_Dimensions;
5642 --------------------------
5643 -- Number_Discriminants --
5644 --------------------------
5646 function Number_Discriminants (Id : E) return Pos is
5652 Discr := First_Discriminant (Id);
5654 while Present (Discr) loop
5656 Discr := Next_Discriminant (Discr);
5660 end Number_Discriminants;
5662 --------------------
5663 -- Number_Entries --
5664 --------------------
5666 function Number_Entries (Id : E) return Nat is
5671 pragma Assert (Is_Concurrent_Type (Id));
5673 Ent := First_Entity (Id);
5675 while Present (Ent) loop
5676 if Is_Entry (Ent) then
5680 Ent := Next_Entity (Ent);
5686 --------------------
5687 -- Number_Formals --
5688 --------------------
5690 function Number_Formals (Id : E) return Pos is
5696 Formal := First_Formal (Id);
5698 while Present (Formal) loop
5700 Formal := Next_Formal (Formal);
5706 --------------------
5707 -- Parameter_Mode --
5708 --------------------
5710 function Parameter_Mode (Id : E) return Formal_Kind is
5719 function Root_Type (Id : E) return E is
5723 pragma Assert (Nkind (Id) in N_Entity);
5725 T := Base_Type (Id);
5727 if Ekind (T) = E_Class_Wide_Type then
5739 -- Following test catches some error cases resulting from
5742 elsif No (Etyp) then
5745 elsif Is_Private_Type (T) and then Etyp = Full_View (T) then
5748 elsif Is_Private_Type (Etyp) and then Full_View (Etyp) = T then
5754 -- Return if there is a circularity in the inheritance chain.
5755 -- This happens in some error situations and we do not want
5756 -- to get stuck in this loop.
5758 if T = Base_Type (Id) then
5764 raise Program_Error;
5771 function Scope_Depth (Id : E) return Uint is
5772 Scop : Entity_Id := Id;
5775 while Is_Record_Type (Scop) loop
5776 Scop := Scope (Scop);
5779 return Scope_Depth_Value (Scop);
5782 ---------------------
5783 -- Scope_Depth_Set --
5784 ---------------------
5786 function Scope_Depth_Set (Id : E) return B is
5788 return not Is_Record_Type (Id)
5789 and then Field22 (Id) /= Union_Id (Empty);
5790 end Scope_Depth_Set;
5792 -----------------------------
5793 -- Set_Component_Alignment --
5794 -----------------------------
5796 -- Component Alignment is encoded using two flags, Flag128/129 as
5797 -- follows. Note that both flags False = Align_Default, so that the
5798 -- default initialization of flags to False initializes component
5799 -- alignment to the default value as required.
5801 -- Flag128 Flag129 Value
5802 -- ------- ------- -----
5803 -- False False Calign_Default
5804 -- False True Calign_Component_Size
5805 -- True False Calign_Component_Size_4
5806 -- True True Calign_Storage_Unit
5808 procedure Set_Component_Alignment (Id : E; V : C) is
5810 pragma Assert ((Is_Array_Type (Id) or else Is_Record_Type (Id))
5811 and then Id = Base_Type (Id));
5814 when Calign_Default =>
5815 Set_Flag128 (Id, False);
5816 Set_Flag129 (Id, False);
5818 when Calign_Component_Size =>
5819 Set_Flag128 (Id, False);
5820 Set_Flag129 (Id, True);
5822 when Calign_Component_Size_4 =>
5823 Set_Flag128 (Id, True);
5824 Set_Flag129 (Id, False);
5826 when Calign_Storage_Unit =>
5827 Set_Flag128 (Id, True);
5828 Set_Flag129 (Id, True);
5830 end Set_Component_Alignment;
5836 function Size_Clause (Id : E) return N is
5840 Ritem := First_Rep_Item (Id);
5841 while Present (Ritem) loop
5842 if Nkind (Ritem) = N_Attribute_Definition_Clause
5843 and then Chars (Ritem) = Name_Size
5847 Ritem := Next_Rep_Item (Ritem);
5858 function Subtype_Kind (K : Entity_Kind) return Entity_Kind is
5864 Kind := E_Access_Subtype;
5868 Kind := E_Array_Subtype;
5870 when E_Class_Wide_Type |
5871 E_Class_Wide_Subtype =>
5872 Kind := E_Class_Wide_Subtype;
5874 when E_Decimal_Fixed_Point_Type |
5875 E_Decimal_Fixed_Point_Subtype =>
5876 Kind := E_Decimal_Fixed_Point_Subtype;
5878 when E_Ordinary_Fixed_Point_Type |
5879 E_Ordinary_Fixed_Point_Subtype =>
5880 Kind := E_Ordinary_Fixed_Point_Subtype;
5882 when E_Private_Type |
5883 E_Private_Subtype =>
5884 Kind := E_Private_Subtype;
5886 when E_Limited_Private_Type |
5887 E_Limited_Private_Subtype =>
5888 Kind := E_Limited_Private_Subtype;
5890 when E_Record_Type_With_Private |
5891 E_Record_Subtype_With_Private =>
5892 Kind := E_Record_Subtype_With_Private;
5894 when E_Record_Type |
5896 Kind := E_Record_Subtype;
5898 when E_String_Type |
5900 Kind := E_String_Subtype;
5902 when Enumeration_Kind =>
5903 Kind := E_Enumeration_Subtype;
5906 Kind := E_Floating_Point_Subtype;
5908 when Signed_Integer_Kind =>
5909 Kind := E_Signed_Integer_Subtype;
5911 when Modular_Integer_Kind =>
5912 Kind := E_Modular_Integer_Subtype;
5914 when Protected_Kind =>
5915 Kind := E_Protected_Subtype;
5918 Kind := E_Task_Subtype;
5922 raise Program_Error;
5932 function Tag_Component (Id : E) return E is
5934 Typ : Entity_Id := Id;
5937 pragma Assert (Is_Tagged_Type (Typ));
5939 if Is_Class_Wide_Type (Typ) then
5940 Typ := Root_Type (Typ);
5943 if Is_Private_Type (Typ) then
5944 Typ := Underlying_Type (Typ);
5947 Comp := First_Entity (Typ);
5948 while Present (Comp) loop
5949 if Is_Tag (Comp) then
5953 Comp := Next_Entity (Comp);
5956 -- No tag component found
5961 ---------------------
5962 -- Type_High_Bound --
5963 ---------------------
5965 function Type_High_Bound (Id : E) return Node_Id is
5967 if Nkind (Scalar_Range (Id)) = N_Subtype_Indication then
5968 return High_Bound (Range_Expression (Constraint (Scalar_Range (Id))));
5970 return High_Bound (Scalar_Range (Id));
5972 end Type_High_Bound;
5974 --------------------
5975 -- Type_Low_Bound --
5976 --------------------
5978 function Type_Low_Bound (Id : E) return Node_Id is
5980 if Nkind (Scalar_Range (Id)) = N_Subtype_Indication then
5981 return Low_Bound (Range_Expression (Constraint (Scalar_Range (Id))));
5983 return Low_Bound (Scalar_Range (Id));
5987 ---------------------
5988 -- Underlying_Type --
5989 ---------------------
5991 function Underlying_Type (Id : E) return E is
5993 -- For record_with_private the underlying type is always the direct
5994 -- full view. Never try to take the full view of the parent it
5995 -- doesn't make sense.
5997 if Ekind (Id) = E_Record_Type_With_Private then
5998 return Full_View (Id);
6000 elsif Ekind (Id) in Incomplete_Or_Private_Kind then
6002 -- If we have an incomplete or private type with a full view,
6003 -- then we return the Underlying_Type of this full view
6005 if Present (Full_View (Id)) then
6006 if Id = Full_View (Id) then
6008 -- Previous error in declaration
6013 return Underlying_Type (Full_View (Id));
6016 -- Otherwise check for the case where we have a derived type or
6017 -- subtype, and if so get the Underlying_Type of the parent type.
6019 elsif Etype (Id) /= Id then
6020 return Underlying_Type (Etype (Id));
6022 -- Otherwise we have an incomplete or private type that has
6023 -- no full view, which means that we have not encountered the
6024 -- completion, so return Empty to indicate the underlying type
6025 -- is not yet known.
6031 -- For non-incomplete, non-private types, return the type itself
6032 -- Also for entities that are not types at all return the entity
6038 end Underlying_Type;
6040 ------------------------
6041 -- Write_Entity_Flags --
6042 ------------------------
6044 procedure Write_Entity_Flags (Id : Entity_Id; Prefix : String) is
6046 procedure W (Flag_Name : String; Flag : Boolean);
6047 -- Write out given flag if it is set
6049 procedure W (Flag_Name : String; Flag : Boolean) is
6053 Write_Str (Flag_Name);
6054 Write_Str (" = True");
6059 -- Start of processing for Write_Entity_Flags
6062 if (Is_Array_Type (Id) or else Is_Record_Type (Id))
6063 and then Base_Type (Id) = Id
6066 Write_Str ("Component_Alignment = ");
6068 case Component_Alignment (Id) is
6069 when Calign_Default =>
6070 Write_Str ("Calign_Default");
6072 when Calign_Component_Size =>
6073 Write_Str ("Calign_Component_Size");
6075 when Calign_Component_Size_4 =>
6076 Write_Str ("Calign_Component_Size_4");
6078 when Calign_Storage_Unit =>
6079 Write_Str ("Calign_Storage_Unit");
6085 W ("Address_Taken", Flag104 (Id));
6086 W ("Body_Needed_For_SAL", Flag40 (Id));
6087 W ("C_Pass_By_Copy", Flag125 (Id));
6088 W ("Can_Never_Be_Null", Flag38 (Id));
6089 W ("Checks_May_Be_Suppressed", Flag31 (Id));
6090 W ("Debug_Info_Off", Flag166 (Id));
6091 W ("Default_Expressions_Processed", Flag108 (Id));
6092 W ("Delay_Cleanups", Flag114 (Id));
6093 W ("Delay_Subprogram_Descriptors", Flag50 (Id));
6094 W ("Depends_On_Private", Flag14 (Id));
6095 W ("Discard_Names", Flag88 (Id));
6096 W ("Elaborate_All_Desirable", Flag146 (Id));
6097 W ("Elaboration_Entity_Required", Flag174 (Id));
6098 W ("Entry_Accepted", Flag152 (Id));
6099 W ("Finalize_Storage_Only", Flag158 (Id));
6100 W ("From_With_Type", Flag159 (Id));
6101 W ("Function_Returns_With_DSP", Flag169 (Id));
6102 W ("Has_Aliased_Components", Flag135 (Id));
6103 W ("Has_Alignment_Clause", Flag46 (Id));
6104 W ("Has_All_Calls_Remote", Flag79 (Id));
6105 W ("Has_Atomic_Components", Flag86 (Id));
6106 W ("Has_Biased_Representation", Flag139 (Id));
6107 W ("Has_Completion", Flag26 (Id));
6108 W ("Has_Completion_In_Body", Flag71 (Id));
6109 W ("Has_Complex_Representation", Flag140 (Id));
6110 W ("Has_Component_Size_Clause", Flag68 (Id));
6111 W ("Has_Contiguous_Rep", Flag181 (Id));
6112 W ("Has_Controlled_Component", Flag43 (Id));
6113 W ("Has_Controlling_Result", Flag98 (Id));
6114 W ("Has_Convention_Pragma", Flag119 (Id));
6115 W ("Has_Delayed_Freeze", Flag18 (Id));
6116 W ("Has_Discriminants", Flag5 (Id));
6117 W ("Has_Enumeration_Rep_Clause", Flag66 (Id));
6118 W ("Has_Exit", Flag47 (Id));
6119 W ("Has_External_Tag_Rep_Clause", Flag110 (Id));
6120 W ("Has_Forward_Instantiation", Flag175 (Id));
6121 W ("Has_Fully_Qualified_Name", Flag173 (Id));
6122 W ("Has_Gigi_Rep_Item", Flag82 (Id));
6123 W ("Has_Homonym", Flag56 (Id));
6124 W ("Has_Machine_Radix_Clause", Flag83 (Id));
6125 W ("Has_Master_Entity", Flag21 (Id));
6126 W ("Has_Missing_Return", Flag142 (Id));
6127 W ("Has_Nested_Block_With_Handler", Flag101 (Id));
6128 W ("Has_Non_Standard_Rep", Flag75 (Id));
6129 W ("Has_Object_Size_Clause", Flag172 (Id));
6130 W ("Has_Per_Object_Constraint", Flag154 (Id));
6131 W ("Has_Pragma_Controlled", Flag27 (Id));
6132 W ("Has_Pragma_Elaborate_Body", Flag150 (Id));
6133 W ("Has_Pragma_Inline", Flag157 (Id));
6134 W ("Has_Pragma_Pack", Flag121 (Id));
6135 W ("Has_Pragma_Pure_Function", Flag179 (Id));
6136 W ("Has_Pragma_Unreferenced", Flag180 (Id));
6137 W ("Has_Primitive_Operations", Flag120 (Id));
6138 W ("Has_Private_Declaration", Flag155 (Id));
6139 W ("Has_Qualified_Name", Flag161 (Id));
6140 W ("Has_Record_Rep_Clause", Flag65 (Id));
6141 W ("Has_Recursive_Call", Flag143 (Id));
6142 W ("Has_Size_Clause", Flag29 (Id));
6143 W ("Has_Small_Clause", Flag67 (Id));
6144 W ("Has_Specified_Layout", Flag100 (Id));
6145 W ("Has_Storage_Size_Clause", Flag23 (Id));
6146 W ("Has_Subprogram_Descriptor", Flag93 (Id));
6147 W ("Has_Task", Flag30 (Id));
6148 W ("Has_Unchecked_Union", Flag123 (Id));
6149 W ("Has_Unknown_Discriminants", Flag72 (Id));
6150 W ("Has_Volatile_Components", Flag87 (Id));
6151 W ("Has_Xref_Entry", Flag182 (Id));
6152 W ("In_Package_Body", Flag48 (Id));
6153 W ("In_Private_Part", Flag45 (Id));
6154 W ("In_Use", Flag8 (Id));
6155 W ("Is_AST_Entry", Flag132 (Id));
6156 W ("Is_Abstract", Flag19 (Id));
6157 W ("Is_Access_Constant", Flag69 (Id));
6158 W ("Is_Aliased", Flag15 (Id));
6159 W ("Is_Asynchronous", Flag81 (Id));
6160 W ("Is_Atomic", Flag85 (Id));
6161 W ("Is_Bit_Packed_Array", Flag122 (Id));
6162 W ("Is_CPP_Class", Flag74 (Id));
6163 W ("Is_Called", Flag102 (Id));
6164 W ("Is_Character_Type", Flag63 (Id));
6165 W ("Is_Child_Unit", Flag73 (Id));
6166 W ("Is_Class_Wide_Equivalent_Type", Flag35 (Id));
6167 W ("Is_Compilation_Unit", Flag149 (Id));
6168 W ("Is_Completely_Hidden", Flag103 (Id));
6169 W ("Is_Concurrent_Record_Type", Flag20 (Id));
6170 W ("Is_Constr_Subt_For_UN_Aliased", Flag141 (Id));
6171 W ("Is_Constr_Subt_For_U_Nominal", Flag80 (Id));
6172 W ("Is_Constrained", Flag12 (Id));
6173 W ("Is_Constructor", Flag76 (Id));
6174 W ("Is_Controlled", Flag42 (Id));
6175 W ("Is_Controlling_Formal", Flag97 (Id));
6176 W ("Is_Discrim_SO_Function", Flag176 (Id));
6177 W ("Is_Dispatching_Operation", Flag6 (Id));
6178 W ("Is_Eliminated", Flag124 (Id));
6179 W ("Is_Entry_Formal", Flag52 (Id));
6180 W ("Is_Exported", Flag99 (Id));
6181 W ("Is_First_Subtype", Flag70 (Id));
6182 W ("Is_For_Access_Subtype", Flag118 (Id));
6183 W ("Is_Formal_Subprogram", Flag111 (Id));
6184 W ("Is_Frozen", Flag4 (Id));
6185 W ("Is_Generic_Actual_Type", Flag94 (Id));
6186 W ("Is_Generic_Instance", Flag130 (Id));
6187 W ("Is_Generic_Type", Flag13 (Id));
6188 W ("Is_Hidden", Flag57 (Id));
6189 W ("Is_Hidden_Open_Scope", Flag171 (Id));
6190 W ("Is_Immediately_Visible", Flag7 (Id));
6191 W ("Is_Imported", Flag24 (Id));
6192 W ("Is_Inlined", Flag11 (Id));
6193 W ("Is_Instantiated", Flag126 (Id));
6194 W ("Is_Internal", Flag17 (Id));
6195 W ("Is_Interrupt_Handler", Flag89 (Id));
6196 W ("Is_Intrinsic_Subprogram", Flag64 (Id));
6197 W ("Is_Itype", Flag91 (Id));
6198 W ("Is_Known_Valid", Flag37 (Id));
6199 W ("Is_Known_Valid", Flag170 (Id));
6200 W ("Is_Limited_Composite", Flag106 (Id));
6201 W ("Is_Limited_Record", Flag25 (Id));
6202 W ("Is_Machine_Code_Subprogram", Flag137 (Id));
6203 W ("Is_Non_Static_Subtype", Flag109 (Id));
6204 W ("Is_Null_Init_Proc", Flag178 (Id));
6205 W ("Is_Optional_Parameter", Flag134 (Id));
6206 W ("Is_Overriding_Operation", Flag39 (Id));
6207 W ("Is_Package_Body_Entity", Flag160 (Id));
6208 W ("Is_Packed", Flag51 (Id));
6209 W ("Is_Packed_Array_Type", Flag138 (Id));
6210 W ("Is_Potentially_Use_Visible", Flag9 (Id));
6211 W ("Is_Preelaborated", Flag59 (Id));
6212 W ("Is_Private_Composite", Flag107 (Id));
6213 W ("Is_Private_Descendant", Flag53 (Id));
6214 W ("Is_Psected", Flag153 (Id));
6215 W ("Is_Public", Flag10 (Id));
6216 W ("Is_Pure", Flag44 (Id));
6217 W ("Is_Remote_Call_Interface", Flag62 (Id));
6218 W ("Is_Remote_Types", Flag61 (Id));
6219 W ("Is_Renaming_Of_Object", Flag112 (Id));
6220 W ("Is_Shared_Passive", Flag60 (Id));
6221 W ("Is_Statically_Allocated", Flag28 (Id));
6222 W ("Is_Tag", Flag78 (Id));
6223 W ("Is_Tagged_Type", Flag55 (Id));
6224 W ("Is_Thread_Body", Flag77 (Id));
6225 W ("Is_True_Constant", Flag163 (Id));
6226 W ("Is_Unchecked_Union", Flag117 (Id));
6227 W ("Is_Unsigned_Type", Flag144 (Id));
6228 W ("Is_VMS_Exception", Flag133 (Id));
6229 W ("Is_Valued_Procedure", Flag127 (Id));
6230 W ("Is_Visible_Child_Unit", Flag116 (Id));
6231 W ("Is_Volatile", Flag16 (Id));
6232 W ("Kill_Elaboration_Checks", Flag32 (Id));
6233 W ("Kill_Range_Checks", Flag33 (Id));
6234 W ("Kill_Tag_Checks", Flag34 (Id));
6235 W ("Machine_Radix_10", Flag84 (Id));
6236 W ("Materialize_Entity", Flag168 (Id));
6237 W ("Needs_Debug_Info", Flag147 (Id));
6238 W ("Needs_No_Actuals", Flag22 (Id));
6239 W ("Never_Set_In_Source", Flag115 (Id));
6240 W ("No_Pool_Assigned", Flag131 (Id));
6241 W ("No_Return", Flag113 (Id));
6242 W ("No_Strict_Aliasing", Flag136 (Id));
6243 W ("Non_Binary_Modulus", Flag58 (Id));
6244 W ("Nonzero_Is_True", Flag162 (Id));
6245 W ("Reachable", Flag49 (Id));
6246 W ("Referenced", Flag156 (Id));
6247 W ("Referenced_As_LHS", Flag36 (Id));
6248 W ("Return_Present", Flag54 (Id));
6249 W ("Returns_By_Ref", Flag90 (Id));
6250 W ("Reverse_Bit_Order", Flag164 (Id));
6251 W ("Sec_Stack_Needed_For_Return", Flag167 (Id));
6252 W ("Size_Depends_On_Discriminant", Flag177 (Id));
6253 W ("Size_Known_At_Compile_Time", Flag92 (Id));
6254 W ("Strict_Alignment", Flag145 (Id));
6255 W ("Suppress_Elaboration_Warnings", Flag148 (Id));
6256 W ("Suppress_Init_Proc", Flag105 (Id));
6257 W ("Suppress_Style_Checks", Flag165 (Id));
6258 W ("Treat_As_Volatile", Flag41 (Id));
6259 W ("Uses_Sec_Stack", Flag95 (Id));
6260 W ("Vax_Float", Flag151 (Id));
6261 W ("Warnings_Off", Flag96 (Id));
6262 end Write_Entity_Flags;
6264 -----------------------
6265 -- Write_Entity_Info --
6266 -----------------------
6268 procedure Write_Entity_Info (Id : Entity_Id; Prefix : String) is
6270 procedure Write_Attribute (Which : String; Nam : E);
6271 -- Write attribute value with given string name
6273 procedure Write_Kind (Id : Entity_Id);
6274 -- Write Ekind field of entity
6276 procedure Write_Attribute (Which : String; Nam : E) is
6280 Write_Int (Int (Nam));
6282 Write_Name (Chars (Nam));
6284 end Write_Attribute;
6286 procedure Write_Kind (Id : Entity_Id) is
6287 K : constant String := Entity_Kind'Image (Ekind (Id));
6291 Write_Str (" Kind ");
6293 if Is_Type (Id) and then Is_Tagged_Type (Id) then
6294 Write_Str ("TAGGED ");
6297 Write_Str (K (3 .. K'Length));
6300 if Is_Type (Id) and then Depends_On_Private (Id) then
6301 Write_Str ("Depends_On_Private ");
6305 -- Start of processing for Write_Entity_Info
6309 Write_Attribute ("Name ", Id);
6310 Write_Int (Int (Id));
6314 Write_Attribute (" Type ", Etype (Id));
6316 Write_Attribute (" Scope ", Scope (Id));
6321 when Discrete_Kind =>
6322 Write_Str ("Bounds: Id = ");
6324 if Present (Scalar_Range (Id)) then
6325 Write_Int (Int (Type_Low_Bound (Id)));
6326 Write_Str (" .. Id = ");
6327 Write_Int (Int (Type_High_Bound (Id)));
6329 Write_Str ("Empty");
6339 Write_Attribute (" Component Type ",
6340 Component_Type (Id));
6343 Write_Str (" Indices ");
6345 Index := First_Index (Id);
6347 while Present (Index) loop
6348 Write_Attribute (" ", Etype (Index));
6349 Index := Next_Index (Index);
6357 (" Directly Designated Type ",
6358 Directly_Designated_Type (Id));
6361 when Overloadable_Kind =>
6362 if Present (Homonym (Id)) then
6363 Write_Str (" Homonym ");
6364 Write_Name (Chars (Homonym (Id)));
6366 Write_Int (Int (Homonym (Id)));
6373 if Ekind (Scope (Id)) in Record_Kind then
6375 " Original_Record_Component ",
6376 Original_Record_Component (Id));
6377 Write_Int (Int (Original_Record_Component (Id)));
6381 when others => null;
6383 end Write_Entity_Info;
6385 -----------------------
6386 -- Write_Field6_Name --
6387 -----------------------
6389 procedure Write_Field6_Name (Id : Entity_Id) is
6390 pragma Warnings (Off, Id);
6393 Write_Str ("First_Rep_Item");
6394 end Write_Field6_Name;
6396 -----------------------
6397 -- Write_Field7_Name --
6398 -----------------------
6400 procedure Write_Field7_Name (Id : Entity_Id) is
6401 pragma Warnings (Off, Id);
6404 Write_Str ("Freeze_Node");
6405 end Write_Field7_Name;
6407 -----------------------
6408 -- Write_Field8_Name --
6409 -----------------------
6411 procedure Write_Field8_Name (Id : Entity_Id) is
6416 Write_Str ("Normalized_First_Bit");
6420 E_Subprogram_Body =>
6421 Write_Str ("Mechanism");
6424 Write_Str ("Associated_Node_For_Itype");
6427 Write_Str ("Dependent_Instances");
6430 Write_Str ("Hiding_Loop_Variable");
6433 Write_Str ("Field8??");
6435 end Write_Field8_Name;
6437 -----------------------
6438 -- Write_Field9_Name --
6439 -----------------------
6441 procedure Write_Field9_Name (Id : Entity_Id) is
6445 Write_Str ("Class_Wide_Type");
6448 E_Generic_Function |
6450 E_Generic_Procedure |
6453 Write_Str ("Renaming_Map");
6456 Write_Str ("Current_Value");
6459 Write_Str ("Field9??");
6461 end Write_Field9_Name;
6463 ------------------------
6464 -- Write_Field10_Name --
6465 ------------------------
6467 procedure Write_Field10_Name (Id : Entity_Id) is
6471 Write_Str ("Referenced_Object");
6473 when E_In_Parameter |
6475 Write_Str ("Discriminal_Link");
6481 Write_Str ("Handler_Records");
6485 Write_Str ("Normalized_Position_Max");
6488 Write_Str ("Field10??");
6490 end Write_Field10_Name;
6492 ------------------------
6493 -- Write_Field11_Name --
6494 ------------------------
6496 procedure Write_Field11_Name (Id : Entity_Id) is
6500 Write_Str ("Entry_Component");
6504 Write_Str ("Component_Bit_Offset");
6507 Write_Str ("Full_View");
6509 when E_Enumeration_Literal =>
6510 Write_Str ("Enumeration_Pos");
6513 Write_Str ("Block_Node");
6519 Write_Str ("Protected_Body_Subprogram");
6521 when E_Generic_Package =>
6522 Write_Str ("Generic_Homonym");
6525 Write_Str ("Full_View");
6528 Write_Str ("Field11??");
6530 end Write_Field11_Name;
6532 ------------------------
6533 -- Write_Field12_Name --
6534 ------------------------
6536 procedure Write_Field12_Name (Id : Entity_Id) is
6540 Write_Str ("Barrier_Function");
6542 when E_Enumeration_Literal =>
6543 Write_Str ("Enumeration_Rep");
6550 E_In_Out_Parameter |
6554 Write_Str ("Esize");
6558 Write_Str ("Next_Inlined_Subprogram");
6561 Write_Str ("Associated_Formal_Package");
6564 Write_Str ("Field12??");
6566 end Write_Field12_Name;
6568 ------------------------
6569 -- Write_Field13_Name --
6570 ------------------------
6572 procedure Write_Field13_Name (Id : Entity_Id) is
6576 Write_Str ("RM_Size");
6580 Write_Str ("Component_Clause");
6582 when E_Enumeration_Literal =>
6583 Write_Str ("Debug_Renaming_Link");
6586 if not Comes_From_Source (Id)
6588 Chars (Id) = Name_Op_Ne
6590 Write_Str ("Corresponding_Equality");
6592 elsif Comes_From_Source (Id) then
6593 Write_Str ("Elaboration_Entity");
6596 Write_Str ("Field13??");
6601 Write_Str ("Extra_Accessibility");
6605 Generic_Unit_Kind =>
6606 Write_Str ("Elaboration_Entity");
6609 Write_Str ("Field13??");
6611 end Write_Field13_Name;
6613 -----------------------
6614 -- Write_Field14_Name --
6615 -----------------------
6617 procedure Write_Field14_Name (Id : Entity_Id) is
6625 Write_Str ("Alignment");
6629 Write_Str ("Normalized_Position");
6633 Write_Str ("First_Optional_Parameter");
6636 E_Generic_Package =>
6637 Write_Str ("Shadow_Entities");
6640 Write_Str ("Field14??");
6642 end Write_Field14_Name;
6644 ------------------------
6645 -- Write_Field15_Name --
6646 ------------------------
6648 procedure Write_Field15_Name (Id : Entity_Id) is
6653 Write_Str ("Storage_Size_Variable");
6655 when Class_Wide_Kind |
6659 Write_Str ("Primitive_Operations");
6662 Write_Str ("DT_Entry_Count");
6664 when Decimal_Fixed_Point_Kind =>
6665 Write_Str ("Scale_Value");
6667 when E_Discriminant =>
6668 Write_Str ("Discriminant_Number");
6671 Write_Str ("Extra_Formal");
6675 Write_Str ("DT_Position");
6678 Write_Str ("Entry_Parameters_Type");
6680 when Enumeration_Kind =>
6681 Write_Str ("Lit_Indexes");
6685 Write_Str ("Related_Instance");
6687 when E_Protected_Type =>
6688 Write_Str ("Entry_Bodies_Array");
6690 when E_String_Literal_Subtype =>
6691 Write_Str ("String_Literal_Low_Bound");
6694 Write_Str ("Shared_Var_Read_Proc");
6697 Write_Str ("Field15??");
6699 end Write_Field15_Name;
6701 ------------------------
6702 -- Write_Field16_Name --
6703 ------------------------
6705 procedure Write_Field16_Name (Id : Entity_Id) is
6709 Write_Str ("Entry_Formal");
6713 Write_Str ("DTC_Entity");
6718 Write_Str ("First_Private_Entity");
6720 when E_Record_Type |
6721 E_Record_Type_With_Private =>
6722 Write_Str ("Access_Disp_Table");
6724 when E_String_Literal_Subtype =>
6725 Write_Str ("String_Literal_Length");
6727 when Enumeration_Kind =>
6728 Write_Str ("Lit_Strings");
6732 Write_Str ("Unset_Reference");
6734 when E_Record_Subtype |
6735 E_Class_Wide_Subtype =>
6736 Write_Str ("Cloned_Subtype");
6739 Write_Str ("Field16??");
6741 end Write_Field16_Name;
6743 ------------------------
6744 -- Write_Field17_Name --
6745 ------------------------
6747 procedure Write_Field17_Name (Id : Entity_Id) is
6751 Write_Str ("Digits_Value");
6754 Write_Str ("Prival");
6756 when E_Discriminant =>
6757 Write_Str ("Discriminal");
6766 E_Generic_Function |
6768 E_Generic_Procedure |
6777 E_Subprogram_Type =>
6778 Write_Str ("First_Entity");
6781 Write_Str ("First_Index");
6783 when E_Protected_Body =>
6784 Write_Str ("Object_Ref");
6786 when Enumeration_Kind =>
6787 Write_Str ("First_Literal");
6790 Write_Str ("Master_Id");
6792 when Modular_Integer_Kind =>
6793 Write_Str ("Modulus");
6797 E_Generic_In_Out_Parameter |
6799 Write_Str ("Actual_Subtype");
6801 when E_Incomplete_Type =>
6802 Write_Str ("Non-limited view");
6805 Write_Str ("Field17??");
6807 end Write_Field17_Name;
6809 -----------------------
6810 -- Write_Field18_Name --
6811 -----------------------
6813 procedure Write_Field18_Name (Id : Entity_Id) is
6816 when E_Enumeration_Literal |
6820 Write_Str ("Alias");
6822 when E_Record_Type =>
6823 Write_Str ("Corresponding_Concurrent_Type");
6825 when E_Entry_Index_Parameter =>
6826 Write_Str ("Entry_Index_Constant");
6828 when E_Class_Wide_Subtype |
6829 E_Access_Protected_Subprogram_Type |
6830 E_Access_Subprogram_Type |
6832 Write_Str ("Equivalent_Type");
6834 when Fixed_Point_Kind =>
6835 Write_Str ("Delta_Value");
6839 Write_Str ("Renamed_Object");
6843 E_Generic_Function |
6844 E_Generic_Procedure |
6845 E_Generic_Package =>
6846 Write_Str ("Renamed_Entity");
6848 when Incomplete_Or_Private_Kind =>
6849 Write_Str ("Private_Dependents");
6851 when Concurrent_Kind =>
6852 Write_Str ("Corresponding_Record_Type");
6857 Write_Str ("Enclosing_Scope");
6860 Write_Str ("Field18??");
6862 end Write_Field18_Name;
6864 -----------------------
6865 -- Write_Field19_Name --
6866 -----------------------
6868 procedure Write_Field19_Name (Id : Entity_Id) is
6873 Write_Str ("Related_Array_Object");
6880 Write_Str ("Finalization_Chain_Entity");
6882 when E_Constant | E_Variable =>
6883 Write_Str ("Size_Check_Code");
6885 when E_Discriminant =>
6886 Write_Str ("Corresponding_Discriminant");
6889 E_Generic_Package =>
6890 Write_Str ("Body_Entity");
6892 when E_Package_Body |
6894 Write_Str ("Spec_Entity");
6896 when Private_Kind =>
6897 Write_Str ("Underlying_Full_View");
6899 when E_Record_Type =>
6900 Write_Str ("Parent_Subtype");
6903 Write_Str ("Field19??");
6905 end Write_Field19_Name;
6907 -----------------------
6908 -- Write_Field20_Name --
6909 -----------------------
6911 procedure Write_Field20_Name (Id : Entity_Id) is
6915 Write_Str ("Component_Type");
6917 when E_In_Parameter |
6918 E_Generic_In_Parameter =>
6919 Write_Str ("Default_Value");
6922 Write_Str ("Directly_Designated_Type");
6925 Write_Str ("Discriminant_Checking_Func");
6927 when E_Discriminant =>
6928 Write_Str ("Discriminant_Default_Value");
6937 E_Generic_Function |
6939 E_Generic_Procedure |
6948 E_Subprogram_Type =>
6950 Write_Str ("Last_Entity");
6953 Write_Str ("Scalar_Range");
6956 Write_Str ("Register_Exception_Call");
6959 Write_Str ("Field20??");
6961 end Write_Field20_Name;
6963 -----------------------
6964 -- Write_Field21_Name --
6965 -----------------------
6967 procedure Write_Field21_Name (Id : Entity_Id) is
6973 E_Generic_Function |
6975 E_Generic_Procedure |
6977 Write_Str ("Interface_Name");
6979 when Concurrent_Kind |
6980 Incomplete_Or_Private_Kind |
6984 Write_Str ("Discriminant_Constraint");
6987 Write_Str ("Accept_Address");
6989 when Fixed_Point_Kind =>
6990 Write_Str ("Small_Value");
6992 when E_In_Parameter =>
6993 Write_Str ("Default_Expr_Function");
6996 Modular_Integer_Kind =>
6997 Write_Str ("Original_Array_Type");
7000 Write_Str ("Field21??");
7002 end Write_Field21_Name;
7004 -----------------------
7005 -- Write_Field22_Name --
7006 -----------------------
7008 procedure Write_Field22_Name (Id : Entity_Id) is
7012 Write_Str ("Associated_Storage_Pool");
7015 Write_Str ("Component_Size");
7019 Write_Str ("Original_Record_Component");
7021 when E_Enumeration_Literal =>
7022 Write_Str ("Enumeration_Rep_Expr");
7025 Write_Str ("Exception_Code");
7028 Write_Str ("Protected_Formal");
7030 when E_Record_Type =>
7031 Write_Str ("Corresponding_Remote_Type");
7041 E_Generic_Function |
7042 E_Generic_Procedure |
7047 Write_Str ("Scope_Depth_Value");
7049 when E_Record_Type_With_Private |
7050 E_Record_Subtype_With_Private |
7053 E_Limited_Private_Type |
7054 E_Limited_Private_Subtype =>
7055 Write_Str ("Private_View");
7058 Write_Str ("Shared_Var_Assign_Proc");
7061 Write_Str ("Field22??");
7063 end Write_Field22_Name;
7065 ------------------------
7066 -- Write_Field23_Name --
7067 ------------------------
7069 procedure Write_Field23_Name (Id : Entity_Id) is
7073 Write_Str ("Associated_Final_Chain");
7076 Write_Str ("Packed_Array_Type");
7079 Write_Str ("Entry_Cancel_Parameter");
7082 Write_Str ("Protected_Operation");
7084 when E_Discriminant =>
7085 Write_Str ("CR_Discriminant");
7087 when E_Enumeration_Type =>
7088 Write_Str ("Enum_Pos_To_Rep");
7092 Write_Str ("Extra_Constrained");
7094 when E_Generic_Function |
7096 E_Generic_Procedure =>
7097 Write_Str ("Inner_Instances");
7099 when Concurrent_Kind |
7100 Incomplete_Or_Private_Kind |
7104 Write_Str ("Stored_Constraint");
7108 Write_Str ("Generic_Renamings");
7111 if Is_Generic_Instance (Id) then
7112 Write_Str ("Generic_Renamings");
7114 Write_Str ("Limited Views");
7117 -- What about Privals_Chain for protected operations ???
7120 Write_Str ("Privals_Chain");
7123 Write_Str ("Field23??");
7125 end Write_Field23_Name;
7127 -------------------------
7128 -- Iterator Procedures --
7129 -------------------------
7131 procedure Proc_Next_Component (N : in out Node_Id) is
7133 N := Next_Component (N);
7134 end Proc_Next_Component;
7136 procedure Proc_Next_Discriminant (N : in out Node_Id) is
7138 N := Next_Discriminant (N);
7139 end Proc_Next_Discriminant;
7141 procedure Proc_Next_Formal (N : in out Node_Id) is
7143 N := Next_Formal (N);
7144 end Proc_Next_Formal;
7146 procedure Proc_Next_Formal_With_Extras (N : in out Node_Id) is
7148 N := Next_Formal_With_Extras (N);
7149 end Proc_Next_Formal_With_Extras;
7151 procedure Proc_Next_Index (N : in out Node_Id) is
7153 N := Next_Index (N);
7154 end Proc_Next_Index;
7156 procedure Proc_Next_Inlined_Subprogram (N : in out Node_Id) is
7158 N := Next_Inlined_Subprogram (N);
7159 end Proc_Next_Inlined_Subprogram;
7161 procedure Proc_Next_Literal (N : in out Node_Id) is
7163 N := Next_Literal (N);
7164 end Proc_Next_Literal;
7166 procedure Proc_Next_Stored_Discriminant (N : in out Node_Id) is
7168 N := Next_Stored_Discriminant (N);
7169 end Proc_Next_Stored_Discriminant;