1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2003 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 CPARTICULAR 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 -- Is_Machine_Code_Subprogram Flag137
371 -- Is_Packed_Array_Type Flag138
372 -- Has_Biased_Representation Flag139
373 -- Has_Complex_Representation Flag140
375 -- Is_Constr_Subt_For_UN_Aliased Flag141
376 -- Has_Missing_Return Flag142
377 -- Has_Recursive_Call Flag143
378 -- Is_Unsigned_Type Flag144
379 -- Strict_Alignment Flag145
380 -- Elaborate_All_Desirable Flag146
381 -- Needs_Debug_Info Flag147
382 -- Suppress_Elaboration_Warnings Flag148
383 -- Is_Compilation_Unit Flag149
384 -- Has_Pragma_Elaborate_Body Flag150
387 -- Entry_Accepted Flag152
388 -- Is_Psected Flag153
389 -- Has_Per_Object_Constraint Flag154
390 -- Has_Private_Declaration Flag155
391 -- Referenced Flag156
392 -- Has_Pragma_Inline Flag157
393 -- Finalize_Storage_Only Flag158
394 -- From_With_Type Flag159
395 -- Is_Package_Body_Entity Flag160
397 -- Has_Qualified_Name Flag161
398 -- Nonzero_Is_True Flag162
399 -- Is_True_Constant Flag163
400 -- Reverse_Bit_Order Flag164
401 -- Suppress_Style_Checks Flag165
402 -- Debug_Info_Off Flag166
403 -- Sec_Stack_Needed_For_Return Flag167
404 -- Materialize_Entity Flag168
405 -- Function_Returns_With_DSP Flag169
406 -- Is_Known_Valid Flag170
408 -- Is_Hidden_Open_Scope Flag171
409 -- Has_Object_Size_Clause Flag172
410 -- Has_Fully_Qualified_Name Flag173
411 -- Elaboration_Entity_Required Flag174
412 -- Has_Forward_Instantiation Flag175
413 -- Is_Discrim_SO_Function Flag176
414 -- Size_Depends_On_Discriminant Flag177
415 -- Is_Null_Init_Proc Flag178
416 -- Has_Pragma_Pure_Function Flag179
417 -- Has_Pragma_Unreferenced Flag180
419 -- Has_Contiguous_Rep Flag181
420 -- Has_Xref_Entry Flag182
422 -- 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 Non_Binary_Modulus (Id : E) return B is
1798 pragma Assert (Is_Modular_Integer_Type (Id));
1799 return Flag58 (Base_Type (Id));
1800 end Non_Binary_Modulus;
1802 function Non_Limited_View (Id : E) return E is
1804 pragma Assert (False
1805 or else Ekind (Id) = E_Incomplete_Type);
1807 end Non_Limited_View;
1809 function Nonzero_Is_True (Id : E) return B is
1811 pragma Assert (Root_Type (Id) = Standard_Boolean);
1812 return Flag162 (Base_Type (Id));
1813 end Nonzero_Is_True;
1815 function Normalized_First_Bit (Id : E) return U is
1818 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
1820 end Normalized_First_Bit;
1822 function Normalized_Position (Id : E) return U is
1825 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
1827 end Normalized_Position;
1829 function Normalized_Position_Max (Id : E) return U is
1832 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
1834 end Normalized_Position_Max;
1836 function Object_Ref (Id : E) return E is
1838 pragma Assert (Ekind (Id) = E_Protected_Body);
1842 function Original_Array_Type (Id : E) return E is
1844 pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id));
1846 end Original_Array_Type;
1848 function Original_Record_Component (Id : E) return E is
1851 (Ekind (Id) = E_Void
1852 or else Ekind (Id) = E_Component
1853 or else Ekind (Id) = E_Discriminant);
1855 end Original_Record_Component;
1857 function Packed_Array_Type (Id : E) return E is
1859 pragma Assert (Is_Array_Type (Id));
1861 end Packed_Array_Type;
1863 function Parent_Subtype (Id : E) return E is
1865 pragma Assert (Ekind (Id) = E_Record_Type);
1869 function Primitive_Operations (Id : E) return L is
1871 pragma Assert (Is_Tagged_Type (Id));
1872 return Elist15 (Id);
1873 end Primitive_Operations;
1875 function Prival (Id : E) return E is
1877 pragma Assert (Is_Protected_Private (Id));
1881 function Privals_Chain (Id : E) return L is
1883 pragma Assert (Is_Overloadable (Id)
1884 or else Ekind (Id) = E_Entry_Family);
1885 return Elist23 (Id);
1888 function Private_Dependents (Id : E) return L is
1890 pragma Assert (Is_Incomplete_Or_Private_Type (Id));
1891 return Elist18 (Id);
1892 end Private_Dependents;
1894 function Private_View (Id : E) return N is
1896 pragma Assert (Is_Private_Type (Id));
1900 function Protected_Body_Subprogram (Id : E) return E is
1902 pragma Assert (Is_Subprogram (Id) or else Is_Entry (Id));
1904 end Protected_Body_Subprogram;
1906 function Protected_Formal (Id : E) return E is
1908 pragma Assert (Is_Formal (Id));
1910 end Protected_Formal;
1912 function Protected_Operation (Id : E) return N is
1914 pragma Assert (Is_Protected_Private (Id));
1916 end Protected_Operation;
1918 function Reachable (Id : E) return B is
1923 function Referenced (Id : E) return B is
1925 return Flag156 (Id);
1928 function Referenced_As_LHS (Id : E) return B is
1931 end Referenced_As_LHS;
1933 function Referenced_Object (Id : E) return N is
1935 pragma Assert (Is_Type (Id));
1937 end Referenced_Object;
1939 function Register_Exception_Call (Id : E) return N is
1941 pragma Assert (Ekind (Id) = E_Exception);
1943 end Register_Exception_Call;
1945 function Related_Array_Object (Id : E) return E is
1947 pragma Assert (Is_Array_Type (Id));
1949 end Related_Array_Object;
1951 function Related_Instance (Id : E) return E is
1954 (Ekind (Id) = E_Package or else Ekind (Id) = E_Package_Body);
1956 end Related_Instance;
1958 function Renamed_Entity (Id : E) return N is
1963 function Renamed_Object (Id : E) return N is
1968 function Renaming_Map (Id : E) return U is
1973 function Return_Present (Id : E) return B is
1978 function Returns_By_Ref (Id : E) return B is
1983 function Reverse_Bit_Order (Id : E) return B is
1985 pragma Assert (Is_Record_Type (Id));
1986 return Flag164 (Base_Type (Id));
1987 end Reverse_Bit_Order;
1989 function RM_Size (Id : E) return U is
1991 pragma Assert (Is_Type (Id));
1995 function Scalar_Range (Id : E) return N is
2000 function Scale_Value (Id : E) return U is
2005 function Scope_Depth_Value (Id : E) return U is
2008 end Scope_Depth_Value;
2010 function Sec_Stack_Needed_For_Return (Id : E) return B is
2012 return Flag167 (Id);
2013 end Sec_Stack_Needed_For_Return;
2015 function Shadow_Entities (Id : E) return S is
2018 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
2020 end Shadow_Entities;
2022 function Shared_Var_Assign_Proc (Id : E) return E is
2024 pragma Assert (Ekind (Id) = E_Variable);
2026 end Shared_Var_Assign_Proc;
2028 function Shared_Var_Read_Proc (Id : E) return E is
2030 pragma Assert (Ekind (Id) = E_Variable);
2032 end Shared_Var_Read_Proc;
2034 function Size_Check_Code (Id : E) return N is
2036 pragma Assert (Ekind (Id) = E_Constant or else Ekind (Id) = E_Variable);
2038 end Size_Check_Code;
2040 function Size_Depends_On_Discriminant (Id : E) return B is
2042 return Flag177 (Id);
2043 end Size_Depends_On_Discriminant;
2045 function Size_Known_At_Compile_Time (Id : E) return B is
2048 end Size_Known_At_Compile_Time;
2050 function Small_Value (Id : E) return R is
2052 pragma Assert (Is_Fixed_Point_Type (Id));
2053 return Ureal21 (Id);
2056 function Spec_Entity (Id : E) return E is
2059 (Ekind (Id) = E_Package_Body or else Is_Formal (Id));
2063 function Storage_Size_Variable (Id : E) return E is
2065 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
2066 return Node15 (Implementation_Base_Type (Id));
2067 end Storage_Size_Variable;
2069 function Stored_Constraint (Id : E) return L is
2072 (Is_Composite_Type (Id) and then not Is_Array_Type (Id));
2073 return Elist23 (Id);
2074 end Stored_Constraint;
2076 function Strict_Alignment (Id : E) return B is
2078 return Flag145 (Implementation_Base_Type (Id));
2079 end Strict_Alignment;
2081 function String_Literal_Length (Id : E) return U is
2084 end String_Literal_Length;
2086 function String_Literal_Low_Bound (Id : E) return N is
2089 end String_Literal_Low_Bound;
2091 function Suppress_Elaboration_Warnings (Id : E) return B is
2093 return Flag148 (Id);
2094 end Suppress_Elaboration_Warnings;
2096 function Suppress_Init_Proc (Id : E) return B is
2098 return Flag105 (Base_Type (Id));
2099 end Suppress_Init_Proc;
2101 function Suppress_Style_Checks (Id : E) return B is
2103 return Flag165 (Id);
2104 end Suppress_Style_Checks;
2106 function Treat_As_Volatile (Id : E) return B is
2109 end Treat_As_Volatile;
2111 function Underlying_Full_View (Id : E) return E is
2113 pragma Assert (Ekind (Id) in Private_Kind);
2115 end Underlying_Full_View;
2117 function Unset_Reference (Id : E) return N is
2120 end Unset_Reference;
2122 function Uses_Sec_Stack (Id : E) return B is
2127 function Vax_Float (Id : E) return B is
2129 return Flag151 (Base_Type (Id));
2132 function Warnings_Off (Id : E) return B is
2137 ------------------------------
2138 -- Classification Functions --
2139 ------------------------------
2141 function Is_Access_Type (Id : E) return B is
2143 return Ekind (Id) in Access_Kind;
2146 function Is_Array_Type (Id : E) return B is
2148 return Ekind (Id) in Array_Kind;
2151 function Is_Class_Wide_Type (Id : E) return B is
2153 return Ekind (Id) in Class_Wide_Kind;
2154 end Is_Class_Wide_Type;
2156 function Is_Composite_Type (Id : E) return B is
2158 return Ekind (Id) in Composite_Kind;
2159 end Is_Composite_Type;
2161 function Is_Concurrent_Body (Id : E) return B is
2163 return Ekind (Id) in
2164 Concurrent_Body_Kind;
2165 end Is_Concurrent_Body;
2167 function Is_Concurrent_Record_Type (Id : E) return B is
2170 end Is_Concurrent_Record_Type;
2172 function Is_Concurrent_Type (Id : E) return B is
2174 return Ekind (Id) in Concurrent_Kind;
2175 end Is_Concurrent_Type;
2177 function Is_Decimal_Fixed_Point_Type (Id : E) return B is
2179 return Ekind (Id) in
2180 Decimal_Fixed_Point_Kind;
2181 end Is_Decimal_Fixed_Point_Type;
2183 function Is_Digits_Type (Id : E) return B is
2185 return Ekind (Id) in Digits_Kind;
2188 function Is_Discrete_Or_Fixed_Point_Type (Id : E) return B is
2190 return Ekind (Id) in Discrete_Or_Fixed_Point_Kind;
2191 end Is_Discrete_Or_Fixed_Point_Type;
2193 function Is_Discrete_Type (Id : E) return B is
2195 return Ekind (Id) in Discrete_Kind;
2196 end Is_Discrete_Type;
2198 function Is_Elementary_Type (Id : E) return B is
2200 return Ekind (Id) in Elementary_Kind;
2201 end Is_Elementary_Type;
2203 function Is_Entry (Id : E) return B is
2205 return Ekind (Id) in Entry_Kind;
2208 function Is_Enumeration_Type (Id : E) return B is
2210 return Ekind (Id) in
2212 end Is_Enumeration_Type;
2214 function Is_Fixed_Point_Type (Id : E) return B is
2216 return Ekind (Id) in
2218 end Is_Fixed_Point_Type;
2220 function Is_Floating_Point_Type (Id : E) return B is
2222 return Ekind (Id) in Float_Kind;
2223 end Is_Floating_Point_Type;
2225 function Is_Formal (Id : E) return B is
2227 return Ekind (Id) in Formal_Kind;
2230 function Is_Generic_Subprogram (Id : E) return B is
2232 return Ekind (Id) in Generic_Subprogram_Kind;
2233 end Is_Generic_Subprogram;
2235 function Is_Generic_Unit (Id : E) return B is
2237 return Ekind (Id) in Generic_Unit_Kind;
2238 end Is_Generic_Unit;
2240 function Is_Incomplete_Or_Private_Type (Id : E) return B is
2242 return Ekind (Id) in
2243 Incomplete_Or_Private_Kind;
2244 end Is_Incomplete_Or_Private_Type;
2246 function Is_Integer_Type (Id : E) return B is
2248 return Ekind (Id) in Integer_Kind;
2249 end Is_Integer_Type;
2251 function Is_Modular_Integer_Type (Id : E) return B is
2253 return Ekind (Id) in
2254 Modular_Integer_Kind;
2255 end Is_Modular_Integer_Type;
2257 function Is_Named_Number (Id : E) return B is
2259 return Ekind (Id) in Named_Kind;
2260 end Is_Named_Number;
2262 function Is_Numeric_Type (Id : E) return B is
2264 return Ekind (Id) in Numeric_Kind;
2265 end Is_Numeric_Type;
2267 function Is_Object (Id : E) return B is
2269 return Ekind (Id) in Object_Kind;
2272 function Is_Ordinary_Fixed_Point_Type (Id : E) return B is
2274 return Ekind (Id) in
2275 Ordinary_Fixed_Point_Kind;
2276 end Is_Ordinary_Fixed_Point_Type;
2278 function Is_Overloadable (Id : E) return B is
2280 return Ekind (Id) in Overloadable_Kind;
2281 end Is_Overloadable;
2283 function Is_Private_Type (Id : E) return B is
2285 return Ekind (Id) in Private_Kind;
2286 end Is_Private_Type;
2288 function Is_Protected_Type (Id : E) return B is
2290 return Ekind (Id) in Protected_Kind;
2291 end Is_Protected_Type;
2293 function Is_Real_Type (Id : E) return B is
2295 return Ekind (Id) in Real_Kind;
2298 function Is_Record_Type (Id : E) return B is
2300 return Ekind (Id) in Record_Kind;
2303 function Is_Scalar_Type (Id : E) return B is
2305 return Ekind (Id) in Scalar_Kind;
2308 function Is_Signed_Integer_Type (Id : E) return B is
2310 return Ekind (Id) in
2311 Signed_Integer_Kind;
2312 end Is_Signed_Integer_Type;
2314 function Is_Subprogram (Id : E) return B is
2316 return Ekind (Id) in Subprogram_Kind;
2319 function Is_Task_Type (Id : E) return B is
2321 return Ekind (Id) in Task_Kind;
2324 function Is_Type (Id : E) return B is
2326 return Ekind (Id) in Type_Kind;
2329 ------------------------------
2330 -- Attribute Set Procedures --
2331 ------------------------------
2333 procedure Set_Accept_Address (Id : E; V : L) is
2335 Set_Elist21 (Id, V);
2336 end Set_Accept_Address;
2338 procedure Set_Access_Disp_Table (Id : E; V : E) is
2340 pragma Assert (Is_Tagged_Type (Id) and then Id = Base_Type (Id));
2342 end Set_Access_Disp_Table;
2344 procedure Set_Associated_Final_Chain (Id : E; V : E) is
2346 pragma Assert (Is_Access_Type (Id));
2348 end Set_Associated_Final_Chain;
2350 procedure Set_Associated_Formal_Package (Id : E; V : E) is
2353 end Set_Associated_Formal_Package;
2355 procedure Set_Associated_Node_For_Itype (Id : E; V : E) is
2358 end Set_Associated_Node_For_Itype;
2360 procedure Set_Associated_Storage_Pool (Id : E; V : E) is
2362 pragma Assert (Is_Access_Type (Id) and then Id = Base_Type (Id));
2364 end Set_Associated_Storage_Pool;
2366 procedure Set_Actual_Subtype (Id : E; V : E) is
2369 (Ekind (Id) = E_Constant
2370 or else Ekind (Id) = E_Variable
2371 or else Ekind (Id) = E_Generic_In_Out_Parameter
2372 or else Ekind (Id) in E_In_Parameter .. E_In_Out_Parameter);
2374 end Set_Actual_Subtype;
2376 procedure Set_Address_Taken (Id : E; V : B := True) is
2378 Set_Flag104 (Id, V);
2379 end Set_Address_Taken;
2381 procedure Set_Alias (Id : E; V : E) is
2384 (Is_Overloadable (Id) or else Ekind (Id) = E_Subprogram_Type);
2388 procedure Set_Alignment (Id : E; V : U) is
2390 pragma Assert (Is_Type (Id)
2391 or else Is_Formal (Id)
2392 or else Ekind (Id) = E_Loop_Parameter
2393 or else Ekind (Id) = E_Constant
2394 or else Ekind (Id) = E_Exception
2395 or else Ekind (Id) = E_Variable);
2399 procedure Set_Barrier_Function (Id : E; V : N) is
2401 pragma Assert (Is_Entry (Id));
2403 end Set_Barrier_Function;
2405 procedure Set_Block_Node (Id : E; V : N) is
2407 pragma Assert (Ekind (Id) = E_Block);
2411 procedure Set_Body_Entity (Id : E; V : E) is
2414 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
2416 end Set_Body_Entity;
2418 procedure Set_Body_Needed_For_SAL (Id : E; V : B := True) is
2421 (Ekind (Id) = E_Package
2422 or else Is_Subprogram (Id)
2423 or else Is_Generic_Unit (Id));
2425 end Set_Body_Needed_For_SAL;
2427 procedure Set_C_Pass_By_Copy (Id : E; V : B := True) is
2429 pragma Assert (Is_Record_Type (Id) and then Id = Base_Type (Id));
2430 Set_Flag125 (Id, V);
2431 end Set_C_Pass_By_Copy;
2433 procedure Set_Can_Never_Be_Null (Id : E; V : B := True) is
2436 end Set_Can_Never_Be_Null;
2438 procedure Set_Checks_May_Be_Suppressed (Id : E; V : B := True) is
2441 end Set_Checks_May_Be_Suppressed;
2443 procedure Set_Class_Wide_Type (Id : E; V : E) is
2445 pragma Assert (Is_Type (Id));
2447 end Set_Class_Wide_Type;
2449 procedure Set_Cloned_Subtype (Id : E; V : E) is
2452 (Ekind (Id) = E_Record_Subtype
2453 or else Ekind (Id) = E_Class_Wide_Subtype);
2455 end Set_Cloned_Subtype;
2457 procedure Set_Component_Bit_Offset (Id : E; V : U) is
2460 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
2462 end Set_Component_Bit_Offset;
2464 procedure Set_Component_Clause (Id : E; V : N) is
2467 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
2469 end Set_Component_Clause;
2471 procedure Set_Component_Size (Id : E; V : U) is
2473 pragma Assert (Is_Array_Type (Id) and then Id = Base_Type (Id));
2475 end Set_Component_Size;
2477 procedure Set_Component_Type (Id : E; V : E) is
2479 pragma Assert (Is_Array_Type (Id) and then Id = Base_Type (Id));
2481 end Set_Component_Type;
2483 procedure Set_Corresponding_Concurrent_Type (Id : E; V : E) is
2486 (Ekind (Id) = E_Record_Type and then Is_Concurrent_Type (V));
2488 end Set_Corresponding_Concurrent_Type;
2490 procedure Set_Corresponding_Discriminant (Id : E; V : E) is
2492 pragma Assert (Ekind (Id) = E_Discriminant);
2494 end Set_Corresponding_Discriminant;
2496 procedure Set_Corresponding_Equality (Id : E; V : E) is
2499 (Ekind (Id) = E_Function
2500 and then not Comes_From_Source (Id)
2501 and then Chars (Id) = Name_Op_Ne);
2503 end Set_Corresponding_Equality;
2505 procedure Set_Corresponding_Record_Type (Id : E; V : E) is
2507 pragma Assert (Is_Concurrent_Type (Id));
2509 end Set_Corresponding_Record_Type;
2511 procedure Set_Corresponding_Remote_Type (Id : E; V : E) is
2514 end Set_Corresponding_Remote_Type;
2516 procedure Set_Current_Value (Id : E; V : E) is
2518 pragma Assert (Ekind (Id) in Object_Kind or else Ekind (Id) = E_Void);
2520 end Set_Current_Value;
2522 procedure Set_CR_Discriminant (Id : E; V : E) is
2525 end Set_CR_Discriminant;
2527 procedure Set_Debug_Info_Off (Id : E; V : B := True) is
2529 Set_Flag166 (Id, V);
2530 end Set_Debug_Info_Off;
2532 procedure Set_Debug_Renaming_Link (Id : E; V : E) is
2535 end Set_Debug_Renaming_Link;
2537 procedure Set_Default_Expr_Function (Id : E; V : E) is
2539 pragma Assert (Is_Formal (Id));
2541 end Set_Default_Expr_Function;
2543 procedure Set_Default_Expressions_Processed (Id : E; V : B := True) is
2545 Set_Flag108 (Id, V);
2546 end Set_Default_Expressions_Processed;
2548 procedure Set_Default_Value (Id : E; V : N) is
2550 pragma Assert (Is_Formal (Id));
2552 end Set_Default_Value;
2554 procedure Set_Delay_Cleanups (Id : E; V : B := True) is
2558 or else Is_Task_Type (Id)
2559 or else Ekind (Id) = E_Block);
2560 Set_Flag114 (Id, V);
2561 end Set_Delay_Cleanups;
2563 procedure Set_Delay_Subprogram_Descriptors (Id : E; V : B := True) is
2567 or else Ekind (Id) = E_Package
2568 or else Ekind (Id) = E_Package_Body);
2570 end Set_Delay_Subprogram_Descriptors;
2572 procedure Set_Delta_Value (Id : E; V : R) is
2574 pragma Assert (Is_Fixed_Point_Type (Id));
2575 Set_Ureal18 (Id, V);
2576 end Set_Delta_Value;
2578 procedure Set_Dependent_Instances (Id : E; V : L) is
2580 pragma Assert (Is_Generic_Instance (Id));
2582 end Set_Dependent_Instances;
2584 procedure Set_Depends_On_Private (Id : E; V : B := True) is
2586 pragma Assert (Nkind (Id) in N_Entity);
2588 end Set_Depends_On_Private;
2590 procedure Set_Digits_Value (Id : E; V : U) is
2593 (Is_Floating_Point_Type (Id)
2594 or else Is_Decimal_Fixed_Point_Type (Id));
2596 end Set_Digits_Value;
2598 procedure Set_Directly_Designated_Type (Id : E; V : E) is
2601 end Set_Directly_Designated_Type;
2603 procedure Set_Discard_Names (Id : E; V : B := True) is
2606 end Set_Discard_Names;
2608 procedure Set_Discriminal (Id : E; V : E) is
2610 pragma Assert (Ekind (Id) = E_Discriminant);
2612 end Set_Discriminal;
2614 procedure Set_Discriminal_Link (Id : E; V : E) is
2617 end Set_Discriminal_Link;
2619 procedure Set_Discriminant_Checking_Func (Id : E; V : E) is
2621 pragma Assert (Ekind (Id) = E_Component);
2623 end Set_Discriminant_Checking_Func;
2625 procedure Set_Discriminant_Constraint (Id : E; V : L) is
2627 pragma Assert (Nkind (Id) in N_Entity);
2628 Set_Elist21 (Id, V);
2629 end Set_Discriminant_Constraint;
2631 procedure Set_Discriminant_Default_Value (Id : E; V : N) is
2634 end Set_Discriminant_Default_Value;
2636 procedure Set_Discriminant_Number (Id : E; V : U) is
2639 end Set_Discriminant_Number;
2641 procedure Set_DT_Entry_Count (Id : E; V : U) is
2643 pragma Assert (Ekind (Id) = E_Component);
2645 end Set_DT_Entry_Count;
2647 procedure Set_DT_Position (Id : E; V : U) is
2649 pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2651 end Set_DT_Position;
2653 procedure Set_DTC_Entity (Id : E; V : E) is
2656 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2660 procedure Set_Elaborate_All_Desirable (Id : E; V : B := True) is
2662 Set_Flag146 (Id, V);
2663 end Set_Elaborate_All_Desirable;
2665 procedure Set_Elaboration_Entity (Id : E; V : E) is
2670 Ekind (Id) = E_Package
2672 Is_Generic_Unit (Id));
2674 end Set_Elaboration_Entity;
2676 procedure Set_Elaboration_Entity_Required (Id : E; V : B := True) is
2681 Ekind (Id) = E_Package
2683 Is_Generic_Unit (Id));
2684 Set_Flag174 (Id, V);
2685 end Set_Elaboration_Entity_Required;
2687 procedure Set_Enclosing_Scope (Id : E; V : E) is
2690 end Set_Enclosing_Scope;
2692 procedure Set_Entry_Accepted (Id : E; V : B := True) is
2694 pragma Assert (Is_Entry (Id));
2695 Set_Flag152 (Id, V);
2696 end Set_Entry_Accepted;
2698 procedure Set_Entry_Bodies_Array (Id : E; V : E) is
2701 end Set_Entry_Bodies_Array;
2703 procedure Set_Entry_Cancel_Parameter (Id : E; V : E) is
2706 end Set_Entry_Cancel_Parameter;
2708 procedure Set_Entry_Component (Id : E; V : E) is
2711 end Set_Entry_Component;
2713 procedure Set_Entry_Formal (Id : E; V : E) is
2716 end Set_Entry_Formal;
2718 procedure Set_Entry_Index_Constant (Id : E; V : E) is
2720 pragma Assert (Ekind (Id) = E_Entry_Index_Parameter);
2722 end Set_Entry_Index_Constant;
2724 procedure Set_Entry_Parameters_Type (Id : E; V : E) is
2727 end Set_Entry_Parameters_Type;
2729 procedure Set_Enum_Pos_To_Rep (Id : E; V : E) is
2731 pragma Assert (Ekind (Id) = E_Enumeration_Type);
2733 end Set_Enum_Pos_To_Rep;
2735 procedure Set_Enumeration_Pos (Id : E; V : U) is
2737 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2739 end Set_Enumeration_Pos;
2741 procedure Set_Enumeration_Rep (Id : E; V : U) is
2743 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2745 end Set_Enumeration_Rep;
2747 procedure Set_Enumeration_Rep_Expr (Id : E; V : N) is
2749 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2751 end Set_Enumeration_Rep_Expr;
2753 procedure Set_Equivalent_Type (Id : E; V : E) is
2756 (Ekind (Id) = E_Class_Wide_Type or else
2757 Ekind (Id) = E_Class_Wide_Subtype or else
2758 Ekind (Id) = E_Access_Protected_Subprogram_Type or else
2759 Ekind (Id) = E_Access_Subprogram_Type or else
2760 Ekind (Id) = E_Exception_Type);
2762 end Set_Equivalent_Type;
2764 procedure Set_Esize (Id : E; V : U) is
2769 procedure Set_Exception_Code (Id : E; V : U) is
2771 pragma Assert (Ekind (Id) = E_Exception);
2773 end Set_Exception_Code;
2775 procedure Set_Extra_Accessibility (Id : E; V : E) is
2777 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
2779 end Set_Extra_Accessibility;
2781 procedure Set_Extra_Constrained (Id : E; V : E) is
2783 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
2785 end Set_Extra_Constrained;
2787 procedure Set_Extra_Formal (Id : E; V : E) is
2790 end Set_Extra_Formal;
2792 procedure Set_Finalization_Chain_Entity (Id : E; V : E) is
2795 end Set_Finalization_Chain_Entity;
2797 procedure Set_Finalize_Storage_Only (Id : E; V : B := True) is
2799 pragma Assert (Is_Type (Id) and then Id = Base_Type (Id));
2800 Set_Flag158 (Id, V);
2801 end Set_Finalize_Storage_Only;
2803 procedure Set_First_Entity (Id : E; V : E) is
2806 end Set_First_Entity;
2808 procedure Set_First_Index (Id : E; V : N) is
2811 end Set_First_Index;
2813 procedure Set_First_Literal (Id : E; V : E) is
2816 end Set_First_Literal;
2818 procedure Set_First_Optional_Parameter (Id : E; V : E) is
2821 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2823 end Set_First_Optional_Parameter;
2825 procedure Set_First_Private_Entity (Id : E; V : E) is
2827 pragma Assert (Nkind (Id) in N_Entity);
2829 end Set_First_Private_Entity;
2831 procedure Set_First_Rep_Item (Id : E; V : N) is
2834 end Set_First_Rep_Item;
2836 procedure Set_Freeze_Node (Id : E; V : N) is
2839 end Set_Freeze_Node;
2841 procedure Set_From_With_Type (Id : E; V : B := True) is
2845 or else Ekind (Id) = E_Package);
2846 Set_Flag159 (Id, V);
2847 end Set_From_With_Type;
2849 procedure Set_Full_View (Id : E; V : E) is
2851 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Constant);
2855 procedure Set_Function_Returns_With_DSP (Id : E; V : B := True) is
2858 (Is_Subprogram (Id) or else Ekind (Id) = E_Subprogram_Type);
2859 Set_Flag169 (Id, V);
2860 end Set_Function_Returns_With_DSP;
2862 procedure Set_Generic_Homonym (Id : E; V : E) is
2865 end Set_Generic_Homonym;
2867 procedure Set_Generic_Renamings (Id : E; V : L) is
2869 Set_Elist23 (Id, V);
2870 end Set_Generic_Renamings;
2872 procedure Set_Handler_Records (Id : E; V : S) is
2875 end Set_Handler_Records;
2877 procedure Set_Has_Aliased_Components (Id : E; V : B := True) is
2879 pragma Assert (Base_Type (Id) = Id);
2880 Set_Flag135 (Id, V);
2881 end Set_Has_Aliased_Components;
2883 procedure Set_Has_Alignment_Clause (Id : E; V : B := True) is
2886 end Set_Has_Alignment_Clause;
2888 procedure Set_Has_All_Calls_Remote (Id : E; V : B := True) is
2891 end Set_Has_All_Calls_Remote;
2893 procedure Set_Has_Atomic_Components (Id : E; V : B := True) is
2895 pragma Assert (not Is_Type (Id) or else Base_Type (Id) = Id);
2897 end Set_Has_Atomic_Components;
2899 procedure Set_Has_Biased_Representation (Id : E; V : B := True) is
2902 ((V = False) or else (Is_Discrete_Type (Id) or Is_Object (Id)));
2903 Set_Flag139 (Id, V);
2904 end Set_Has_Biased_Representation;
2906 procedure Set_Has_Completion (Id : E; V : B := True) is
2909 end Set_Has_Completion;
2911 procedure Set_Has_Completion_In_Body (Id : E; V : B := True) is
2913 pragma Assert (Ekind (Id) = E_Incomplete_Type);
2915 end Set_Has_Completion_In_Body;
2917 procedure Set_Has_Complex_Representation (Id : E; V : B := True) is
2919 pragma Assert (Ekind (Id) = E_Record_Type);
2920 Set_Flag140 (Id, V);
2921 end Set_Has_Complex_Representation;
2923 procedure Set_Has_Component_Size_Clause (Id : E; V : B := True) is
2925 pragma Assert (Ekind (Id) = E_Array_Type);
2927 end Set_Has_Component_Size_Clause;
2929 procedure Set_Has_Contiguous_Rep (Id : E; V : B := True) is
2931 Set_Flag181 (Id, V);
2932 end Set_Has_Contiguous_Rep;
2934 procedure Set_Has_Controlled_Component (Id : E; V : B := True) is
2936 pragma Assert (Base_Type (Id) = Id);
2938 end Set_Has_Controlled_Component;
2940 procedure Set_Has_Controlling_Result (Id : E; V : B := True) is
2943 end Set_Has_Controlling_Result;
2945 procedure Set_Has_Convention_Pragma (Id : E; V : B := True) is
2947 Set_Flag119 (Id, V);
2948 end Set_Has_Convention_Pragma;
2950 procedure Set_Has_Delayed_Freeze (Id : E; V : B := True) is
2952 pragma Assert (Nkind (Id) in N_Entity);
2954 end Set_Has_Delayed_Freeze;
2956 procedure Set_Has_Discriminants (Id : E; V : B := True) is
2958 pragma Assert (Nkind (Id) in N_Entity);
2960 end Set_Has_Discriminants;
2962 procedure Set_Has_Enumeration_Rep_Clause (Id : E; V : B := True) is
2964 pragma Assert (Is_Enumeration_Type (Id));
2966 end Set_Has_Enumeration_Rep_Clause;
2968 procedure Set_Has_Exit (Id : E; V : B := True) is
2973 procedure Set_Has_External_Tag_Rep_Clause (Id : E; V : B := True) is
2975 pragma Assert (Is_Tagged_Type (Id));
2976 Set_Flag110 (Id, V);
2977 end Set_Has_External_Tag_Rep_Clause;
2979 procedure Set_Has_Forward_Instantiation (Id : E; V : B := True) is
2981 Set_Flag175 (Id, V);
2982 end Set_Has_Forward_Instantiation;
2984 procedure Set_Has_Fully_Qualified_Name (Id : E; V : B := True) is
2986 Set_Flag173 (Id, V);
2987 end Set_Has_Fully_Qualified_Name;
2989 procedure Set_Has_Gigi_Rep_Item (Id : E; V : B := True) is
2992 end Set_Has_Gigi_Rep_Item;
2994 procedure Set_Has_Homonym (Id : E; V : B := True) is
2997 end Set_Has_Homonym;
2999 procedure Set_Has_Machine_Radix_Clause (Id : E; V : B := True) is
3001 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
3003 end Set_Has_Machine_Radix_Clause;
3005 procedure Set_Has_Master_Entity (Id : E; V : B := True) is
3008 end Set_Has_Master_Entity;
3010 procedure Set_Has_Missing_Return (Id : E; V : B := True) is
3013 (Ekind (Id) = E_Function or else Ekind (Id) = E_Generic_Function);
3014 Set_Flag142 (Id, V);
3015 end Set_Has_Missing_Return;
3017 procedure Set_Has_Nested_Block_With_Handler (Id : E; V : B := True) is
3019 Set_Flag101 (Id, V);
3020 end Set_Has_Nested_Block_With_Handler;
3022 procedure Set_Has_Non_Standard_Rep (Id : E; V : B := True) is
3024 pragma Assert (Base_Type (Id) = Id);
3026 end Set_Has_Non_Standard_Rep;
3028 procedure Set_Has_Object_Size_Clause (Id : E; V : B := True) is
3030 pragma Assert (Is_Type (Id));
3031 Set_Flag172 (Id, V);
3032 end Set_Has_Object_Size_Clause;
3034 procedure Set_Has_Per_Object_Constraint (Id : E; V : B := True) is
3036 Set_Flag154 (Id, V);
3037 end Set_Has_Per_Object_Constraint;
3039 procedure Set_Has_Pragma_Controlled (Id : E; V : B := True) is
3041 pragma Assert (Is_Access_Type (Id));
3042 Set_Flag27 (Base_Type (Id), V);
3043 end Set_Has_Pragma_Controlled;
3045 procedure Set_Has_Pragma_Elaborate_Body (Id : E; V : B := True) is
3047 Set_Flag150 (Id, V);
3048 end Set_Has_Pragma_Elaborate_Body;
3050 procedure Set_Has_Pragma_Inline (Id : E; V : B := True) is
3052 Set_Flag157 (Id, V);
3053 end Set_Has_Pragma_Inline;
3055 procedure Set_Has_Pragma_Pack (Id : E; V : B := True) is
3057 pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id));
3058 pragma Assert (Id = Base_Type (Id));
3059 Set_Flag121 (Id, V);
3060 end Set_Has_Pragma_Pack;
3062 procedure Set_Has_Pragma_Pure_Function (Id : E; V : B := True) is
3064 pragma Assert (Is_Subprogram (Id));
3065 Set_Flag179 (Id, V);
3066 end Set_Has_Pragma_Pure_Function;
3068 procedure Set_Has_Pragma_Unreferenced (Id : E; V : B := True) is
3070 Set_Flag180 (Id, V);
3071 end Set_Has_Pragma_Unreferenced;
3073 procedure Set_Has_Primitive_Operations (Id : E; V : B := True) is
3075 pragma Assert (Id = Base_Type (Id));
3076 Set_Flag120 (Id, V);
3077 end Set_Has_Primitive_Operations;
3079 procedure Set_Has_Private_Declaration (Id : E; V : B := True) is
3081 Set_Flag155 (Id, V);
3082 end Set_Has_Private_Declaration;
3084 procedure Set_Has_Qualified_Name (Id : E; V : B := True) is
3086 Set_Flag161 (Id, V);
3087 end Set_Has_Qualified_Name;
3089 procedure Set_Has_Record_Rep_Clause (Id : E; V : B := True) is
3091 pragma Assert (Id = Base_Type (Id));
3093 end Set_Has_Record_Rep_Clause;
3095 procedure Set_Has_Recursive_Call (Id : E; V : B := True) is
3097 pragma Assert (Is_Subprogram (Id));
3098 Set_Flag143 (Id, V);
3099 end Set_Has_Recursive_Call;
3101 procedure Set_Has_Size_Clause (Id : E; V : B := True) is
3104 end Set_Has_Size_Clause;
3106 procedure Set_Has_Small_Clause (Id : E; V : B := True) is
3109 end Set_Has_Small_Clause;
3111 procedure Set_Has_Specified_Layout (Id : E; V : B := True) is
3113 pragma Assert (Id = Base_Type (Id));
3114 Set_Flag100 (Id, V);
3115 end Set_Has_Specified_Layout;
3117 procedure Set_Has_Storage_Size_Clause (Id : E; V : B := True) is
3119 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
3120 pragma Assert (Base_Type (Id) = Id);
3122 end Set_Has_Storage_Size_Clause;
3124 procedure Set_Has_Subprogram_Descriptor (Id : E; V : B := True) is
3127 end Set_Has_Subprogram_Descriptor;
3129 procedure Set_Has_Task (Id : E; V : B := True) is
3131 pragma Assert (Base_Type (Id) = Id);
3135 procedure Set_Has_Unchecked_Union (Id : E; V : B := True) is
3137 pragma Assert (Base_Type (Id) = Id);
3138 Set_Flag123 (Id, V);
3139 end Set_Has_Unchecked_Union;
3141 procedure Set_Has_Unknown_Discriminants (Id : E; V : B := True) is
3143 pragma Assert (Is_Type (Id));
3145 end Set_Has_Unknown_Discriminants;
3147 procedure Set_Has_Volatile_Components (Id : E; V : B := True) is
3149 pragma Assert (not Is_Type (Id) or else Base_Type (Id) = Id);
3151 end Set_Has_Volatile_Components;
3153 procedure Set_Has_Xref_Entry (Id : E; V : B := True) is
3155 Set_Flag182 (Id, V);
3156 end Set_Has_Xref_Entry;
3158 procedure Set_Hiding_Loop_Variable (Id : E; V : E) is
3160 pragma Assert (Ekind (Id) = E_Variable);
3162 end Set_Hiding_Loop_Variable;
3164 procedure Set_Homonym (Id : E; V : E) is
3166 pragma Assert (Id /= V);
3170 procedure Set_In_Package_Body (Id : E; V : B := True) is
3173 end Set_In_Package_Body;
3175 procedure Set_In_Private_Part (Id : E; V : B := True) is
3178 end Set_In_Private_Part;
3180 procedure Set_In_Use (Id : E; V : B := True) is
3182 pragma Assert (Nkind (Id) in N_Entity);
3186 procedure Set_Inner_Instances (Id : E; V : L) is
3188 Set_Elist23 (Id, V);
3189 end Set_Inner_Instances;
3191 procedure Set_Interface_Name (Id : E; V : N) is
3194 end Set_Interface_Name;
3196 procedure Set_Is_Abstract (Id : E; V : B := True) is
3199 end Set_Is_Abstract;
3201 procedure Set_Is_Access_Constant (Id : E; V : B := True) is
3203 pragma Assert (Is_Access_Type (Id));
3205 end Set_Is_Access_Constant;
3207 procedure Set_Is_Aliased (Id : E; V : B := True) is
3209 pragma Assert (Nkind (Id) in N_Entity);
3213 procedure Set_Is_AST_Entry (Id : E; V : B := True) is
3215 pragma Assert (Is_Entry (Id));
3216 Set_Flag132 (Id, V);
3217 end Set_Is_AST_Entry;
3219 procedure Set_Is_Asynchronous (Id : E; V : B := True) is
3222 (Ekind (Id) = E_Procedure or else Is_Type (Id));
3224 end Set_Is_Asynchronous;
3226 procedure Set_Is_Atomic (Id : E; V : B := True) is
3231 procedure Set_Is_Bit_Packed_Array (Id : E; V : B := True) is
3233 pragma Assert ((not V)
3234 or else (Is_Array_Type (Id) and then Id = Base_Type (Id)));
3236 Set_Flag122 (Id, V);
3237 end Set_Is_Bit_Packed_Array;
3239 procedure Set_Is_Called (Id : E; V : B := True) is
3242 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Function);
3243 Set_Flag102 (Id, V);
3246 procedure Set_Is_Character_Type (Id : E; V : B := True) is
3249 end Set_Is_Character_Type;
3251 procedure Set_Is_Child_Unit (Id : E; V : B := True) is
3254 end Set_Is_Child_Unit;
3256 procedure Set_Is_Class_Wide_Equivalent_Type (Id : E; V : B := True) is
3259 end Set_Is_Class_Wide_Equivalent_Type;
3261 procedure Set_Is_Compilation_Unit (Id : E; V : B := True) is
3263 Set_Flag149 (Id, V);
3264 end Set_Is_Compilation_Unit;
3266 procedure Set_Is_Completely_Hidden (Id : E; V : B := True) is
3268 pragma Assert (Ekind (Id) = E_Discriminant);
3269 Set_Flag103 (Id, V);
3270 end Set_Is_Completely_Hidden;
3272 procedure Set_Is_Concurrent_Record_Type (Id : E; V : B := True) is
3275 end Set_Is_Concurrent_Record_Type;
3277 procedure Set_Is_Constr_Subt_For_U_Nominal (Id : E; V : B := True) is
3280 end Set_Is_Constr_Subt_For_U_Nominal;
3282 procedure Set_Is_Constr_Subt_For_UN_Aliased (Id : E; V : B := True) is
3284 Set_Flag141 (Id, V);
3285 end Set_Is_Constr_Subt_For_UN_Aliased;
3287 procedure Set_Is_Constrained (Id : E; V : B := True) is
3289 pragma Assert (Nkind (Id) in N_Entity);
3291 end Set_Is_Constrained;
3293 procedure Set_Is_Constructor (Id : E; V : B := True) is
3296 end Set_Is_Constructor;
3298 procedure Set_Is_Controlled (Id : E; V : B := True) is
3300 pragma Assert (Id = Base_Type (Id));
3302 end Set_Is_Controlled;
3304 procedure Set_Is_Controlling_Formal (Id : E; V : B := True) is
3306 pragma Assert (Is_Formal (Id));
3308 end Set_Is_Controlling_Formal;
3310 procedure Set_Is_CPP_Class (Id : E; V : B := True) is
3313 end Set_Is_CPP_Class;
3315 procedure Set_Is_Discrim_SO_Function (Id : E; V : B := True) is
3317 Set_Flag176 (Id, V);
3318 end Set_Is_Discrim_SO_Function;
3320 procedure Set_Is_Dispatching_Operation (Id : E; V : B := True) is
3325 Is_Overloadable (Id)
3327 Ekind (Id) = E_Subprogram_Type);
3330 end Set_Is_Dispatching_Operation;
3332 procedure Set_Is_Eliminated (Id : E; V : B := True) is
3334 Set_Flag124 (Id, V);
3335 end Set_Is_Eliminated;
3337 procedure Set_Is_Entry_Formal (Id : E; V : B := True) is
3340 end Set_Is_Entry_Formal;
3342 procedure Set_Is_Exported (Id : E; V : B := True) is
3345 end Set_Is_Exported;
3347 procedure Set_Is_First_Subtype (Id : E; V : B := True) is
3350 end Set_Is_First_Subtype;
3352 procedure Set_Is_For_Access_Subtype (Id : E; V : B := True) is
3355 (Ekind (Id) = E_Record_Subtype
3357 Ekind (Id) = E_Private_Subtype);
3358 Set_Flag118 (Id, V);
3359 end Set_Is_For_Access_Subtype;
3361 procedure Set_Is_Formal_Subprogram (Id : E; V : B := True) is
3363 Set_Flag111 (Id, V);
3364 end Set_Is_Formal_Subprogram;
3366 procedure Set_Is_Frozen (Id : E; V : B := True) is
3368 pragma Assert (Nkind (Id) in N_Entity);
3372 procedure Set_Is_Generic_Actual_Type (Id : E; V : B := True) is
3374 pragma Assert (Is_Type (Id));
3376 end Set_Is_Generic_Actual_Type;
3378 procedure Set_Is_Generic_Instance (Id : E; V : B := True) is
3380 Set_Flag130 (Id, V);
3381 end Set_Is_Generic_Instance;
3383 procedure Set_Is_Generic_Type (Id : E; V : B := True) is
3385 pragma Assert (Nkind (Id) in N_Entity);
3387 end Set_Is_Generic_Type;
3389 procedure Set_Is_Hidden (Id : E; V : B := True) is
3394 procedure Set_Is_Hidden_Open_Scope (Id : E; V : B := True) is
3396 Set_Flag171 (Id, V);
3397 end Set_Is_Hidden_Open_Scope;
3399 procedure Set_Is_Immediately_Visible (Id : E; V : B := True) is
3401 pragma Assert (Nkind (Id) in N_Entity);
3403 end Set_Is_Immediately_Visible;
3405 procedure Set_Is_Imported (Id : E; V : B := True) is
3408 end Set_Is_Imported;
3410 procedure Set_Is_Inlined (Id : E; V : B := True) is
3415 procedure Set_Is_Instantiated (Id : E; V : B := True) is
3417 Set_Flag126 (Id, V);
3418 end Set_Is_Instantiated;
3420 procedure Set_Is_Internal (Id : E; V : B := True) is
3422 pragma Assert (Nkind (Id) in N_Entity);
3424 end Set_Is_Internal;
3426 procedure Set_Is_Interrupt_Handler (Id : E; V : B := True) is
3428 pragma Assert (Nkind (Id) in N_Entity);
3430 end Set_Is_Interrupt_Handler;
3432 procedure Set_Is_Intrinsic_Subprogram (Id : E; V : B := True) is
3435 end Set_Is_Intrinsic_Subprogram;
3437 procedure Set_Is_Itype (Id : E; V : B := True) is
3442 procedure Set_Is_Known_Non_Null (Id : E; V : B := True) is
3445 end Set_Is_Known_Non_Null;
3447 procedure Set_Is_Known_Valid (Id : E; V : B := True) is
3449 Set_Flag170 (Id, V);
3450 end Set_Is_Known_Valid;
3452 procedure Set_Is_Limited_Composite (Id : E; V : B := True) is
3454 pragma Assert (Is_Type (Id));
3455 Set_Flag106 (Id, V);
3456 end Set_Is_Limited_Composite;
3458 procedure Set_Is_Limited_Record (Id : E; V : B := True) is
3461 end Set_Is_Limited_Record;
3463 procedure Set_Is_Machine_Code_Subprogram (Id : E; V : B := True) is
3465 pragma Assert (Is_Subprogram (Id));
3466 Set_Flag137 (Id, V);
3467 end Set_Is_Machine_Code_Subprogram;
3469 procedure Set_Is_Non_Static_Subtype (Id : E; V : B := True) is
3471 pragma Assert (Is_Type (Id));
3472 Set_Flag109 (Id, V);
3473 end Set_Is_Non_Static_Subtype;
3475 procedure Set_Is_Null_Init_Proc (Id : E; V : B := True) is
3477 pragma Assert (Ekind (Id) = E_Procedure);
3478 Set_Flag178 (Id, V);
3479 end Set_Is_Null_Init_Proc;
3481 procedure Set_Is_Optional_Parameter (Id : E; V : B := True) is
3483 pragma Assert (Is_Formal (Id));
3484 Set_Flag134 (Id, V);
3485 end Set_Is_Optional_Parameter;
3487 procedure Set_Is_Overriding_Operation (Id : E; V : B := True) is
3489 pragma Assert (Is_Subprogram (Id));
3491 end Set_Is_Overriding_Operation;
3493 procedure Set_Is_Package_Body_Entity (Id : E; V : B := True) is
3495 Set_Flag160 (Id, V);
3496 end Set_Is_Package_Body_Entity;
3498 procedure Set_Is_Packed (Id : E; V : B := True) is
3500 pragma Assert (Base_Type (Id) = Id);
3504 procedure Set_Is_Packed_Array_Type (Id : E; V : B := True) is
3506 Set_Flag138 (Id, V);
3507 end Set_Is_Packed_Array_Type;
3509 procedure Set_Is_Potentially_Use_Visible (Id : E; V : B := True) is
3511 pragma Assert (Nkind (Id) in N_Entity);
3513 end Set_Is_Potentially_Use_Visible;
3515 procedure Set_Is_Preelaborated (Id : E; V : B := True) is
3518 end Set_Is_Preelaborated;
3520 procedure Set_Is_Private_Composite (Id : E; V : B := True) is
3522 pragma Assert (Is_Type (Id));
3523 Set_Flag107 (Id, V);
3524 end Set_Is_Private_Composite;
3526 procedure Set_Is_Private_Descendant (Id : E; V : B := True) is
3529 end Set_Is_Private_Descendant;
3531 procedure Set_Is_Psected (Id : E; V : B := True) is
3533 Set_Flag153 (Id, V);
3536 procedure Set_Is_Public (Id : E; V : B := True) is
3538 pragma Assert (Nkind (Id) in N_Entity);
3542 procedure Set_Is_Pure (Id : E; V : B := True) is
3547 procedure Set_Is_Remote_Call_Interface (Id : E; V : B := True) is
3550 end Set_Is_Remote_Call_Interface;
3552 procedure Set_Is_Remote_Types (Id : E; V : B := True) is
3555 end Set_Is_Remote_Types;
3557 procedure Set_Is_Renaming_Of_Object (Id : E; V : B := True) is
3559 Set_Flag112 (Id, V);
3560 end Set_Is_Renaming_Of_Object;
3562 procedure Set_Is_Shared_Passive (Id : E; V : B := True) is
3565 end Set_Is_Shared_Passive;
3567 procedure Set_Is_Statically_Allocated (Id : E; V : B := True) is
3570 (Ekind (Id) = E_Exception
3571 or else Ekind (Id) = E_Variable
3572 or else Ekind (Id) = E_Constant
3573 or else Is_Type (Id)
3574 or else Ekind (Id) = E_Void);
3576 end Set_Is_Statically_Allocated;
3578 procedure Set_Is_Tag (Id : E; V : B := True) is
3580 pragma Assert (Nkind (Id) in N_Entity);
3584 procedure Set_Is_Tagged_Type (Id : E; V : B := True) is
3587 end Set_Is_Tagged_Type;
3589 procedure Set_Is_Thread_Body (Id : E; V : B := True) is
3592 end Set_Is_Thread_Body;
3594 procedure Set_Is_True_Constant (Id : E; V : B := True) is
3596 Set_Flag163 (Id, V);
3597 end Set_Is_True_Constant;
3599 procedure Set_Is_Unchecked_Union (Id : E; V : B := True) is
3601 pragma Assert (Base_Type (Id) = Id);
3602 Set_Flag117 (Id, V);
3603 end Set_Is_Unchecked_Union;
3605 procedure Set_Is_Unsigned_Type (Id : E; V : B := True) is
3607 pragma Assert (Is_Discrete_Or_Fixed_Point_Type (Id));
3608 Set_Flag144 (Id, V);
3609 end Set_Is_Unsigned_Type;
3611 procedure Set_Is_Valued_Procedure (Id : E; V : B := True) is
3613 pragma Assert (Ekind (Id) = E_Procedure);
3614 Set_Flag127 (Id, V);
3615 end Set_Is_Valued_Procedure;
3617 procedure Set_Is_Visible_Child_Unit (Id : E; V : B := True) is
3619 pragma Assert (Is_Child_Unit (Id));
3620 Set_Flag116 (Id, V);
3621 end Set_Is_Visible_Child_Unit;
3623 procedure Set_Is_VMS_Exception (Id : E; V : B := True) is
3625 pragma Assert (Ekind (Id) = E_Exception);
3626 Set_Flag133 (Id, V);
3627 end Set_Is_VMS_Exception;
3629 procedure Set_Is_Volatile (Id : E; V : B := True) is
3631 pragma Assert (Nkind (Id) in N_Entity);
3633 end Set_Is_Volatile;
3635 procedure Set_Kill_Elaboration_Checks (Id : E; V : B := True) is
3638 end Set_Kill_Elaboration_Checks;
3640 procedure Set_Kill_Range_Checks (Id : E; V : B := True) is
3643 end Set_Kill_Range_Checks;
3645 procedure Set_Kill_Tag_Checks (Id : E; V : B := True) is
3648 end Set_Kill_Tag_Checks;
3650 procedure Set_Last_Entity (Id : E; V : E) is
3653 end Set_Last_Entity;
3655 procedure Set_Limited_Views (Id : E; V : L) is
3657 pragma Assert (Ekind (Id) = E_Package);
3658 Set_Elist23 (Id, V);
3659 end Set_Limited_Views;
3661 procedure Set_Lit_Indexes (Id : E; V : E) is
3663 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
3665 end Set_Lit_Indexes;
3667 procedure Set_Lit_Strings (Id : E; V : E) is
3669 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
3671 end Set_Lit_Strings;
3673 procedure Set_Machine_Radix_10 (Id : E; V : B := True) is
3675 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
3677 end Set_Machine_Radix_10;
3679 procedure Set_Master_Id (Id : E; V : E) is
3684 procedure Set_Materialize_Entity (Id : E; V : B := True) is
3686 Set_Flag168 (Id, V);
3687 end Set_Materialize_Entity;
3689 procedure Set_Mechanism (Id : E; V : M) is
3691 pragma Assert (Ekind (Id) = E_Function or else Is_Formal (Id));
3692 Set_Uint8 (Id, UI_From_Int (V));
3695 procedure Set_Modulus (Id : E; V : U) is
3697 pragma Assert (Ekind (Id) = E_Modular_Integer_Type);
3701 procedure Set_Needs_Debug_Info (Id : E; V : B := True) is
3703 Set_Flag147 (Id, V);
3704 end Set_Needs_Debug_Info;
3706 procedure Set_Needs_No_Actuals (Id : E; V : B := True) is
3709 (Is_Overloadable (Id)
3710 or else Ekind (Id) = E_Subprogram_Type
3711 or else Ekind (Id) = E_Entry_Family);
3713 end Set_Needs_No_Actuals;
3715 procedure Set_Never_Set_In_Source (Id : E; V : B := True) is
3717 Set_Flag115 (Id, V);
3718 end Set_Never_Set_In_Source;
3720 procedure Set_Next_Inlined_Subprogram (Id : E; V : E) is
3723 end Set_Next_Inlined_Subprogram;
3725 procedure Set_No_Pool_Assigned (Id : E; V : B := True) is
3727 pragma Assert (Is_Access_Type (Id) and then Base_Type (Id) = Id);
3728 Set_Flag131 (Id, V);
3729 end Set_No_Pool_Assigned;
3731 procedure Set_No_Return (Id : E; V : B := True) is
3734 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Generic_Procedure);
3735 Set_Flag113 (Id, V);
3738 procedure Set_Non_Binary_Modulus (Id : E; V : B := True) is
3740 pragma Assert (Ekind (Id) = E_Modular_Integer_Type);
3742 end Set_Non_Binary_Modulus;
3744 procedure Set_Non_Limited_View (Id : E; V : E) is
3745 pragma Assert (False
3746 or else Ekind (Id) = E_Incomplete_Type);
3749 end Set_Non_Limited_View;
3751 procedure Set_Nonzero_Is_True (Id : E; V : B := True) is
3754 (Root_Type (Id) = Standard_Boolean
3755 and then Ekind (Id) = E_Enumeration_Type);
3756 Set_Flag162 (Id, V);
3757 end Set_Nonzero_Is_True;
3759 procedure Set_Normalized_First_Bit (Id : E; V : U) is
3762 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
3764 end Set_Normalized_First_Bit;
3766 procedure Set_Normalized_Position (Id : E; V : U) is
3769 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
3771 end Set_Normalized_Position;
3773 procedure Set_Normalized_Position_Max (Id : E; V : U) is
3776 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
3778 end Set_Normalized_Position_Max;
3780 procedure Set_Object_Ref (Id : E; V : E) is
3782 pragma Assert (Ekind (Id) = E_Protected_Body);
3786 procedure Set_Original_Array_Type (Id : E; V : E) is
3788 pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id));
3790 end Set_Original_Array_Type;
3792 procedure Set_Original_Record_Component (Id : E; V : E) is
3795 (Ekind (Id) = E_Void
3796 or else Ekind (Id) = E_Component
3797 or else Ekind (Id) = E_Discriminant);
3799 end Set_Original_Record_Component;
3801 procedure Set_Packed_Array_Type (Id : E; V : E) is
3803 pragma Assert (Is_Array_Type (Id));
3805 end Set_Packed_Array_Type;
3807 procedure Set_Parent_Subtype (Id : E; V : E) is
3809 pragma Assert (Ekind (Id) = E_Record_Type);
3811 end Set_Parent_Subtype;
3813 procedure Set_Primitive_Operations (Id : E; V : L) is
3815 pragma Assert (Is_Tagged_Type (Id));
3816 Set_Elist15 (Id, V);
3817 end Set_Primitive_Operations;
3819 procedure Set_Prival (Id : E; V : E) is
3821 pragma Assert (Is_Protected_Private (Id));
3825 procedure Set_Privals_Chain (Id : E; V : L) is
3827 pragma Assert (Is_Overloadable (Id)
3828 or else Ekind (Id) = E_Entry_Family);
3829 Set_Elist23 (Id, V);
3830 end Set_Privals_Chain;
3832 procedure Set_Private_Dependents (Id : E; V : L) is
3834 pragma Assert (Is_Incomplete_Or_Private_Type (Id));
3835 Set_Elist18 (Id, V);
3836 end Set_Private_Dependents;
3838 procedure Set_Private_View (Id : E; V : N) is
3840 pragma Assert (Is_Private_Type (Id));
3842 end Set_Private_View;
3844 procedure Set_Protected_Body_Subprogram (Id : E; V : E) is
3846 pragma Assert (Is_Subprogram (Id) or else Is_Entry (Id));
3848 end Set_Protected_Body_Subprogram;
3850 procedure Set_Protected_Formal (Id : E; V : E) is
3852 pragma Assert (Is_Formal (Id));
3854 end Set_Protected_Formal;
3856 procedure Set_Protected_Operation (Id : E; V : N) is
3858 pragma Assert (Is_Protected_Private (Id));
3860 end Set_Protected_Operation;
3862 procedure Set_Reachable (Id : E; V : B := True) is
3867 procedure Set_Referenced (Id : E; V : B := True) is
3869 Set_Flag156 (Id, V);
3872 procedure Set_Referenced_As_LHS (Id : E; V : B := True) is
3875 end Set_Referenced_As_LHS;
3877 procedure Set_Referenced_Object (Id : E; V : N) is
3879 pragma Assert (Is_Type (Id));
3881 end Set_Referenced_Object;
3883 procedure Set_Register_Exception_Call (Id : E; V : N) is
3885 pragma Assert (Ekind (Id) = E_Exception);
3887 end Set_Register_Exception_Call;
3889 procedure Set_Related_Array_Object (Id : E; V : E) is
3891 pragma Assert (Is_Array_Type (Id));
3893 end Set_Related_Array_Object;
3895 procedure Set_Related_Instance (Id : E; V : E) is
3898 (Ekind (Id) = E_Package or else Ekind (Id) = E_Package_Body);
3900 end Set_Related_Instance;
3902 procedure Set_Renamed_Entity (Id : E; V : N) is
3905 end Set_Renamed_Entity;
3907 procedure Set_Renamed_Object (Id : E; V : N) is
3910 end Set_Renamed_Object;
3912 procedure Set_Renaming_Map (Id : E; V : U) is
3915 end Set_Renaming_Map;
3917 procedure Set_Return_Present (Id : E; V : B := True) is
3920 end Set_Return_Present;
3922 procedure Set_Returns_By_Ref (Id : E; V : B := True) is
3925 end Set_Returns_By_Ref;
3927 procedure Set_Reverse_Bit_Order (Id : E; V : B := True) is
3930 (Is_Record_Type (Id) and then Id = Base_Type (Id));
3931 Set_Flag164 (Id, V);
3932 end Set_Reverse_Bit_Order;
3934 procedure Set_RM_Size (Id : E; V : U) is
3936 pragma Assert (Is_Type (Id));
3940 procedure Set_Scalar_Range (Id : E; V : N) is
3943 end Set_Scalar_Range;
3945 procedure Set_Scale_Value (Id : E; V : U) is
3948 end Set_Scale_Value;
3950 procedure Set_Scope_Depth_Value (Id : E; V : U) is
3952 pragma Assert (not Is_Record_Type (Id));
3954 end Set_Scope_Depth_Value;
3956 procedure Set_Sec_Stack_Needed_For_Return (Id : E; V : B := True) is
3958 Set_Flag167 (Id, V);
3959 end Set_Sec_Stack_Needed_For_Return;
3961 procedure Set_Shadow_Entities (Id : E; V : S) is
3964 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
3966 end Set_Shadow_Entities;
3968 procedure Set_Shared_Var_Assign_Proc (Id : E; V : E) is
3970 pragma Assert (Ekind (Id) = E_Variable);
3972 end Set_Shared_Var_Assign_Proc;
3974 procedure Set_Shared_Var_Read_Proc (Id : E; V : E) is
3976 pragma Assert (Ekind (Id) = E_Variable);
3978 end Set_Shared_Var_Read_Proc;
3980 procedure Set_Size_Check_Code (Id : E; V : N) is
3982 pragma Assert (Ekind (Id) = E_Constant or else Ekind (Id) = E_Variable);
3984 end Set_Size_Check_Code;
3986 procedure Set_Size_Depends_On_Discriminant (Id : E; V : B := True) is
3988 Set_Flag177 (Id, V);
3989 end Set_Size_Depends_On_Discriminant;
3991 procedure Set_Size_Known_At_Compile_Time (Id : E; V : B := True) is
3994 end Set_Size_Known_At_Compile_Time;
3996 procedure Set_Small_Value (Id : E; V : R) is
3998 pragma Assert (Is_Fixed_Point_Type (Id));
3999 Set_Ureal21 (Id, V);
4000 end Set_Small_Value;
4002 procedure Set_Spec_Entity (Id : E; V : E) is
4004 pragma Assert (Ekind (Id) = E_Package_Body or else Is_Formal (Id));
4006 end Set_Spec_Entity;
4008 procedure Set_Storage_Size_Variable (Id : E; V : E) is
4010 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
4011 pragma Assert (Base_Type (Id) = Id);
4013 end Set_Storage_Size_Variable;
4015 procedure Set_Stored_Constraint (Id : E; V : L) is
4017 pragma Assert (Nkind (Id) in N_Entity);
4018 Set_Elist23 (Id, V);
4019 end Set_Stored_Constraint;
4021 procedure Set_Strict_Alignment (Id : E; V : B := True) is
4023 pragma Assert (Base_Type (Id) = Id);
4024 Set_Flag145 (Id, V);
4025 end Set_Strict_Alignment;
4027 procedure Set_String_Literal_Length (Id : E; V : U) is
4029 pragma Assert (Ekind (Id) = E_String_Literal_Subtype);
4031 end Set_String_Literal_Length;
4033 procedure Set_String_Literal_Low_Bound (Id : E; V : N) is
4035 pragma Assert (Ekind (Id) = E_String_Literal_Subtype);
4037 end Set_String_Literal_Low_Bound;
4039 procedure Set_Suppress_Elaboration_Warnings (Id : E; V : B := True) is
4041 Set_Flag148 (Id, V);
4042 end Set_Suppress_Elaboration_Warnings;
4044 procedure Set_Suppress_Init_Proc (Id : E; V : B := True) is
4046 pragma Assert (Id = Base_Type (Id));
4047 Set_Flag105 (Id, V);
4048 end Set_Suppress_Init_Proc;
4050 procedure Set_Suppress_Style_Checks (Id : E; V : B := True) is
4052 Set_Flag165 (Id, V);
4053 end Set_Suppress_Style_Checks;
4055 procedure Set_Treat_As_Volatile (Id : E; V : B := True) is
4058 end Set_Treat_As_Volatile;
4060 procedure Set_Underlying_Full_View (Id : E; V : E) is
4062 pragma Assert (Ekind (Id) in Private_Kind);
4064 end Set_Underlying_Full_View;
4066 procedure Set_Unset_Reference (Id : E; V : N) is
4069 end Set_Unset_Reference;
4071 procedure Set_Uses_Sec_Stack (Id : E; V : B := True) is
4074 end Set_Uses_Sec_Stack;
4076 procedure Set_Vax_Float (Id : E; V : B := True) is
4078 pragma Assert (Id = Base_Type (Id));
4079 Set_Flag151 (Id, V);
4082 procedure Set_Warnings_Off (Id : E; V : B := True) is
4085 end Set_Warnings_Off;
4087 -----------------------------------
4088 -- Field Initialization Routines --
4089 -----------------------------------
4091 procedure Init_Alignment (Id : E) is
4093 Set_Uint14 (Id, Uint_0);
4096 procedure Init_Alignment (Id : E; V : Int) is
4098 Set_Uint14 (Id, UI_From_Int (V));
4101 procedure Init_Component_Bit_Offset (Id : E) is
4103 Set_Uint11 (Id, No_Uint);
4104 end Init_Component_Bit_Offset;
4106 procedure Init_Component_Bit_Offset (Id : E; V : Int) is
4108 Set_Uint11 (Id, UI_From_Int (V));
4109 end Init_Component_Bit_Offset;
4111 procedure Init_Component_Size (Id : E) is
4113 Set_Uint22 (Id, Uint_0);
4114 end Init_Component_Size;
4116 procedure Init_Component_Size (Id : E; V : Int) is
4118 Set_Uint22 (Id, UI_From_Int (V));
4119 end Init_Component_Size;
4121 procedure Init_Digits_Value (Id : E) is
4123 Set_Uint17 (Id, Uint_0);
4124 end Init_Digits_Value;
4126 procedure Init_Digits_Value (Id : E; V : Int) is
4128 Set_Uint17 (Id, UI_From_Int (V));
4129 end Init_Digits_Value;
4131 procedure Init_Esize (Id : E) is
4133 Set_Uint12 (Id, Uint_0);
4136 procedure Init_Esize (Id : E; V : Int) is
4138 Set_Uint12 (Id, UI_From_Int (V));
4141 procedure Init_Normalized_First_Bit (Id : E) is
4143 Set_Uint8 (Id, No_Uint);
4144 end Init_Normalized_First_Bit;
4146 procedure Init_Normalized_First_Bit (Id : E; V : Int) is
4148 Set_Uint8 (Id, UI_From_Int (V));
4149 end Init_Normalized_First_Bit;
4151 procedure Init_Normalized_Position (Id : E) is
4153 Set_Uint14 (Id, No_Uint);
4154 end Init_Normalized_Position;
4156 procedure Init_Normalized_Position (Id : E; V : Int) is
4158 Set_Uint14 (Id, UI_From_Int (V));
4159 end Init_Normalized_Position;
4161 procedure Init_Normalized_Position_Max (Id : E) is
4163 Set_Uint10 (Id, No_Uint);
4164 end Init_Normalized_Position_Max;
4166 procedure Init_Normalized_Position_Max (Id : E; V : Int) is
4168 Set_Uint10 (Id, UI_From_Int (V));
4169 end Init_Normalized_Position_Max;
4171 procedure Init_RM_Size (Id : E) is
4173 Set_Uint13 (Id, Uint_0);
4176 procedure Init_RM_Size (Id : E; V : Int) is
4178 Set_Uint13 (Id, UI_From_Int (V));
4181 -----------------------------
4182 -- Init_Component_Location --
4183 -----------------------------
4185 procedure Init_Component_Location (Id : E) is
4187 Set_Uint8 (Id, No_Uint); -- Normalized_First_Bit
4188 Set_Uint10 (Id, No_Uint); -- Normalized_Position_Max
4189 Set_Uint11 (Id, No_Uint); -- Component_First_Bit
4190 Set_Uint12 (Id, Uint_0); -- Esize
4191 Set_Uint14 (Id, No_Uint); -- Normalized_Position
4192 end Init_Component_Location;
4198 procedure Init_Size (Id : E; V : Int) is
4200 Set_Uint12 (Id, UI_From_Int (V)); -- Esize
4201 Set_Uint13 (Id, UI_From_Int (V)); -- RM_Size
4204 ---------------------
4205 -- Init_Size_Align --
4206 ---------------------
4208 procedure Init_Size_Align (Id : E) is
4210 Set_Uint12 (Id, Uint_0); -- Esize
4211 Set_Uint13 (Id, Uint_0); -- RM_Size
4212 Set_Uint14 (Id, Uint_0); -- Alignment
4213 end Init_Size_Align;
4215 ----------------------------------------------
4216 -- Type Representation Attribute Predicates --
4217 ----------------------------------------------
4219 function Known_Alignment (E : Entity_Id) return B is
4221 return Uint14 (E) /= Uint_0
4222 and then Uint14 (E) /= No_Uint;
4223 end Known_Alignment;
4225 function Known_Component_Bit_Offset (E : Entity_Id) return B is
4227 return Uint11 (E) /= No_Uint;
4228 end Known_Component_Bit_Offset;
4230 function Known_Component_Size (E : Entity_Id) return B is
4232 return Uint22 (Base_Type (E)) /= Uint_0
4233 and then Uint22 (Base_Type (E)) /= No_Uint;
4234 end Known_Component_Size;
4236 function Known_Esize (E : Entity_Id) return B is
4238 return Uint12 (E) /= Uint_0
4239 and then Uint12 (E) /= No_Uint;
4242 function Known_Normalized_First_Bit (E : Entity_Id) return B is
4244 return Uint8 (E) /= No_Uint;
4245 end Known_Normalized_First_Bit;
4247 function Known_Normalized_Position (E : Entity_Id) return B is
4249 return Uint14 (E) /= No_Uint;
4250 end Known_Normalized_Position;
4252 function Known_Normalized_Position_Max (E : Entity_Id) return B is
4254 return Uint10 (E) /= No_Uint;
4255 end Known_Normalized_Position_Max;
4257 function Known_RM_Size (E : Entity_Id) return B is
4259 return Uint13 (E) /= No_Uint
4260 and then (Uint13 (E) /= Uint_0
4261 or else Is_Discrete_Type (E)
4262 or else Is_Fixed_Point_Type (E));
4265 function Known_Static_Component_Bit_Offset (E : Entity_Id) return B is
4267 return Uint11 (E) /= No_Uint
4268 and then Uint11 (E) >= Uint_0;
4269 end Known_Static_Component_Bit_Offset;
4271 function Known_Static_Component_Size (E : Entity_Id) return B is
4273 return Uint22 (Base_Type (E)) > Uint_0;
4274 end Known_Static_Component_Size;
4276 function Known_Static_Esize (E : Entity_Id) return B is
4278 return Uint12 (E) > Uint_0;
4279 end Known_Static_Esize;
4281 function Known_Static_Normalized_First_Bit (E : Entity_Id) return B is
4283 return Uint8 (E) /= No_Uint
4284 and then Uint8 (E) >= Uint_0;
4285 end Known_Static_Normalized_First_Bit;
4287 function Known_Static_Normalized_Position (E : Entity_Id) return B is
4289 return Uint14 (E) /= No_Uint
4290 and then Uint14 (E) >= Uint_0;
4291 end Known_Static_Normalized_Position;
4293 function Known_Static_Normalized_Position_Max (E : Entity_Id) return B is
4295 return Uint10 (E) /= No_Uint
4296 and then Uint10 (E) >= Uint_0;
4297 end Known_Static_Normalized_Position_Max;
4299 function Known_Static_RM_Size (E : Entity_Id) return B is
4301 return Uint13 (E) > Uint_0
4302 or else Is_Discrete_Type (E)
4303 or else Is_Fixed_Point_Type (E);
4304 end Known_Static_RM_Size;
4306 function Unknown_Alignment (E : Entity_Id) return B is
4308 return Uint14 (E) = Uint_0
4309 or else Uint14 (E) = No_Uint;
4310 end Unknown_Alignment;
4312 function Unknown_Component_Bit_Offset (E : Entity_Id) return B is
4314 return Uint11 (E) = No_Uint;
4315 end Unknown_Component_Bit_Offset;
4317 function Unknown_Component_Size (E : Entity_Id) return B is
4319 return Uint22 (Base_Type (E)) = Uint_0
4321 Uint22 (Base_Type (E)) = No_Uint;
4322 end Unknown_Component_Size;
4324 function Unknown_Esize (E : Entity_Id) return B is
4326 return Uint12 (E) = No_Uint
4328 Uint12 (E) = Uint_0;
4331 function Unknown_Normalized_First_Bit (E : Entity_Id) return B is
4333 return Uint8 (E) = No_Uint;
4334 end Unknown_Normalized_First_Bit;
4336 function Unknown_Normalized_Position (E : Entity_Id) return B is
4338 return Uint14 (E) = No_Uint;
4339 end Unknown_Normalized_Position;
4341 function Unknown_Normalized_Position_Max (E : Entity_Id) return B is
4343 return Uint10 (E) = No_Uint;
4344 end Unknown_Normalized_Position_Max;
4346 function Unknown_RM_Size (E : Entity_Id) return B is
4348 return (Uint13 (E) = Uint_0
4349 and then not Is_Discrete_Type (E)
4350 and then not Is_Fixed_Point_Type (E))
4351 or else Uint13 (E) = No_Uint;
4352 end Unknown_RM_Size;
4354 --------------------
4355 -- Address_Clause --
4356 --------------------
4358 function Address_Clause (Id : E) return N is
4362 Ritem := First_Rep_Item (Id);
4363 while Present (Ritem) loop
4364 if Nkind (Ritem) = N_Attribute_Definition_Clause
4365 and then Chars (Ritem) = Name_Address
4369 Ritem := Next_Rep_Item (Ritem);
4376 ----------------------
4377 -- Alignment_Clause --
4378 ----------------------
4380 function Alignment_Clause (Id : E) return N is
4384 Ritem := First_Rep_Item (Id);
4385 while Present (Ritem) loop
4386 if Nkind (Ritem) = N_Attribute_Definition_Clause
4387 and then Chars (Ritem) = Name_Alignment
4391 Ritem := Next_Rep_Item (Ritem);
4396 end Alignment_Clause;
4398 ----------------------
4399 -- Ancestor_Subtype --
4400 ----------------------
4402 function Ancestor_Subtype (Id : E) return E is
4404 -- If this is first subtype, or is a base type, then there is no
4405 -- ancestor subtype, so we return Empty to indicate this fact.
4407 if Is_First_Subtype (Id)
4408 or else Id = Base_Type (Id)
4414 D : constant Node_Id := Declaration_Node (Id);
4417 -- If we have a subtype declaration, get the ancestor subtype
4419 if Nkind (D) = N_Subtype_Declaration then
4420 if Nkind (Subtype_Indication (D)) = N_Subtype_Indication then
4421 return Entity (Subtype_Mark (Subtype_Indication (D)));
4423 return Entity (Subtype_Indication (D));
4426 -- If not, then no subtype indication is available
4432 end Ancestor_Subtype;
4438 procedure Append_Entity (Id : Entity_Id; V : Entity_Id) is
4440 if Last_Entity (V) = Empty then
4441 Set_First_Entity (V, Id);
4443 Set_Next_Entity (Last_Entity (V), Id);
4446 Set_Next_Entity (Id, Empty);
4448 Set_Last_Entity (V, Id);
4455 function Base_Type (Id : E) return E is
4458 when E_Enumeration_Subtype |
4460 E_Signed_Integer_Subtype |
4461 E_Modular_Integer_Subtype |
4462 E_Floating_Point_Subtype |
4463 E_Ordinary_Fixed_Point_Subtype |
4464 E_Decimal_Fixed_Point_Subtype |
4469 E_Record_Subtype_With_Private |
4470 E_Limited_Private_Subtype |
4472 E_Protected_Subtype |
4474 E_String_Literal_Subtype |
4475 E_Class_Wide_Subtype =>
4483 -------------------------
4484 -- Component_Alignment --
4485 -------------------------
4487 -- Component Alignment is encoded using two flags, Flag128/129 as
4488 -- follows. Note that both flags False = Align_Default, so that the
4489 -- default initialization of flags to False initializes component
4490 -- alignment to the default value as required.
4492 -- Flag128 Flag129 Value
4493 -- ------- ------- -----
4494 -- False False Calign_Default
4495 -- False True Calign_Component_Size
4496 -- True False Calign_Component_Size_4
4497 -- True True Calign_Storage_Unit
4499 function Component_Alignment (Id : E) return C is
4500 BT : constant Node_Id := Base_Type (Id);
4503 pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id));
4505 if Flag128 (BT) then
4506 if Flag129 (BT) then
4507 return Calign_Storage_Unit;
4509 return Calign_Component_Size_4;
4513 if Flag129 (BT) then
4514 return Calign_Component_Size;
4516 return Calign_Default;
4519 end Component_Alignment;
4521 --------------------
4522 -- Constant_Value --
4523 --------------------
4525 function Constant_Value (Id : E) return N is
4526 D : constant Node_Id := Declaration_Node (Id);
4530 -- If we have no declaration node, then return no constant value.
4531 -- Not clear how this can happen, but it does sometimes ???
4532 -- To investigate, remove this check and compile discrim_po.adb.
4537 -- Normal case where a declaration node is present
4539 elsif Nkind (D) = N_Object_Renaming_Declaration then
4540 return Renamed_Object (Id);
4542 -- If this is a component declaration whose entity is constant, it
4543 -- is a prival within a protected function. It does not have
4544 -- a constant value.
4546 elsif Nkind (D) = N_Component_Declaration then
4549 -- If there is an expression, return it
4551 elsif Present (Expression (D)) then
4552 return (Expression (D));
4554 -- For a constant, see if we have a full view
4556 elsif Ekind (Id) = E_Constant
4557 and then Present (Full_View (Id))
4559 Full_D := Parent (Full_View (Id));
4561 -- The full view may have been rewritten as an object renaming.
4563 if Nkind (Full_D) = N_Object_Renaming_Declaration then
4564 return Name (Full_D);
4566 return Expression (Full_D);
4569 -- Otherwise we have no expression to return
4576 ----------------------
4577 -- Declaration_Node --
4578 ----------------------
4580 function Declaration_Node (Id : E) return N is
4584 if Ekind (Id) = E_Incomplete_Type
4585 and then Present (Full_View (Id))
4587 P := Parent (Full_View (Id));
4593 if Nkind (P) /= N_Selected_Component
4594 and then Nkind (P) /= N_Expanded_Name
4596 not (Nkind (P) = N_Defining_Program_Unit_Name
4597 and then Is_Child_Unit (Id))
4605 end Declaration_Node;
4607 ---------------------
4608 -- Designated_Type --
4609 ---------------------
4611 function Designated_Type (Id : E) return E is
4615 Desig_Type := Directly_Designated_Type (Id);
4617 if Ekind (Desig_Type) = E_Incomplete_Type
4618 and then Present (Full_View (Desig_Type))
4620 return Full_View (Desig_Type);
4622 elsif Is_Class_Wide_Type (Desig_Type)
4623 and then Ekind (Etype (Desig_Type)) = E_Incomplete_Type
4624 and then Present (Full_View (Etype (Desig_Type)))
4625 and then Present (Class_Wide_Type (Full_View (Etype (Desig_Type))))
4627 return Class_Wide_Type (Full_View (Etype (Desig_Type)));
4632 end Designated_Type;
4634 -----------------------------
4635 -- Enclosing_Dynamic_Scope --
4636 -----------------------------
4638 function Enclosing_Dynamic_Scope (Id : E) return E is
4643 while S /= Standard_Standard
4644 and then not Is_Dynamic_Scope (S)
4650 end Enclosing_Dynamic_Scope;
4652 ----------------------
4653 -- Entry_Index_Type --
4654 ----------------------
4656 function Entry_Index_Type (Id : E) return N is
4658 pragma Assert (Ekind (Id) = E_Entry_Family);
4659 return Etype (Discrete_Subtype_Definition (Parent (Id)));
4660 end Entry_Index_Type;
4662 ---------------------
4663 -- First_Component --
4664 ---------------------
4666 function First_Component (Id : E) return E is
4671 (Is_Record_Type (Id) or else Is_Incomplete_Or_Private_Type (Id));
4673 Comp_Id := First_Entity (Id);
4675 while Present (Comp_Id) loop
4676 exit when Ekind (Comp_Id) = E_Component;
4677 Comp_Id := Next_Entity (Comp_Id);
4681 end First_Component;
4683 ------------------------
4684 -- First_Discriminant --
4685 ------------------------
4687 function First_Discriminant (Id : E) return E is
4692 (Has_Discriminants (Id)
4693 or else Has_Unknown_Discriminants (Id));
4695 Ent := First_Entity (Id);
4697 -- The discriminants are not necessarily contiguous, because access
4698 -- discriminants will generate itypes. They are not the first entities
4699 -- either, because tag and controller record must be ahead of them.
4701 if Chars (Ent) = Name_uTag then
4702 Ent := Next_Entity (Ent);
4705 if Chars (Ent) = Name_uController then
4706 Ent := Next_Entity (Ent);
4709 -- Skip all hidden stored discriminants if any.
4711 while Present (Ent) loop
4712 exit when Ekind (Ent) = E_Discriminant
4713 and then not Is_Completely_Hidden (Ent);
4715 Ent := Next_Entity (Ent);
4718 pragma Assert (Ekind (Ent) = E_Discriminant);
4721 end First_Discriminant;
4727 function First_Formal (Id : E) return E is
4732 (Is_Overloadable (Id)
4733 or else Ekind (Id) = E_Entry_Family
4734 or else Ekind (Id) = E_Subprogram_Body
4735 or else Ekind (Id) = E_Subprogram_Type);
4737 if Ekind (Id) = E_Enumeration_Literal then
4741 Formal := First_Entity (Id);
4743 if Present (Formal) and then Is_Formal (Formal) then
4751 -------------------------------
4752 -- First_Stored_Discriminant --
4753 -------------------------------
4755 function First_Stored_Discriminant (Id : E) return E is
4758 function Has_Completely_Hidden_Discriminant (Id : E) return Boolean;
4759 -- Scans the Discriminants to see whether any are Completely_Hidden
4760 -- (the mechanism for describing non-specified stored discriminants)
4762 function Has_Completely_Hidden_Discriminant (Id : E) return Boolean is
4763 Ent : Entity_Id := Id;
4766 pragma Assert (Ekind (Id) = E_Discriminant);
4768 while Present (Ent) and then Ekind (Ent) = E_Discriminant loop
4770 if Is_Completely_Hidden (Ent) then
4774 Ent := Next_Entity (Ent);
4778 end Has_Completely_Hidden_Discriminant;
4780 -- Start of processing for First_Stored_Discriminant
4784 (Has_Discriminants (Id)
4785 or else Has_Unknown_Discriminants (Id));
4787 Ent := First_Entity (Id);
4789 if Chars (Ent) = Name_uTag then
4790 Ent := Next_Entity (Ent);
4793 if Chars (Ent) = Name_uController then
4794 Ent := Next_Entity (Ent);
4797 if Has_Completely_Hidden_Discriminant (Ent) then
4799 while Present (Ent) loop
4800 exit when Is_Completely_Hidden (Ent);
4801 Ent := Next_Entity (Ent);
4806 pragma Assert (Ekind (Ent) = E_Discriminant);
4809 end First_Stored_Discriminant;
4815 function First_Subtype (Id : E) return E is
4816 B : constant Entity_Id := Base_Type (Id);
4817 F : constant Node_Id := Freeze_Node (B);
4821 -- If the base type has no freeze node, it is a type in standard,
4822 -- and always acts as its own first subtype unless it is one of
4823 -- the predefined integer types. If the type is formal, it is also
4824 -- a first subtype, and its base type has no freeze node. On the other
4825 -- hand, a subtype of a generic formal is not its own first_subtype.
4826 -- Its base type, if anonymous, is attached to the formal type decl.
4827 -- from which the first subtype is obtained.
4831 if B = Base_Type (Standard_Integer) then
4832 return Standard_Integer;
4834 elsif B = Base_Type (Standard_Long_Integer) then
4835 return Standard_Long_Integer;
4837 elsif B = Base_Type (Standard_Short_Short_Integer) then
4838 return Standard_Short_Short_Integer;
4840 elsif B = Base_Type (Standard_Short_Integer) then
4841 return Standard_Short_Integer;
4843 elsif B = Base_Type (Standard_Long_Long_Integer) then
4844 return Standard_Long_Long_Integer;
4846 elsif Is_Generic_Type (Id) then
4847 if Present (Parent (B)) then
4848 return Defining_Identifier (Parent (B));
4850 return Defining_Identifier (Associated_Node_For_Itype (B));
4857 -- Otherwise we check the freeze node, if it has a First_Subtype_Link
4858 -- then we use that link, otherwise (happens with some Itypes), we use
4859 -- the base type itself.
4862 Ent := First_Subtype_Link (F);
4864 if Present (Ent) then
4872 -------------------------------------
4873 -- Get_Attribute_Definition_Clause --
4874 -------------------------------------
4876 function Get_Attribute_Definition_Clause
4884 N := First_Rep_Item (E);
4885 while Present (N) loop
4886 if Nkind (N) = N_Attribute_Definition_Clause
4887 and then Get_Attribute_Id (Chars (N)) = Id
4896 end Get_Attribute_Definition_Clause;
4898 --------------------
4899 -- Get_Rep_Pragma --
4900 --------------------
4902 function Get_Rep_Pragma (E : Entity_Id; Nam : Name_Id) return Node_Id is
4907 N := First_Rep_Item (E);
4909 while Present (N) loop
4910 if Nkind (N) = N_Pragma and then Chars (N) = Nam then
4912 if Nam = Name_Stream_Convert then
4914 -- For tagged types this pragma is not inherited, so we
4915 -- must verify that it is defined for the given type and
4918 Typ := Entity (Expression
4919 (First (Pragma_Argument_Associations (N))));
4921 if not Is_Tagged_Type (E)
4923 or else (Is_Private_Type (Typ)
4924 and then E = Full_View (Typ))
4942 ------------------------
4943 -- Has_Attach_Handler --
4944 ------------------------
4946 function Has_Attach_Handler (Id : E) return B is
4950 pragma Assert (Is_Protected_Type (Id));
4952 Ritem := First_Rep_Item (Id);
4953 while Present (Ritem) loop
4954 if Nkind (Ritem) = N_Pragma
4955 and then Chars (Ritem) = Name_Attach_Handler
4959 Ritem := Next_Rep_Item (Ritem);
4964 end Has_Attach_Handler;
4970 function Has_Entries (Id : E) return B is
4971 Result : Boolean := False;
4975 pragma Assert (Is_Concurrent_Type (Id));
4976 Ent := First_Entity (Id);
4978 while Present (Ent) loop
4979 if Is_Entry (Ent) then
4984 Ent := Next_Entity (Ent);
4990 ----------------------------
4991 -- Has_Foreign_Convention --
4992 ----------------------------
4994 function Has_Foreign_Convention (Id : E) return B is
4996 return Convention (Id) >= Foreign_Convention'First;
4997 end Has_Foreign_Convention;
4999 ---------------------------
5000 -- Has_Interrupt_Handler --
5001 ---------------------------
5003 function Has_Interrupt_Handler (Id : E) return B is
5007 pragma Assert (Is_Protected_Type (Id));
5009 Ritem := First_Rep_Item (Id);
5010 while Present (Ritem) loop
5011 if Nkind (Ritem) = N_Pragma
5012 and then Chars (Ritem) = Name_Interrupt_Handler
5016 Ritem := Next_Rep_Item (Ritem);
5021 end Has_Interrupt_Handler;
5023 --------------------------
5024 -- Has_Private_Ancestor --
5025 --------------------------
5027 function Has_Private_Ancestor (Id : E) return B is
5028 R : constant Entity_Id := Root_Type (Id);
5029 T1 : Entity_Id := Id;
5033 if Is_Private_Type (T1) then
5043 end Has_Private_Ancestor;
5045 ------------------------------
5046 -- Implementation_Base_Type --
5047 ------------------------------
5049 function Implementation_Base_Type (Id : E) return E is
5054 Bastyp := Base_Type (Id);
5056 if Is_Incomplete_Or_Private_Type (Bastyp) then
5057 Imptyp := Underlying_Type (Bastyp);
5059 -- If we have an implementation type, then just return it,
5060 -- otherwise we return the Base_Type anyway. This can only
5061 -- happen in error situations and should avoid some error bombs.
5063 if Present (Imptyp) then
5064 return Base_Type (Imptyp);
5072 end Implementation_Base_Type;
5074 -----------------------
5075 -- Is_Always_Inlined --
5076 -----------------------
5078 function Is_Always_Inlined (Id : E) return B is
5082 Item := First_Rep_Item (Id);
5084 while Present (Item) loop
5085 if Nkind (Item) = N_Pragma
5086 and then Get_Pragma_Id (Chars (Item)) = Pragma_Inline_Always
5091 Next_Rep_Item (Item);
5095 end Is_Always_Inlined;
5097 ---------------------
5098 -- Is_Boolean_Type --
5099 ---------------------
5101 function Is_Boolean_Type (Id : E) return B is
5103 return Root_Type (Id) = Standard_Boolean;
5104 end Is_Boolean_Type;
5106 ---------------------
5107 -- Is_By_Copy_Type --
5108 ---------------------
5110 function Is_By_Copy_Type (Id : E) return B is
5112 -- If Id is a private type whose full declaration has not been seen,
5113 -- we assume for now that it is not a By_Copy type. Clearly this
5114 -- attribute should not be used before the type is frozen, but it is
5115 -- needed to build the associated record of a protected type. Another
5116 -- place where some lookahead for a full view is needed ???
5119 Is_Elementary_Type (Id)
5120 or else (Is_Private_Type (Id)
5121 and then Present (Underlying_Type (Id))
5122 and then Is_Elementary_Type (Underlying_Type (Id)));
5123 end Is_By_Copy_Type;
5125 --------------------------
5126 -- Is_By_Reference_Type --
5127 --------------------------
5129 function Is_By_Reference_Type (Id : E) return B is
5130 Btype : constant Entity_Id := Base_Type (Id);
5133 if Error_Posted (Id)
5134 or else Error_Posted (Btype)
5138 elsif Is_Private_Type (Btype) then
5140 Utyp : constant Entity_Id := Underlying_Type (Btype);
5146 return Is_By_Reference_Type (Utyp);
5150 elsif Is_Concurrent_Type (Btype) then
5153 elsif Is_Record_Type (Btype) then
5154 if Is_Limited_Record (Btype)
5155 or else Is_Tagged_Type (Btype)
5156 or else Is_Volatile (Btype)
5162 C : Entity_Id := First_Component (Btype);
5165 while Present (C) loop
5166 if Is_By_Reference_Type (Etype (C))
5167 or else Is_Volatile (Etype (C))
5172 C := Next_Component (C);
5179 elsif Is_Array_Type (Btype) then
5182 or else Is_By_Reference_Type (Component_Type (Btype))
5183 or else Is_Volatile (Component_Type (Btype))
5184 or else Has_Volatile_Components (Btype);
5189 end Is_By_Reference_Type;
5191 ---------------------
5192 -- Is_Derived_Type --
5193 ---------------------
5195 function Is_Derived_Type (Id : E) return B is
5199 if Base_Type (Id) /= Root_Type (Id)
5200 and then not Is_Generic_Type (Id)
5201 and then not Is_Class_Wide_Type (Id)
5203 if not Is_Numeric_Type (Root_Type (Id)) then
5207 Par := Parent (First_Subtype (Id));
5209 return Present (Par)
5210 and then Nkind (Par) = N_Full_Type_Declaration
5211 and then Nkind (Type_Definition (Par))
5212 = N_Derived_Type_Definition;
5218 end Is_Derived_Type;
5220 ----------------------
5221 -- Is_Dynamic_Scope --
5222 ----------------------
5224 function Is_Dynamic_Scope (Id : E) return B is
5227 Ekind (Id) = E_Block
5229 Ekind (Id) = E_Function
5231 Ekind (Id) = E_Procedure
5233 Ekind (Id) = E_Subprogram_Body
5235 Ekind (Id) = E_Task_Type
5237 Ekind (Id) = E_Entry
5239 Ekind (Id) = E_Entry_Family;
5240 end Is_Dynamic_Scope;
5242 --------------------
5243 -- Is_Entity_Name --
5244 --------------------
5246 function Is_Entity_Name (N : Node_Id) return Boolean is
5247 Kind : constant Node_Kind := Nkind (N);
5250 -- Identifiers, operator symbols, expanded names are entity names
5252 return Kind = N_Identifier
5253 or else Kind = N_Operator_Symbol
5254 or else Kind = N_Expanded_Name
5256 -- Attribute references are entity names if they refer to an entity.
5257 -- Note that we don't do this by testing for the presence of the
5258 -- Entity field in the N_Attribute_Reference node, since it may not
5259 -- have been set yet.
5261 or else (Kind = N_Attribute_Reference
5262 and then Is_Entity_Attribute_Name (Attribute_Name (N)));
5265 ---------------------------
5266 -- Is_Indefinite_Subtype --
5267 ---------------------------
5269 function Is_Indefinite_Subtype (Id : Entity_Id) return B is
5270 K : constant Entity_Kind := Ekind (Id);
5273 if Is_Constrained (Id) then
5276 elsif K in Array_Kind
5277 or else K in Class_Wide_Kind
5278 or else Has_Unknown_Discriminants (Id)
5282 -- Known discriminants: indefinite if there are no default values
5284 elsif K in Record_Kind
5285 or else Is_Incomplete_Or_Private_Type (Id)
5286 or else Is_Concurrent_Type (Id)
5288 return (Has_Discriminants (Id)
5289 and then No (Discriminant_Default_Value (First_Discriminant (Id))));
5294 end Is_Indefinite_Subtype;
5296 ---------------------
5297 -- Is_Limited_Type --
5298 ---------------------
5300 function Is_Limited_Type (Id : E) return B is
5301 Btype : constant E := Base_Type (Id);
5304 if not Is_Type (Id) then
5307 elsif Ekind (Btype) = E_Limited_Private_Type
5308 or else Is_Limited_Composite (Btype)
5312 elsif Is_Concurrent_Type (Btype) then
5315 -- Otherwise we will look around to see if there is some other reason
5316 -- for it to be limited, except that if an error was posted on the
5317 -- entity, then just assume it is non-limited, because it can cause
5318 -- trouble to recurse into a murky erroneous entity!
5320 elsif Error_Posted (Id) then
5323 elsif Is_Record_Type (Btype) then
5324 if Is_Limited_Record (Root_Type (Btype)) then
5327 elsif Is_Class_Wide_Type (Btype) then
5328 return Is_Limited_Type (Root_Type (Btype));
5332 C : E := First_Component (Btype);
5335 while Present (C) loop
5336 if Is_Limited_Type (Etype (C)) then
5340 C := Next_Component (C);
5347 elsif Is_Array_Type (Btype) then
5348 return Is_Limited_Type (Component_Type (Btype));
5353 end Is_Limited_Type;
5359 function Is_Package (Id : E) return B is
5362 Ekind (Id) = E_Package
5364 Ekind (Id) = E_Generic_Package;
5367 --------------------------
5368 -- Is_Protected_Private --
5369 --------------------------
5371 function Is_Protected_Private (Id : E) return B is
5373 pragma Assert (Ekind (Id) = E_Component);
5374 return Is_Protected_Type (Scope (Id));
5375 end Is_Protected_Private;
5377 ------------------------------
5378 -- Is_Protected_Record_Type --
5379 ------------------------------
5381 function Is_Protected_Record_Type (Id : E) return B is
5384 Is_Concurrent_Record_Type (Id)
5385 and then Is_Protected_Type (Corresponding_Concurrent_Type (Id));
5386 end Is_Protected_Record_Type;
5388 ---------------------------------
5389 -- Is_Return_By_Reference_Type --
5390 ---------------------------------
5392 function Is_Return_By_Reference_Type (Id : E) return B is
5393 Btype : constant Entity_Id := Base_Type (Id);
5396 if Is_Private_Type (Btype) then
5398 Utyp : constant Entity_Id := Underlying_Type (Btype);
5404 return Is_Return_By_Reference_Type (Utyp);
5408 elsif Is_Concurrent_Type (Btype) then
5411 elsif Is_Record_Type (Btype) then
5412 if Is_Limited_Record (Btype) then
5415 elsif Is_Class_Wide_Type (Btype) then
5416 return Is_Return_By_Reference_Type (Root_Type (Btype));
5420 C : Entity_Id := First_Component (Btype);
5423 while Present (C) loop
5424 if Is_Return_By_Reference_Type (Etype (C)) then
5428 C := Next_Component (C);
5435 elsif Is_Array_Type (Btype) then
5436 return Is_Return_By_Reference_Type (Component_Type (Btype));
5441 end Is_Return_By_Reference_Type;
5443 --------------------
5444 -- Is_String_Type --
5445 --------------------
5447 function Is_String_Type (Id : E) return B is
5449 return Ekind (Id) in String_Kind
5450 or else (Is_Array_Type (Id)
5451 and then Number_Dimensions (Id) = 1
5452 and then Is_Character_Type (Component_Type (Id)));
5455 -------------------------
5456 -- Is_Task_Record_Type --
5457 -------------------------
5459 function Is_Task_Record_Type (Id : E) return B is
5462 Is_Concurrent_Record_Type (Id)
5463 and then Is_Task_Type (Corresponding_Concurrent_Type (Id));
5464 end Is_Task_Record_Type;
5466 ------------------------
5467 -- Is_Wrapper_Package --
5468 ------------------------
5470 function Is_Wrapper_Package (Id : E) return B is
5472 return (Ekind (Id) = E_Package
5473 and then Present (Related_Instance (Id)));
5474 end Is_Wrapper_Package;
5476 --------------------
5477 -- Next_Component --
5478 --------------------
5480 function Next_Component (Id : E) return E is
5484 Comp_Id := Next_Entity (Id);
5486 while Present (Comp_Id) loop
5487 exit when Ekind (Comp_Id) = E_Component;
5488 Comp_Id := Next_Entity (Comp_Id);
5494 -----------------------
5495 -- Next_Discriminant --
5496 -----------------------
5498 -- This function actually implements both Next_Discriminant and
5499 -- Next_Stored_Discriminant by making sure that the Discriminant
5500 -- returned is of the same variety as Id.
5502 function Next_Discriminant (Id : E) return E is
5504 -- Derived Tagged types with private extensions look like this...
5506 -- E_Discriminant d1
5507 -- E_Discriminant d2
5509 -- E_Discriminant d1
5510 -- E_Discriminant d2
5513 -- so it is critical not to go past the leading discriminants.
5518 pragma Assert (Ekind (Id) = E_Discriminant);
5521 D := Next_Entity (D);
5523 or else (Ekind (D) /= E_Discriminant
5524 and then not Is_Itype (D))
5529 exit when Ekind (D) = E_Discriminant
5530 and then (Is_Completely_Hidden (D) = Is_Completely_Hidden (Id));
5534 end Next_Discriminant;
5540 function Next_Formal (Id : E) return E is
5544 -- Follow the chain of declared entities as long as the kind of
5545 -- the entity corresponds to a formal parameter. Skip internal
5546 -- entities that may have been created for implicit subtypes,
5547 -- in the process of analyzing default expressions.
5552 P := Next_Entity (P);
5554 if No (P) or else Is_Formal (P) then
5556 elsif not Is_Internal (P) then
5562 -----------------------------
5563 -- Next_Formal_With_Extras --
5564 -----------------------------
5566 function Next_Formal_With_Extras (Id : E) return E is
5568 if Present (Extra_Formal (Id)) then
5569 return Extra_Formal (Id);
5571 return Next_Formal (Id);
5573 end Next_Formal_With_Extras;
5579 function Next_Index (Id : Node_Id) return Node_Id is
5588 function Next_Literal (Id : E) return E is
5590 pragma Assert (Nkind (Id) in N_Entity);
5594 ------------------------------
5595 -- Next_Stored_Discriminant --
5596 ------------------------------
5598 function Next_Stored_Discriminant (Id : E) return E is
5600 -- See comment in Next_Discriminant
5602 return Next_Discriminant (Id);
5603 end Next_Stored_Discriminant;
5605 -----------------------
5606 -- Number_Dimensions --
5607 -----------------------
5609 function Number_Dimensions (Id : E) return Pos is
5614 if Ekind (Id) in String_Kind then
5619 T := First_Index (Id);
5621 while Present (T) loop
5628 end Number_Dimensions;
5630 --------------------------
5631 -- Number_Discriminants --
5632 --------------------------
5634 function Number_Discriminants (Id : E) return Pos is
5640 Discr := First_Discriminant (Id);
5642 while Present (Discr) loop
5644 Discr := Next_Discriminant (Discr);
5648 end Number_Discriminants;
5650 --------------------
5651 -- Number_Entries --
5652 --------------------
5654 function Number_Entries (Id : E) return Nat is
5659 pragma Assert (Is_Concurrent_Type (Id));
5661 Ent := First_Entity (Id);
5663 while Present (Ent) loop
5664 if Is_Entry (Ent) then
5668 Ent := Next_Entity (Ent);
5674 --------------------
5675 -- Number_Formals --
5676 --------------------
5678 function Number_Formals (Id : E) return Pos is
5684 Formal := First_Formal (Id);
5686 while Present (Formal) loop
5688 Formal := Next_Formal (Formal);
5694 --------------------
5695 -- Parameter_Mode --
5696 --------------------
5698 function Parameter_Mode (Id : E) return Formal_Kind is
5707 function Root_Type (Id : E) return E is
5711 pragma Assert (Nkind (Id) in N_Entity);
5713 T := Base_Type (Id);
5715 if Ekind (T) = E_Class_Wide_Type then
5727 -- Following test catches some error cases resulting from
5730 elsif No (Etyp) then
5733 elsif Is_Private_Type (T) and then Etyp = Full_View (T) then
5736 elsif Is_Private_Type (Etyp) and then Full_View (Etyp) = T then
5742 -- Return if there is a circularity in the inheritance chain.
5743 -- This happens in some error situations and we do not want
5744 -- to get stuck in this loop.
5746 if T = Base_Type (Id) then
5752 raise Program_Error;
5759 function Scope_Depth (Id : E) return Uint is
5760 Scop : Entity_Id := Id;
5763 while Is_Record_Type (Scop) loop
5764 Scop := Scope (Scop);
5767 return Scope_Depth_Value (Scop);
5770 ---------------------
5771 -- Scope_Depth_Set --
5772 ---------------------
5774 function Scope_Depth_Set (Id : E) return B is
5776 return not Is_Record_Type (Id)
5777 and then Field22 (Id) /= Union_Id (Empty);
5778 end Scope_Depth_Set;
5780 -----------------------------
5781 -- Set_Component_Alignment --
5782 -----------------------------
5784 -- Component Alignment is encoded using two flags, Flag128/129 as
5785 -- follows. Note that both flags False = Align_Default, so that the
5786 -- default initialization of flags to False initializes component
5787 -- alignment to the default value as required.
5789 -- Flag128 Flag129 Value
5790 -- ------- ------- -----
5791 -- False False Calign_Default
5792 -- False True Calign_Component_Size
5793 -- True False Calign_Component_Size_4
5794 -- True True Calign_Storage_Unit
5796 procedure Set_Component_Alignment (Id : E; V : C) is
5798 pragma Assert ((Is_Array_Type (Id) or else Is_Record_Type (Id))
5799 and then Id = Base_Type (Id));
5802 when Calign_Default =>
5803 Set_Flag128 (Id, False);
5804 Set_Flag129 (Id, False);
5806 when Calign_Component_Size =>
5807 Set_Flag128 (Id, False);
5808 Set_Flag129 (Id, True);
5810 when Calign_Component_Size_4 =>
5811 Set_Flag128 (Id, True);
5812 Set_Flag129 (Id, False);
5814 when Calign_Storage_Unit =>
5815 Set_Flag128 (Id, True);
5816 Set_Flag129 (Id, True);
5818 end Set_Component_Alignment;
5824 function Size_Clause (Id : E) return N is
5828 Ritem := First_Rep_Item (Id);
5829 while Present (Ritem) loop
5830 if Nkind (Ritem) = N_Attribute_Definition_Clause
5831 and then Chars (Ritem) = Name_Size
5835 Ritem := Next_Rep_Item (Ritem);
5846 function Subtype_Kind (K : Entity_Kind) return Entity_Kind is
5852 Kind := E_Access_Subtype;
5856 Kind := E_Array_Subtype;
5858 when E_Class_Wide_Type |
5859 E_Class_Wide_Subtype =>
5860 Kind := E_Class_Wide_Subtype;
5862 when E_Decimal_Fixed_Point_Type |
5863 E_Decimal_Fixed_Point_Subtype =>
5864 Kind := E_Decimal_Fixed_Point_Subtype;
5866 when E_Ordinary_Fixed_Point_Type |
5867 E_Ordinary_Fixed_Point_Subtype =>
5868 Kind := E_Ordinary_Fixed_Point_Subtype;
5870 when E_Private_Type |
5871 E_Private_Subtype =>
5872 Kind := E_Private_Subtype;
5874 when E_Limited_Private_Type |
5875 E_Limited_Private_Subtype =>
5876 Kind := E_Limited_Private_Subtype;
5878 when E_Record_Type_With_Private |
5879 E_Record_Subtype_With_Private =>
5880 Kind := E_Record_Subtype_With_Private;
5882 when E_Record_Type |
5884 Kind := E_Record_Subtype;
5886 when E_String_Type |
5888 Kind := E_String_Subtype;
5890 when Enumeration_Kind =>
5891 Kind := E_Enumeration_Subtype;
5894 Kind := E_Floating_Point_Subtype;
5896 when Signed_Integer_Kind =>
5897 Kind := E_Signed_Integer_Subtype;
5899 when Modular_Integer_Kind =>
5900 Kind := E_Modular_Integer_Subtype;
5902 when Protected_Kind =>
5903 Kind := E_Protected_Subtype;
5906 Kind := E_Task_Subtype;
5910 raise Program_Error;
5920 function Tag_Component (Id : E) return E is
5922 Typ : Entity_Id := Id;
5925 pragma Assert (Is_Tagged_Type (Typ));
5927 if Is_Class_Wide_Type (Typ) then
5928 Typ := Root_Type (Typ);
5931 if Is_Private_Type (Typ) then
5932 Typ := Underlying_Type (Typ);
5935 Comp := First_Entity (Typ);
5936 while Present (Comp) loop
5937 if Is_Tag (Comp) then
5941 Comp := Next_Entity (Comp);
5944 -- No tag component found
5949 ---------------------
5950 -- Type_High_Bound --
5951 ---------------------
5953 function Type_High_Bound (Id : E) return Node_Id is
5955 if Nkind (Scalar_Range (Id)) = N_Subtype_Indication then
5956 return High_Bound (Range_Expression (Constraint (Scalar_Range (Id))));
5958 return High_Bound (Scalar_Range (Id));
5960 end Type_High_Bound;
5962 --------------------
5963 -- Type_Low_Bound --
5964 --------------------
5966 function Type_Low_Bound (Id : E) return Node_Id is
5968 if Nkind (Scalar_Range (Id)) = N_Subtype_Indication then
5969 return Low_Bound (Range_Expression (Constraint (Scalar_Range (Id))));
5971 return Low_Bound (Scalar_Range (Id));
5975 ---------------------
5976 -- Underlying_Type --
5977 ---------------------
5979 function Underlying_Type (Id : E) return E is
5981 -- For record_with_private the underlying type is always the direct
5982 -- full view. Never try to take the full view of the parent it
5983 -- doesn't make sense.
5985 if Ekind (Id) = E_Record_Type_With_Private then
5986 return Full_View (Id);
5988 elsif Ekind (Id) in Incomplete_Or_Private_Kind then
5990 -- If we have an incomplete or private type with a full view,
5991 -- then we return the Underlying_Type of this full view
5993 if Present (Full_View (Id)) then
5994 if Id = Full_View (Id) then
5996 -- Previous error in declaration
6001 return Underlying_Type (Full_View (Id));
6004 -- Otherwise check for the case where we have a derived type or
6005 -- subtype, and if so get the Underlying_Type of the parent type.
6007 elsif Etype (Id) /= Id then
6008 return Underlying_Type (Etype (Id));
6010 -- Otherwise we have an incomplete or private type that has
6011 -- no full view, which means that we have not encountered the
6012 -- completion, so return Empty to indicate the underlying type
6013 -- is not yet known.
6019 -- For non-incomplete, non-private types, return the type itself
6020 -- Also for entities that are not types at all return the entity
6026 end Underlying_Type;
6028 ------------------------
6029 -- Write_Entity_Flags --
6030 ------------------------
6032 procedure Write_Entity_Flags (Id : Entity_Id; Prefix : String) is
6034 procedure W (Flag_Name : String; Flag : Boolean);
6035 -- Write out given flag if it is set
6037 procedure W (Flag_Name : String; Flag : Boolean) is
6041 Write_Str (Flag_Name);
6042 Write_Str (" = True");
6047 -- Start of processing for Write_Entity_Flags
6050 if (Is_Array_Type (Id) or else Is_Record_Type (Id))
6051 and then Base_Type (Id) = Id
6054 Write_Str ("Component_Alignment = ");
6056 case Component_Alignment (Id) is
6057 when Calign_Default =>
6058 Write_Str ("Calign_Default");
6060 when Calign_Component_Size =>
6061 Write_Str ("Calign_Component_Size");
6063 when Calign_Component_Size_4 =>
6064 Write_Str ("Calign_Component_Size_4");
6066 when Calign_Storage_Unit =>
6067 Write_Str ("Calign_Storage_Unit");
6073 W ("Address_Taken", Flag104 (Id));
6074 W ("Body_Needed_For_SAL", Flag40 (Id));
6075 W ("C_Pass_By_Copy", Flag125 (Id));
6076 W ("Can_Never_Be_Null", Flag38 (Id));
6077 W ("Checks_May_Be_Suppressed", Flag31 (Id));
6078 W ("Debug_Info_Off", Flag166 (Id));
6079 W ("Default_Expressions_Processed", Flag108 (Id));
6080 W ("Delay_Cleanups", Flag114 (Id));
6081 W ("Delay_Subprogram_Descriptors", Flag50 (Id));
6082 W ("Depends_On_Private", Flag14 (Id));
6083 W ("Discard_Names", Flag88 (Id));
6084 W ("Elaborate_All_Desirable", Flag146 (Id));
6085 W ("Elaboration_Entity_Required", Flag174 (Id));
6086 W ("Entry_Accepted", Flag152 (Id));
6087 W ("Finalize_Storage_Only", Flag158 (Id));
6088 W ("From_With_Type", Flag159 (Id));
6089 W ("Function_Returns_With_DSP", Flag169 (Id));
6090 W ("Has_Aliased_Components", Flag135 (Id));
6091 W ("Has_Alignment_Clause", Flag46 (Id));
6092 W ("Has_All_Calls_Remote", Flag79 (Id));
6093 W ("Has_Atomic_Components", Flag86 (Id));
6094 W ("Has_Biased_Representation", Flag139 (Id));
6095 W ("Has_Completion", Flag26 (Id));
6096 W ("Has_Completion_In_Body", Flag71 (Id));
6097 W ("Has_Complex_Representation", Flag140 (Id));
6098 W ("Has_Component_Size_Clause", Flag68 (Id));
6099 W ("Has_Contiguous_Rep", Flag181 (Id));
6100 W ("Has_Controlled_Component", Flag43 (Id));
6101 W ("Has_Controlling_Result", Flag98 (Id));
6102 W ("Has_Convention_Pragma", Flag119 (Id));
6103 W ("Has_Delayed_Freeze", Flag18 (Id));
6104 W ("Has_Discriminants", Flag5 (Id));
6105 W ("Has_Enumeration_Rep_Clause", Flag66 (Id));
6106 W ("Has_Exit", Flag47 (Id));
6107 W ("Has_External_Tag_Rep_Clause", Flag110 (Id));
6108 W ("Has_Forward_Instantiation", Flag175 (Id));
6109 W ("Has_Fully_Qualified_Name", Flag173 (Id));
6110 W ("Has_Gigi_Rep_Item", Flag82 (Id));
6111 W ("Has_Homonym", Flag56 (Id));
6112 W ("Has_Machine_Radix_Clause", Flag83 (Id));
6113 W ("Has_Master_Entity", Flag21 (Id));
6114 W ("Has_Missing_Return", Flag142 (Id));
6115 W ("Has_Nested_Block_With_Handler", Flag101 (Id));
6116 W ("Has_Non_Standard_Rep", Flag75 (Id));
6117 W ("Has_Object_Size_Clause", Flag172 (Id));
6118 W ("Has_Per_Object_Constraint", Flag154 (Id));
6119 W ("Has_Pragma_Controlled", Flag27 (Id));
6120 W ("Has_Pragma_Elaborate_Body", Flag150 (Id));
6121 W ("Has_Pragma_Inline", Flag157 (Id));
6122 W ("Has_Pragma_Pack", Flag121 (Id));
6123 W ("Has_Pragma_Pure_Function", Flag179 (Id));
6124 W ("Has_Pragma_Unreferenced", Flag180 (Id));
6125 W ("Has_Primitive_Operations", Flag120 (Id));
6126 W ("Has_Private_Declaration", Flag155 (Id));
6127 W ("Has_Qualified_Name", Flag161 (Id));
6128 W ("Has_Record_Rep_Clause", Flag65 (Id));
6129 W ("Has_Recursive_Call", Flag143 (Id));
6130 W ("Has_Size_Clause", Flag29 (Id));
6131 W ("Has_Small_Clause", Flag67 (Id));
6132 W ("Has_Specified_Layout", Flag100 (Id));
6133 W ("Has_Storage_Size_Clause", Flag23 (Id));
6134 W ("Has_Subprogram_Descriptor", Flag93 (Id));
6135 W ("Has_Task", Flag30 (Id));
6136 W ("Has_Unchecked_Union", Flag123 (Id));
6137 W ("Has_Unknown_Discriminants", Flag72 (Id));
6138 W ("Has_Volatile_Components", Flag87 (Id));
6139 W ("Has_Xref_Entry", Flag182 (Id));
6140 W ("In_Package_Body", Flag48 (Id));
6141 W ("In_Private_Part", Flag45 (Id));
6142 W ("In_Use", Flag8 (Id));
6143 W ("Is_AST_Entry", Flag132 (Id));
6144 W ("Is_Abstract", Flag19 (Id));
6145 W ("Is_Access_Constant", Flag69 (Id));
6146 W ("Is_Aliased", Flag15 (Id));
6147 W ("Is_Asynchronous", Flag81 (Id));
6148 W ("Is_Atomic", Flag85 (Id));
6149 W ("Is_Bit_Packed_Array", Flag122 (Id));
6150 W ("Is_CPP_Class", Flag74 (Id));
6151 W ("Is_Called", Flag102 (Id));
6152 W ("Is_Character_Type", Flag63 (Id));
6153 W ("Is_Child_Unit", Flag73 (Id));
6154 W ("Is_Class_Wide_Equivalent_Type", Flag35 (Id));
6155 W ("Is_Compilation_Unit", Flag149 (Id));
6156 W ("Is_Completely_Hidden", Flag103 (Id));
6157 W ("Is_Concurrent_Record_Type", Flag20 (Id));
6158 W ("Is_Constr_Subt_For_UN_Aliased", Flag141 (Id));
6159 W ("Is_Constr_Subt_For_U_Nominal", Flag80 (Id));
6160 W ("Is_Constrained", Flag12 (Id));
6161 W ("Is_Constructor", Flag76 (Id));
6162 W ("Is_Controlled", Flag42 (Id));
6163 W ("Is_Controlling_Formal", Flag97 (Id));
6164 W ("Is_Discrim_SO_Function", Flag176 (Id));
6165 W ("Is_Dispatching_Operation", Flag6 (Id));
6166 W ("Is_Eliminated", Flag124 (Id));
6167 W ("Is_Entry_Formal", Flag52 (Id));
6168 W ("Is_Exported", Flag99 (Id));
6169 W ("Is_First_Subtype", Flag70 (Id));
6170 W ("Is_For_Access_Subtype", Flag118 (Id));
6171 W ("Is_Formal_Subprogram", Flag111 (Id));
6172 W ("Is_Frozen", Flag4 (Id));
6173 W ("Is_Generic_Actual_Type", Flag94 (Id));
6174 W ("Is_Generic_Instance", Flag130 (Id));
6175 W ("Is_Generic_Type", Flag13 (Id));
6176 W ("Is_Hidden", Flag57 (Id));
6177 W ("Is_Hidden_Open_Scope", Flag171 (Id));
6178 W ("Is_Immediately_Visible", Flag7 (Id));
6179 W ("Is_Imported", Flag24 (Id));
6180 W ("Is_Inlined", Flag11 (Id));
6181 W ("Is_Instantiated", Flag126 (Id));
6182 W ("Is_Internal", Flag17 (Id));
6183 W ("Is_Interrupt_Handler", Flag89 (Id));
6184 W ("Is_Intrinsic_Subprogram", Flag64 (Id));
6185 W ("Is_Itype", Flag91 (Id));
6186 W ("Is_Known_Valid", Flag37 (Id));
6187 W ("Is_Known_Valid", Flag170 (Id));
6188 W ("Is_Limited_Composite", Flag106 (Id));
6189 W ("Is_Limited_Record", Flag25 (Id));
6190 W ("Is_Machine_Code_Subprogram", Flag137 (Id));
6191 W ("Is_Non_Static_Subtype", Flag109 (Id));
6192 W ("Is_Null_Init_Proc", Flag178 (Id));
6193 W ("Is_Optional_Parameter", Flag134 (Id));
6194 W ("Is_Overriding_Operation", Flag39 (Id));
6195 W ("Is_Package_Body_Entity", Flag160 (Id));
6196 W ("Is_Packed", Flag51 (Id));
6197 W ("Is_Packed_Array_Type", Flag138 (Id));
6198 W ("Is_Potentially_Use_Visible", Flag9 (Id));
6199 W ("Is_Preelaborated", Flag59 (Id));
6200 W ("Is_Private_Composite", Flag107 (Id));
6201 W ("Is_Private_Descendant", Flag53 (Id));
6202 W ("Is_Psected", Flag153 (Id));
6203 W ("Is_Public", Flag10 (Id));
6204 W ("Is_Pure", Flag44 (Id));
6205 W ("Is_Remote_Call_Interface", Flag62 (Id));
6206 W ("Is_Remote_Types", Flag61 (Id));
6207 W ("Is_Renaming_Of_Object", Flag112 (Id));
6208 W ("Is_Shared_Passive", Flag60 (Id));
6209 W ("Is_Statically_Allocated", Flag28 (Id));
6210 W ("Is_Tag", Flag78 (Id));
6211 W ("Is_Tagged_Type", Flag55 (Id));
6212 W ("Is_Thread_Body", Flag77 (Id));
6213 W ("Is_True_Constant", Flag163 (Id));
6214 W ("Is_Unchecked_Union", Flag117 (Id));
6215 W ("Is_Unsigned_Type", Flag144 (Id));
6216 W ("Is_VMS_Exception", Flag133 (Id));
6217 W ("Is_Valued_Procedure", Flag127 (Id));
6218 W ("Is_Visible_Child_Unit", Flag116 (Id));
6219 W ("Is_Volatile", Flag16 (Id));
6220 W ("Kill_Elaboration_Checks", Flag32 (Id));
6221 W ("Kill_Range_Checks", Flag33 (Id));
6222 W ("Kill_Tag_Checks", Flag34 (Id));
6223 W ("Machine_Radix_10", Flag84 (Id));
6224 W ("Materialize_Entity", Flag168 (Id));
6225 W ("Needs_Debug_Info", Flag147 (Id));
6226 W ("Needs_No_Actuals", Flag22 (Id));
6227 W ("Never_Set_In_Source", Flag115 (Id));
6228 W ("No_Pool_Assigned", Flag131 (Id));
6229 W ("No_Return", Flag113 (Id));
6230 W ("Non_Binary_Modulus", Flag58 (Id));
6231 W ("Nonzero_Is_True", Flag162 (Id));
6232 W ("Reachable", Flag49 (Id));
6233 W ("Referenced", Flag156 (Id));
6234 W ("Referenced_As_LHS", Flag36 (Id));
6235 W ("Return_Present", Flag54 (Id));
6236 W ("Returns_By_Ref", Flag90 (Id));
6237 W ("Reverse_Bit_Order", Flag164 (Id));
6238 W ("Sec_Stack_Needed_For_Return", Flag167 (Id));
6239 W ("Size_Depends_On_Discriminant", Flag177 (Id));
6240 W ("Size_Known_At_Compile_Time", Flag92 (Id));
6241 W ("Strict_Alignment", Flag145 (Id));
6242 W ("Suppress_Elaboration_Warnings", Flag148 (Id));
6243 W ("Suppress_Init_Proc", Flag105 (Id));
6244 W ("Suppress_Style_Checks", Flag165 (Id));
6245 W ("Treat_As_Volatile", Flag41 (Id));
6246 W ("Uses_Sec_Stack", Flag95 (Id));
6247 W ("Vax_Float", Flag151 (Id));
6248 W ("Warnings_Off", Flag96 (Id));
6249 end Write_Entity_Flags;
6251 -----------------------
6252 -- Write_Entity_Info --
6253 -----------------------
6255 procedure Write_Entity_Info (Id : Entity_Id; Prefix : String) is
6257 procedure Write_Attribute (Which : String; Nam : E);
6258 -- Write attribute value with given string name
6260 procedure Write_Kind (Id : Entity_Id);
6261 -- Write Ekind field of entity
6263 procedure Write_Attribute (Which : String; Nam : E) is
6267 Write_Int (Int (Nam));
6269 Write_Name (Chars (Nam));
6271 end Write_Attribute;
6273 procedure Write_Kind (Id : Entity_Id) is
6274 K : constant String := Entity_Kind'Image (Ekind (Id));
6278 Write_Str (" Kind ");
6280 if Is_Type (Id) and then Is_Tagged_Type (Id) then
6281 Write_Str ("TAGGED ");
6284 Write_Str (K (3 .. K'Length));
6287 if Is_Type (Id) and then Depends_On_Private (Id) then
6288 Write_Str ("Depends_On_Private ");
6292 -- Start of processing for Write_Entity_Info
6296 Write_Attribute ("Name ", Id);
6297 Write_Int (Int (Id));
6301 Write_Attribute (" Type ", Etype (Id));
6303 Write_Attribute (" Scope ", Scope (Id));
6308 when Discrete_Kind =>
6309 Write_Str ("Bounds: Id = ");
6311 if Present (Scalar_Range (Id)) then
6312 Write_Int (Int (Type_Low_Bound (Id)));
6313 Write_Str (" .. Id = ");
6314 Write_Int (Int (Type_High_Bound (Id)));
6316 Write_Str ("Empty");
6326 Write_Attribute (" Component Type ",
6327 Component_Type (Id));
6330 Write_Str (" Indices ");
6332 Index := First_Index (Id);
6334 while Present (Index) loop
6335 Write_Attribute (" ", Etype (Index));
6336 Index := Next_Index (Index);
6344 (" Directly Designated Type ",
6345 Directly_Designated_Type (Id));
6348 when Overloadable_Kind =>
6349 if Present (Homonym (Id)) then
6350 Write_Str (" Homonym ");
6351 Write_Name (Chars (Homonym (Id)));
6353 Write_Int (Int (Homonym (Id)));
6360 if Ekind (Scope (Id)) in Record_Kind then
6362 " Original_Record_Component ",
6363 Original_Record_Component (Id));
6364 Write_Int (Int (Original_Record_Component (Id)));
6368 when others => null;
6370 end Write_Entity_Info;
6372 -----------------------
6373 -- Write_Field6_Name --
6374 -----------------------
6376 procedure Write_Field6_Name (Id : Entity_Id) is
6377 pragma Warnings (Off, Id);
6380 Write_Str ("First_Rep_Item");
6381 end Write_Field6_Name;
6383 -----------------------
6384 -- Write_Field7_Name --
6385 -----------------------
6387 procedure Write_Field7_Name (Id : Entity_Id) is
6388 pragma Warnings (Off, Id);
6391 Write_Str ("Freeze_Node");
6392 end Write_Field7_Name;
6394 -----------------------
6395 -- Write_Field8_Name --
6396 -----------------------
6398 procedure Write_Field8_Name (Id : Entity_Id) is
6403 Write_Str ("Normalized_First_Bit");
6407 E_Subprogram_Body =>
6408 Write_Str ("Mechanism");
6411 Write_Str ("Associated_Node_For_Itype");
6414 Write_Str ("Dependent_Instances");
6417 Write_Str ("Hiding_Loop_Variable");
6420 Write_Str ("Field8??");
6422 end Write_Field8_Name;
6424 -----------------------
6425 -- Write_Field9_Name --
6426 -----------------------
6428 procedure Write_Field9_Name (Id : Entity_Id) is
6432 Write_Str ("Class_Wide_Type");
6435 E_Generic_Function |
6437 E_Generic_Procedure |
6440 Write_Str ("Renaming_Map");
6443 Write_Str ("Current_Value");
6446 Write_Str ("Field9??");
6448 end Write_Field9_Name;
6450 ------------------------
6451 -- Write_Field10_Name --
6452 ------------------------
6454 procedure Write_Field10_Name (Id : Entity_Id) is
6458 Write_Str ("Referenced_Object");
6460 when E_In_Parameter |
6462 Write_Str ("Discriminal_Link");
6468 Write_Str ("Handler_Records");
6472 Write_Str ("Normalized_Position_Max");
6475 Write_Str ("Field10??");
6477 end Write_Field10_Name;
6479 ------------------------
6480 -- Write_Field11_Name --
6481 ------------------------
6483 procedure Write_Field11_Name (Id : Entity_Id) is
6487 Write_Str ("Entry_Component");
6491 Write_Str ("Component_Bit_Offset");
6494 Write_Str ("Full_View");
6496 when E_Enumeration_Literal =>
6497 Write_Str ("Enumeration_Pos");
6500 Write_Str ("Block_Node");
6506 Write_Str ("Protected_Body_Subprogram");
6508 when E_Generic_Package =>
6509 Write_Str ("Generic_Homonym");
6512 Write_Str ("Full_View");
6515 Write_Str ("Field11??");
6517 end Write_Field11_Name;
6519 ------------------------
6520 -- Write_Field12_Name --
6521 ------------------------
6523 procedure Write_Field12_Name (Id : Entity_Id) is
6527 Write_Str ("Barrier_Function");
6529 when E_Enumeration_Literal =>
6530 Write_Str ("Enumeration_Rep");
6537 E_In_Out_Parameter |
6541 Write_Str ("Esize");
6545 Write_Str ("Next_Inlined_Subprogram");
6548 Write_Str ("Associated_Formal_Package");
6551 Write_Str ("Field12??");
6553 end Write_Field12_Name;
6555 ------------------------
6556 -- Write_Field13_Name --
6557 ------------------------
6559 procedure Write_Field13_Name (Id : Entity_Id) is
6563 Write_Str ("RM_Size");
6567 Write_Str ("Component_Clause");
6569 when E_Enumeration_Literal =>
6570 Write_Str ("Debug_Renaming_Link");
6573 if not Comes_From_Source (Id)
6575 Chars (Id) = Name_Op_Ne
6577 Write_Str ("Corresponding_Equality");
6579 elsif Comes_From_Source (Id) then
6580 Write_Str ("Elaboration_Entity");
6583 Write_Str ("Field13??");
6588 Write_Str ("Extra_Accessibility");
6592 Generic_Unit_Kind =>
6593 Write_Str ("Elaboration_Entity");
6596 Write_Str ("Field13??");
6598 end Write_Field13_Name;
6600 -----------------------
6601 -- Write_Field14_Name --
6602 -----------------------
6604 procedure Write_Field14_Name (Id : Entity_Id) is
6612 Write_Str ("Alignment");
6616 Write_Str ("Normalized_Position");
6620 Write_Str ("First_Optional_Parameter");
6623 E_Generic_Package =>
6624 Write_Str ("Shadow_Entities");
6627 Write_Str ("Field14??");
6629 end Write_Field14_Name;
6631 ------------------------
6632 -- Write_Field15_Name --
6633 ------------------------
6635 procedure Write_Field15_Name (Id : Entity_Id) is
6640 Write_Str ("Storage_Size_Variable");
6642 when Class_Wide_Kind |
6646 Write_Str ("Primitive_Operations");
6649 Write_Str ("DT_Entry_Count");
6651 when Decimal_Fixed_Point_Kind =>
6652 Write_Str ("Scale_Value");
6654 when E_Discriminant =>
6655 Write_Str ("Discriminant_Number");
6658 Write_Str ("Extra_Formal");
6662 Write_Str ("DT_Position");
6665 Write_Str ("Entry_Parameters_Type");
6667 when Enumeration_Kind =>
6668 Write_Str ("Lit_Indexes");
6672 Write_Str ("Related_Instance");
6674 when E_Protected_Type =>
6675 Write_Str ("Entry_Bodies_Array");
6677 when E_String_Literal_Subtype =>
6678 Write_Str ("String_Literal_Low_Bound");
6681 Write_Str ("Shared_Var_Read_Proc");
6684 Write_Str ("Field15??");
6686 end Write_Field15_Name;
6688 ------------------------
6689 -- Write_Field16_Name --
6690 ------------------------
6692 procedure Write_Field16_Name (Id : Entity_Id) is
6696 Write_Str ("Entry_Formal");
6700 Write_Str ("DTC_Entity");
6705 Write_Str ("First_Private_Entity");
6707 when E_Record_Type |
6708 E_Record_Type_With_Private =>
6709 Write_Str ("Access_Disp_Table");
6711 when E_String_Literal_Subtype =>
6712 Write_Str ("String_Literal_Length");
6714 when Enumeration_Kind =>
6715 Write_Str ("Lit_Strings");
6719 Write_Str ("Unset_Reference");
6721 when E_Record_Subtype |
6722 E_Class_Wide_Subtype =>
6723 Write_Str ("Cloned_Subtype");
6726 Write_Str ("Field16??");
6728 end Write_Field16_Name;
6730 ------------------------
6731 -- Write_Field17_Name --
6732 ------------------------
6734 procedure Write_Field17_Name (Id : Entity_Id) is
6738 Write_Str ("Digits_Value");
6741 Write_Str ("Prival");
6743 when E_Discriminant =>
6744 Write_Str ("Discriminal");
6753 E_Generic_Function |
6755 E_Generic_Procedure |
6764 E_Subprogram_Type =>
6765 Write_Str ("First_Entity");
6768 Write_Str ("First_Index");
6770 when E_Protected_Body =>
6771 Write_Str ("Object_Ref");
6773 when Enumeration_Kind =>
6774 Write_Str ("First_Literal");
6777 Write_Str ("Master_Id");
6779 when Modular_Integer_Kind =>
6780 Write_Str ("Modulus");
6784 E_Generic_In_Out_Parameter |
6786 Write_Str ("Actual_Subtype");
6788 when E_Incomplete_Type =>
6789 Write_Str ("Non-limited view");
6792 Write_Str ("Field17??");
6794 end Write_Field17_Name;
6796 -----------------------
6797 -- Write_Field18_Name --
6798 -----------------------
6800 procedure Write_Field18_Name (Id : Entity_Id) is
6803 when E_Enumeration_Literal |
6807 Write_Str ("Alias");
6809 when E_Record_Type =>
6810 Write_Str ("Corresponding_Concurrent_Type");
6812 when E_Entry_Index_Parameter =>
6813 Write_Str ("Entry_Index_Constant");
6815 when E_Class_Wide_Subtype |
6816 E_Access_Protected_Subprogram_Type |
6817 E_Access_Subprogram_Type |
6819 Write_Str ("Equivalent_Type");
6821 when Fixed_Point_Kind =>
6822 Write_Str ("Delta_Value");
6826 Write_Str ("Renamed_Object");
6830 E_Generic_Function |
6831 E_Generic_Procedure |
6832 E_Generic_Package =>
6833 Write_Str ("Renamed_Entity");
6835 when Incomplete_Or_Private_Kind =>
6836 Write_Str ("Private_Dependents");
6838 when Concurrent_Kind =>
6839 Write_Str ("Corresponding_Record_Type");
6844 Write_Str ("Enclosing_Scope");
6847 Write_Str ("Field18??");
6849 end Write_Field18_Name;
6851 -----------------------
6852 -- Write_Field19_Name --
6853 -----------------------
6855 procedure Write_Field19_Name (Id : Entity_Id) is
6860 Write_Str ("Related_Array_Object");
6867 Write_Str ("Finalization_Chain_Entity");
6869 when E_Constant | E_Variable =>
6870 Write_Str ("Size_Check_Code");
6872 when E_Discriminant =>
6873 Write_Str ("Corresponding_Discriminant");
6876 E_Generic_Package =>
6877 Write_Str ("Body_Entity");
6879 when E_Package_Body |
6881 Write_Str ("Spec_Entity");
6883 when Private_Kind =>
6884 Write_Str ("Underlying_Full_View");
6886 when E_Record_Type =>
6887 Write_Str ("Parent_Subtype");
6890 Write_Str ("Field19??");
6892 end Write_Field19_Name;
6894 -----------------------
6895 -- Write_Field20_Name --
6896 -----------------------
6898 procedure Write_Field20_Name (Id : Entity_Id) is
6902 Write_Str ("Component_Type");
6904 when E_In_Parameter |
6905 E_Generic_In_Parameter =>
6906 Write_Str ("Default_Value");
6909 Write_Str ("Directly_Designated_Type");
6912 Write_Str ("Discriminant_Checking_Func");
6914 when E_Discriminant =>
6915 Write_Str ("Discriminant_Default_Value");
6924 E_Generic_Function |
6926 E_Generic_Procedure |
6935 E_Subprogram_Type =>
6937 Write_Str ("Last_Entity");
6940 Write_Str ("Scalar_Range");
6943 Write_Str ("Register_Exception_Call");
6946 Write_Str ("Field20??");
6948 end Write_Field20_Name;
6950 -----------------------
6951 -- Write_Field21_Name --
6952 -----------------------
6954 procedure Write_Field21_Name (Id : Entity_Id) is
6960 E_Generic_Function |
6962 E_Generic_Procedure |
6964 Write_Str ("Interface_Name");
6966 when Concurrent_Kind |
6967 Incomplete_Or_Private_Kind |
6971 Write_Str ("Discriminant_Constraint");
6974 Write_Str ("Accept_Address");
6976 when Fixed_Point_Kind =>
6977 Write_Str ("Small_Value");
6979 when E_In_Parameter =>
6980 Write_Str ("Default_Expr_Function");
6983 Modular_Integer_Kind =>
6984 Write_Str ("Original_Array_Type");
6987 Write_Str ("Field21??");
6989 end Write_Field21_Name;
6991 -----------------------
6992 -- Write_Field22_Name --
6993 -----------------------
6995 procedure Write_Field22_Name (Id : Entity_Id) is
6999 Write_Str ("Associated_Storage_Pool");
7002 Write_Str ("Component_Size");
7006 Write_Str ("Original_Record_Component");
7008 when E_Enumeration_Literal =>
7009 Write_Str ("Enumeration_Rep_Expr");
7012 Write_Str ("Exception_Code");
7015 Write_Str ("Protected_Formal");
7017 when E_Record_Type =>
7018 Write_Str ("Corresponding_Remote_Type");
7028 E_Generic_Function |
7029 E_Generic_Procedure |
7034 Write_Str ("Scope_Depth_Value");
7036 when E_Record_Type_With_Private |
7037 E_Record_Subtype_With_Private |
7040 E_Limited_Private_Type |
7041 E_Limited_Private_Subtype =>
7042 Write_Str ("Private_View");
7045 Write_Str ("Shared_Var_Assign_Proc");
7048 Write_Str ("Field22??");
7050 end Write_Field22_Name;
7052 ------------------------
7053 -- Write_Field23_Name --
7054 ------------------------
7056 procedure Write_Field23_Name (Id : Entity_Id) is
7060 Write_Str ("Associated_Final_Chain");
7063 Write_Str ("Packed_Array_Type");
7066 Write_Str ("Entry_Cancel_Parameter");
7069 Write_Str ("Protected_Operation");
7071 when E_Discriminant =>
7072 Write_Str ("CR_Discriminant");
7074 when E_Enumeration_Type =>
7075 Write_Str ("Enum_Pos_To_Rep");
7079 Write_Str ("Extra_Constrained");
7081 when E_Generic_Function |
7083 E_Generic_Procedure =>
7084 Write_Str ("Inner_Instances");
7086 when Concurrent_Kind |
7087 Incomplete_Or_Private_Kind |
7091 Write_Str ("Stored_Constraint");
7095 Write_Str ("Generic_Renamings");
7098 if Is_Generic_Instance (Id) then
7099 Write_Str ("Generic_Renamings");
7101 Write_Str ("Limited Views");
7104 -- What about Privals_Chain for protected operations ???
7107 Write_Str ("Privals_Chain");
7110 Write_Str ("Field23??");
7112 end Write_Field23_Name;
7114 -------------------------
7115 -- Iterator Procedures --
7116 -------------------------
7118 procedure Proc_Next_Component (N : in out Node_Id) is
7120 N := Next_Component (N);
7121 end Proc_Next_Component;
7123 procedure Proc_Next_Discriminant (N : in out Node_Id) is
7125 N := Next_Discriminant (N);
7126 end Proc_Next_Discriminant;
7128 procedure Proc_Next_Formal (N : in out Node_Id) is
7130 N := Next_Formal (N);
7131 end Proc_Next_Formal;
7133 procedure Proc_Next_Formal_With_Extras (N : in out Node_Id) is
7135 N := Next_Formal_With_Extras (N);
7136 end Proc_Next_Formal_With_Extras;
7138 procedure Proc_Next_Index (N : in out Node_Id) is
7140 N := Next_Index (N);
7141 end Proc_Next_Index;
7143 procedure Proc_Next_Inlined_Subprogram (N : in out Node_Id) is
7145 N := Next_Inlined_Subprogram (N);
7146 end Proc_Next_Inlined_Subprogram;
7148 procedure Proc_Next_Literal (N : in out Node_Id) is
7150 N := Next_Literal (N);
7151 end Proc_Next_Literal;
7153 procedure Proc_Next_Stored_Discriminant (N : in out Node_Id) is
7155 N := Next_Stored_Discriminant (N);
7156 end Proc_Next_Stored_Discriminant;