1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, 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 Nlists; use Nlists;
39 with Sinfo; use Sinfo;
40 with Stand; use Stand;
41 with Output; use Output;
45 use Atree.Unchecked_Access;
46 -- This is one of the packages that is allowed direct untyped access to
47 -- the fields in a node, since it provides the next level abstraction
48 -- which incorporates appropriate checks.
50 ----------------------------------------------
51 -- Usage of Fields in Defining Entity Nodes --
52 ----------------------------------------------
54 -- Four of these fields are defined in Sinfo, since they in are the
55 -- base part of the node. The access routines for these fields and
56 -- the corresponding set procedures are defined in Sinfo. These fields
57 -- are present in all entities. Note that Homonym is also in the base
58 -- part of the node, but has access routines that are more properly
59 -- part of Einfo, which is why they are defined here.
66 -- Remaining fields are present only in extended nodes (i.e. entities)
68 -- The following fields are present in all entities
71 -- First_Rep_Item Node6
73 -- Obsolescent_Warning Node24
75 -- The usage of other fields (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
83 -- Return_Applies_To Node8
85 -- Class_Wide_Type Node9
86 -- Current_Value Node9
89 -- Discriminal_Link Node10
90 -- Handler_Records List10
91 -- Normalized_Position_Max Uint10
92 -- Referenced_Object Node10
94 -- Component_Bit_Offset Uint11
96 -- Entry_Component Node11
97 -- Enumeration_Pos Uint11
98 -- Generic_Homonym Node11
99 -- Protected_Body_Subprogram Node11
102 -- Barrier_Function Node12
103 -- Enumeration_Rep Uint12
105 -- Next_Inlined_Subprogram Node12
107 -- Corresponding_Equality Node13
108 -- Component_Clause Node13
109 -- Debug_Renaming_Link Node13
110 -- Elaboration_Entity Node13
111 -- Extra_Accessibility Node13
115 -- First_Optional_Parameter Node14
116 -- Normalized_Position Uint14
117 -- Shadow_Entities List14
119 -- Discriminant_Number Uint15
120 -- DT_Position Uint15
121 -- DT_Entry_Count Uint15
122 -- Entry_Bodies_Array Node15
123 -- Entry_Parameters_Type Node15
124 -- Extra_Formal Node15
125 -- Lit_Indexes Node15
126 -- Primitive_Operations Elist15
127 -- Related_Instance Node15
128 -- Scale_Value Uint15
129 -- Storage_Size_Variable Node15
130 -- String_Literal_Low_Bound Node15
131 -- Shared_Var_Read_Proc Node15
133 -- Access_Disp_Table Elist16
134 -- Cloned_Subtype Node16
136 -- Entry_Formal Node16
137 -- First_Private_Entity Node16
138 -- Lit_Strings Node16
139 -- String_Literal_Length Uint16
140 -- Unset_Reference Node16
142 -- Actual_Subtype Node17
143 -- Digits_Value Uint17
144 -- Discriminal Node17
145 -- First_Entity Node17
146 -- First_Index Node17
147 -- First_Literal Node17
150 -- Non_Limited_View Node17
155 -- Corresponding_Concurrent_Type Node18
156 -- Corresponding_Record_Type Node18
157 -- Delta_Value Ureal18
158 -- Enclosing_Scope Node18
159 -- Equivalent_Type Node18
160 -- Private_Dependents Elist18
161 -- Renamed_Entity Node18
162 -- Renamed_Object Node18
164 -- Body_Entity Node19
165 -- Corresponding_Discriminant Node19
166 -- Finalization_Chain_Entity Node19
167 -- Parent_Subtype Node19
168 -- Related_Array_Object Node19
169 -- Size_Check_Code Node19
170 -- Spec_Entity Node19
171 -- Underlying_Full_View Node19
173 -- Component_Type Node20
174 -- Default_Value Node20
175 -- Directly_Designated_Type Node20
176 -- Discriminant_Checking_Func Node20
177 -- Discriminant_Default_Value Node20
178 -- Last_Assignment Node20
179 -- Last_Entity Node20
180 -- Register_Exception_Call Node20
181 -- Scalar_Range Node20
183 -- Accept_Address Elist21
184 -- Default_Expr_Function Node21
185 -- Discriminant_Constraint Elist21
186 -- Interface_Name Node21
187 -- Original_Array_Type Node21
188 -- Small_Value Ureal21
190 -- Associated_Storage_Pool Node22
191 -- Component_Size Uint22
192 -- Corresponding_Remote_Type Node22
193 -- Enumeration_Rep_Expr Node22
194 -- Exception_Code Uint22
195 -- Original_Record_Component Node22
196 -- Private_View Node22
197 -- Protected_Formal Node22
198 -- Scope_Depth_Value Uint22
199 -- Shared_Var_Assign_Proc Node22
201 -- Associated_Final_Chain Node23
202 -- CR_Discriminant Node23
203 -- Stored_Constraint Elist23
204 -- Entry_Cancel_Parameter Node23
205 -- Extra_Constrained Node23
206 -- Generic_Renamings Elist23
207 -- Inner_Instances Elist23
208 -- Enum_Pos_To_Rep Node23
209 -- Packed_Array_Type Node23
210 -- Limited_View Node23
211 -- Privals_Chain Elist23
212 -- Protected_Operation Node23
214 -- Abstract_Interface_Alias Node25
215 -- Abstract_Interfaces Elist25
216 -- Current_Use_Clause Node25
217 -- DT_Offset_To_Top_Func Node25
218 -- Task_Body_Procedure Node25
220 -- Overridden_Operation Node26
221 -- Package_Instantiation Node26
222 -- Related_Interface Node26
223 -- Static_Initialization Node26
225 -- Wrapped_Entity Node27
227 -- Extra_Formals Node28
229 ---------------------------------------------
230 -- Usage of Flags in Defining Entity Nodes --
231 ---------------------------------------------
233 -- All flags are unique, there is no overlaying, so each flag is physically
234 -- present in every entity. However, for many of the flags, it only makes
235 -- sense for them to be set true for certain subsets of entity kinds. See
236 -- the spec of Einfo for further details.
238 -- Note: Flag1-Flag3 are absent from this list, since these flag positions
239 -- are used for the flags Analyzed, Comes_From_Source, and Error_Posted,
240 -- which are common to all nodes, including entity nodes.
243 -- Has_Discriminants Flag5
244 -- Is_Dispatching_Operation Flag6
245 -- Is_Immediately_Visible Flag7
247 -- Is_Potentially_Use_Visible Flag9
251 -- Is_Constrained Flag12
252 -- Is_Generic_Type Flag13
253 -- Depends_On_Private Flag14
255 -- Is_Volatile Flag16
256 -- Is_Internal Flag17
257 -- Has_Delayed_Freeze Flag18
258 -- Is_Abstract_Subprogram Flag19
259 -- Is_Concurrent_Record_Type Flag20
261 -- Has_Master_Entity Flag21
262 -- Needs_No_Actuals Flag22
263 -- Has_Storage_Size_Clause Flag23
264 -- Is_Imported Flag24
265 -- Is_Limited_Record Flag25
266 -- Has_Completion Flag26
267 -- Has_Pragma_Controlled Flag27
268 -- Is_Statically_Allocated Flag28
269 -- Has_Size_Clause Flag29
272 -- Checks_May_Be_Suppressed Flag31
273 -- Kill_Elaboration_Checks Flag32
274 -- Kill_Range_Checks Flag33
275 -- Kill_Tag_Checks Flag34
276 -- Is_Class_Wide_Equivalent_Type Flag35
277 -- Referenced_As_LHS Flag36
278 -- Is_Known_Non_Null Flag37
279 -- Can_Never_Be_Null Flag38
280 -- Is_Overriding_Operation Flag39
281 -- Body_Needed_For_SAL Flag40
283 -- Treat_As_Volatile Flag41
284 -- Is_Controlled Flag42
285 -- Has_Controlled_Component Flag43
287 -- In_Private_Part Flag45
288 -- Has_Alignment_Clause Flag46
290 -- In_Package_Body Flag48
292 -- Delay_Subprogram_Descriptors Flag50
295 -- Is_Entry_Formal Flag52
296 -- Is_Private_Descendant Flag53
297 -- Return_Present Flag54
298 -- Is_Tagged_Type Flag55
299 -- Has_Homonym Flag56
301 -- Non_Binary_Modulus Flag58
302 -- Is_Preelaborated Flag59
303 -- Is_Shared_Passive Flag60
305 -- Is_Remote_Types Flag61
306 -- Is_Remote_Call_Interface Flag62
307 -- Is_Character_Type Flag63
308 -- Is_Intrinsic_Subprogram Flag64
309 -- Has_Record_Rep_Clause Flag65
310 -- Has_Enumeration_Rep_Clause Flag66
311 -- Has_Small_Clause Flag67
312 -- Has_Component_Size_Clause Flag68
313 -- Is_Access_Constant Flag69
314 -- Is_First_Subtype Flag70
316 -- Has_Completion_In_Body Flag71
317 -- Has_Unknown_Discriminants Flag72
318 -- Is_Child_Unit Flag73
319 -- Is_CPP_Class Flag74
320 -- Has_Non_Standard_Rep Flag75
321 -- Is_Constructor Flag76
322 -- Static_Elaboration_Desired Flag77
324 -- Has_All_Calls_Remote Flag79
325 -- Is_Constr_Subt_For_U_Nominal Flag80
327 -- Is_Asynchronous Flag81
328 -- Has_Gigi_Rep_Item Flag82
329 -- Has_Machine_Radix_Clause Flag83
330 -- Machine_Radix_10 Flag84
332 -- Has_Atomic_Components Flag86
333 -- Has_Volatile_Components Flag87
334 -- Discard_Names Flag88
335 -- Is_Interrupt_Handler Flag89
336 -- Returns_By_Ref Flag90
339 -- Size_Known_At_Compile_Time Flag92
340 -- Has_Subprogram_Descriptor Flag93
341 -- Is_Generic_Actual_Type Flag94
342 -- Uses_Sec_Stack Flag95
343 -- Warnings_Off Flag96
344 -- Is_Controlling_Formal Flag97
345 -- Has_Controlling_Result Flag98
346 -- Is_Exported Flag99
347 -- Has_Specified_Layout Flag100
349 -- Has_Nested_Block_With_Handler Flag101
351 -- Is_Completely_Hidden Flag103
352 -- Address_Taken Flag104
353 -- Suppress_Init_Proc Flag105
354 -- Is_Limited_Composite Flag106
355 -- Is_Private_Composite Flag107
356 -- Default_Expressions_Processed Flag108
357 -- Is_Non_Static_Subtype Flag109
358 -- Has_External_Tag_Rep_Clause Flag110
360 -- Is_Formal_Subprogram Flag111
361 -- Is_Renaming_Of_Object Flag112
363 -- Delay_Cleanups Flag114
364 -- Never_Set_In_Source Flag115
365 -- Is_Visible_Child_Unit Flag116
366 -- Is_Unchecked_Union Flag117
367 -- Is_For_Access_Subtype Flag118
368 -- Has_Convention_Pragma Flag119
369 -- Has_Primitive_Operations Flag120
371 -- Has_Pragma_Pack Flag121
372 -- Is_Bit_Packed_Array Flag122
373 -- Has_Unchecked_Union Flag123
374 -- Is_Eliminated Flag124
375 -- C_Pass_By_Copy Flag125
376 -- Is_Instantiated Flag126
377 -- Is_Valued_Procedure Flag127
378 -- (used for Component_Alignment) Flag128
379 -- (used for Component_Alignment) Flag129
380 -- Is_Generic_Instance Flag130
382 -- No_Pool_Assigned Flag131
383 -- Is_AST_Entry Flag132
384 -- Is_VMS_Exception Flag133
385 -- Is_Optional_Parameter Flag134
386 -- Has_Aliased_Components Flag135
387 -- No_Strict_Aliasing Flag136
388 -- Is_Machine_Code_Subprogram Flag137
389 -- Is_Packed_Array_Type Flag138
390 -- Has_Biased_Representation Flag139
391 -- Has_Complex_Representation Flag140
393 -- Is_Constr_Subt_For_UN_Aliased Flag141
394 -- Has_Missing_Return Flag142
395 -- Has_Recursive_Call Flag143
396 -- Is_Unsigned_Type Flag144
397 -- Strict_Alignment Flag145
398 -- Is_Abstract_Type Flag146
399 -- Needs_Debug_Info Flag147
400 -- Suppress_Elaboration_Warnings Flag148
401 -- Is_Compilation_Unit Flag149
402 -- Has_Pragma_Elaborate_Body Flag150
405 -- Entry_Accepted Flag152
406 -- Is_Obsolescent Flag153
407 -- Has_Per_Object_Constraint Flag154
408 -- Has_Private_Declaration Flag155
409 -- Referenced Flag156
410 -- Has_Pragma_Inline Flag157
411 -- Finalize_Storage_Only Flag158
412 -- From_With_Type Flag159
413 -- Is_Package_Body_Entity Flag160
415 -- Has_Qualified_Name Flag161
416 -- Nonzero_Is_True Flag162
417 -- Is_True_Constant Flag163
418 -- Reverse_Bit_Order Flag164
419 -- Suppress_Style_Checks Flag165
420 -- Debug_Info_Off Flag166
421 -- Sec_Stack_Needed_For_Return Flag167
422 -- Materialize_Entity Flag168
423 -- Function_Returns_With_DSP Flag169
424 -- Is_Known_Valid Flag170
426 -- Is_Hidden_Open_Scope Flag171
427 -- Has_Object_Size_Clause Flag172
428 -- Has_Fully_Qualified_Name Flag173
429 -- Elaboration_Entity_Required Flag174
430 -- Has_Forward_Instantiation Flag175
431 -- Is_Discrim_SO_Function Flag176
432 -- Size_Depends_On_Discriminant Flag177
433 -- Is_Null_Init_Proc Flag178
434 -- Has_Pragma_Pure_Function Flag179
435 -- Has_Pragma_Unreferenced Flag180
437 -- Has_Contiguous_Rep Flag181
438 -- Has_Xref_Entry Flag182
439 -- Must_Be_On_Byte_Boundary Flag183
440 -- Has_Stream_Size_Clause Flag184
441 -- Is_Ada_2005_Only Flag185
442 -- Is_Interface Flag186
443 -- Has_Constrained_Partial_View Flag187
444 -- Has_Persistent_BSS Flag188
445 -- Is_Pure_Unit_Access_Type Flag189
446 -- Has_Specified_Stream_Input Flag190
448 -- Has_Specified_Stream_Output Flag191
449 -- Has_Specified_Stream_Read Flag192
450 -- Has_Specified_Stream_Write Flag193
451 -- Is_Local_Anonymous_Access Flag194
452 -- Is_Primitive_Wrapper Flag195
453 -- Was_Hidden Flag196
454 -- Is_Limited_Interface Flag197
455 -- Is_Protected_Interface Flag198
456 -- Is_Synchronized_Interface Flag199
457 -- Is_Task_Interface Flag200
459 -- Has_Anon_Block_Suffix Flag201
460 -- Itype_Printed Flag202
461 -- Has_Pragma_Pure Flag203
462 -- Is_Known_Null Flag204
463 -- Low_Bound_Known Flag205
464 -- Is_Visible_Formal Flag206
465 -- Known_To_Have_Preelab_Init Flag207
466 -- Must_Have_Preelab_Init Flag208
467 -- Is_Return_Object Flag209
468 -- Elaborate_Body_Desirable Flag210
470 -- Has_Static_Discriminants Flag211
471 -- Has_Pragma_Unreferenced_Objects Flag212
472 -- Requires_Overriding Flag213
474 -- Has_Up_Level_Access Flag215
475 -- Universal_Aliasing Flag216
476 -- Suppress_Value_Tracking_On_Call Flag217
495 -----------------------
496 -- Local subprograms --
497 -----------------------
499 function Rep_Clause (Id : E; Rep_Name : Name_Id) return N;
500 -- Returns the attribute definition clause whose name is Rep_Name. Returns
501 -- Empty if not found.
507 function Rep_Clause (Id : E; Rep_Name : Name_Id) return N is
511 Ritem := First_Rep_Item (Id);
512 while Present (Ritem) loop
513 if Nkind (Ritem) = N_Attribute_Definition_Clause
514 and then Chars (Ritem) = Rep_Name
518 Ritem := Next_Rep_Item (Ritem);
525 --------------------------------
526 -- Attribute Access Functions --
527 --------------------------------
529 function Abstract_Interfaces (Id : E) return L is
531 pragma Assert (Is_Record_Type (Id));
533 end Abstract_Interfaces;
535 function Abstract_Interface_Alias (Id : E) return E is
537 pragma Assert (Is_Subprogram (Id));
539 end Abstract_Interface_Alias;
541 function Accept_Address (Id : E) return L is
546 function Access_Disp_Table (Id : E) return L is
548 pragma Assert (Is_Tagged_Type (Id));
549 return Elist16 (Implementation_Base_Type (Id));
550 end Access_Disp_Table;
552 function Actual_Subtype (Id : E) return E is
555 (Ekind (Id) = E_Constant
556 or else Ekind (Id) = E_Variable
557 or else Ekind (Id) = E_Generic_In_Out_Parameter
558 or else Ekind (Id) in E_In_Parameter .. E_In_Out_Parameter);
562 function Address_Taken (Id : E) return B is
567 function Alias (Id : E) return E is
570 (Is_Overloadable (Id) or else Ekind (Id) = E_Subprogram_Type);
574 function Alignment (Id : E) return U is
576 pragma Assert (Is_Type (Id)
577 or else Is_Formal (Id)
578 or else Ekind (Id) = E_Loop_Parameter
579 or else Ekind (Id) = E_Constant
580 or else Ekind (Id) = E_Exception
581 or else Ekind (Id) = E_Variable);
585 function Associated_Final_Chain (Id : E) return E is
587 pragma Assert (Is_Access_Type (Id));
589 end Associated_Final_Chain;
591 function Associated_Formal_Package (Id : E) return E is
593 pragma Assert (Ekind (Id) = E_Package);
595 end Associated_Formal_Package;
597 function Associated_Node_For_Itype (Id : E) return N is
600 end Associated_Node_For_Itype;
602 function Associated_Storage_Pool (Id : E) return E is
604 pragma Assert (Is_Access_Type (Id));
605 return Node22 (Root_Type (Id));
606 end Associated_Storage_Pool;
608 function Barrier_Function (Id : E) return N is
610 pragma Assert (Is_Entry (Id));
612 end Barrier_Function;
614 function Block_Node (Id : E) return N is
616 pragma Assert (Ekind (Id) = E_Block);
620 function Body_Entity (Id : E) return E is
623 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
627 function Body_Needed_For_SAL (Id : E) return B is
630 (Ekind (Id) = E_Package
631 or else Is_Subprogram (Id)
632 or else Is_Generic_Unit (Id));
634 end Body_Needed_For_SAL;
636 function C_Pass_By_Copy (Id : E) return B is
638 pragma Assert (Is_Record_Type (Id));
639 return Flag125 (Implementation_Base_Type (Id));
642 function Can_Never_Be_Null (Id : E) return B is
645 end Can_Never_Be_Null;
647 function Checks_May_Be_Suppressed (Id : E) return B is
650 end Checks_May_Be_Suppressed;
652 function Class_Wide_Type (Id : E) return E is
654 pragma Assert (Is_Type (Id));
658 function Cloned_Subtype (Id : E) return E is
661 (Ekind (Id) = E_Record_Subtype
662 or else Ekind (Id) = E_Class_Wide_Subtype);
666 function Component_Bit_Offset (Id : E) return U is
669 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
671 end Component_Bit_Offset;
673 function Component_Clause (Id : E) return N is
676 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
678 end Component_Clause;
680 function Component_Size (Id : E) return U is
682 pragma Assert (Is_Array_Type (Id));
683 return Uint22 (Implementation_Base_Type (Id));
686 function Component_Type (Id : E) return E is
688 return Node20 (Implementation_Base_Type (Id));
691 function Corresponding_Concurrent_Type (Id : E) return E is
693 pragma Assert (Ekind (Id) = E_Record_Type);
695 end Corresponding_Concurrent_Type;
697 function Corresponding_Discriminant (Id : E) return E is
699 pragma Assert (Ekind (Id) = E_Discriminant);
701 end Corresponding_Discriminant;
703 function Corresponding_Equality (Id : E) return E is
706 (Ekind (Id) = E_Function
707 and then not Comes_From_Source (Id)
708 and then Chars (Id) = Name_Op_Ne);
710 end Corresponding_Equality;
712 function Corresponding_Record_Type (Id : E) return E is
714 pragma Assert (Is_Concurrent_Type (Id));
716 end Corresponding_Record_Type;
718 function Corresponding_Remote_Type (Id : E) return E is
721 end Corresponding_Remote_Type;
723 function Current_Use_Clause (Id : E) return E is
725 pragma Assert (Ekind (Id) = E_Package);
727 end Current_Use_Clause;
729 function Current_Value (Id : E) return N is
731 pragma Assert (Ekind (Id) in Object_Kind);
735 function CR_Discriminant (Id : E) return E is
740 function Debug_Info_Off (Id : E) return B is
745 function Debug_Renaming_Link (Id : E) return E is
748 end Debug_Renaming_Link;
750 function Default_Expr_Function (Id : E) return E is
752 pragma Assert (Is_Formal (Id));
754 end Default_Expr_Function;
756 function Default_Expressions_Processed (Id : E) return B is
759 end Default_Expressions_Processed;
761 function Default_Value (Id : E) return N is
763 pragma Assert (Is_Formal (Id));
767 function Delay_Cleanups (Id : E) return B is
772 function Delay_Subprogram_Descriptors (Id : E) return B is
775 end Delay_Subprogram_Descriptors;
777 function Delta_Value (Id : E) return R is
779 pragma Assert (Is_Fixed_Point_Type (Id));
783 function Dependent_Instances (Id : E) return L is
785 pragma Assert (Is_Generic_Instance (Id));
787 end Dependent_Instances;
789 function Depends_On_Private (Id : E) return B is
791 pragma Assert (Nkind (Id) in N_Entity);
793 end Depends_On_Private;
795 function Digits_Value (Id : E) return U is
798 (Is_Floating_Point_Type (Id)
799 or else Is_Decimal_Fixed_Point_Type (Id));
803 function Directly_Designated_Type (Id : E) return E is
806 end Directly_Designated_Type;
808 function Discard_Names (Id : E) return B is
813 function Discriminal (Id : E) return E is
815 pragma Assert (Ekind (Id) = E_Discriminant);
819 function Discriminal_Link (Id : E) return N is
822 end Discriminal_Link;
824 function Discriminant_Checking_Func (Id : E) return E is
826 pragma Assert (Ekind (Id) = E_Component);
828 end Discriminant_Checking_Func;
830 function Discriminant_Constraint (Id : E) return L is
832 pragma Assert (Is_Composite_Type (Id) and then Has_Discriminants (Id));
834 end Discriminant_Constraint;
836 function Discriminant_Default_Value (Id : E) return N is
838 pragma Assert (Ekind (Id) = E_Discriminant);
840 end Discriminant_Default_Value;
842 function Discriminant_Number (Id : E) return U is
844 pragma Assert (Ekind (Id) = E_Discriminant);
846 end Discriminant_Number;
848 function DT_Entry_Count (Id : E) return U is
850 pragma Assert (Ekind (Id) = E_Component and then Is_Tag (Id));
854 function DT_Offset_To_Top_Func (Id : E) return E is
856 pragma Assert (Ekind (Id) = E_Component and then Is_Tag (Id));
858 end DT_Offset_To_Top_Func;
860 function DT_Position (Id : E) return U is
863 ((Ekind (Id) = E_Function
864 or else Ekind (Id) = E_Procedure)
865 and then Present (DTC_Entity (Id)));
869 function DTC_Entity (Id : E) return E is
872 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
876 function Elaborate_Body_Desirable (Id : E) return B is
878 pragma Assert (Ekind (Id) = E_Package);
880 end Elaborate_Body_Desirable;
882 function Elaboration_Entity (Id : E) return E is
887 Ekind (Id) = E_Package
889 Is_Generic_Unit (Id));
891 end Elaboration_Entity;
893 function Elaboration_Entity_Required (Id : E) return B is
898 Ekind (Id) = E_Package
900 Is_Generic_Unit (Id));
902 end Elaboration_Entity_Required;
904 function Enclosing_Scope (Id : E) return E is
909 function Entry_Accepted (Id : E) return B is
911 pragma Assert (Is_Entry (Id));
915 function Entry_Bodies_Array (Id : E) return E is
918 end Entry_Bodies_Array;
920 function Entry_Cancel_Parameter (Id : E) return E is
923 end Entry_Cancel_Parameter;
925 function Entry_Component (Id : E) return E is
930 function Entry_Formal (Id : E) return E is
935 function Entry_Index_Constant (Id : E) return N is
937 pragma Assert (Ekind (Id) = E_Entry_Index_Parameter);
939 end Entry_Index_Constant;
941 function Entry_Parameters_Type (Id : E) return E is
944 end Entry_Parameters_Type;
946 function Enum_Pos_To_Rep (Id : E) return E is
948 pragma Assert (Ekind (Id) = E_Enumeration_Type);
952 function Enumeration_Pos (Id : E) return Uint is
954 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
958 function Enumeration_Rep (Id : E) return U is
960 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
964 function Enumeration_Rep_Expr (Id : E) return N is
966 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
968 end Enumeration_Rep_Expr;
970 function Equivalent_Type (Id : E) return E is
973 (Ekind (Id) = E_Class_Wide_Subtype or else
974 Ekind (Id) = E_Access_Protected_Subprogram_Type or else
975 Ekind (Id) = E_Anonymous_Access_Protected_Subprogram_Type or else
976 Ekind (Id) = E_Access_Subprogram_Type or else
977 Ekind (Id) = E_Exception_Type);
981 function Esize (Id : E) return Uint is
986 function Exception_Code (Id : E) return Uint is
988 pragma Assert (Ekind (Id) = E_Exception);
992 function Extra_Accessibility (Id : E) return E is
994 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
996 end Extra_Accessibility;
998 function Extra_Constrained (Id : E) return E is
1000 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
1002 end Extra_Constrained;
1004 function Extra_Formal (Id : E) return E is
1009 function Extra_Formals (Id : E) return E is
1012 (Is_Overloadable (Id)
1013 or else Ekind (Id) = E_Entry_Family
1014 or else Ekind (Id) = E_Subprogram_Body
1015 or else Ekind (Id) = E_Subprogram_Type);
1019 function Finalization_Chain_Entity (Id : E) return E is
1022 end Finalization_Chain_Entity;
1024 function Finalize_Storage_Only (Id : E) return B is
1026 pragma Assert (Is_Type (Id));
1027 return Flag158 (Base_Type (Id));
1028 end Finalize_Storage_Only;
1030 function First_Entity (Id : E) return E is
1035 function First_Index (Id : E) return N is
1037 pragma Assert (Is_Array_Type (Id) or else Is_String_Type (Id));
1041 function First_Literal (Id : E) return E is
1043 pragma Assert (Is_Enumeration_Type (Id));
1047 function First_Optional_Parameter (Id : E) return E is
1050 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
1052 end First_Optional_Parameter;
1054 function First_Private_Entity (Id : E) return E is
1056 pragma Assert (Ekind (Id) = E_Package
1057 or else Ekind (Id) = E_Generic_Package
1058 or else Ekind (Id) in Concurrent_Kind);
1060 end First_Private_Entity;
1062 function First_Rep_Item (Id : E) return E is
1067 function Freeze_Node (Id : E) return N is
1072 function From_With_Type (Id : E) return B is
1074 return Flag159 (Id);
1077 function Full_View (Id : E) return E is
1079 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Constant);
1083 function Function_Returns_With_DSP (Id : E) return B is
1086 (Is_Subprogram (Id) or else Ekind (Id) = E_Subprogram_Type);
1087 return Flag169 (Id);
1088 end Function_Returns_With_DSP;
1090 function Generic_Homonym (Id : E) return E is
1092 pragma Assert (Ekind (Id) = E_Generic_Package);
1094 end Generic_Homonym;
1096 function Generic_Renamings (Id : E) return L is
1098 return Elist23 (Id);
1099 end Generic_Renamings;
1101 function Handler_Records (Id : E) return S is
1104 end Handler_Records;
1106 function Has_Aliased_Components (Id : E) return B is
1108 return Flag135 (Implementation_Base_Type (Id));
1109 end Has_Aliased_Components;
1111 function Has_Alignment_Clause (Id : E) return B is
1114 end Has_Alignment_Clause;
1116 function Has_All_Calls_Remote (Id : E) return B is
1119 end Has_All_Calls_Remote;
1121 function Has_Anon_Block_Suffix (Id : E) return B is
1123 return Flag201 (Id);
1124 end Has_Anon_Block_Suffix;
1126 function Has_Atomic_Components (Id : E) return B is
1128 return Flag86 (Implementation_Base_Type (Id));
1129 end Has_Atomic_Components;
1131 function Has_Biased_Representation (Id : E) return B is
1133 return Flag139 (Id);
1134 end Has_Biased_Representation;
1136 function Has_Completion (Id : E) return B is
1141 function Has_Completion_In_Body (Id : E) return B is
1143 pragma Assert (Is_Type (Id));
1145 end Has_Completion_In_Body;
1147 function Has_Complex_Representation (Id : E) return B is
1149 pragma Assert (Is_Type (Id));
1150 return Flag140 (Implementation_Base_Type (Id));
1151 end Has_Complex_Representation;
1153 function Has_Component_Size_Clause (Id : E) return B is
1155 pragma Assert (Is_Array_Type (Id));
1156 return Flag68 (Implementation_Base_Type (Id));
1157 end Has_Component_Size_Clause;
1159 function Has_Constrained_Partial_View (Id : E) return B is
1161 pragma Assert (Is_Type (Id));
1162 return Flag187 (Id);
1163 end Has_Constrained_Partial_View;
1165 function Has_Controlled_Component (Id : E) return B is
1167 return Flag43 (Base_Type (Id));
1168 end Has_Controlled_Component;
1170 function Has_Contiguous_Rep (Id : E) return B is
1172 return Flag181 (Id);
1173 end Has_Contiguous_Rep;
1175 function Has_Controlling_Result (Id : E) return B is
1178 end Has_Controlling_Result;
1180 function Has_Convention_Pragma (Id : E) return B is
1182 return Flag119 (Id);
1183 end Has_Convention_Pragma;
1185 function Has_Delayed_Freeze (Id : E) return B is
1187 pragma Assert (Nkind (Id) in N_Entity);
1189 end Has_Delayed_Freeze;
1191 function Has_Discriminants (Id : E) return B is
1193 pragma Assert (Nkind (Id) in N_Entity);
1195 end Has_Discriminants;
1197 function Has_Enumeration_Rep_Clause (Id : E) return B is
1199 pragma Assert (Is_Enumeration_Type (Id));
1201 end Has_Enumeration_Rep_Clause;
1203 function Has_Exit (Id : E) return B is
1208 function Has_External_Tag_Rep_Clause (Id : E) return B is
1210 pragma Assert (Is_Tagged_Type (Id));
1211 return Flag110 (Id);
1212 end Has_External_Tag_Rep_Clause;
1214 function Has_Forward_Instantiation (Id : E) return B is
1216 return Flag175 (Id);
1217 end Has_Forward_Instantiation;
1219 function Has_Fully_Qualified_Name (Id : E) return B is
1221 return Flag173 (Id);
1222 end Has_Fully_Qualified_Name;
1224 function Has_Gigi_Rep_Item (Id : E) return B is
1227 end Has_Gigi_Rep_Item;
1229 function Has_Homonym (Id : E) return B is
1234 function Has_Machine_Radix_Clause (Id : E) return B is
1236 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
1238 end Has_Machine_Radix_Clause;
1240 function Has_Master_Entity (Id : E) return B is
1243 end Has_Master_Entity;
1245 function Has_Missing_Return (Id : E) return B is
1248 (Ekind (Id) = E_Function or else Ekind (Id) = E_Generic_Function);
1249 return Flag142 (Id);
1250 end Has_Missing_Return;
1252 function Has_Nested_Block_With_Handler (Id : E) return B is
1254 return Flag101 (Id);
1255 end Has_Nested_Block_With_Handler;
1257 function Has_Non_Standard_Rep (Id : E) return B is
1259 return Flag75 (Implementation_Base_Type (Id));
1260 end Has_Non_Standard_Rep;
1262 function Has_Object_Size_Clause (Id : E) return B is
1264 pragma Assert (Is_Type (Id));
1265 return Flag172 (Id);
1266 end Has_Object_Size_Clause;
1268 function Has_Per_Object_Constraint (Id : E) return B is
1270 return Flag154 (Id);
1271 end Has_Per_Object_Constraint;
1273 function Has_Persistent_BSS (Id : E) return B is
1275 return Flag188 (Id);
1276 end Has_Persistent_BSS;
1278 function Has_Pragma_Controlled (Id : E) return B is
1280 pragma Assert (Is_Access_Type (Id));
1281 return Flag27 (Implementation_Base_Type (Id));
1282 end Has_Pragma_Controlled;
1284 function Has_Pragma_Elaborate_Body (Id : E) return B is
1286 return Flag150 (Id);
1287 end Has_Pragma_Elaborate_Body;
1289 function Has_Pragma_Inline (Id : E) return B is
1291 return Flag157 (Id);
1292 end Has_Pragma_Inline;
1294 function Has_Pragma_Pack (Id : E) return B is
1296 pragma Assert (Is_Record_Type (Id) or else Is_Array_Type (Id));
1297 return Flag121 (Implementation_Base_Type (Id));
1298 end Has_Pragma_Pack;
1300 function Has_Pragma_Pure (Id : E) return B is
1302 return Flag203 (Id);
1303 end Has_Pragma_Pure;
1305 function Has_Pragma_Pure_Function (Id : E) return B is
1307 return Flag179 (Id);
1308 end Has_Pragma_Pure_Function;
1310 function Has_Pragma_Unreferenced (Id : E) return B is
1312 return Flag180 (Id);
1313 end Has_Pragma_Unreferenced;
1315 function Has_Pragma_Unreferenced_Objects (Id : E) return B is
1317 pragma Assert (Is_Type (Id));
1318 return Flag212 (Id);
1319 end Has_Pragma_Unreferenced_Objects;
1321 function Has_Primitive_Operations (Id : E) return B is
1323 pragma Assert (Is_Type (Id));
1324 return Flag120 (Base_Type (Id));
1325 end Has_Primitive_Operations;
1327 function Has_Private_Declaration (Id : E) return B is
1329 return Flag155 (Id);
1330 end Has_Private_Declaration;
1332 function Has_Qualified_Name (Id : E) return B is
1334 return Flag161 (Id);
1335 end Has_Qualified_Name;
1337 function Has_RACW (Id : E) return B is
1339 pragma Assert (Ekind (Id) = E_Package);
1340 return Flag214 (Id);
1343 function Has_Record_Rep_Clause (Id : E) return B is
1345 pragma Assert (Is_Record_Type (Id));
1346 return Flag65 (Implementation_Base_Type (Id));
1347 end Has_Record_Rep_Clause;
1349 function Has_Recursive_Call (Id : E) return B is
1351 pragma Assert (Is_Subprogram (Id));
1352 return Flag143 (Id);
1353 end Has_Recursive_Call;
1355 function Has_Size_Clause (Id : E) return B is
1358 end Has_Size_Clause;
1360 function Has_Small_Clause (Id : E) return B is
1363 end Has_Small_Clause;
1365 function Has_Specified_Layout (Id : E) return B is
1367 pragma Assert (Is_Type (Id));
1368 return Flag100 (Implementation_Base_Type (Id));
1369 end Has_Specified_Layout;
1371 function Has_Specified_Stream_Input (Id : E) return B is
1373 pragma Assert (Is_Type (Id));
1374 return Flag190 (Id);
1375 end Has_Specified_Stream_Input;
1377 function Has_Specified_Stream_Output (Id : E) return B is
1379 pragma Assert (Is_Type (Id));
1380 return Flag191 (Id);
1381 end Has_Specified_Stream_Output;
1383 function Has_Specified_Stream_Read (Id : E) return B is
1385 pragma Assert (Is_Type (Id));
1386 return Flag192 (Id);
1387 end Has_Specified_Stream_Read;
1389 function Has_Specified_Stream_Write (Id : E) return B is
1391 pragma Assert (Is_Type (Id));
1392 return Flag193 (Id);
1393 end Has_Specified_Stream_Write;
1395 function Has_Static_Discriminants (Id : E) return B is
1397 pragma Assert (Is_Type (Id));
1398 return Flag211 (Id);
1399 end Has_Static_Discriminants;
1401 function Has_Storage_Size_Clause (Id : E) return B is
1403 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
1404 return Flag23 (Implementation_Base_Type (Id));
1405 end Has_Storage_Size_Clause;
1407 function Has_Stream_Size_Clause (Id : E) return B is
1409 return Flag184 (Id);
1410 end Has_Stream_Size_Clause;
1412 function Has_Subprogram_Descriptor (Id : E) return B is
1415 end Has_Subprogram_Descriptor;
1417 function Has_Task (Id : E) return B is
1419 return Flag30 (Base_Type (Id));
1422 function Has_Unchecked_Union (Id : E) return B is
1424 return Flag123 (Base_Type (Id));
1425 end Has_Unchecked_Union;
1427 function Has_Unknown_Discriminants (Id : E) return B is
1429 pragma Assert (Is_Type (Id));
1431 end Has_Unknown_Discriminants;
1433 function Has_Up_Level_Access (Id : E) return B is
1436 (Ekind (Id) = E_Variable
1437 or else Ekind (Id) = E_Constant
1438 or else Ekind (Id) = E_Loop_Parameter);
1439 return Flag215 (Id);
1440 end Has_Up_Level_Access;
1442 function Has_Volatile_Components (Id : E) return B is
1444 return Flag87 (Implementation_Base_Type (Id));
1445 end Has_Volatile_Components;
1447 function Has_Xref_Entry (Id : E) return B is
1449 return Flag182 (Implementation_Base_Type (Id));
1452 function Hiding_Loop_Variable (Id : E) return E is
1454 pragma Assert (Ekind (Id) = E_Variable);
1456 end Hiding_Loop_Variable;
1458 function Homonym (Id : E) return E is
1463 function In_Package_Body (Id : E) return B is
1466 end In_Package_Body;
1468 function In_Private_Part (Id : E) return B is
1471 end In_Private_Part;
1473 function In_Use (Id : E) return B is
1475 pragma Assert (Nkind (Id) in N_Entity);
1479 function Inner_Instances (Id : E) return L is
1481 return Elist23 (Id);
1482 end Inner_Instances;
1484 function Interface_Name (Id : E) return N is
1489 function Is_Abstract_Subprogram (Id : E) return B is
1491 pragma Assert (Is_Overloadable (Id));
1493 end Is_Abstract_Subprogram;
1495 function Is_Abstract_Type (Id : E) return B is
1497 pragma Assert (Is_Type (Id));
1498 return Flag146 (Id);
1499 end Is_Abstract_Type;
1501 function Is_Local_Anonymous_Access (Id : E) return B is
1503 pragma Assert (Is_Access_Type (Id));
1504 return Flag194 (Id);
1505 end Is_Local_Anonymous_Access;
1507 function Is_Access_Constant (Id : E) return B is
1509 pragma Assert (Is_Access_Type (Id));
1511 end Is_Access_Constant;
1513 function Is_Ada_2005_Only (Id : E) return B is
1515 return Flag185 (Id);
1516 end Is_Ada_2005_Only;
1518 function Is_Aliased (Id : E) return B is
1520 pragma Assert (Nkind (Id) in N_Entity);
1524 function Is_AST_Entry (Id : E) return B is
1526 pragma Assert (Is_Entry (Id));
1527 return Flag132 (Id);
1530 function Is_Asynchronous (Id : E) return B is
1533 (Ekind (Id) = E_Procedure or else Is_Type (Id));
1535 end Is_Asynchronous;
1537 function Is_Atomic (Id : E) return B is
1542 function Is_Bit_Packed_Array (Id : E) return B is
1544 return Flag122 (Implementation_Base_Type (Id));
1545 end Is_Bit_Packed_Array;
1547 function Is_Called (Id : E) return B is
1550 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Function);
1551 return Flag102 (Id);
1554 function Is_Character_Type (Id : E) return B is
1557 end Is_Character_Type;
1559 function Is_Child_Unit (Id : E) return B is
1564 function Is_Class_Wide_Equivalent_Type (Id : E) return B is
1567 end Is_Class_Wide_Equivalent_Type;
1569 function Is_Compilation_Unit (Id : E) return B is
1571 return Flag149 (Id);
1572 end Is_Compilation_Unit;
1574 function Is_Completely_Hidden (Id : E) return B is
1576 pragma Assert (Ekind (Id) = E_Discriminant);
1577 return Flag103 (Id);
1578 end Is_Completely_Hidden;
1580 function Is_Constr_Subt_For_U_Nominal (Id : E) return B is
1583 end Is_Constr_Subt_For_U_Nominal;
1585 function Is_Constr_Subt_For_UN_Aliased (Id : E) return B is
1587 return Flag141 (Id);
1588 end Is_Constr_Subt_For_UN_Aliased;
1590 function Is_Constrained (Id : E) return B is
1592 pragma Assert (Nkind (Id) in N_Entity);
1596 function Is_Constructor (Id : E) return B is
1601 function Is_Controlled (Id : E) return B is
1603 return Flag42 (Base_Type (Id));
1606 function Is_Controlling_Formal (Id : E) return B is
1608 pragma Assert (Is_Formal (Id));
1610 end Is_Controlling_Formal;
1612 function Is_CPP_Class (Id : E) return B is
1617 function Is_Discrim_SO_Function (Id : E) return B is
1619 return Flag176 (Id);
1620 end Is_Discrim_SO_Function;
1622 function Is_Dispatching_Operation (Id : E) return B is
1624 pragma Assert (Nkind (Id) in N_Entity);
1626 end Is_Dispatching_Operation;
1628 function Is_Eliminated (Id : E) return B is
1630 return Flag124 (Id);
1633 function Is_Entry_Formal (Id : E) return B is
1636 end Is_Entry_Formal;
1638 function Is_Exported (Id : E) return B is
1643 function Is_First_Subtype (Id : E) return B is
1646 end Is_First_Subtype;
1648 function Is_For_Access_Subtype (Id : E) return B is
1651 (Ekind (Id) = E_Record_Subtype
1653 Ekind (Id) = E_Private_Subtype);
1654 return Flag118 (Id);
1655 end Is_For_Access_Subtype;
1657 function Is_Formal_Subprogram (Id : E) return B is
1659 return Flag111 (Id);
1660 end Is_Formal_Subprogram;
1662 function Is_Frozen (Id : E) return B is
1667 function Is_Generic_Actual_Type (Id : E) return B is
1669 pragma Assert (Is_Type (Id));
1671 end Is_Generic_Actual_Type;
1673 function Is_Generic_Instance (Id : E) return B is
1675 return Flag130 (Id);
1676 end Is_Generic_Instance;
1678 function Is_Generic_Type (Id : E) return B is
1680 pragma Assert (Nkind (Id) in N_Entity);
1682 end Is_Generic_Type;
1684 function Is_Hidden (Id : E) return B is
1689 function Is_Hidden_Open_Scope (Id : E) return B is
1691 return Flag171 (Id);
1692 end Is_Hidden_Open_Scope;
1694 function Is_Immediately_Visible (Id : E) return B is
1696 pragma Assert (Nkind (Id) in N_Entity);
1698 end Is_Immediately_Visible;
1700 function Is_Imported (Id : E) return B is
1705 function Is_Inlined (Id : E) return B is
1710 function Is_Interface (Id : E) return B is
1712 return Flag186 (Id);
1715 function Is_Instantiated (Id : E) return B is
1717 return Flag126 (Id);
1718 end Is_Instantiated;
1720 function Is_Internal (Id : E) return B is
1722 pragma Assert (Nkind (Id) in N_Entity);
1726 function Is_Interrupt_Handler (Id : E) return B is
1728 pragma Assert (Nkind (Id) in N_Entity);
1730 end Is_Interrupt_Handler;
1732 function Is_Intrinsic_Subprogram (Id : E) return B is
1735 end Is_Intrinsic_Subprogram;
1737 function Is_Itype (Id : E) return B is
1742 function Is_Known_Non_Null (Id : E) return B is
1745 end Is_Known_Non_Null;
1747 function Is_Known_Null (Id : E) return B is
1749 return Flag204 (Id);
1752 function Is_Known_Valid (Id : E) return B is
1754 return Flag170 (Id);
1757 function Is_Limited_Composite (Id : E) return B is
1759 return Flag106 (Id);
1760 end Is_Limited_Composite;
1762 function Is_Limited_Interface (Id : E) return B is
1764 return Flag197 (Id);
1765 end Is_Limited_Interface;
1767 function Is_Limited_Record (Id : E) return B is
1770 end Is_Limited_Record;
1772 function Is_Machine_Code_Subprogram (Id : E) return B is
1774 pragma Assert (Is_Subprogram (Id));
1775 return Flag137 (Id);
1776 end Is_Machine_Code_Subprogram;
1778 function Is_Non_Static_Subtype (Id : E) return B is
1780 pragma Assert (Is_Type (Id));
1781 return Flag109 (Id);
1782 end Is_Non_Static_Subtype;
1784 function Is_Null_Init_Proc (Id : E) return B is
1786 pragma Assert (Ekind (Id) = E_Procedure);
1787 return Flag178 (Id);
1788 end Is_Null_Init_Proc;
1790 function Is_Obsolescent (Id : E) return B is
1792 return Flag153 (Id);
1795 function Is_Optional_Parameter (Id : E) return B is
1797 pragma Assert (Is_Formal (Id));
1798 return Flag134 (Id);
1799 end Is_Optional_Parameter;
1801 function Is_Overriding_Operation (Id : E) return B is
1803 pragma Assert (Is_Subprogram (Id));
1805 end Is_Overriding_Operation;
1807 function Is_Package_Body_Entity (Id : E) return B is
1809 return Flag160 (Id);
1810 end Is_Package_Body_Entity;
1812 function Is_Packed (Id : E) return B is
1814 return Flag51 (Implementation_Base_Type (Id));
1817 function Is_Packed_Array_Type (Id : E) return B is
1819 return Flag138 (Id);
1820 end Is_Packed_Array_Type;
1822 function Is_Potentially_Use_Visible (Id : E) return B is
1824 pragma Assert (Nkind (Id) in N_Entity);
1826 end Is_Potentially_Use_Visible;
1828 function Is_Preelaborated (Id : E) return B is
1831 end Is_Preelaborated;
1833 function Is_Primitive_Wrapper (Id : E) return B is
1835 pragma Assert (Ekind (Id) = E_Procedure);
1836 return Flag195 (Id);
1837 end Is_Primitive_Wrapper;
1839 function Is_Private_Composite (Id : E) return B is
1841 pragma Assert (Is_Type (Id));
1842 return Flag107 (Id);
1843 end Is_Private_Composite;
1845 function Is_Private_Descendant (Id : E) return B is
1848 end Is_Private_Descendant;
1850 function Is_Protected_Interface (Id : E) return B is
1852 pragma Assert (Is_Interface (Id));
1853 return Flag198 (Id);
1854 end Is_Protected_Interface;
1856 function Is_Public (Id : E) return B is
1858 pragma Assert (Nkind (Id) in N_Entity);
1862 function Is_Pure (Id : E) return B is
1867 function Is_Pure_Unit_Access_Type (Id : E) return B is
1869 pragma Assert (Is_Access_Type (Id));
1870 return Flag189 (Id);
1871 end Is_Pure_Unit_Access_Type;
1873 function Is_Remote_Call_Interface (Id : E) return B is
1876 end Is_Remote_Call_Interface;
1878 function Is_Remote_Types (Id : E) return B is
1881 end Is_Remote_Types;
1883 function Is_Renaming_Of_Object (Id : E) return B is
1885 return Flag112 (Id);
1886 end Is_Renaming_Of_Object;
1888 function Is_Return_Object (Id : E) return B is
1890 return Flag209 (Id);
1891 end Is_Return_Object;
1893 function Is_Shared_Passive (Id : E) return B is
1896 end Is_Shared_Passive;
1898 function Is_Statically_Allocated (Id : E) return B is
1901 end Is_Statically_Allocated;
1903 function Is_Synchronized_Interface (Id : E) return B is
1905 pragma Assert (Is_Interface (Id));
1906 return Flag199 (Id);
1907 end Is_Synchronized_Interface;
1909 function Is_Tag (Id : E) return B is
1911 pragma Assert (Nkind (Id) in N_Entity);
1915 function Is_Tagged_Type (Id : E) return B is
1920 function Is_Task_Interface (Id : E) return B is
1922 pragma Assert (Is_Interface (Id));
1923 return Flag200 (Id);
1924 end Is_Task_Interface;
1926 function Is_True_Constant (Id : E) return B is
1928 return Flag163 (Id);
1929 end Is_True_Constant;
1931 function Is_Unchecked_Union (Id : E) return B is
1933 return Flag117 (Implementation_Base_Type (Id));
1934 end Is_Unchecked_Union;
1936 function Is_Unsigned_Type (Id : E) return B is
1938 pragma Assert (Is_Type (Id));
1939 return Flag144 (Id);
1940 end Is_Unsigned_Type;
1942 function Is_Valued_Procedure (Id : E) return B is
1944 pragma Assert (Ekind (Id) = E_Procedure);
1945 return Flag127 (Id);
1946 end Is_Valued_Procedure;
1948 function Is_Visible_Child_Unit (Id : E) return B is
1950 pragma Assert (Is_Child_Unit (Id));
1951 return Flag116 (Id);
1952 end Is_Visible_Child_Unit;
1954 function Is_Visible_Formal (Id : E) return B is
1956 return Flag206 (Id);
1957 end Is_Visible_Formal;
1959 function Is_VMS_Exception (Id : E) return B is
1961 return Flag133 (Id);
1962 end Is_VMS_Exception;
1964 function Is_Volatile (Id : E) return B is
1966 pragma Assert (Nkind (Id) in N_Entity);
1968 if Is_Type (Id) then
1969 return Flag16 (Base_Type (Id));
1975 function Itype_Printed (Id : E) return B is
1977 pragma Assert (Is_Itype (Id));
1978 return Flag202 (Id);
1981 function Kill_Elaboration_Checks (Id : E) return B is
1984 end Kill_Elaboration_Checks;
1986 function Kill_Range_Checks (Id : E) return B is
1989 end Kill_Range_Checks;
1991 function Kill_Tag_Checks (Id : E) return B is
1994 end Kill_Tag_Checks;
1996 function Known_To_Have_Preelab_Init (Id : E) return B is
1998 pragma Assert (Is_Type (Id));
1999 return Flag207 (Id);
2000 end Known_To_Have_Preelab_Init;
2002 function Last_Assignment (Id : E) return N is
2004 pragma Assert (Ekind (Id) = E_Variable);
2006 end Last_Assignment;
2008 function Last_Entity (Id : E) return E is
2013 function Limited_View (Id : E) return E is
2015 pragma Assert (Ekind (Id) = E_Package);
2019 function Lit_Indexes (Id : E) return E is
2021 pragma Assert (Is_Enumeration_Type (Id));
2025 function Lit_Strings (Id : E) return E is
2027 pragma Assert (Is_Enumeration_Type (Id));
2031 function Low_Bound_Known (Id : E) return B is
2033 return Flag205 (Id);
2034 end Low_Bound_Known;
2036 function Machine_Radix_10 (Id : E) return B is
2038 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
2040 end Machine_Radix_10;
2042 function Master_Id (Id : E) return E is
2044 pragma Assert (Is_Access_Type (Id));
2048 function Materialize_Entity (Id : E) return B is
2050 return Flag168 (Id);
2051 end Materialize_Entity;
2053 function Mechanism (Id : E) return M is
2055 pragma Assert (Ekind (Id) = E_Function or else Is_Formal (Id));
2056 return UI_To_Int (Uint8 (Id));
2059 function Modulus (Id : E) return Uint is
2061 pragma Assert (Is_Modular_Integer_Type (Id));
2062 return Uint17 (Base_Type (Id));
2065 function Must_Be_On_Byte_Boundary (Id : E) return B is
2067 pragma Assert (Is_Type (Id));
2068 return Flag183 (Id);
2069 end Must_Be_On_Byte_Boundary;
2071 function Must_Have_Preelab_Init (Id : E) return B is
2073 pragma Assert (Is_Type (Id));
2074 return Flag208 (Id);
2075 end Must_Have_Preelab_Init;
2077 function Needs_Debug_Info (Id : E) return B is
2079 return Flag147 (Id);
2080 end Needs_Debug_Info;
2082 function Needs_No_Actuals (Id : E) return B is
2085 (Is_Overloadable (Id)
2086 or else Ekind (Id) = E_Subprogram_Type
2087 or else Ekind (Id) = E_Entry_Family);
2089 end Needs_No_Actuals;
2091 function Never_Set_In_Source (Id : E) return B is
2093 return Flag115 (Id);
2094 end Never_Set_In_Source;
2096 function Next_Inlined_Subprogram (Id : E) return E is
2099 end Next_Inlined_Subprogram;
2101 function No_Pool_Assigned (Id : E) return B is
2103 pragma Assert (Is_Access_Type (Id));
2104 return Flag131 (Root_Type (Id));
2105 end No_Pool_Assigned;
2107 function No_Return (Id : E) return B is
2109 return Flag113 (Id);
2112 function No_Strict_Aliasing (Id : E) return B is
2114 pragma Assert (Is_Access_Type (Id));
2115 return Flag136 (Base_Type (Id));
2116 end No_Strict_Aliasing;
2118 function Non_Binary_Modulus (Id : E) return B is
2120 pragma Assert (Is_Modular_Integer_Type (Id));
2121 return Flag58 (Base_Type (Id));
2122 end Non_Binary_Modulus;
2124 function Non_Limited_View (Id : E) return E is
2126 pragma Assert (Ekind (Id) in Incomplete_Kind);
2128 end Non_Limited_View;
2130 function Nonzero_Is_True (Id : E) return B is
2132 pragma Assert (Root_Type (Id) = Standard_Boolean);
2133 return Flag162 (Base_Type (Id));
2134 end Nonzero_Is_True;
2136 function Normalized_First_Bit (Id : E) return U is
2139 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
2141 end Normalized_First_Bit;
2143 function Normalized_Position (Id : E) return U is
2146 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
2148 end Normalized_Position;
2150 function Normalized_Position_Max (Id : E) return U is
2153 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
2155 end Normalized_Position_Max;
2157 function Object_Ref (Id : E) return E is
2159 pragma Assert (Ekind (Id) = E_Protected_Body);
2163 function Obsolescent_Warning (Id : E) return N is
2166 end Obsolescent_Warning;
2168 function Original_Array_Type (Id : E) return E is
2170 pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id));
2172 end Original_Array_Type;
2174 function Original_Record_Component (Id : E) return E is
2177 (Ekind (Id) = E_Void
2178 or else Ekind (Id) = E_Component
2179 or else Ekind (Id) = E_Discriminant);
2181 end Original_Record_Component;
2183 function Overridden_Operation (Id : E) return E is
2186 end Overridden_Operation;
2188 function Package_Instantiation (Id : E) return N is
2192 or else Ekind (Id) = E_Generic_Package
2193 or else Ekind (Id) = E_Package);
2195 end Package_Instantiation;
2197 function Packed_Array_Type (Id : E) return E is
2199 pragma Assert (Is_Array_Type (Id));
2201 end Packed_Array_Type;
2203 function Parent_Subtype (Id : E) return E is
2205 pragma Assert (Ekind (Id) = E_Record_Type);
2209 function Primitive_Operations (Id : E) return L is
2211 pragma Assert (Is_Tagged_Type (Id));
2212 return Elist15 (Id);
2213 end Primitive_Operations;
2215 function Prival (Id : E) return E is
2217 pragma Assert (Is_Protected_Private (Id));
2221 function Privals_Chain (Id : E) return L is
2223 pragma Assert (Is_Overloadable (Id)
2224 or else Ekind (Id) = E_Entry_Family);
2225 return Elist23 (Id);
2228 function Private_Dependents (Id : E) return L is
2230 pragma Assert (Is_Incomplete_Or_Private_Type (Id));
2231 return Elist18 (Id);
2232 end Private_Dependents;
2234 function Private_View (Id : E) return N is
2236 pragma Assert (Is_Private_Type (Id));
2240 function Protected_Body_Subprogram (Id : E) return E is
2242 pragma Assert (Is_Subprogram (Id) or else Is_Entry (Id));
2244 end Protected_Body_Subprogram;
2246 function Protected_Formal (Id : E) return E is
2248 pragma Assert (Is_Formal (Id));
2250 end Protected_Formal;
2252 function Protected_Operation (Id : E) return N is
2254 pragma Assert (Is_Protected_Private (Id));
2256 end Protected_Operation;
2258 function Reachable (Id : E) return B is
2263 function Referenced (Id : E) return B is
2265 return Flag156 (Id);
2268 function Referenced_As_LHS (Id : E) return B is
2271 end Referenced_As_LHS;
2273 function Referenced_Object (Id : E) return N is
2275 pragma Assert (Is_Type (Id));
2277 end Referenced_Object;
2279 function Register_Exception_Call (Id : E) return N is
2281 pragma Assert (Ekind (Id) = E_Exception);
2283 end Register_Exception_Call;
2285 function Related_Array_Object (Id : E) return E is
2287 pragma Assert (Is_Array_Type (Id));
2289 end Related_Array_Object;
2291 function Related_Instance (Id : E) return E is
2294 (Ekind (Id) = E_Package or else Ekind (Id) = E_Package_Body);
2296 end Related_Instance;
2298 function Related_Interface (Id : E) return E is
2300 pragma Assert (Ekind (Id) = E_Component);
2302 end Related_Interface;
2304 function Renamed_Entity (Id : E) return N is
2309 function Renamed_Object (Id : E) return N is
2314 function Renaming_Map (Id : E) return U is
2319 function Requires_Overriding (Id : E) return B is
2321 pragma Assert (Is_Overloadable (Id));
2322 return Flag213 (Id);
2323 end Requires_Overriding;
2325 function Return_Present (Id : E) return B is
2330 function Return_Applies_To (Id : E) return N is
2333 end Return_Applies_To;
2335 function Returns_By_Ref (Id : E) return B is
2340 function Reverse_Bit_Order (Id : E) return B is
2342 pragma Assert (Is_Record_Type (Id));
2343 return Flag164 (Base_Type (Id));
2344 end Reverse_Bit_Order;
2346 function RM_Size (Id : E) return U is
2348 pragma Assert (Is_Type (Id));
2352 function Scalar_Range (Id : E) return N is
2357 function Scale_Value (Id : E) return U is
2362 function Scope_Depth_Value (Id : E) return U is
2365 end Scope_Depth_Value;
2367 function Sec_Stack_Needed_For_Return (Id : E) return B is
2369 return Flag167 (Id);
2370 end Sec_Stack_Needed_For_Return;
2372 function Shadow_Entities (Id : E) return S is
2375 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
2377 end Shadow_Entities;
2379 function Shared_Var_Assign_Proc (Id : E) return E is
2381 pragma Assert (Ekind (Id) = E_Variable);
2383 end Shared_Var_Assign_Proc;
2385 function Shared_Var_Read_Proc (Id : E) return E is
2387 pragma Assert (Ekind (Id) = E_Variable);
2389 end Shared_Var_Read_Proc;
2391 function Size_Check_Code (Id : E) return N is
2393 pragma Assert (Ekind (Id) = E_Constant or else Ekind (Id) = E_Variable);
2395 end Size_Check_Code;
2397 function Size_Depends_On_Discriminant (Id : E) return B is
2399 return Flag177 (Id);
2400 end Size_Depends_On_Discriminant;
2402 function Size_Known_At_Compile_Time (Id : E) return B is
2405 end Size_Known_At_Compile_Time;
2407 function Small_Value (Id : E) return R is
2409 pragma Assert (Is_Fixed_Point_Type (Id));
2410 return Ureal21 (Id);
2413 function Spec_Entity (Id : E) return E is
2416 (Ekind (Id) = E_Package_Body or else Is_Formal (Id));
2420 function Storage_Size_Variable (Id : E) return E is
2422 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
2423 return Node15 (Implementation_Base_Type (Id));
2424 end Storage_Size_Variable;
2426 function Static_Elaboration_Desired (Id : E) return B is
2428 pragma Assert (Ekind (Id) = E_Package);
2430 end Static_Elaboration_Desired;
2432 function Static_Initialization (Id : E) return N is
2435 (Ekind (Id) = E_Procedure and then not Is_Dispatching_Operation (Id));
2437 end Static_Initialization;
2439 function Stored_Constraint (Id : E) return L is
2442 (Is_Composite_Type (Id) and then not Is_Array_Type (Id));
2443 return Elist23 (Id);
2444 end Stored_Constraint;
2446 function Strict_Alignment (Id : E) return B is
2448 return Flag145 (Implementation_Base_Type (Id));
2449 end Strict_Alignment;
2451 function String_Literal_Length (Id : E) return U is
2454 end String_Literal_Length;
2456 function String_Literal_Low_Bound (Id : E) return N is
2459 end String_Literal_Low_Bound;
2461 function Suppress_Elaboration_Warnings (Id : E) return B is
2463 return Flag148 (Id);
2464 end Suppress_Elaboration_Warnings;
2466 function Suppress_Init_Proc (Id : E) return B is
2468 return Flag105 (Base_Type (Id));
2469 end Suppress_Init_Proc;
2471 function Suppress_Style_Checks (Id : E) return B is
2473 return Flag165 (Id);
2474 end Suppress_Style_Checks;
2476 function Suppress_Value_Tracking_On_Call (Id : E) return B is
2478 return Flag217 (Id);
2479 end Suppress_Value_Tracking_On_Call;
2481 function Task_Body_Procedure (Id : E) return N is
2483 pragma Assert (Ekind (Id) in Task_Kind);
2485 end Task_Body_Procedure;
2487 function Treat_As_Volatile (Id : E) return B is
2490 end Treat_As_Volatile;
2492 function Underlying_Full_View (Id : E) return E is
2494 pragma Assert (Ekind (Id) in Private_Kind);
2496 end Underlying_Full_View;
2498 function Universal_Aliasing (Id : E) return B is
2500 pragma Assert (Is_Type (Id));
2501 return Flag216 (Base_Type (Id));
2502 end Universal_Aliasing;
2504 function Unset_Reference (Id : E) return N is
2507 end Unset_Reference;
2509 function Uses_Sec_Stack (Id : E) return B is
2514 function Vax_Float (Id : E) return B is
2516 return Flag151 (Base_Type (Id));
2519 function Warnings_Off (Id : E) return B is
2524 function Wrapped_Entity (Id : E) return E is
2526 pragma Assert (Ekind (Id) = E_Procedure
2527 and then Is_Primitive_Wrapper (Id));
2531 function Was_Hidden (Id : E) return B is
2533 return Flag196 (Id);
2536 ------------------------------
2537 -- Classification Functions --
2538 ------------------------------
2540 function Is_Access_Type (Id : E) return B is
2542 return Ekind (Id) in Access_Kind;
2545 function Is_Access_Protected_Subprogram_Type (Id : E) return B is
2547 return Ekind (Id) in Access_Protected_Kind;
2548 end Is_Access_Protected_Subprogram_Type;
2550 function Is_Array_Type (Id : E) return B is
2552 return Ekind (Id) in Array_Kind;
2555 function Is_Class_Wide_Type (Id : E) return B is
2557 return Ekind (Id) in Class_Wide_Kind;
2558 end Is_Class_Wide_Type;
2560 function Is_Composite_Type (Id : E) return B is
2562 return Ekind (Id) in Composite_Kind;
2563 end Is_Composite_Type;
2565 function Is_Concurrent_Body (Id : E) return B is
2567 return Ekind (Id) in
2568 Concurrent_Body_Kind;
2569 end Is_Concurrent_Body;
2571 function Is_Concurrent_Record_Type (Id : E) return B is
2574 end Is_Concurrent_Record_Type;
2576 function Is_Concurrent_Type (Id : E) return B is
2578 return Ekind (Id) in Concurrent_Kind;
2579 end Is_Concurrent_Type;
2581 function Is_Decimal_Fixed_Point_Type (Id : E) return B is
2583 return Ekind (Id) in
2584 Decimal_Fixed_Point_Kind;
2585 end Is_Decimal_Fixed_Point_Type;
2587 function Is_Digits_Type (Id : E) return B is
2589 return Ekind (Id) in Digits_Kind;
2592 function Is_Discrete_Or_Fixed_Point_Type (Id : E) return B is
2594 return Ekind (Id) in Discrete_Or_Fixed_Point_Kind;
2595 end Is_Discrete_Or_Fixed_Point_Type;
2597 function Is_Discrete_Type (Id : E) return B is
2599 return Ekind (Id) in Discrete_Kind;
2600 end Is_Discrete_Type;
2602 function Is_Elementary_Type (Id : E) return B is
2604 return Ekind (Id) in Elementary_Kind;
2605 end Is_Elementary_Type;
2607 function Is_Entry (Id : E) return B is
2609 return Ekind (Id) in Entry_Kind;
2612 function Is_Enumeration_Type (Id : E) return B is
2614 return Ekind (Id) in
2616 end Is_Enumeration_Type;
2618 function Is_Fixed_Point_Type (Id : E) return B is
2620 return Ekind (Id) in
2622 end Is_Fixed_Point_Type;
2624 function Is_Floating_Point_Type (Id : E) return B is
2626 return Ekind (Id) in Float_Kind;
2627 end Is_Floating_Point_Type;
2629 function Is_Formal (Id : E) return B is
2631 return Ekind (Id) in Formal_Kind;
2634 function Is_Formal_Object (Id : E) return B is
2636 return Ekind (Id) in Formal_Object_Kind;
2637 end Is_Formal_Object;
2639 function Is_Generic_Subprogram (Id : E) return B is
2641 return Ekind (Id) in Generic_Subprogram_Kind;
2642 end Is_Generic_Subprogram;
2644 function Is_Generic_Unit (Id : E) return B is
2646 return Ekind (Id) in Generic_Unit_Kind;
2647 end Is_Generic_Unit;
2649 function Is_Incomplete_Or_Private_Type (Id : E) return B is
2651 return Ekind (Id) in
2652 Incomplete_Or_Private_Kind;
2653 end Is_Incomplete_Or_Private_Type;
2655 function Is_Incomplete_Type (Id : E) return B is
2657 return Ekind (Id) in
2659 end Is_Incomplete_Type;
2661 function Is_Integer_Type (Id : E) return B is
2663 return Ekind (Id) in Integer_Kind;
2664 end Is_Integer_Type;
2666 function Is_Modular_Integer_Type (Id : E) return B is
2668 return Ekind (Id) in
2669 Modular_Integer_Kind;
2670 end Is_Modular_Integer_Type;
2672 function Is_Named_Number (Id : E) return B is
2674 return Ekind (Id) in Named_Kind;
2675 end Is_Named_Number;
2677 function Is_Numeric_Type (Id : E) return B is
2679 return Ekind (Id) in Numeric_Kind;
2680 end Is_Numeric_Type;
2682 function Is_Object (Id : E) return B is
2684 return Ekind (Id) in Object_Kind;
2687 function Is_Ordinary_Fixed_Point_Type (Id : E) return B is
2689 return Ekind (Id) in
2690 Ordinary_Fixed_Point_Kind;
2691 end Is_Ordinary_Fixed_Point_Type;
2693 function Is_Overloadable (Id : E) return B is
2695 return Ekind (Id) in Overloadable_Kind;
2696 end Is_Overloadable;
2698 function Is_Private_Type (Id : E) return B is
2700 return Ekind (Id) in Private_Kind;
2701 end Is_Private_Type;
2703 function Is_Protected_Type (Id : E) return B is
2705 return Ekind (Id) in Protected_Kind;
2706 end Is_Protected_Type;
2708 function Is_Real_Type (Id : E) return B is
2710 return Ekind (Id) in Real_Kind;
2713 function Is_Record_Type (Id : E) return B is
2715 return Ekind (Id) in Record_Kind;
2718 function Is_Scalar_Type (Id : E) return B is
2720 return Ekind (Id) in Scalar_Kind;
2723 function Is_Signed_Integer_Type (Id : E) return B is
2725 return Ekind (Id) in
2726 Signed_Integer_Kind;
2727 end Is_Signed_Integer_Type;
2729 function Is_Subprogram (Id : E) return B is
2731 return Ekind (Id) in Subprogram_Kind;
2734 function Is_Task_Type (Id : E) return B is
2736 return Ekind (Id) in Task_Kind;
2739 function Is_Type (Id : E) return B is
2741 return Ekind (Id) in Type_Kind;
2744 ------------------------------
2745 -- Attribute Set Procedures --
2746 ------------------------------
2748 procedure Set_Abstract_Interfaces (Id : E; V : L) is
2750 pragma Assert (Is_Record_Type (Id));
2751 Set_Elist25 (Id, V);
2752 end Set_Abstract_Interfaces;
2754 procedure Set_Abstract_Interface_Alias (Id : E; V : E) is
2759 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Function));
2761 end Set_Abstract_Interface_Alias;
2763 procedure Set_Accept_Address (Id : E; V : L) is
2765 Set_Elist21 (Id, V);
2766 end Set_Accept_Address;
2768 procedure Set_Access_Disp_Table (Id : E; V : L) is
2770 pragma Assert (Is_Tagged_Type (Id) and then Id = Base_Type (Id));
2771 Set_Elist16 (Id, V);
2772 end Set_Access_Disp_Table;
2774 procedure Set_Associated_Final_Chain (Id : E; V : E) is
2776 pragma Assert (Is_Access_Type (Id));
2778 end Set_Associated_Final_Chain;
2780 procedure Set_Associated_Formal_Package (Id : E; V : E) is
2783 end Set_Associated_Formal_Package;
2785 procedure Set_Associated_Node_For_Itype (Id : E; V : E) is
2788 end Set_Associated_Node_For_Itype;
2790 procedure Set_Associated_Storage_Pool (Id : E; V : E) is
2792 pragma Assert (Is_Access_Type (Id) and then Id = Base_Type (Id));
2794 end Set_Associated_Storage_Pool;
2796 procedure Set_Actual_Subtype (Id : E; V : E) is
2799 (Ekind (Id) = E_Constant
2800 or else Ekind (Id) = E_Variable
2801 or else Ekind (Id) = E_Generic_In_Out_Parameter
2802 or else Ekind (Id) in E_In_Parameter .. E_In_Out_Parameter);
2804 end Set_Actual_Subtype;
2806 procedure Set_Address_Taken (Id : E; V : B := True) is
2808 Set_Flag104 (Id, V);
2809 end Set_Address_Taken;
2811 procedure Set_Alias (Id : E; V : E) is
2814 (Is_Overloadable (Id) or else Ekind (Id) = E_Subprogram_Type);
2818 procedure Set_Alignment (Id : E; V : U) is
2820 pragma Assert (Is_Type (Id)
2821 or else Is_Formal (Id)
2822 or else Ekind (Id) = E_Loop_Parameter
2823 or else Ekind (Id) = E_Constant
2824 or else Ekind (Id) = E_Exception
2825 or else Ekind (Id) = E_Variable);
2829 procedure Set_Barrier_Function (Id : E; V : N) is
2831 pragma Assert (Is_Entry (Id));
2833 end Set_Barrier_Function;
2835 procedure Set_Block_Node (Id : E; V : N) is
2837 pragma Assert (Ekind (Id) = E_Block);
2841 procedure Set_Body_Entity (Id : E; V : E) is
2844 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
2846 end Set_Body_Entity;
2848 procedure Set_Body_Needed_For_SAL (Id : E; V : B := True) is
2851 (Ekind (Id) = E_Package
2852 or else Is_Subprogram (Id)
2853 or else Is_Generic_Unit (Id));
2855 end Set_Body_Needed_For_SAL;
2857 procedure Set_C_Pass_By_Copy (Id : E; V : B := True) is
2859 pragma Assert (Is_Record_Type (Id) and then Id = Base_Type (Id));
2860 Set_Flag125 (Id, V);
2861 end Set_C_Pass_By_Copy;
2863 procedure Set_Can_Never_Be_Null (Id : E; V : B := True) is
2866 end Set_Can_Never_Be_Null;
2868 procedure Set_Checks_May_Be_Suppressed (Id : E; V : B := True) is
2871 end Set_Checks_May_Be_Suppressed;
2873 procedure Set_Class_Wide_Type (Id : E; V : E) is
2875 pragma Assert (Is_Type (Id));
2877 end Set_Class_Wide_Type;
2879 procedure Set_Cloned_Subtype (Id : E; V : E) is
2882 (Ekind (Id) = E_Record_Subtype
2883 or else Ekind (Id) = E_Class_Wide_Subtype);
2885 end Set_Cloned_Subtype;
2887 procedure Set_Component_Bit_Offset (Id : E; V : U) is
2890 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
2892 end Set_Component_Bit_Offset;
2894 procedure Set_Component_Clause (Id : E; V : N) is
2897 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
2899 end Set_Component_Clause;
2901 procedure Set_Component_Size (Id : E; V : U) is
2903 pragma Assert (Is_Array_Type (Id) and then Id = Base_Type (Id));
2905 end Set_Component_Size;
2907 procedure Set_Component_Type (Id : E; V : E) is
2909 pragma Assert (Is_Array_Type (Id) and then Id = Base_Type (Id));
2911 end Set_Component_Type;
2913 procedure Set_Corresponding_Concurrent_Type (Id : E; V : E) is
2916 (Ekind (Id) = E_Record_Type and then Is_Concurrent_Type (V));
2918 end Set_Corresponding_Concurrent_Type;
2920 procedure Set_Corresponding_Discriminant (Id : E; V : E) is
2922 pragma Assert (Ekind (Id) = E_Discriminant);
2924 end Set_Corresponding_Discriminant;
2926 procedure Set_Corresponding_Equality (Id : E; V : E) is
2929 (Ekind (Id) = E_Function
2930 and then not Comes_From_Source (Id)
2931 and then Chars (Id) = Name_Op_Ne);
2933 end Set_Corresponding_Equality;
2935 procedure Set_Corresponding_Record_Type (Id : E; V : E) is
2937 pragma Assert (Is_Concurrent_Type (Id));
2939 end Set_Corresponding_Record_Type;
2941 procedure Set_Corresponding_Remote_Type (Id : E; V : E) is
2944 end Set_Corresponding_Remote_Type;
2946 procedure Set_Current_Use_Clause (Id : E; V : E) is
2948 pragma Assert (Ekind (Id) = E_Package);
2950 end Set_Current_Use_Clause;
2952 procedure Set_Current_Value (Id : E; V : N) is
2954 pragma Assert (Ekind (Id) in Object_Kind or else Ekind (Id) = E_Void);
2956 end Set_Current_Value;
2958 procedure Set_CR_Discriminant (Id : E; V : E) is
2961 end Set_CR_Discriminant;
2963 procedure Set_Debug_Info_Off (Id : E; V : B := True) is
2965 Set_Flag166 (Id, V);
2966 end Set_Debug_Info_Off;
2968 procedure Set_Debug_Renaming_Link (Id : E; V : E) is
2971 end Set_Debug_Renaming_Link;
2973 procedure Set_Default_Expr_Function (Id : E; V : E) is
2975 pragma Assert (Is_Formal (Id));
2977 end Set_Default_Expr_Function;
2979 procedure Set_Default_Expressions_Processed (Id : E; V : B := True) is
2981 Set_Flag108 (Id, V);
2982 end Set_Default_Expressions_Processed;
2984 procedure Set_Default_Value (Id : E; V : N) is
2986 pragma Assert (Is_Formal (Id));
2988 end Set_Default_Value;
2990 procedure Set_Delay_Cleanups (Id : E; V : B := True) is
2994 or else Is_Task_Type (Id)
2995 or else Ekind (Id) = E_Block);
2996 Set_Flag114 (Id, V);
2997 end Set_Delay_Cleanups;
2999 procedure Set_Delay_Subprogram_Descriptors (Id : E; V : B := True) is
3003 or else Ekind (Id) = E_Package
3004 or else Ekind (Id) = E_Package_Body);
3006 end Set_Delay_Subprogram_Descriptors;
3008 procedure Set_Delta_Value (Id : E; V : R) is
3010 pragma Assert (Is_Fixed_Point_Type (Id));
3011 Set_Ureal18 (Id, V);
3012 end Set_Delta_Value;
3014 procedure Set_Dependent_Instances (Id : E; V : L) is
3016 pragma Assert (Is_Generic_Instance (Id));
3018 end Set_Dependent_Instances;
3020 procedure Set_Depends_On_Private (Id : E; V : B := True) is
3022 pragma Assert (Nkind (Id) in N_Entity);
3024 end Set_Depends_On_Private;
3026 procedure Set_Digits_Value (Id : E; V : U) is
3029 (Is_Floating_Point_Type (Id)
3030 or else Is_Decimal_Fixed_Point_Type (Id));
3032 end Set_Digits_Value;
3034 procedure Set_Directly_Designated_Type (Id : E; V : E) is
3037 end Set_Directly_Designated_Type;
3039 procedure Set_Discard_Names (Id : E; V : B := True) is
3042 end Set_Discard_Names;
3044 procedure Set_Discriminal (Id : E; V : E) is
3046 pragma Assert (Ekind (Id) = E_Discriminant);
3048 end Set_Discriminal;
3050 procedure Set_Discriminal_Link (Id : E; V : E) is
3053 end Set_Discriminal_Link;
3055 procedure Set_Discriminant_Checking_Func (Id : E; V : E) is
3057 pragma Assert (Ekind (Id) = E_Component);
3059 end Set_Discriminant_Checking_Func;
3061 procedure Set_Discriminant_Constraint (Id : E; V : L) is
3063 pragma Assert (Nkind (Id) in N_Entity);
3064 Set_Elist21 (Id, V);
3065 end Set_Discriminant_Constraint;
3067 procedure Set_Discriminant_Default_Value (Id : E; V : N) is
3070 end Set_Discriminant_Default_Value;
3072 procedure Set_Discriminant_Number (Id : E; V : U) is
3075 end Set_Discriminant_Number;
3077 procedure Set_DT_Entry_Count (Id : E; V : U) is
3079 pragma Assert (Ekind (Id) = E_Component);
3081 end Set_DT_Entry_Count;
3083 procedure Set_DT_Offset_To_Top_Func (Id : E; V : E) is
3085 pragma Assert (Ekind (Id) = E_Component and then Is_Tag (Id));
3087 end Set_DT_Offset_To_Top_Func;
3089 procedure Set_DT_Position (Id : E; V : U) is
3091 pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
3093 end Set_DT_Position;
3095 procedure Set_DTC_Entity (Id : E; V : E) is
3098 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
3102 procedure Set_Elaborate_Body_Desirable (Id : E; V : B := True) is
3104 pragma Assert (Ekind (Id) = E_Package);
3105 Set_Flag210 (Id, V);
3106 end Set_Elaborate_Body_Desirable;
3108 procedure Set_Elaboration_Entity (Id : E; V : E) is
3113 Ekind (Id) = E_Package
3115 Is_Generic_Unit (Id));
3117 end Set_Elaboration_Entity;
3119 procedure Set_Elaboration_Entity_Required (Id : E; V : B := True) is
3124 Ekind (Id) = E_Package
3126 Is_Generic_Unit (Id));
3127 Set_Flag174 (Id, V);
3128 end Set_Elaboration_Entity_Required;
3130 procedure Set_Enclosing_Scope (Id : E; V : E) is
3133 end Set_Enclosing_Scope;
3135 procedure Set_Entry_Accepted (Id : E; V : B := True) is
3137 pragma Assert (Is_Entry (Id));
3138 Set_Flag152 (Id, V);
3139 end Set_Entry_Accepted;
3141 procedure Set_Entry_Bodies_Array (Id : E; V : E) is
3144 end Set_Entry_Bodies_Array;
3146 procedure Set_Entry_Cancel_Parameter (Id : E; V : E) is
3149 end Set_Entry_Cancel_Parameter;
3151 procedure Set_Entry_Component (Id : E; V : E) is
3154 end Set_Entry_Component;
3156 procedure Set_Entry_Formal (Id : E; V : E) is
3159 end Set_Entry_Formal;
3161 procedure Set_Entry_Index_Constant (Id : E; V : E) is
3163 pragma Assert (Ekind (Id) = E_Entry_Index_Parameter);
3165 end Set_Entry_Index_Constant;
3167 procedure Set_Entry_Parameters_Type (Id : E; V : E) is
3170 end Set_Entry_Parameters_Type;
3172 procedure Set_Enum_Pos_To_Rep (Id : E; V : E) is
3174 pragma Assert (Ekind (Id) = E_Enumeration_Type);
3176 end Set_Enum_Pos_To_Rep;
3178 procedure Set_Enumeration_Pos (Id : E; V : U) is
3180 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
3182 end Set_Enumeration_Pos;
3184 procedure Set_Enumeration_Rep (Id : E; V : U) is
3186 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
3188 end Set_Enumeration_Rep;
3190 procedure Set_Enumeration_Rep_Expr (Id : E; V : N) is
3192 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
3194 end Set_Enumeration_Rep_Expr;
3196 procedure Set_Equivalent_Type (Id : E; V : E) is
3199 (Ekind (Id) = E_Class_Wide_Type or else
3200 Ekind (Id) = E_Class_Wide_Subtype or else
3201 Ekind (Id) = E_Access_Protected_Subprogram_Type or else
3202 Ekind (Id) = E_Anonymous_Access_Protected_Subprogram_Type or else
3203 Ekind (Id) = E_Access_Subprogram_Type or else
3204 Ekind (Id) = E_Exception_Type);
3206 end Set_Equivalent_Type;
3208 procedure Set_Esize (Id : E; V : U) is
3213 procedure Set_Exception_Code (Id : E; V : U) is
3215 pragma Assert (Ekind (Id) = E_Exception);
3217 end Set_Exception_Code;
3219 procedure Set_Extra_Accessibility (Id : E; V : E) is
3221 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
3223 end Set_Extra_Accessibility;
3225 procedure Set_Extra_Constrained (Id : E; V : E) is
3227 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
3229 end Set_Extra_Constrained;
3231 procedure Set_Extra_Formal (Id : E; V : E) is
3234 end Set_Extra_Formal;
3236 procedure Set_Extra_Formals (Id : E; V : E) is
3239 (Is_Overloadable (Id)
3240 or else Ekind (Id) = E_Entry_Family
3241 or else Ekind (Id) = E_Subprogram_Body
3242 or else Ekind (Id) = E_Subprogram_Type);
3244 end Set_Extra_Formals;
3246 procedure Set_Finalization_Chain_Entity (Id : E; V : E) is
3249 end Set_Finalization_Chain_Entity;
3251 procedure Set_Finalize_Storage_Only (Id : E; V : B := True) is
3253 pragma Assert (Is_Type (Id) and then Id = Base_Type (Id));
3254 Set_Flag158 (Id, V);
3255 end Set_Finalize_Storage_Only;
3257 procedure Set_First_Entity (Id : E; V : E) is
3260 end Set_First_Entity;
3262 procedure Set_First_Index (Id : E; V : N) is
3264 pragma Assert (Is_Array_Type (Id) or else Is_String_Type (Id));
3266 end Set_First_Index;
3268 procedure Set_First_Literal (Id : E; V : E) is
3270 pragma Assert (Is_Enumeration_Type (Id));
3272 end Set_First_Literal;
3274 procedure Set_First_Optional_Parameter (Id : E; V : E) is
3277 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
3279 end Set_First_Optional_Parameter;
3281 procedure Set_First_Private_Entity (Id : E; V : E) is
3283 pragma Assert (Ekind (Id) = E_Package
3284 or else Ekind (Id) = E_Generic_Package
3285 or else Ekind (Id) in Concurrent_Kind);
3287 end Set_First_Private_Entity;
3289 procedure Set_First_Rep_Item (Id : E; V : N) is
3292 end Set_First_Rep_Item;
3294 procedure Set_Freeze_Node (Id : E; V : N) is
3297 end Set_Freeze_Node;
3299 procedure Set_From_With_Type (Id : E; V : B := True) is
3303 or else Ekind (Id) = E_Package);
3304 Set_Flag159 (Id, V);
3305 end Set_From_With_Type;
3307 procedure Set_Full_View (Id : E; V : E) is
3309 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Constant);
3313 procedure Set_Function_Returns_With_DSP (Id : E; V : B := True) is
3316 (Is_Subprogram (Id) or else Ekind (Id) = E_Subprogram_Type);
3317 Set_Flag169 (Id, V);
3318 end Set_Function_Returns_With_DSP;
3320 procedure Set_Generic_Homonym (Id : E; V : E) is
3323 end Set_Generic_Homonym;
3325 procedure Set_Generic_Renamings (Id : E; V : L) is
3327 Set_Elist23 (Id, V);
3328 end Set_Generic_Renamings;
3330 procedure Set_Handler_Records (Id : E; V : S) is
3333 end Set_Handler_Records;
3335 procedure Set_Has_Aliased_Components (Id : E; V : B := True) is
3337 pragma Assert (Base_Type (Id) = Id);
3338 Set_Flag135 (Id, V);
3339 end Set_Has_Aliased_Components;
3341 procedure Set_Has_Alignment_Clause (Id : E; V : B := True) is
3344 end Set_Has_Alignment_Clause;
3346 procedure Set_Has_All_Calls_Remote (Id : E; V : B := True) is
3349 end Set_Has_All_Calls_Remote;
3351 procedure Set_Has_Anon_Block_Suffix (Id : E; V : B := True) is
3353 Set_Flag201 (Id, V);
3354 end Set_Has_Anon_Block_Suffix;
3356 procedure Set_Has_Atomic_Components (Id : E; V : B := True) is
3358 pragma Assert (not Is_Type (Id) or else Base_Type (Id) = Id);
3360 end Set_Has_Atomic_Components;
3362 procedure Set_Has_Biased_Representation (Id : E; V : B := True) is
3365 ((V = False) or else (Is_Discrete_Type (Id) or Is_Object (Id)));
3366 Set_Flag139 (Id, V);
3367 end Set_Has_Biased_Representation;
3369 procedure Set_Has_Completion (Id : E; V : B := True) is
3372 end Set_Has_Completion;
3374 procedure Set_Has_Completion_In_Body (Id : E; V : B := True) is
3376 pragma Assert (Is_Type (Id));
3378 end Set_Has_Completion_In_Body;
3380 procedure Set_Has_Complex_Representation (Id : E; V : B := True) is
3382 pragma Assert (Ekind (Id) = E_Record_Type);
3383 Set_Flag140 (Id, V);
3384 end Set_Has_Complex_Representation;
3386 procedure Set_Has_Component_Size_Clause (Id : E; V : B := True) is
3388 pragma Assert (Ekind (Id) = E_Array_Type);
3390 end Set_Has_Component_Size_Clause;
3392 procedure Set_Has_Constrained_Partial_View (Id : E; V : B := True) is
3394 pragma Assert (Is_Type (Id));
3395 Set_Flag187 (Id, V);
3396 end Set_Has_Constrained_Partial_View;
3398 procedure Set_Has_Contiguous_Rep (Id : E; V : B := True) is
3400 Set_Flag181 (Id, V);
3401 end Set_Has_Contiguous_Rep;
3403 procedure Set_Has_Controlled_Component (Id : E; V : B := True) is
3405 pragma Assert (Base_Type (Id) = Id);
3407 end Set_Has_Controlled_Component;
3409 procedure Set_Has_Controlling_Result (Id : E; V : B := True) is
3412 end Set_Has_Controlling_Result;
3414 procedure Set_Has_Convention_Pragma (Id : E; V : B := True) is
3416 Set_Flag119 (Id, V);
3417 end Set_Has_Convention_Pragma;
3419 procedure Set_Has_Delayed_Freeze (Id : E; V : B := True) is
3421 pragma Assert (Nkind (Id) in N_Entity);
3423 end Set_Has_Delayed_Freeze;
3425 procedure Set_Has_Discriminants (Id : E; V : B := True) is
3427 pragma Assert (Nkind (Id) in N_Entity);
3429 end Set_Has_Discriminants;
3431 procedure Set_Has_Enumeration_Rep_Clause (Id : E; V : B := True) is
3433 pragma Assert (Is_Enumeration_Type (Id));
3435 end Set_Has_Enumeration_Rep_Clause;
3437 procedure Set_Has_Exit (Id : E; V : B := True) is
3442 procedure Set_Has_External_Tag_Rep_Clause (Id : E; V : B := True) is
3444 pragma Assert (Is_Tagged_Type (Id));
3445 Set_Flag110 (Id, V);
3446 end Set_Has_External_Tag_Rep_Clause;
3448 procedure Set_Has_Forward_Instantiation (Id : E; V : B := True) is
3450 Set_Flag175 (Id, V);
3451 end Set_Has_Forward_Instantiation;
3453 procedure Set_Has_Fully_Qualified_Name (Id : E; V : B := True) is
3455 Set_Flag173 (Id, V);
3456 end Set_Has_Fully_Qualified_Name;
3458 procedure Set_Has_Gigi_Rep_Item (Id : E; V : B := True) is
3461 end Set_Has_Gigi_Rep_Item;
3463 procedure Set_Has_Homonym (Id : E; V : B := True) is
3466 end Set_Has_Homonym;
3468 procedure Set_Has_Machine_Radix_Clause (Id : E; V : B := True) is
3470 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
3472 end Set_Has_Machine_Radix_Clause;
3474 procedure Set_Has_Master_Entity (Id : E; V : B := True) is
3477 end Set_Has_Master_Entity;
3479 procedure Set_Has_Missing_Return (Id : E; V : B := True) is
3482 (Ekind (Id) = E_Function or else Ekind (Id) = E_Generic_Function);
3483 Set_Flag142 (Id, V);
3484 end Set_Has_Missing_Return;
3486 procedure Set_Has_Nested_Block_With_Handler (Id : E; V : B := True) is
3488 Set_Flag101 (Id, V);
3489 end Set_Has_Nested_Block_With_Handler;
3491 procedure Set_Has_Up_Level_Access (Id : E; V : B := True) is
3494 (Ekind (Id) = E_Variable
3495 or else Ekind (Id) = E_Constant
3496 or else Ekind (Id) = E_Loop_Parameter);
3497 Set_Flag215 (Id, V);
3498 end Set_Has_Up_Level_Access;
3500 procedure Set_Has_Non_Standard_Rep (Id : E; V : B := True) is
3502 pragma Assert (Base_Type (Id) = Id);
3504 end Set_Has_Non_Standard_Rep;
3506 procedure Set_Has_Object_Size_Clause (Id : E; V : B := True) is
3508 pragma Assert (Is_Type (Id));
3509 Set_Flag172 (Id, V);
3510 end Set_Has_Object_Size_Clause;
3512 procedure Set_Has_Per_Object_Constraint (Id : E; V : B := True) is
3514 Set_Flag154 (Id, V);
3515 end Set_Has_Per_Object_Constraint;
3517 procedure Set_Has_Persistent_BSS (Id : E; V : B := True) is
3519 Set_Flag188 (Id, V);
3520 end Set_Has_Persistent_BSS;
3522 procedure Set_Has_Pragma_Controlled (Id : E; V : B := True) is
3524 pragma Assert (Is_Access_Type (Id));
3525 Set_Flag27 (Base_Type (Id), V);
3526 end Set_Has_Pragma_Controlled;
3528 procedure Set_Has_Pragma_Elaborate_Body (Id : E; V : B := True) is
3530 Set_Flag150 (Id, V);
3531 end Set_Has_Pragma_Elaborate_Body;
3533 procedure Set_Has_Pragma_Inline (Id : E; V : B := True) is
3535 Set_Flag157 (Id, V);
3536 end Set_Has_Pragma_Inline;
3538 procedure Set_Has_Pragma_Pack (Id : E; V : B := True) is
3540 pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id));
3541 pragma Assert (Id = Base_Type (Id));
3542 Set_Flag121 (Id, V);
3543 end Set_Has_Pragma_Pack;
3545 procedure Set_Has_Pragma_Pure (Id : E; V : B := True) is
3547 Set_Flag203 (Id, V);
3548 end Set_Has_Pragma_Pure;
3550 procedure Set_Has_Pragma_Pure_Function (Id : E; V : B := True) is
3552 Set_Flag179 (Id, V);
3553 end Set_Has_Pragma_Pure_Function;
3555 procedure Set_Has_Pragma_Unreferenced (Id : E; V : B := True) is
3557 Set_Flag180 (Id, V);
3558 end Set_Has_Pragma_Unreferenced;
3560 procedure Set_Has_Pragma_Unreferenced_Objects (Id : E; V : B := True) is
3562 pragma Assert (Is_Type (Id));
3563 Set_Flag212 (Id, V);
3564 end Set_Has_Pragma_Unreferenced_Objects;
3566 procedure Set_Has_Primitive_Operations (Id : E; V : B := True) is
3568 pragma Assert (Id = Base_Type (Id));
3569 Set_Flag120 (Id, V);
3570 end Set_Has_Primitive_Operations;
3572 procedure Set_Has_Private_Declaration (Id : E; V : B := True) is
3574 Set_Flag155 (Id, V);
3575 end Set_Has_Private_Declaration;
3577 procedure Set_Has_Qualified_Name (Id : E; V : B := True) is
3579 Set_Flag161 (Id, V);
3580 end Set_Has_Qualified_Name;
3582 procedure Set_Has_RACW (Id : E; V : B := True) is
3584 pragma Assert (Ekind (Id) = E_Package);
3585 Set_Flag214 (Id, V);
3588 procedure Set_Has_Record_Rep_Clause (Id : E; V : B := True) is
3590 pragma Assert (Id = Base_Type (Id));
3592 end Set_Has_Record_Rep_Clause;
3594 procedure Set_Has_Recursive_Call (Id : E; V : B := True) is
3596 pragma Assert (Is_Subprogram (Id));
3597 Set_Flag143 (Id, V);
3598 end Set_Has_Recursive_Call;
3600 procedure Set_Has_Size_Clause (Id : E; V : B := True) is
3603 end Set_Has_Size_Clause;
3605 procedure Set_Has_Small_Clause (Id : E; V : B := True) is
3608 end Set_Has_Small_Clause;
3610 procedure Set_Has_Specified_Layout (Id : E; V : B := True) is
3612 pragma Assert (Id = Base_Type (Id));
3613 Set_Flag100 (Id, V);
3614 end Set_Has_Specified_Layout;
3616 procedure Set_Has_Specified_Stream_Input (Id : E; V : B := True) is
3618 pragma Assert (Is_Type (Id));
3619 Set_Flag190 (Id, V);
3620 end Set_Has_Specified_Stream_Input;
3622 procedure Set_Has_Specified_Stream_Output (Id : E; V : B := True) is
3624 pragma Assert (Is_Type (Id));
3625 Set_Flag191 (Id, V);
3626 end Set_Has_Specified_Stream_Output;
3628 procedure Set_Has_Specified_Stream_Read (Id : E; V : B := True) is
3630 pragma Assert (Is_Type (Id));
3631 Set_Flag192 (Id, V);
3632 end Set_Has_Specified_Stream_Read;
3634 procedure Set_Has_Specified_Stream_Write (Id : E; V : B := True) is
3636 pragma Assert (Is_Type (Id));
3637 Set_Flag193 (Id, V);
3638 end Set_Has_Specified_Stream_Write;
3640 procedure Set_Has_Static_Discriminants (Id : E; V : B := True) is
3642 Set_Flag211 (Id, V);
3643 end Set_Has_Static_Discriminants;
3645 procedure Set_Has_Storage_Size_Clause (Id : E; V : B := True) is
3647 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
3648 pragma Assert (Base_Type (Id) = Id);
3650 end Set_Has_Storage_Size_Clause;
3652 procedure Set_Has_Stream_Size_Clause (Id : E; V : B := True) is
3654 pragma Assert (Is_Elementary_Type (Id));
3655 Set_Flag184 (Id, V);
3656 end Set_Has_Stream_Size_Clause;
3658 procedure Set_Has_Subprogram_Descriptor (Id : E; V : B := True) is
3661 end Set_Has_Subprogram_Descriptor;
3663 procedure Set_Has_Task (Id : E; V : B := True) is
3665 pragma Assert (Base_Type (Id) = Id);
3669 procedure Set_Has_Unchecked_Union (Id : E; V : B := True) is
3671 pragma Assert (Base_Type (Id) = Id);
3672 Set_Flag123 (Id, V);
3673 end Set_Has_Unchecked_Union;
3675 procedure Set_Has_Unknown_Discriminants (Id : E; V : B := True) is
3677 pragma Assert (Is_Type (Id));
3679 end Set_Has_Unknown_Discriminants;
3681 procedure Set_Has_Volatile_Components (Id : E; V : B := True) is
3683 pragma Assert (not Is_Type (Id) or else Base_Type (Id) = Id);
3685 end Set_Has_Volatile_Components;
3687 procedure Set_Has_Xref_Entry (Id : E; V : B := True) is
3689 Set_Flag182 (Id, V);
3690 end Set_Has_Xref_Entry;
3692 procedure Set_Hiding_Loop_Variable (Id : E; V : E) is
3694 pragma Assert (Ekind (Id) = E_Variable);
3696 end Set_Hiding_Loop_Variable;
3698 procedure Set_Homonym (Id : E; V : E) is
3700 pragma Assert (Id /= V);
3704 procedure Set_In_Package_Body (Id : E; V : B := True) is
3707 end Set_In_Package_Body;
3709 procedure Set_In_Private_Part (Id : E; V : B := True) is
3712 end Set_In_Private_Part;
3714 procedure Set_In_Use (Id : E; V : B := True) is
3716 pragma Assert (Nkind (Id) in N_Entity);
3720 procedure Set_Inner_Instances (Id : E; V : L) is
3722 Set_Elist23 (Id, V);
3723 end Set_Inner_Instances;
3725 procedure Set_Interface_Name (Id : E; V : N) is
3728 end Set_Interface_Name;
3730 procedure Set_Is_Abstract_Subprogram (Id : E; V : B := True) is
3732 pragma Assert (Is_Overloadable (Id));
3734 end Set_Is_Abstract_Subprogram;
3736 procedure Set_Is_Abstract_Type (Id : E; V : B := True) is
3738 pragma Assert (Is_Type (Id));
3739 Set_Flag146 (Id, V);
3740 end Set_Is_Abstract_Type;
3742 procedure Set_Is_Local_Anonymous_Access (Id : E; V : B := True) is
3744 pragma Assert (Is_Access_Type (Id));
3745 Set_Flag194 (Id, V);
3746 end Set_Is_Local_Anonymous_Access;
3748 procedure Set_Is_Access_Constant (Id : E; V : B := True) is
3750 pragma Assert (Is_Access_Type (Id));
3752 end Set_Is_Access_Constant;
3754 procedure Set_Is_Ada_2005_Only (Id : E; V : B := True) is
3756 Set_Flag185 (Id, V);
3757 end Set_Is_Ada_2005_Only;
3759 procedure Set_Is_Aliased (Id : E; V : B := True) is
3761 pragma Assert (Nkind (Id) in N_Entity);
3765 procedure Set_Is_AST_Entry (Id : E; V : B := True) is
3767 pragma Assert (Is_Entry (Id));
3768 Set_Flag132 (Id, V);
3769 end Set_Is_AST_Entry;
3771 procedure Set_Is_Asynchronous (Id : E; V : B := True) is
3774 (Ekind (Id) = E_Procedure or else Is_Type (Id));
3776 end Set_Is_Asynchronous;
3778 procedure Set_Is_Atomic (Id : E; V : B := True) is
3783 procedure Set_Is_Bit_Packed_Array (Id : E; V : B := True) is
3785 pragma Assert ((not V)
3786 or else (Is_Array_Type (Id) and then Id = Base_Type (Id)));
3788 Set_Flag122 (Id, V);
3789 end Set_Is_Bit_Packed_Array;
3791 procedure Set_Is_Called (Id : E; V : B := True) is
3794 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Function);
3795 Set_Flag102 (Id, V);
3798 procedure Set_Is_Character_Type (Id : E; V : B := True) is
3801 end Set_Is_Character_Type;
3803 procedure Set_Is_Child_Unit (Id : E; V : B := True) is
3806 end Set_Is_Child_Unit;
3808 procedure Set_Is_Class_Wide_Equivalent_Type (Id : E; V : B := True) is
3811 end Set_Is_Class_Wide_Equivalent_Type;
3813 procedure Set_Is_Compilation_Unit (Id : E; V : B := True) is
3815 Set_Flag149 (Id, V);
3816 end Set_Is_Compilation_Unit;
3818 procedure Set_Is_Completely_Hidden (Id : E; V : B := True) is
3820 pragma Assert (Ekind (Id) = E_Discriminant);
3821 Set_Flag103 (Id, V);
3822 end Set_Is_Completely_Hidden;
3824 procedure Set_Is_Concurrent_Record_Type (Id : E; V : B := True) is
3827 end Set_Is_Concurrent_Record_Type;
3829 procedure Set_Is_Constr_Subt_For_U_Nominal (Id : E; V : B := True) is
3832 end Set_Is_Constr_Subt_For_U_Nominal;
3834 procedure Set_Is_Constr_Subt_For_UN_Aliased (Id : E; V : B := True) is
3836 Set_Flag141 (Id, V);
3837 end Set_Is_Constr_Subt_For_UN_Aliased;
3839 procedure Set_Is_Constrained (Id : E; V : B := True) is
3841 pragma Assert (Nkind (Id) in N_Entity);
3843 end Set_Is_Constrained;
3845 procedure Set_Is_Constructor (Id : E; V : B := True) is
3848 end Set_Is_Constructor;
3850 procedure Set_Is_Controlled (Id : E; V : B := True) is
3852 pragma Assert (Id = Base_Type (Id));
3854 end Set_Is_Controlled;
3856 procedure Set_Is_Controlling_Formal (Id : E; V : B := True) is
3858 pragma Assert (Is_Formal (Id));
3860 end Set_Is_Controlling_Formal;
3862 procedure Set_Is_CPP_Class (Id : E; V : B := True) is
3865 end Set_Is_CPP_Class;
3867 procedure Set_Is_Discrim_SO_Function (Id : E; V : B := True) is
3869 Set_Flag176 (Id, V);
3870 end Set_Is_Discrim_SO_Function;
3872 procedure Set_Is_Dispatching_Operation (Id : E; V : B := True) is
3877 Is_Overloadable (Id)
3879 Ekind (Id) = E_Subprogram_Type);
3882 end Set_Is_Dispatching_Operation;
3884 procedure Set_Is_Eliminated (Id : E; V : B := True) is
3886 Set_Flag124 (Id, V);
3887 end Set_Is_Eliminated;
3889 procedure Set_Is_Entry_Formal (Id : E; V : B := True) is
3892 end Set_Is_Entry_Formal;
3894 procedure Set_Is_Exported (Id : E; V : B := True) is
3897 end Set_Is_Exported;
3899 procedure Set_Is_First_Subtype (Id : E; V : B := True) is
3902 end Set_Is_First_Subtype;
3904 procedure Set_Is_For_Access_Subtype (Id : E; V : B := True) is
3907 (Ekind (Id) = E_Record_Subtype
3909 Ekind (Id) = E_Private_Subtype);
3910 Set_Flag118 (Id, V);
3911 end Set_Is_For_Access_Subtype;
3913 procedure Set_Is_Formal_Subprogram (Id : E; V : B := True) is
3915 Set_Flag111 (Id, V);
3916 end Set_Is_Formal_Subprogram;
3918 procedure Set_Is_Frozen (Id : E; V : B := True) is
3920 pragma Assert (Nkind (Id) in N_Entity);
3924 procedure Set_Is_Generic_Actual_Type (Id : E; V : B := True) is
3926 pragma Assert (Is_Type (Id));
3928 end Set_Is_Generic_Actual_Type;
3930 procedure Set_Is_Generic_Instance (Id : E; V : B := True) is
3932 Set_Flag130 (Id, V);
3933 end Set_Is_Generic_Instance;
3935 procedure Set_Is_Generic_Type (Id : E; V : B := True) is
3937 pragma Assert (Nkind (Id) in N_Entity);
3939 end Set_Is_Generic_Type;
3941 procedure Set_Is_Hidden (Id : E; V : B := True) is
3946 procedure Set_Is_Hidden_Open_Scope (Id : E; V : B := True) is
3948 Set_Flag171 (Id, V);
3949 end Set_Is_Hidden_Open_Scope;
3951 procedure Set_Is_Immediately_Visible (Id : E; V : B := True) is
3953 pragma Assert (Nkind (Id) in N_Entity);
3955 end Set_Is_Immediately_Visible;
3957 procedure Set_Is_Imported (Id : E; V : B := True) is
3960 end Set_Is_Imported;
3962 procedure Set_Is_Inlined (Id : E; V : B := True) is
3967 procedure Set_Is_Interface (Id : E; V : B := True) is
3970 (Ekind (Id) = E_Record_Type
3971 or else Ekind (Id) = E_Record_Subtype
3972 or else Ekind (Id) = E_Record_Type_With_Private
3973 or else Ekind (Id) = E_Record_Subtype_With_Private
3974 or else Ekind (Id) = E_Class_Wide_Type
3975 or else Ekind (Id) = E_Class_Wide_Subtype);
3976 Set_Flag186 (Id, V);
3977 end Set_Is_Interface;
3979 procedure Set_Is_Instantiated (Id : E; V : B := True) is
3981 Set_Flag126 (Id, V);
3982 end Set_Is_Instantiated;
3984 procedure Set_Is_Internal (Id : E; V : B := True) is
3986 pragma Assert (Nkind (Id) in N_Entity);
3988 end Set_Is_Internal;
3990 procedure Set_Is_Interrupt_Handler (Id : E; V : B := True) is
3992 pragma Assert (Nkind (Id) in N_Entity);
3994 end Set_Is_Interrupt_Handler;
3996 procedure Set_Is_Intrinsic_Subprogram (Id : E; V : B := True) is
3999 end Set_Is_Intrinsic_Subprogram;
4001 procedure Set_Is_Itype (Id : E; V : B := True) is
4006 procedure Set_Is_Known_Non_Null (Id : E; V : B := True) is
4009 end Set_Is_Known_Non_Null;
4011 procedure Set_Is_Known_Null (Id : E; V : B := True) is
4013 Set_Flag204 (Id, V);
4014 end Set_Is_Known_Null;
4016 procedure Set_Is_Known_Valid (Id : E; V : B := True) is
4018 Set_Flag170 (Id, V);
4019 end Set_Is_Known_Valid;
4021 procedure Set_Is_Limited_Composite (Id : E; V : B := True) is
4023 pragma Assert (Is_Type (Id));
4024 Set_Flag106 (Id, V);
4025 end Set_Is_Limited_Composite;
4027 procedure Set_Is_Limited_Interface (Id : E; V : B := True) is
4029 pragma Assert (Is_Interface (Id));
4030 Set_Flag197 (Id, V);
4031 end Set_Is_Limited_Interface;
4033 procedure Set_Is_Limited_Record (Id : E; V : B := True) is
4036 end Set_Is_Limited_Record;
4038 procedure Set_Is_Machine_Code_Subprogram (Id : E; V : B := True) is
4040 pragma Assert (Is_Subprogram (Id));
4041 Set_Flag137 (Id, V);
4042 end Set_Is_Machine_Code_Subprogram;
4044 procedure Set_Is_Non_Static_Subtype (Id : E; V : B := True) is
4046 pragma Assert (Is_Type (Id));
4047 Set_Flag109 (Id, V);
4048 end Set_Is_Non_Static_Subtype;
4050 procedure Set_Is_Null_Init_Proc (Id : E; V : B := True) is
4052 pragma Assert (Ekind (Id) = E_Procedure);
4053 Set_Flag178 (Id, V);
4054 end Set_Is_Null_Init_Proc;
4056 procedure Set_Is_Obsolescent (Id : E; V : B := True) is
4058 Set_Flag153 (Id, V);
4059 end Set_Is_Obsolescent;
4061 procedure Set_Is_Optional_Parameter (Id : E; V : B := True) is
4063 pragma Assert (Is_Formal (Id));
4064 Set_Flag134 (Id, V);
4065 end Set_Is_Optional_Parameter;
4067 procedure Set_Is_Overriding_Operation (Id : E; V : B := True) is
4069 pragma Assert (Is_Subprogram (Id));
4071 end Set_Is_Overriding_Operation;
4073 procedure Set_Is_Package_Body_Entity (Id : E; V : B := True) is
4075 Set_Flag160 (Id, V);
4076 end Set_Is_Package_Body_Entity;
4078 procedure Set_Is_Packed (Id : E; V : B := True) is
4080 pragma Assert (Base_Type (Id) = Id);
4084 procedure Set_Is_Packed_Array_Type (Id : E; V : B := True) is
4086 Set_Flag138 (Id, V);
4087 end Set_Is_Packed_Array_Type;
4089 procedure Set_Is_Potentially_Use_Visible (Id : E; V : B := True) is
4091 pragma Assert (Nkind (Id) in N_Entity);
4093 end Set_Is_Potentially_Use_Visible;
4095 procedure Set_Is_Preelaborated (Id : E; V : B := True) is
4098 end Set_Is_Preelaborated;
4100 procedure Set_Is_Primitive_Wrapper (Id : E; V : B := True) is
4102 pragma Assert (Ekind (Id) = E_Procedure);
4103 Set_Flag195 (Id, V);
4104 end Set_Is_Primitive_Wrapper;
4106 procedure Set_Is_Private_Composite (Id : E; V : B := True) is
4108 pragma Assert (Is_Type (Id));
4109 Set_Flag107 (Id, V);
4110 end Set_Is_Private_Composite;
4112 procedure Set_Is_Private_Descendant (Id : E; V : B := True) is
4115 end Set_Is_Private_Descendant;
4117 procedure Set_Is_Protected_Interface (Id : E; V : B := True) is
4119 pragma Assert (Is_Interface (Id));
4120 Set_Flag198 (Id, V);
4121 end Set_Is_Protected_Interface;
4123 procedure Set_Is_Public (Id : E; V : B := True) is
4125 pragma Assert (Nkind (Id) in N_Entity);
4129 procedure Set_Is_Pure (Id : E; V : B := True) is
4134 procedure Set_Is_Pure_Unit_Access_Type (Id : E; V : B := True) is
4136 pragma Assert (Is_Access_Type (Id));
4137 Set_Flag189 (Id, V);
4138 end Set_Is_Pure_Unit_Access_Type;
4140 procedure Set_Is_Remote_Call_Interface (Id : E; V : B := True) is
4143 end Set_Is_Remote_Call_Interface;
4145 procedure Set_Is_Remote_Types (Id : E; V : B := True) is
4148 end Set_Is_Remote_Types;
4150 procedure Set_Is_Renaming_Of_Object (Id : E; V : B := True) is
4152 Set_Flag112 (Id, V);
4153 end Set_Is_Renaming_Of_Object;
4155 procedure Set_Is_Return_Object (Id : E; V : B := True) is
4157 Set_Flag209 (Id, V);
4158 end Set_Is_Return_Object;
4160 procedure Set_Is_Shared_Passive (Id : E; V : B := True) is
4163 end Set_Is_Shared_Passive;
4165 procedure Set_Is_Statically_Allocated (Id : E; V : B := True) is
4168 (Ekind (Id) = E_Exception
4169 or else Ekind (Id) = E_Variable
4170 or else Ekind (Id) = E_Constant
4171 or else Is_Type (Id)
4172 or else Ekind (Id) = E_Void);
4174 end Set_Is_Statically_Allocated;
4176 procedure Set_Is_Synchronized_Interface (Id : E; V : B := True) is
4178 pragma Assert (Is_Interface (Id));
4179 Set_Flag199 (Id, V);
4180 end Set_Is_Synchronized_Interface;
4182 procedure Set_Is_Tag (Id : E; V : B := True) is
4184 pragma Assert (Nkind (Id) in N_Entity);
4188 procedure Set_Is_Tagged_Type (Id : E; V : B := True) is
4191 end Set_Is_Tagged_Type;
4193 procedure Set_Is_Task_Interface (Id : E; V : B := True) is
4195 pragma Assert (Is_Interface (Id));
4196 Set_Flag200 (Id, V);
4197 end Set_Is_Task_Interface;
4199 procedure Set_Is_True_Constant (Id : E; V : B := True) is
4201 Set_Flag163 (Id, V);
4202 end Set_Is_True_Constant;
4204 procedure Set_Is_Unchecked_Union (Id : E; V : B := True) is
4206 pragma Assert (Base_Type (Id) = Id);
4207 Set_Flag117 (Id, V);
4208 end Set_Is_Unchecked_Union;
4210 procedure Set_Is_Unsigned_Type (Id : E; V : B := True) is
4212 pragma Assert (Is_Discrete_Or_Fixed_Point_Type (Id));
4213 Set_Flag144 (Id, V);
4214 end Set_Is_Unsigned_Type;
4216 procedure Set_Is_Valued_Procedure (Id : E; V : B := True) is
4218 pragma Assert (Ekind (Id) = E_Procedure);
4219 Set_Flag127 (Id, V);
4220 end Set_Is_Valued_Procedure;
4222 procedure Set_Is_Visible_Child_Unit (Id : E; V : B := True) is
4224 pragma Assert (Is_Child_Unit (Id));
4225 Set_Flag116 (Id, V);
4226 end Set_Is_Visible_Child_Unit;
4228 procedure Set_Is_Visible_Formal (Id : E; V : B := True) is
4230 Set_Flag206 (Id, V);
4231 end Set_Is_Visible_Formal;
4233 procedure Set_Is_VMS_Exception (Id : E; V : B := True) is
4235 pragma Assert (Ekind (Id) = E_Exception);
4236 Set_Flag133 (Id, V);
4237 end Set_Is_VMS_Exception;
4239 procedure Set_Is_Volatile (Id : E; V : B := True) is
4241 pragma Assert (Nkind (Id) in N_Entity);
4243 end Set_Is_Volatile;
4245 procedure Set_Itype_Printed (Id : E; V : B := True) is
4247 pragma Assert (Is_Itype (Id));
4248 Set_Flag202 (Id, V);
4249 end Set_Itype_Printed;
4251 procedure Set_Kill_Elaboration_Checks (Id : E; V : B := True) is
4254 end Set_Kill_Elaboration_Checks;
4256 procedure Set_Kill_Range_Checks (Id : E; V : B := True) is
4259 end Set_Kill_Range_Checks;
4261 procedure Set_Kill_Tag_Checks (Id : E; V : B := True) is
4264 end Set_Kill_Tag_Checks;
4266 procedure Set_Known_To_Have_Preelab_Init (Id : E; V : B := True) is
4268 pragma Assert (Is_Type (Id));
4269 Set_Flag207 (Id, V);
4270 end Set_Known_To_Have_Preelab_Init;
4272 procedure Set_Last_Assignment (Id : E; V : N) is
4274 pragma Assert (Ekind (Id) = E_Variable);
4276 end Set_Last_Assignment;
4278 procedure Set_Last_Entity (Id : E; V : E) is
4281 end Set_Last_Entity;
4283 procedure Set_Limited_View (Id : E; V : E) is
4285 pragma Assert (Ekind (Id) = E_Package);
4287 end Set_Limited_View;
4289 procedure Set_Lit_Indexes (Id : E; V : E) is
4291 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
4293 end Set_Lit_Indexes;
4295 procedure Set_Lit_Strings (Id : E; V : E) is
4297 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
4299 end Set_Lit_Strings;
4301 procedure Set_Low_Bound_Known (Id : E; V : B := True) is
4303 pragma Assert (Is_Formal (Id));
4304 Set_Flag205 (Id, V);
4305 end Set_Low_Bound_Known;
4307 procedure Set_Machine_Radix_10 (Id : E; V : B := True) is
4309 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
4311 end Set_Machine_Radix_10;
4313 procedure Set_Master_Id (Id : E; V : E) is
4315 pragma Assert (Is_Access_Type (Id));
4319 procedure Set_Materialize_Entity (Id : E; V : B := True) is
4321 Set_Flag168 (Id, V);
4322 end Set_Materialize_Entity;
4324 procedure Set_Mechanism (Id : E; V : M) is
4326 pragma Assert (Ekind (Id) = E_Function or else Is_Formal (Id));
4327 Set_Uint8 (Id, UI_From_Int (V));
4330 procedure Set_Modulus (Id : E; V : U) is
4332 pragma Assert (Ekind (Id) = E_Modular_Integer_Type);
4336 procedure Set_Must_Be_On_Byte_Boundary (Id : E; V : B := True) is
4338 pragma Assert (Is_Type (Id));
4339 Set_Flag183 (Id, V);
4340 end Set_Must_Be_On_Byte_Boundary;
4342 procedure Set_Must_Have_Preelab_Init (Id : E; V : B := True) is
4344 pragma Assert (Is_Type (Id));
4345 Set_Flag208 (Id, V);
4346 end Set_Must_Have_Preelab_Init;
4348 procedure Set_Needs_Debug_Info (Id : E; V : B := True) is
4350 Set_Flag147 (Id, V);
4351 end Set_Needs_Debug_Info;
4353 procedure Set_Needs_No_Actuals (Id : E; V : B := True) is
4356 (Is_Overloadable (Id)
4357 or else Ekind (Id) = E_Subprogram_Type
4358 or else Ekind (Id) = E_Entry_Family);
4360 end Set_Needs_No_Actuals;
4362 procedure Set_Never_Set_In_Source (Id : E; V : B := True) is
4364 Set_Flag115 (Id, V);
4365 end Set_Never_Set_In_Source;
4367 procedure Set_Next_Inlined_Subprogram (Id : E; V : E) is
4370 end Set_Next_Inlined_Subprogram;
4372 procedure Set_No_Pool_Assigned (Id : E; V : B := True) is
4374 pragma Assert (Is_Access_Type (Id) and then Base_Type (Id) = Id);
4375 Set_Flag131 (Id, V);
4376 end Set_No_Pool_Assigned;
4378 procedure Set_No_Return (Id : E; V : B := True) is
4382 or else Ekind (Id) = E_Procedure
4383 or else Ekind (Id) = E_Generic_Procedure);
4384 Set_Flag113 (Id, V);
4387 procedure Set_No_Strict_Aliasing (Id : E; V : B := True) is
4389 pragma Assert (Is_Access_Type (Id) and then Base_Type (Id) = Id);
4390 Set_Flag136 (Id, V);
4391 end Set_No_Strict_Aliasing;
4393 procedure Set_Non_Binary_Modulus (Id : E; V : B := True) is
4395 pragma Assert (Ekind (Id) = E_Modular_Integer_Type);
4397 end Set_Non_Binary_Modulus;
4399 procedure Set_Non_Limited_View (Id : E; V : E) is
4401 pragma Assert (Ekind (Id) in Incomplete_Kind);
4403 end Set_Non_Limited_View;
4405 procedure Set_Nonzero_Is_True (Id : E; V : B := True) is
4408 (Root_Type (Id) = Standard_Boolean
4409 and then Ekind (Id) = E_Enumeration_Type);
4410 Set_Flag162 (Id, V);
4411 end Set_Nonzero_Is_True;
4413 procedure Set_Normalized_First_Bit (Id : E; V : U) is
4416 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
4418 end Set_Normalized_First_Bit;
4420 procedure Set_Normalized_Position (Id : E; V : U) is
4423 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
4425 end Set_Normalized_Position;
4427 procedure Set_Normalized_Position_Max (Id : E; V : U) is
4430 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
4432 end Set_Normalized_Position_Max;
4434 procedure Set_Object_Ref (Id : E; V : E) is
4436 pragma Assert (Ekind (Id) = E_Protected_Body);
4440 procedure Set_Obsolescent_Warning (Id : E; V : N) is
4443 end Set_Obsolescent_Warning;
4445 procedure Set_Original_Array_Type (Id : E; V : E) is
4447 pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id));
4449 end Set_Original_Array_Type;
4451 procedure Set_Original_Record_Component (Id : E; V : E) is
4454 (Ekind (Id) = E_Void
4455 or else Ekind (Id) = E_Component
4456 or else Ekind (Id) = E_Discriminant);
4458 end Set_Original_Record_Component;
4460 procedure Set_Overridden_Operation (Id : E; V : E) is
4463 end Set_Overridden_Operation;
4465 procedure Set_Package_Instantiation (Id : E; V : N) is
4468 (Ekind (Id) = E_Void
4469 or else Ekind (Id) = E_Generic_Package
4470 or else Ekind (Id) = E_Package);
4472 end Set_Package_Instantiation;
4474 procedure Set_Packed_Array_Type (Id : E; V : E) is
4476 pragma Assert (Is_Array_Type (Id));
4478 end Set_Packed_Array_Type;
4480 procedure Set_Parent_Subtype (Id : E; V : E) is
4482 pragma Assert (Ekind (Id) = E_Record_Type);
4484 end Set_Parent_Subtype;
4486 procedure Set_Primitive_Operations (Id : E; V : L) is
4488 pragma Assert (Is_Tagged_Type (Id));
4489 Set_Elist15 (Id, V);
4490 end Set_Primitive_Operations;
4492 procedure Set_Prival (Id : E; V : E) is
4494 pragma Assert (Is_Protected_Private (Id));
4498 procedure Set_Privals_Chain (Id : E; V : L) is
4500 pragma Assert (Is_Overloadable (Id)
4501 or else Ekind (Id) = E_Entry_Family);
4502 Set_Elist23 (Id, V);
4503 end Set_Privals_Chain;
4505 procedure Set_Private_Dependents (Id : E; V : L) is
4507 pragma Assert (Is_Incomplete_Or_Private_Type (Id));
4508 Set_Elist18 (Id, V);
4509 end Set_Private_Dependents;
4511 procedure Set_Private_View (Id : E; V : N) is
4513 pragma Assert (Is_Private_Type (Id));
4515 end Set_Private_View;
4517 procedure Set_Protected_Body_Subprogram (Id : E; V : E) is
4519 pragma Assert (Is_Subprogram (Id) or else Is_Entry (Id));
4521 end Set_Protected_Body_Subprogram;
4523 procedure Set_Protected_Formal (Id : E; V : E) is
4525 pragma Assert (Is_Formal (Id));
4527 end Set_Protected_Formal;
4529 procedure Set_Protected_Operation (Id : E; V : N) is
4531 pragma Assert (Is_Protected_Private (Id));
4533 end Set_Protected_Operation;
4535 procedure Set_Reachable (Id : E; V : B := True) is
4540 procedure Set_Referenced (Id : E; V : B := True) is
4542 Set_Flag156 (Id, V);
4545 procedure Set_Referenced_As_LHS (Id : E; V : B := True) is
4548 end Set_Referenced_As_LHS;
4550 procedure Set_Referenced_Object (Id : E; V : N) is
4552 pragma Assert (Is_Type (Id));
4554 end Set_Referenced_Object;
4556 procedure Set_Register_Exception_Call (Id : E; V : N) is
4558 pragma Assert (Ekind (Id) = E_Exception);
4560 end Set_Register_Exception_Call;
4562 procedure Set_Related_Array_Object (Id : E; V : E) is
4564 pragma Assert (Is_Array_Type (Id));
4566 end Set_Related_Array_Object;
4568 procedure Set_Related_Instance (Id : E; V : E) is
4571 (Ekind (Id) = E_Package or else Ekind (Id) = E_Package_Body);
4573 end Set_Related_Instance;
4575 procedure Set_Related_Interface (Id : E; V : E) is
4577 pragma Assert (Ekind (Id) = E_Component);
4579 end Set_Related_Interface;
4581 procedure Set_Renamed_Entity (Id : E; V : N) is
4584 end Set_Renamed_Entity;
4586 procedure Set_Renamed_Object (Id : E; V : N) is
4589 end Set_Renamed_Object;
4591 procedure Set_Renaming_Map (Id : E; V : U) is
4594 end Set_Renaming_Map;
4596 procedure Set_Requires_Overriding (Id : E; V : B := True) is
4598 pragma Assert (Is_Overloadable (Id));
4599 Set_Flag213 (Id, V);
4600 end Set_Requires_Overriding;
4602 procedure Set_Return_Present (Id : E; V : B := True) is
4605 end Set_Return_Present;
4607 procedure Set_Return_Applies_To (Id : E; V : N) is
4610 end Set_Return_Applies_To;
4612 procedure Set_Returns_By_Ref (Id : E; V : B := True) is
4615 end Set_Returns_By_Ref;
4617 procedure Set_Reverse_Bit_Order (Id : E; V : B := True) is
4620 (Is_Record_Type (Id) and then Id = Base_Type (Id));
4621 Set_Flag164 (Id, V);
4622 end Set_Reverse_Bit_Order;
4624 procedure Set_RM_Size (Id : E; V : U) is
4626 pragma Assert (Is_Type (Id));
4630 procedure Set_Scalar_Range (Id : E; V : N) is
4633 end Set_Scalar_Range;
4635 procedure Set_Scale_Value (Id : E; V : U) is
4638 end Set_Scale_Value;
4640 procedure Set_Scope_Depth_Value (Id : E; V : U) is
4642 pragma Assert (not Is_Record_Type (Id));
4644 end Set_Scope_Depth_Value;
4646 procedure Set_Sec_Stack_Needed_For_Return (Id : E; V : B := True) is
4648 Set_Flag167 (Id, V);
4649 end Set_Sec_Stack_Needed_For_Return;
4651 procedure Set_Shadow_Entities (Id : E; V : S) is
4654 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
4656 end Set_Shadow_Entities;
4658 procedure Set_Shared_Var_Assign_Proc (Id : E; V : E) is
4660 pragma Assert (Ekind (Id) = E_Variable);
4662 end Set_Shared_Var_Assign_Proc;
4664 procedure Set_Shared_Var_Read_Proc (Id : E; V : E) is
4666 pragma Assert (Ekind (Id) = E_Variable);
4668 end Set_Shared_Var_Read_Proc;
4670 procedure Set_Size_Check_Code (Id : E; V : N) is
4672 pragma Assert (Ekind (Id) = E_Constant or else Ekind (Id) = E_Variable);
4674 end Set_Size_Check_Code;
4676 procedure Set_Size_Depends_On_Discriminant (Id : E; V : B := True) is
4678 Set_Flag177 (Id, V);
4679 end Set_Size_Depends_On_Discriminant;
4681 procedure Set_Size_Known_At_Compile_Time (Id : E; V : B := True) is
4684 end Set_Size_Known_At_Compile_Time;
4686 procedure Set_Small_Value (Id : E; V : R) is
4688 pragma Assert (Is_Fixed_Point_Type (Id));
4689 Set_Ureal21 (Id, V);
4690 end Set_Small_Value;
4692 procedure Set_Spec_Entity (Id : E; V : E) is
4694 pragma Assert (Ekind (Id) = E_Package_Body or else Is_Formal (Id));
4696 end Set_Spec_Entity;
4698 procedure Set_Storage_Size_Variable (Id : E; V : E) is
4700 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
4701 pragma Assert (Base_Type (Id) = Id);
4703 end Set_Storage_Size_Variable;
4705 procedure Set_Static_Elaboration_Desired (Id : E; V : B) is
4707 pragma Assert (Ekind (Id) = E_Package);
4709 end Set_Static_Elaboration_Desired;
4711 procedure Set_Static_Initialization (Id : E; V : N) is
4714 (Ekind (Id) = E_Procedure and then not Is_Dispatching_Operation (Id));
4716 end Set_Static_Initialization;
4718 procedure Set_Stored_Constraint (Id : E; V : L) is
4720 pragma Assert (Nkind (Id) in N_Entity);
4721 Set_Elist23 (Id, V);
4722 end Set_Stored_Constraint;
4724 procedure Set_Strict_Alignment (Id : E; V : B := True) is
4726 pragma Assert (Base_Type (Id) = Id);
4727 Set_Flag145 (Id, V);
4728 end Set_Strict_Alignment;
4730 procedure Set_String_Literal_Length (Id : E; V : U) is
4732 pragma Assert (Ekind (Id) = E_String_Literal_Subtype);
4734 end Set_String_Literal_Length;
4736 procedure Set_String_Literal_Low_Bound (Id : E; V : N) is
4738 pragma Assert (Ekind (Id) = E_String_Literal_Subtype);
4740 end Set_String_Literal_Low_Bound;
4742 procedure Set_Suppress_Elaboration_Warnings (Id : E; V : B := True) is
4744 Set_Flag148 (Id, V);
4745 end Set_Suppress_Elaboration_Warnings;
4747 procedure Set_Suppress_Init_Proc (Id : E; V : B := True) is
4749 pragma Assert (Id = Base_Type (Id));
4750 Set_Flag105 (Id, V);
4751 end Set_Suppress_Init_Proc;
4753 procedure Set_Suppress_Style_Checks (Id : E; V : B := True) is
4755 Set_Flag165 (Id, V);
4756 end Set_Suppress_Style_Checks;
4758 procedure Set_Suppress_Value_Tracking_On_Call (Id : E; V : B := True) is
4760 Set_Flag217 (Id, V);
4761 end Set_Suppress_Value_Tracking_On_Call;
4763 procedure Set_Task_Body_Procedure (Id : E; V : N) is
4765 pragma Assert (Ekind (Id) in Task_Kind);
4767 end Set_Task_Body_Procedure;
4769 procedure Set_Treat_As_Volatile (Id : E; V : B := True) is
4772 end Set_Treat_As_Volatile;
4774 procedure Set_Underlying_Full_View (Id : E; V : E) is
4776 pragma Assert (Ekind (Id) in Private_Kind);
4778 end Set_Underlying_Full_View;
4780 procedure Set_Universal_Aliasing (Id : E; V : B := True) is
4782 pragma Assert (Is_Type (Id) and then Base_Type (Id) = Id);
4783 Set_Flag216 (Id, V);
4784 end Set_Universal_Aliasing;
4786 procedure Set_Unset_Reference (Id : E; V : N) is
4789 end Set_Unset_Reference;
4791 procedure Set_Uses_Sec_Stack (Id : E; V : B := True) is
4794 end Set_Uses_Sec_Stack;
4796 procedure Set_Vax_Float (Id : E; V : B := True) is
4798 pragma Assert (Id = Base_Type (Id));
4799 Set_Flag151 (Id, V);
4802 procedure Set_Warnings_Off (Id : E; V : B := True) is
4805 end Set_Warnings_Off;
4807 procedure Set_Was_Hidden (Id : E; V : B := True) is
4809 Set_Flag196 (Id, V);
4812 procedure Set_Wrapped_Entity (Id : E; V : E) is
4814 pragma Assert (Ekind (Id) = E_Procedure
4815 and then Is_Primitive_Wrapper (Id));
4817 end Set_Wrapped_Entity;
4819 -----------------------------------
4820 -- Field Initialization Routines --
4821 -----------------------------------
4823 procedure Init_Alignment (Id : E) is
4825 Set_Uint14 (Id, Uint_0);
4828 procedure Init_Alignment (Id : E; V : Int) is
4830 Set_Uint14 (Id, UI_From_Int (V));
4833 procedure Init_Component_Bit_Offset (Id : E) is
4835 Set_Uint11 (Id, No_Uint);
4836 end Init_Component_Bit_Offset;
4838 procedure Init_Component_Bit_Offset (Id : E; V : Int) is
4840 Set_Uint11 (Id, UI_From_Int (V));
4841 end Init_Component_Bit_Offset;
4843 procedure Init_Component_Size (Id : E) is
4845 Set_Uint22 (Id, Uint_0);
4846 end Init_Component_Size;
4848 procedure Init_Component_Size (Id : E; V : Int) is
4850 Set_Uint22 (Id, UI_From_Int (V));
4851 end Init_Component_Size;
4853 procedure Init_Digits_Value (Id : E) is
4855 Set_Uint17 (Id, Uint_0);
4856 end Init_Digits_Value;
4858 procedure Init_Digits_Value (Id : E; V : Int) is
4860 Set_Uint17 (Id, UI_From_Int (V));
4861 end Init_Digits_Value;
4863 procedure Init_Esize (Id : E) is
4865 Set_Uint12 (Id, Uint_0);
4868 procedure Init_Esize (Id : E; V : Int) is
4870 Set_Uint12 (Id, UI_From_Int (V));
4873 procedure Init_Normalized_First_Bit (Id : E) is
4875 Set_Uint8 (Id, No_Uint);
4876 end Init_Normalized_First_Bit;
4878 procedure Init_Normalized_First_Bit (Id : E; V : Int) is
4880 Set_Uint8 (Id, UI_From_Int (V));
4881 end Init_Normalized_First_Bit;
4883 procedure Init_Normalized_Position (Id : E) is
4885 Set_Uint14 (Id, No_Uint);
4886 end Init_Normalized_Position;
4888 procedure Init_Normalized_Position (Id : E; V : Int) is
4890 Set_Uint14 (Id, UI_From_Int (V));
4891 end Init_Normalized_Position;
4893 procedure Init_Normalized_Position_Max (Id : E) is
4895 Set_Uint10 (Id, No_Uint);
4896 end Init_Normalized_Position_Max;
4898 procedure Init_Normalized_Position_Max (Id : E; V : Int) is
4900 Set_Uint10 (Id, UI_From_Int (V));
4901 end Init_Normalized_Position_Max;
4903 procedure Init_RM_Size (Id : E) is
4905 Set_Uint13 (Id, Uint_0);
4908 procedure Init_RM_Size (Id : E; V : Int) is
4910 Set_Uint13 (Id, UI_From_Int (V));
4913 -----------------------------
4914 -- Init_Component_Location --
4915 -----------------------------
4917 procedure Init_Component_Location (Id : E) is
4919 Set_Uint8 (Id, No_Uint); -- Normalized_First_Bit
4920 Set_Uint10 (Id, No_Uint); -- Normalized_Position_Max
4921 Set_Uint11 (Id, No_Uint); -- Component_First_Bit
4922 Set_Uint12 (Id, Uint_0); -- Esize
4923 Set_Uint14 (Id, No_Uint); -- Normalized_Position
4924 end Init_Component_Location;
4930 procedure Init_Size (Id : E; V : Int) is
4932 Set_Uint12 (Id, UI_From_Int (V)); -- Esize
4933 Set_Uint13 (Id, UI_From_Int (V)); -- RM_Size
4936 ---------------------
4937 -- Init_Size_Align --
4938 ---------------------
4940 procedure Init_Size_Align (Id : E) is
4942 Set_Uint12 (Id, Uint_0); -- Esize
4943 Set_Uint13 (Id, Uint_0); -- RM_Size
4944 Set_Uint14 (Id, Uint_0); -- Alignment
4945 end Init_Size_Align;
4947 ----------------------------------------------
4948 -- Type Representation Attribute Predicates --
4949 ----------------------------------------------
4951 function Known_Alignment (E : Entity_Id) return B is
4953 return Uint14 (E) /= Uint_0
4954 and then Uint14 (E) /= No_Uint;
4955 end Known_Alignment;
4957 function Known_Component_Bit_Offset (E : Entity_Id) return B is
4959 return Uint11 (E) /= No_Uint;
4960 end Known_Component_Bit_Offset;
4962 function Known_Component_Size (E : Entity_Id) return B is
4964 return Uint22 (Base_Type (E)) /= Uint_0
4965 and then Uint22 (Base_Type (E)) /= No_Uint;
4966 end Known_Component_Size;
4968 function Known_Esize (E : Entity_Id) return B is
4970 return Uint12 (E) /= Uint_0
4971 and then Uint12 (E) /= No_Uint;
4974 function Known_Normalized_First_Bit (E : Entity_Id) return B is
4976 return Uint8 (E) /= No_Uint;
4977 end Known_Normalized_First_Bit;
4979 function Known_Normalized_Position (E : Entity_Id) return B is
4981 return Uint14 (E) /= No_Uint;
4982 end Known_Normalized_Position;
4984 function Known_Normalized_Position_Max (E : Entity_Id) return B is
4986 return Uint10 (E) /= No_Uint;
4987 end Known_Normalized_Position_Max;
4989 function Known_RM_Size (E : Entity_Id) return B is
4991 return Uint13 (E) /= No_Uint
4992 and then (Uint13 (E) /= Uint_0
4993 or else Is_Discrete_Type (E)
4994 or else Is_Fixed_Point_Type (E));
4997 function Known_Static_Component_Bit_Offset (E : Entity_Id) return B is
4999 return Uint11 (E) /= No_Uint
5000 and then Uint11 (E) >= Uint_0;
5001 end Known_Static_Component_Bit_Offset;
5003 function Known_Static_Component_Size (E : Entity_Id) return B is
5005 return Uint22 (Base_Type (E)) > Uint_0;
5006 end Known_Static_Component_Size;
5008 function Known_Static_Esize (E : Entity_Id) return B is
5010 return Uint12 (E) > Uint_0;
5011 end Known_Static_Esize;
5013 function Known_Static_Normalized_First_Bit (E : Entity_Id) return B is
5015 return Uint8 (E) /= No_Uint
5016 and then Uint8 (E) >= Uint_0;
5017 end Known_Static_Normalized_First_Bit;
5019 function Known_Static_Normalized_Position (E : Entity_Id) return B is
5021 return Uint14 (E) /= No_Uint
5022 and then Uint14 (E) >= Uint_0;
5023 end Known_Static_Normalized_Position;
5025 function Known_Static_Normalized_Position_Max (E : Entity_Id) return B is
5027 return Uint10 (E) /= No_Uint
5028 and then Uint10 (E) >= Uint_0;
5029 end Known_Static_Normalized_Position_Max;
5031 function Known_Static_RM_Size (E : Entity_Id) return B is
5033 return Uint13 (E) > Uint_0
5034 or else Is_Discrete_Type (E)
5035 or else Is_Fixed_Point_Type (E);
5036 end Known_Static_RM_Size;
5038 function Unknown_Alignment (E : Entity_Id) return B is
5040 return Uint14 (E) = Uint_0
5041 or else Uint14 (E) = No_Uint;
5042 end Unknown_Alignment;
5044 function Unknown_Component_Bit_Offset (E : Entity_Id) return B is
5046 return Uint11 (E) = No_Uint;
5047 end Unknown_Component_Bit_Offset;
5049 function Unknown_Component_Size (E : Entity_Id) return B is
5051 return Uint22 (Base_Type (E)) = Uint_0
5053 Uint22 (Base_Type (E)) = No_Uint;
5054 end Unknown_Component_Size;
5056 function Unknown_Esize (E : Entity_Id) return B is
5058 return Uint12 (E) = No_Uint
5060 Uint12 (E) = Uint_0;
5063 function Unknown_Normalized_First_Bit (E : Entity_Id) return B is
5065 return Uint8 (E) = No_Uint;
5066 end Unknown_Normalized_First_Bit;
5068 function Unknown_Normalized_Position (E : Entity_Id) return B is
5070 return Uint14 (E) = No_Uint;
5071 end Unknown_Normalized_Position;
5073 function Unknown_Normalized_Position_Max (E : Entity_Id) return B is
5075 return Uint10 (E) = No_Uint;
5076 end Unknown_Normalized_Position_Max;
5078 function Unknown_RM_Size (E : Entity_Id) return B is
5080 return (Uint13 (E) = Uint_0
5081 and then not Is_Discrete_Type (E)
5082 and then not Is_Fixed_Point_Type (E))
5083 or else Uint13 (E) = No_Uint;
5084 end Unknown_RM_Size;
5086 --------------------
5087 -- Address_Clause --
5088 --------------------
5090 function Address_Clause (Id : E) return N is
5092 return Rep_Clause (Id, Name_Address);
5095 ----------------------
5096 -- Alignment_Clause --
5097 ----------------------
5099 function Alignment_Clause (Id : E) return N is
5101 return Rep_Clause (Id, Name_Alignment);
5102 end Alignment_Clause;
5104 ----------------------
5105 -- Ancestor_Subtype --
5106 ----------------------
5108 function Ancestor_Subtype (Id : E) return E is
5110 -- If this is first subtype, or is a base type, then there is no
5111 -- ancestor subtype, so we return Empty to indicate this fact.
5113 if Is_First_Subtype (Id) or else Id = Base_Type (Id) then
5118 D : constant Node_Id := Declaration_Node (Id);
5121 -- If we have a subtype declaration, get the ancestor subtype
5123 if Nkind (D) = N_Subtype_Declaration then
5124 if Nkind (Subtype_Indication (D)) = N_Subtype_Indication then
5125 return Entity (Subtype_Mark (Subtype_Indication (D)));
5127 return Entity (Subtype_Indication (D));
5130 -- If not, then no subtype indication is available
5136 end Ancestor_Subtype;
5142 procedure Append_Entity (Id : Entity_Id; V : Entity_Id) is
5144 if Last_Entity (V) = Empty then
5145 Set_First_Entity (V, Id);
5147 Set_Next_Entity (Last_Entity (V), Id);
5150 Set_Next_Entity (Id, Empty);
5152 Set_Last_Entity (V, Id);
5155 --------------------
5156 -- Available_View --
5157 --------------------
5159 function Available_View (Id : E) return E is
5161 if Is_Incomplete_Type (Id)
5162 and then Present (Non_Limited_View (Id))
5164 return Non_Limited_View (Id);
5166 elsif Is_Class_Wide_Type (Id)
5167 and then Is_Incomplete_Type (Etype (Id))
5168 and then Present (Non_Limited_View (Etype (Id)))
5170 return Class_Wide_Type (Non_Limited_View (Etype (Id)));
5181 function Base_Type (Id : E) return E is
5184 when E_Enumeration_Subtype |
5186 E_Signed_Integer_Subtype |
5187 E_Modular_Integer_Subtype |
5188 E_Floating_Point_Subtype |
5189 E_Ordinary_Fixed_Point_Subtype |
5190 E_Decimal_Fixed_Point_Subtype |
5195 E_Record_Subtype_With_Private |
5196 E_Limited_Private_Subtype |
5198 E_Protected_Subtype |
5200 E_String_Literal_Subtype |
5201 E_Class_Wide_Subtype =>
5209 -------------------------
5210 -- Component_Alignment --
5211 -------------------------
5213 -- Component Alignment is encoded using two flags, Flag128/129 as
5214 -- follows. Note that both flags False = Align_Default, so that the
5215 -- default initialization of flags to False initializes component
5216 -- alignment to the default value as required.
5218 -- Flag128 Flag129 Value
5219 -- ------- ------- -----
5220 -- False False Calign_Default
5221 -- False True Calign_Component_Size
5222 -- True False Calign_Component_Size_4
5223 -- True True Calign_Storage_Unit
5225 function Component_Alignment (Id : E) return C is
5226 BT : constant Node_Id := Base_Type (Id);
5229 pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id));
5231 if Flag128 (BT) then
5232 if Flag129 (BT) then
5233 return Calign_Storage_Unit;
5235 return Calign_Component_Size_4;
5239 if Flag129 (BT) then
5240 return Calign_Component_Size;
5242 return Calign_Default;
5245 end Component_Alignment;
5247 --------------------
5248 -- Constant_Value --
5249 --------------------
5251 function Constant_Value (Id : E) return N is
5252 D : constant Node_Id := Declaration_Node (Id);
5256 -- If we have no declaration node, then return no constant value.
5257 -- Not clear how this can happen, but it does sometimes ???
5258 -- To investigate, remove this check and compile discrim_po.adb.
5263 -- Normal case where a declaration node is present
5265 elsif Nkind (D) = N_Object_Renaming_Declaration then
5266 return Renamed_Object (Id);
5268 -- If this is a component declaration whose entity is constant, it
5269 -- is a prival within a protected function. It does not have
5270 -- a constant value.
5272 elsif Nkind (D) = N_Component_Declaration then
5275 -- If there is an expression, return it
5277 elsif Present (Expression (D)) then
5278 return (Expression (D));
5280 -- For a constant, see if we have a full view
5282 elsif Ekind (Id) = E_Constant
5283 and then Present (Full_View (Id))
5285 Full_D := Parent (Full_View (Id));
5287 -- The full view may have been rewritten as an object renaming
5289 if Nkind (Full_D) = N_Object_Renaming_Declaration then
5290 return Name (Full_D);
5292 return Expression (Full_D);
5295 -- Otherwise we have no expression to return
5302 ----------------------
5303 -- Declaration_Node --
5304 ----------------------
5306 function Declaration_Node (Id : E) return N is
5310 if Ekind (Id) = E_Incomplete_Type
5311 and then Present (Full_View (Id))
5313 P := Parent (Full_View (Id));
5319 if Nkind (P) /= N_Selected_Component
5320 and then Nkind (P) /= N_Expanded_Name
5322 not (Nkind (P) = N_Defining_Program_Unit_Name
5323 and then Is_Child_Unit (Id))
5331 end Declaration_Node;
5333 ---------------------
5334 -- Designated_Type --
5335 ---------------------
5337 function Designated_Type (Id : E) return E is
5341 Desig_Type := Directly_Designated_Type (Id);
5343 if Ekind (Desig_Type) = E_Incomplete_Type
5344 and then Present (Full_View (Desig_Type))
5346 return Full_View (Desig_Type);
5348 elsif Is_Class_Wide_Type (Desig_Type)
5349 and then Ekind (Etype (Desig_Type)) = E_Incomplete_Type
5350 and then Present (Full_View (Etype (Desig_Type)))
5351 and then Present (Class_Wide_Type (Full_View (Etype (Desig_Type))))
5353 return Class_Wide_Type (Full_View (Etype (Desig_Type)));
5358 end Designated_Type;
5360 -----------------------------
5361 -- Enclosing_Dynamic_Scope --
5362 -----------------------------
5364 function Enclosing_Dynamic_Scope (Id : E) return E is
5368 -- The following test is an error defense against some syntax
5369 -- errors that can leave scopes very messed up.
5371 if Id = Standard_Standard then
5375 -- Normal case, search enclosing scopes
5378 while S /= Standard_Standard
5379 and then not Is_Dynamic_Scope (S)
5385 end Enclosing_Dynamic_Scope;
5387 ----------------------
5388 -- Entry_Index_Type --
5389 ----------------------
5391 function Entry_Index_Type (Id : E) return N is
5393 pragma Assert (Ekind (Id) = E_Entry_Family);
5394 return Etype (Discrete_Subtype_Definition (Parent (Id)));
5395 end Entry_Index_Type;
5397 ---------------------
5398 -- First_Component --
5399 ---------------------
5401 function First_Component (Id : E) return E is
5406 (Is_Record_Type (Id) or else Is_Incomplete_Or_Private_Type (Id));
5408 Comp_Id := First_Entity (Id);
5409 while Present (Comp_Id) loop
5410 exit when Ekind (Comp_Id) = E_Component;
5411 Comp_Id := Next_Entity (Comp_Id);
5415 end First_Component;
5417 -------------------------------------
5418 -- First_Component_Or_Discriminant --
5419 -------------------------------------
5421 function First_Component_Or_Discriminant (Id : E) return E is
5426 (Is_Record_Type (Id) or else Is_Incomplete_Or_Private_Type (Id));
5428 Comp_Id := First_Entity (Id);
5429 while Present (Comp_Id) loop
5430 exit when Ekind (Comp_Id) = E_Component
5432 Ekind (Comp_Id) = E_Discriminant;
5433 Comp_Id := Next_Entity (Comp_Id);
5437 end First_Component_Or_Discriminant;
5439 ------------------------
5440 -- First_Discriminant --
5441 ------------------------
5443 function First_Discriminant (Id : E) return E is
5448 (Has_Discriminants (Id)
5449 or else Has_Unknown_Discriminants (Id));
5451 Ent := First_Entity (Id);
5453 -- The discriminants are not necessarily contiguous, because access
5454 -- discriminants will generate itypes. They are not the first entities
5455 -- either, because tag and controller record must be ahead of them.
5457 if Chars (Ent) = Name_uTag then
5458 Ent := Next_Entity (Ent);
5461 if Chars (Ent) = Name_uController then
5462 Ent := Next_Entity (Ent);
5465 -- Skip all hidden stored discriminants if any
5467 while Present (Ent) loop
5468 exit when Ekind (Ent) = E_Discriminant
5469 and then not Is_Completely_Hidden (Ent);
5471 Ent := Next_Entity (Ent);
5474 pragma Assert (Ekind (Ent) = E_Discriminant);
5477 end First_Discriminant;
5483 function First_Formal (Id : E) return E is
5488 (Is_Overloadable (Id)
5489 or else Ekind (Id) = E_Entry_Family
5490 or else Ekind (Id) = E_Subprogram_Body
5491 or else Ekind (Id) = E_Subprogram_Type);
5493 if Ekind (Id) = E_Enumeration_Literal then
5497 Formal := First_Entity (Id);
5499 if Present (Formal) and then Is_Formal (Formal) then
5507 ------------------------------
5508 -- First_Formal_With_Extras --
5509 ------------------------------
5511 function First_Formal_With_Extras (Id : E) return E is
5516 (Is_Overloadable (Id)
5517 or else Ekind (Id) = E_Entry_Family
5518 or else Ekind (Id) = E_Subprogram_Body
5519 or else Ekind (Id) = E_Subprogram_Type);
5521 if Ekind (Id) = E_Enumeration_Literal then
5525 Formal := First_Entity (Id);
5527 if Present (Formal) and then Is_Formal (Formal) then
5530 return Extra_Formals (Id); -- Empty if no extra formals
5533 end First_Formal_With_Extras;
5535 -------------------------------
5536 -- First_Stored_Discriminant --
5537 -------------------------------
5539 function First_Stored_Discriminant (Id : E) return E is
5542 function Has_Completely_Hidden_Discriminant (Id : E) return Boolean;
5543 -- Scans the Discriminants to see whether any are Completely_Hidden
5544 -- (the mechanism for describing non-specified stored discriminants)
5546 ----------------------------------------
5547 -- Has_Completely_Hidden_Discriminant --
5548 ----------------------------------------
5550 function Has_Completely_Hidden_Discriminant (Id : E) return Boolean is
5551 Ent : Entity_Id := Id;
5554 pragma Assert (Ekind (Id) = E_Discriminant);
5556 while Present (Ent) and then Ekind (Ent) = E_Discriminant loop
5557 if Is_Completely_Hidden (Ent) then
5561 Ent := Next_Entity (Ent);
5565 end Has_Completely_Hidden_Discriminant;
5567 -- Start of processing for First_Stored_Discriminant
5571 (Has_Discriminants (Id)
5572 or else Has_Unknown_Discriminants (Id));
5574 Ent := First_Entity (Id);
5576 if Chars (Ent) = Name_uTag then
5577 Ent := Next_Entity (Ent);
5580 if Chars (Ent) = Name_uController then
5581 Ent := Next_Entity (Ent);
5584 if Has_Completely_Hidden_Discriminant (Ent) then
5586 while Present (Ent) loop
5587 exit when Is_Completely_Hidden (Ent);
5588 Ent := Next_Entity (Ent);
5593 pragma Assert (Ekind (Ent) = E_Discriminant);
5596 end First_Stored_Discriminant;
5602 function First_Subtype (Id : E) return E is
5603 B : constant Entity_Id := Base_Type (Id);
5604 F : constant Node_Id := Freeze_Node (B);
5608 -- If the base type has no freeze node, it is a type in standard,
5609 -- and always acts as its own first subtype unless it is one of
5610 -- the predefined integer types. If the type is formal, it is also
5611 -- a first subtype, and its base type has no freeze node. On the other
5612 -- hand, a subtype of a generic formal is not its own first_subtype.
5613 -- Its base type, if anonymous, is attached to the formal type decl.
5614 -- from which the first subtype is obtained.
5618 if B = Base_Type (Standard_Integer) then
5619 return Standard_Integer;
5621 elsif B = Base_Type (Standard_Long_Integer) then
5622 return Standard_Long_Integer;
5624 elsif B = Base_Type (Standard_Short_Short_Integer) then
5625 return Standard_Short_Short_Integer;
5627 elsif B = Base_Type (Standard_Short_Integer) then
5628 return Standard_Short_Integer;
5630 elsif B = Base_Type (Standard_Long_Long_Integer) then
5631 return Standard_Long_Long_Integer;
5633 elsif Is_Generic_Type (Id) then
5634 if Present (Parent (B)) then
5635 return Defining_Identifier (Parent (B));
5637 return Defining_Identifier (Associated_Node_For_Itype (B));
5644 -- Otherwise we check the freeze node, if it has a First_Subtype_Link
5645 -- then we use that link, otherwise (happens with some Itypes), we use
5646 -- the base type itself.
5649 Ent := First_Subtype_Link (F);
5651 if Present (Ent) then
5659 -------------------------------------
5660 -- Get_Attribute_Definition_Clause --
5661 -------------------------------------
5663 function Get_Attribute_Definition_Clause
5665 Id : Attribute_Id) return Node_Id
5670 N := First_Rep_Item (E);
5671 while Present (N) loop
5672 if Nkind (N) = N_Attribute_Definition_Clause
5673 and then Get_Attribute_Id (Chars (N)) = Id
5682 end Get_Attribute_Definition_Clause;
5684 --------------------
5685 -- Get_Rep_Pragma --
5686 --------------------
5688 function Get_Rep_Pragma (E : Entity_Id; Nam : Name_Id) return Node_Id is
5692 N := First_Rep_Item (E);
5693 while Present (N) loop
5694 if Nkind (N) = N_Pragma and then Chars (N) = Nam then
5704 ------------------------
5705 -- Has_Attach_Handler --
5706 ------------------------
5708 function Has_Attach_Handler (Id : E) return B is
5712 pragma Assert (Is_Protected_Type (Id));
5714 Ritem := First_Rep_Item (Id);
5715 while Present (Ritem) loop
5716 if Nkind (Ritem) = N_Pragma
5717 and then Chars (Ritem) = Name_Attach_Handler
5721 Ritem := Next_Rep_Item (Ritem);
5726 end Has_Attach_Handler;
5728 -------------------------------------
5729 -- Has_Attribute_Definition_Clause --
5730 -------------------------------------
5732 function Has_Attribute_Definition_Clause
5734 Id : Attribute_Id) return Boolean
5737 return Present (Get_Attribute_Definition_Clause (E, Id));
5738 end Has_Attribute_Definition_Clause;
5744 function Has_Entries (Id : E) return B is
5745 Result : Boolean := False;
5749 pragma Assert (Is_Concurrent_Type (Id));
5751 Ent := First_Entity (Id);
5752 while Present (Ent) loop
5753 if Is_Entry (Ent) then
5758 Ent := Next_Entity (Ent);
5764 ----------------------------
5765 -- Has_Foreign_Convention --
5766 ----------------------------
5768 function Has_Foreign_Convention (Id : E) return B is
5770 return Convention (Id) >= Foreign_Convention'First;
5771 end Has_Foreign_Convention;
5773 ---------------------------
5774 -- Has_Interrupt_Handler --
5775 ---------------------------
5777 function Has_Interrupt_Handler (Id : E) return B is
5781 pragma Assert (Is_Protected_Type (Id));
5783 Ritem := First_Rep_Item (Id);
5784 while Present (Ritem) loop
5785 if Nkind (Ritem) = N_Pragma
5786 and then Chars (Ritem) = Name_Interrupt_Handler
5790 Ritem := Next_Rep_Item (Ritem);
5795 end Has_Interrupt_Handler;
5797 --------------------------
5798 -- Has_Private_Ancestor --
5799 --------------------------
5801 function Has_Private_Ancestor (Id : E) return B is
5802 R : constant Entity_Id := Root_Type (Id);
5803 T1 : Entity_Id := Id;
5807 if Is_Private_Type (T1) then
5817 end Has_Private_Ancestor;
5819 --------------------
5820 -- Has_Rep_Pragma --
5821 --------------------
5823 function Has_Rep_Pragma (E : Entity_Id; Nam : Name_Id) return Boolean is
5825 return Present (Get_Rep_Pragma (E, Nam));
5828 ------------------------------
5829 -- Implementation_Base_Type --
5830 ------------------------------
5832 function Implementation_Base_Type (Id : E) return E is
5837 Bastyp := Base_Type (Id);
5839 if Is_Incomplete_Or_Private_Type (Bastyp) then
5840 Imptyp := Underlying_Type (Bastyp);
5842 -- If we have an implementation type, then just return it,
5843 -- otherwise we return the Base_Type anyway. This can only
5844 -- happen in error situations and should avoid some error bombs.
5846 if Present (Imptyp) then
5847 return Base_Type (Imptyp);
5855 end Implementation_Base_Type;
5857 -----------------------
5858 -- Is_Always_Inlined --
5859 -----------------------
5861 function Is_Always_Inlined (Id : E) return B is
5865 Item := First_Rep_Item (Id);
5866 while Present (Item) loop
5867 if Nkind (Item) = N_Pragma
5868 and then Get_Pragma_Id (Chars (Item)) = Pragma_Inline_Always
5873 Next_Rep_Item (Item);
5877 end Is_Always_Inlined;
5879 ---------------------
5880 -- Is_Boolean_Type --
5881 ---------------------
5883 function Is_Boolean_Type (Id : E) return B is
5885 return Root_Type (Id) = Standard_Boolean;
5886 end Is_Boolean_Type;
5888 ---------------------
5889 -- Is_By_Copy_Type --
5890 ---------------------
5892 function Is_By_Copy_Type (Id : E) return B is
5894 -- If Id is a private type whose full declaration has not been seen,
5895 -- we assume for now that it is not a By_Copy type. Clearly this
5896 -- attribute should not be used before the type is frozen, but it is
5897 -- needed to build the associated record of a protected type. Another
5898 -- place where some lookahead for a full view is needed ???
5901 Is_Elementary_Type (Id)
5902 or else (Is_Private_Type (Id)
5903 and then Present (Underlying_Type (Id))
5904 and then Is_Elementary_Type (Underlying_Type (Id)));
5905 end Is_By_Copy_Type;
5907 --------------------------
5908 -- Is_By_Reference_Type --
5909 --------------------------
5911 -- This function knows too much semantics, it should be in sem_util ???
5913 function Is_By_Reference_Type (Id : E) return B is
5914 Btype : constant Entity_Id := Base_Type (Id);
5917 if Error_Posted (Id)
5918 or else Error_Posted (Btype)
5922 elsif Is_Private_Type (Btype) then
5924 Utyp : constant Entity_Id := Underlying_Type (Btype);
5929 return Is_By_Reference_Type (Utyp);
5933 elsif Is_Incomplete_Type (Btype) then
5935 Ftyp : constant Entity_Id := Full_View (Btype);
5940 return Is_By_Reference_Type (Ftyp);
5944 elsif Is_Concurrent_Type (Btype) then
5947 elsif Is_Record_Type (Btype) then
5948 if Is_Limited_Record (Btype)
5949 or else Is_Tagged_Type (Btype)
5950 or else Is_Volatile (Btype)
5959 C := First_Component (Btype);
5960 while Present (C) loop
5961 if Is_By_Reference_Type (Etype (C))
5962 or else Is_Volatile (Etype (C))
5967 C := Next_Component (C);
5974 elsif Is_Array_Type (Btype) then
5977 or else Is_By_Reference_Type (Component_Type (Btype))
5978 or else Is_Volatile (Component_Type (Btype))
5979 or else Has_Volatile_Components (Btype);
5984 end Is_By_Reference_Type;
5986 ---------------------
5987 -- Is_Derived_Type --
5988 ---------------------
5990 function Is_Derived_Type (Id : E) return B is
5995 and then Base_Type (Id) /= Root_Type (Id)
5996 and then not Is_Generic_Type (Id)
5997 and then not Is_Class_Wide_Type (Id)
5999 if not Is_Numeric_Type (Root_Type (Id)) then
6003 Par := Parent (First_Subtype (Id));
6005 return Present (Par)
6006 and then Nkind (Par) = N_Full_Type_Declaration
6007 and then Nkind (Type_Definition (Par))
6008 = N_Derived_Type_Definition;
6014 end Is_Derived_Type;
6016 ----------------------
6017 -- Is_Dynamic_Scope --
6018 ----------------------
6020 function Is_Dynamic_Scope (Id : E) return B is
6023 Ekind (Id) = E_Block
6025 Ekind (Id) = E_Function
6027 Ekind (Id) = E_Procedure
6029 Ekind (Id) = E_Subprogram_Body
6031 Ekind (Id) = E_Task_Type
6033 Ekind (Id) = E_Entry
6035 Ekind (Id) = E_Entry_Family
6037 Ekind (Id) = E_Return_Statement;
6038 end Is_Dynamic_Scope;
6040 --------------------
6041 -- Is_Entity_Name --
6042 --------------------
6044 function Is_Entity_Name (N : Node_Id) return Boolean is
6045 Kind : constant Node_Kind := Nkind (N);
6048 -- Identifiers, operator symbols, expanded names are entity names
6050 return Kind = N_Identifier
6051 or else Kind = N_Operator_Symbol
6052 or else Kind = N_Expanded_Name
6054 -- Attribute references are entity names if they refer to an entity.
6055 -- Note that we don't do this by testing for the presence of the
6056 -- Entity field in the N_Attribute_Reference node, since it may not
6057 -- have been set yet.
6059 or else (Kind = N_Attribute_Reference
6060 and then Is_Entity_Attribute_Name (Attribute_Name (N)));
6063 ---------------------------
6064 -- Is_Indefinite_Subtype --
6065 ---------------------------
6067 function Is_Indefinite_Subtype (Id : Entity_Id) return B is
6068 K : constant Entity_Kind := Ekind (Id);
6071 if Is_Constrained (Id) then
6074 elsif K in Array_Kind
6075 or else K in Class_Wide_Kind
6076 or else Has_Unknown_Discriminants (Id)
6080 -- Known discriminants: indefinite if there are no default values
6082 elsif K in Record_Kind
6083 or else Is_Incomplete_Or_Private_Type (Id)
6084 or else Is_Concurrent_Type (Id)
6086 return (Has_Discriminants (Id)
6087 and then No (Discriminant_Default_Value (First_Discriminant (Id))));
6092 end Is_Indefinite_Subtype;
6094 ---------------------
6095 -- Is_Limited_Type --
6096 ---------------------
6098 function Is_Limited_Type (Id : E) return B is
6099 Btype : constant E := Base_Type (Id);
6100 Rtype : constant E := Root_Type (Btype);
6103 if not Is_Type (Id) then
6106 elsif Ekind (Btype) = E_Limited_Private_Type
6107 or else Is_Limited_Composite (Btype)
6111 elsif Is_Concurrent_Type (Btype) then
6114 -- The Is_Limited_Record flag normally indicates that the type is
6115 -- limited. The exception is that a type does not inherit limitedness
6116 -- from its interface ancestor. So the type may be derived from a
6117 -- limited interface, but is not limited.
6119 elsif Is_Limited_Record (Id)
6120 and then not Is_Interface (Id)
6124 -- Otherwise we will look around to see if there is some other reason
6125 -- for it to be limited, except that if an error was posted on the
6126 -- entity, then just assume it is non-limited, because it can cause
6127 -- trouble to recurse into a murky erroneous entity!
6129 elsif Error_Posted (Id) then
6132 elsif Is_Record_Type (Btype) then
6134 if Is_Limited_Interface (Id) then
6137 -- AI-419: limitedness is not inherited from a limited interface
6139 elsif Is_Limited_Record (Rtype) then
6140 return not Is_Interface (Rtype)
6141 or else Is_Protected_Interface (Rtype)
6142 or else Is_Synchronized_Interface (Rtype)
6143 or else Is_Task_Interface (Rtype);
6145 elsif Is_Class_Wide_Type (Btype) then
6146 return Is_Limited_Type (Rtype);
6153 C := First_Component (Btype);
6154 while Present (C) loop
6155 if Is_Limited_Type (Etype (C)) then
6159 C := Next_Component (C);
6166 elsif Is_Array_Type (Btype) then
6167 return Is_Limited_Type (Component_Type (Btype));
6172 end Is_Limited_Type;
6174 -----------------------------------
6175 -- Is_Package_Or_Generic_Package --
6176 -----------------------------------
6178 function Is_Package_Or_Generic_Package (Id : E) return B is
6181 Ekind (Id) = E_Package
6183 Ekind (Id) = E_Generic_Package;
6184 end Is_Package_Or_Generic_Package;
6186 --------------------------
6187 -- Is_Protected_Private --
6188 --------------------------
6190 function Is_Protected_Private (Id : E) return B is
6192 pragma Assert (Ekind (Id) = E_Component);
6193 return Is_Protected_Type (Scope (Id));
6194 end Is_Protected_Private;
6196 ------------------------------
6197 -- Is_Protected_Record_Type --
6198 ------------------------------
6200 function Is_Protected_Record_Type (Id : E) return B is
6203 Is_Concurrent_Record_Type (Id)
6204 and then Is_Protected_Type (Corresponding_Concurrent_Type (Id));
6205 end Is_Protected_Record_Type;
6207 --------------------------------
6208 -- Is_Inherently_Limited_Type --
6209 --------------------------------
6211 function Is_Inherently_Limited_Type (Id : E) return B is
6212 Btype : constant Entity_Id := Base_Type (Id);
6215 if Is_Private_Type (Btype) then
6217 Utyp : constant Entity_Id := Underlying_Type (Btype);
6222 return Is_Inherently_Limited_Type (Utyp);
6226 elsif Is_Concurrent_Type (Btype) then
6229 elsif Is_Record_Type (Btype) then
6230 if Is_Limited_Record (Btype) then
6231 return not Is_Interface (Btype)
6232 or else Is_Protected_Interface (Btype)
6233 or else Is_Synchronized_Interface (Btype)
6234 or else Is_Task_Interface (Btype);
6236 elsif Is_Class_Wide_Type (Btype) then
6237 return Is_Inherently_Limited_Type (Root_Type (Btype));
6244 C := First_Component (Btype);
6245 while Present (C) loop
6246 if Is_Inherently_Limited_Type (Etype (C)) then
6250 C := Next_Component (C);
6257 elsif Is_Array_Type (Btype) then
6258 return Is_Inherently_Limited_Type (Component_Type (Btype));
6263 end Is_Inherently_Limited_Type;
6265 --------------------
6266 -- Is_String_Type --
6267 --------------------
6269 function Is_String_Type (Id : E) return B is
6271 return Ekind (Id) in String_Kind
6272 or else (Is_Array_Type (Id)
6273 and then Number_Dimensions (Id) = 1
6274 and then Is_Character_Type (Component_Type (Id)));
6277 -------------------------
6278 -- Is_Task_Record_Type --
6279 -------------------------
6281 function Is_Task_Record_Type (Id : E) return B is
6284 Is_Concurrent_Record_Type (Id)
6285 and then Is_Task_Type (Corresponding_Concurrent_Type (Id));
6286 end Is_Task_Record_Type;
6288 ------------------------
6289 -- Is_Wrapper_Package --
6290 ------------------------
6292 function Is_Wrapper_Package (Id : E) return B is
6294 return (Ekind (Id) = E_Package
6295 and then Present (Related_Instance (Id)));
6296 end Is_Wrapper_Package;
6298 --------------------
6299 -- Next_Component --
6300 --------------------
6302 function Next_Component (Id : E) return E is
6306 Comp_Id := Next_Entity (Id);
6307 while Present (Comp_Id) loop
6308 exit when Ekind (Comp_Id) = E_Component;
6309 Comp_Id := Next_Entity (Comp_Id);
6315 ------------------------------------
6316 -- Next_Component_Or_Discriminant --
6317 ------------------------------------
6319 function Next_Component_Or_Discriminant (Id : E) return E is
6323 Comp_Id := Next_Entity (Id);
6324 while Present (Comp_Id) loop
6325 exit when Ekind (Comp_Id) = E_Component
6327 Ekind (Comp_Id) = E_Discriminant;
6328 Comp_Id := Next_Entity (Comp_Id);
6332 end Next_Component_Or_Discriminant;
6334 -----------------------
6335 -- Next_Discriminant --
6336 -----------------------
6338 -- This function actually implements both Next_Discriminant and
6339 -- Next_Stored_Discriminant by making sure that the Discriminant
6340 -- returned is of the same variety as Id.
6342 function Next_Discriminant (Id : E) return E is
6344 -- Derived Tagged types with private extensions look like this...
6346 -- E_Discriminant d1
6347 -- E_Discriminant d2
6349 -- E_Discriminant d1
6350 -- E_Discriminant d2
6353 -- so it is critical not to go past the leading discriminants
6358 pragma Assert (Ekind (Id) = E_Discriminant);
6361 D := Next_Entity (D);
6363 or else (Ekind (D) /= E_Discriminant
6364 and then not Is_Itype (D))
6369 exit when Ekind (D) = E_Discriminant
6370 and then (Is_Completely_Hidden (D) = Is_Completely_Hidden (Id));
6374 end Next_Discriminant;
6380 function Next_Formal (Id : E) return E is
6384 -- Follow the chain of declared entities as long as the kind of the
6385 -- entity corresponds to a formal parameter. Skip internal entities
6386 -- that may have been created for implicit subtypes, in the process
6387 -- of analyzing default expressions.
6392 P := Next_Entity (P);
6394 if No (P) or else Is_Formal (P) then
6396 elsif not Is_Internal (P) then
6402 -----------------------------
6403 -- Next_Formal_With_Extras --
6404 -----------------------------
6406 function Next_Formal_With_Extras (Id : E) return E is
6408 if Present (Extra_Formal (Id)) then
6409 return Extra_Formal (Id);
6411 return Next_Formal (Id);
6413 end Next_Formal_With_Extras;
6419 function Next_Index (Id : Node_Id) return Node_Id is
6428 function Next_Literal (Id : E) return E is
6430 pragma Assert (Nkind (Id) in N_Entity);
6434 ------------------------------
6435 -- Next_Stored_Discriminant --
6436 ------------------------------
6438 function Next_Stored_Discriminant (Id : E) return E is
6440 -- See comment in Next_Discriminant
6442 return Next_Discriminant (Id);
6443 end Next_Stored_Discriminant;
6445 -----------------------
6446 -- Number_Dimensions --
6447 -----------------------
6449 function Number_Dimensions (Id : E) return Pos is
6454 if Ekind (Id) in String_Kind then
6459 T := First_Index (Id);
6460 while Present (T) loop
6467 end Number_Dimensions;
6469 --------------------------
6470 -- Number_Discriminants --
6471 --------------------------
6473 function Number_Discriminants (Id : E) return Pos is
6479 Discr := First_Discriminant (Id);
6480 while Present (Discr) loop
6482 Discr := Next_Discriminant (Discr);
6486 end Number_Discriminants;
6488 --------------------
6489 -- Number_Entries --
6490 --------------------
6492 function Number_Entries (Id : E) return Nat is
6497 pragma Assert (Is_Concurrent_Type (Id));
6500 Ent := First_Entity (Id);
6501 while Present (Ent) loop
6502 if Is_Entry (Ent) then
6506 Ent := Next_Entity (Ent);
6512 --------------------
6513 -- Number_Formals --
6514 --------------------
6516 function Number_Formals (Id : E) return Pos is
6522 Formal := First_Formal (Id);
6523 while Present (Formal) loop
6525 Formal := Next_Formal (Formal);
6531 --------------------
6532 -- Parameter_Mode --
6533 --------------------
6535 function Parameter_Mode (Id : E) return Formal_Kind is
6540 ---------------------
6541 -- Record_Rep_Item --
6542 ---------------------
6544 procedure Record_Rep_Item (E : Entity_Id; N : Node_Id) is
6546 Set_Next_Rep_Item (N, First_Rep_Item (E));
6547 Set_First_Rep_Item (E, N);
6548 end Record_Rep_Item;
6554 function Root_Type (Id : E) return E is
6558 pragma Assert (Nkind (Id) in N_Entity);
6560 T := Base_Type (Id);
6562 if Ekind (T) = E_Class_Wide_Type then
6565 elsif Ekind (T) = E_Class_Wide_Subtype then
6566 return Etype (Base_Type (T));
6577 -- Following test catches some error cases resulting from
6580 elsif No (Etyp) then
6583 elsif Is_Private_Type (T) and then Etyp = Full_View (T) then
6586 elsif Is_Private_Type (Etyp) and then Full_View (Etyp) = T then
6592 -- Return if there is a circularity in the inheritance chain.
6593 -- This happens in some error situations and we do not want
6594 -- to get stuck in this loop.
6596 if T = Base_Type (Id) then
6602 raise Program_Error;
6609 function Scope_Depth (Id : E) return Uint is
6614 while Is_Record_Type (Scop) loop
6615 Scop := Scope (Scop);
6618 return Scope_Depth_Value (Scop);
6621 ---------------------
6622 -- Scope_Depth_Set --
6623 ---------------------
6625 function Scope_Depth_Set (Id : E) return B is
6627 return not Is_Record_Type (Id)
6628 and then Field22 (Id) /= Union_Id (Empty);
6629 end Scope_Depth_Set;
6631 -----------------------------
6632 -- Set_Component_Alignment --
6633 -----------------------------
6635 -- Component Alignment is encoded using two flags, Flag128/129 as
6636 -- follows. Note that both flags False = Align_Default, so that the
6637 -- default initialization of flags to False initializes component
6638 -- alignment to the default value as required.
6640 -- Flag128 Flag129 Value
6641 -- ------- ------- -----
6642 -- False False Calign_Default
6643 -- False True Calign_Component_Size
6644 -- True False Calign_Component_Size_4
6645 -- True True Calign_Storage_Unit
6647 procedure Set_Component_Alignment (Id : E; V : C) is
6649 pragma Assert ((Is_Array_Type (Id) or else Is_Record_Type (Id))
6650 and then Id = Base_Type (Id));
6653 when Calign_Default =>
6654 Set_Flag128 (Id, False);
6655 Set_Flag129 (Id, False);
6657 when Calign_Component_Size =>
6658 Set_Flag128 (Id, False);
6659 Set_Flag129 (Id, True);
6661 when Calign_Component_Size_4 =>
6662 Set_Flag128 (Id, True);
6663 Set_Flag129 (Id, False);
6665 when Calign_Storage_Unit =>
6666 Set_Flag128 (Id, True);
6667 Set_Flag129 (Id, True);
6669 end Set_Component_Alignment;
6675 function Size_Clause (Id : E) return N is
6677 return Rep_Clause (Id, Name_Size);
6680 ------------------------
6681 -- Stream_Size_Clause --
6682 ------------------------
6684 function Stream_Size_Clause (Id : E) return N is
6686 return Rep_Clause (Id, Name_Stream_Size);
6687 end Stream_Size_Clause;
6693 function Subtype_Kind (K : Entity_Kind) return Entity_Kind is
6699 Kind := E_Access_Subtype;
6703 Kind := E_Array_Subtype;
6705 when E_Class_Wide_Type |
6706 E_Class_Wide_Subtype =>
6707 Kind := E_Class_Wide_Subtype;
6709 when E_Decimal_Fixed_Point_Type |
6710 E_Decimal_Fixed_Point_Subtype =>
6711 Kind := E_Decimal_Fixed_Point_Subtype;
6713 when E_Ordinary_Fixed_Point_Type |
6714 E_Ordinary_Fixed_Point_Subtype =>
6715 Kind := E_Ordinary_Fixed_Point_Subtype;
6717 when E_Private_Type |
6718 E_Private_Subtype =>
6719 Kind := E_Private_Subtype;
6721 when E_Limited_Private_Type |
6722 E_Limited_Private_Subtype =>
6723 Kind := E_Limited_Private_Subtype;
6725 when E_Record_Type_With_Private |
6726 E_Record_Subtype_With_Private =>
6727 Kind := E_Record_Subtype_With_Private;
6729 when E_Record_Type |
6731 Kind := E_Record_Subtype;
6733 when E_String_Type |
6735 Kind := E_String_Subtype;
6737 when Enumeration_Kind =>
6738 Kind := E_Enumeration_Subtype;
6741 Kind := E_Floating_Point_Subtype;
6743 when Signed_Integer_Kind =>
6744 Kind := E_Signed_Integer_Subtype;
6746 when Modular_Integer_Kind =>
6747 Kind := E_Modular_Integer_Subtype;
6749 when Protected_Kind =>
6750 Kind := E_Protected_Subtype;
6753 Kind := E_Task_Subtype;
6757 raise Program_Error;
6763 -------------------------
6764 -- First_Tag_Component --
6765 -------------------------
6767 function First_Tag_Component (Id : E) return E is
6769 Typ : Entity_Id := Id;
6772 pragma Assert (Is_Tagged_Type (Typ));
6774 if Is_Class_Wide_Type (Typ) then
6775 Typ := Root_Type (Typ);
6778 if Is_Private_Type (Typ) then
6779 Typ := Underlying_Type (Typ);
6781 -- If the underlying type is missing then the source program has
6782 -- errors and there is nothing else to do (the full-type declaration
6783 -- associated with the private type declaration is missing).
6790 Comp := First_Entity (Typ);
6791 while Present (Comp) loop
6792 if Is_Tag (Comp) then
6796 Comp := Next_Entity (Comp);
6799 -- No tag component found
6802 end First_Tag_Component;
6804 ------------------------
6805 -- Next_Tag_Component --
6806 ------------------------
6808 function Next_Tag_Component (Id : E) return E is
6810 Typ : constant Entity_Id := Scope (Id);
6813 pragma Assert (Ekind (Id) = E_Component
6814 and then Is_Tagged_Type (Typ));
6816 Comp := Next_Entity (Id);
6817 while Present (Comp) loop
6818 if Is_Tag (Comp) then
6819 pragma Assert (Chars (Comp) /= Name_uTag);
6823 Comp := Next_Entity (Comp);
6826 -- No tag component found
6829 end Next_Tag_Component;
6831 ---------------------
6832 -- Type_High_Bound --
6833 ---------------------
6835 function Type_High_Bound (Id : E) return Node_Id is
6836 Rng : constant Node_Id := Scalar_Range (Id);
6838 if Nkind (Rng) = N_Subtype_Indication then
6839 return High_Bound (Range_Expression (Constraint (Rng)));
6841 return High_Bound (Rng);
6843 end Type_High_Bound;
6845 --------------------
6846 -- Type_Low_Bound --
6847 --------------------
6849 function Type_Low_Bound (Id : E) return Node_Id is
6850 Rng : constant Node_Id := Scalar_Range (Id);
6852 if Nkind (Rng) = N_Subtype_Indication then
6853 return Low_Bound (Range_Expression (Constraint (Rng)));
6855 return Low_Bound (Rng);
6859 ---------------------
6860 -- Underlying_Type --
6861 ---------------------
6863 function Underlying_Type (Id : E) return E is
6865 -- For record_with_private the underlying type is always the direct
6866 -- full view. Never try to take the full view of the parent it
6867 -- doesn't make sense.
6869 if Ekind (Id) = E_Record_Type_With_Private then
6870 return Full_View (Id);
6872 elsif Ekind (Id) in Incomplete_Or_Private_Kind then
6874 -- If we have an incomplete or private type with a full view,
6875 -- then we return the Underlying_Type of this full view
6877 if Present (Full_View (Id)) then
6878 if Id = Full_View (Id) then
6880 -- Previous error in declaration
6885 return Underlying_Type (Full_View (Id));
6888 -- If we have an incomplete entity that comes from the limited
6889 -- view then we return the Underlying_Type of its non-limited
6892 elsif From_With_Type (Id)
6893 and then Present (Non_Limited_View (Id))
6895 return Underlying_Type (Non_Limited_View (Id));
6897 -- Otherwise check for the case where we have a derived type or
6898 -- subtype, and if so get the Underlying_Type of the parent type.
6900 elsif Etype (Id) /= Id then
6901 return Underlying_Type (Etype (Id));
6903 -- Otherwise we have an incomplete or private type that has
6904 -- no full view, which means that we have not encountered the
6905 -- completion, so return Empty to indicate the underlying type
6906 -- is not yet known.
6912 -- For non-incomplete, non-private types, return the type itself
6913 -- Also for entities that are not types at all return the entity
6919 end Underlying_Type;
6921 ------------------------
6922 -- Write_Entity_Flags --
6923 ------------------------
6925 procedure Write_Entity_Flags (Id : Entity_Id; Prefix : String) is
6927 procedure W (Flag_Name : String; Flag : Boolean);
6928 -- Write out given flag if it is set
6934 procedure W (Flag_Name : String; Flag : Boolean) is
6938 Write_Str (Flag_Name);
6939 Write_Str (" = True");
6944 -- Start of processing for Write_Entity_Flags
6947 if (Is_Array_Type (Id) or else Is_Record_Type (Id))
6948 and then Base_Type (Id) = Id
6951 Write_Str ("Component_Alignment = ");
6953 case Component_Alignment (Id) is
6954 when Calign_Default =>
6955 Write_Str ("Calign_Default");
6957 when Calign_Component_Size =>
6958 Write_Str ("Calign_Component_Size");
6960 when Calign_Component_Size_4 =>
6961 Write_Str ("Calign_Component_Size_4");
6963 when Calign_Storage_Unit =>
6964 Write_Str ("Calign_Storage_Unit");
6970 W ("Address_Taken", Flag104 (Id));
6971 W ("Body_Needed_For_SAL", Flag40 (Id));
6972 W ("C_Pass_By_Copy", Flag125 (Id));
6973 W ("Can_Never_Be_Null", Flag38 (Id));
6974 W ("Checks_May_Be_Suppressed", Flag31 (Id));
6975 W ("Debug_Info_Off", Flag166 (Id));
6976 W ("Default_Expressions_Processed", Flag108 (Id));
6977 W ("Delay_Cleanups", Flag114 (Id));
6978 W ("Delay_Subprogram_Descriptors", Flag50 (Id));
6979 W ("Depends_On_Private", Flag14 (Id));
6980 W ("Discard_Names", Flag88 (Id));
6981 W ("Elaboration_Entity_Required", Flag174 (Id));
6982 W ("Elaborate_Body_Desirable", Flag210 (Id));
6983 W ("Entry_Accepted", Flag152 (Id));
6984 W ("Finalize_Storage_Only", Flag158 (Id));
6985 W ("From_With_Type", Flag159 (Id));
6986 W ("Function_Returns_With_DSP", Flag169 (Id));
6987 W ("Has_Aliased_Components", Flag135 (Id));
6988 W ("Has_Alignment_Clause", Flag46 (Id));
6989 W ("Has_All_Calls_Remote", Flag79 (Id));
6990 W ("Has_Anon_Block_Suffix", Flag201 (Id));
6991 W ("Has_Atomic_Components", Flag86 (Id));
6992 W ("Has_Biased_Representation", Flag139 (Id));
6993 W ("Has_Completion", Flag26 (Id));
6994 W ("Has_Completion_In_Body", Flag71 (Id));
6995 W ("Has_Complex_Representation", Flag140 (Id));
6996 W ("Has_Component_Size_Clause", Flag68 (Id));
6997 W ("Has_Contiguous_Rep", Flag181 (Id));
6998 W ("Has_Controlled_Component", Flag43 (Id));
6999 W ("Has_Controlling_Result", Flag98 (Id));
7000 W ("Has_Convention_Pragma", Flag119 (Id));
7001 W ("Has_Delayed_Freeze", Flag18 (Id));
7002 W ("Has_Discriminants", Flag5 (Id));
7003 W ("Has_Enumeration_Rep_Clause", Flag66 (Id));
7004 W ("Has_Exit", Flag47 (Id));
7005 W ("Has_External_Tag_Rep_Clause", Flag110 (Id));
7006 W ("Has_Forward_Instantiation", Flag175 (Id));
7007 W ("Has_Fully_Qualified_Name", Flag173 (Id));
7008 W ("Has_Gigi_Rep_Item", Flag82 (Id));
7009 W ("Has_Homonym", Flag56 (Id));
7010 W ("Has_Machine_Radix_Clause", Flag83 (Id));
7011 W ("Has_Master_Entity", Flag21 (Id));
7012 W ("Has_Missing_Return", Flag142 (Id));
7013 W ("Has_Nested_Block_With_Handler", Flag101 (Id));
7014 W ("Has_Non_Standard_Rep", Flag75 (Id));
7015 W ("Has_Object_Size_Clause", Flag172 (Id));
7016 W ("Has_Per_Object_Constraint", Flag154 (Id));
7017 W ("Has_Persistent_BSS", Flag188 (Id));
7018 W ("Has_Pragma_Controlled", Flag27 (Id));
7019 W ("Has_Pragma_Elaborate_Body", Flag150 (Id));
7020 W ("Has_Pragma_Inline", Flag157 (Id));
7021 W ("Has_Pragma_Pack", Flag121 (Id));
7022 W ("Has_Pragma_Pure", Flag203 (Id));
7023 W ("Has_Pragma_Pure_Function", Flag179 (Id));
7024 W ("Has_Pragma_Unreferenced", Flag180 (Id));
7025 W ("Has_Pragma_Unreferenced_Objects", Flag212 (Id));
7026 W ("Has_Primitive_Operations", Flag120 (Id));
7027 W ("Has_Private_Declaration", Flag155 (Id));
7028 W ("Has_Qualified_Name", Flag161 (Id));
7029 W ("Has_RACW", Flag214 (Id));
7030 W ("Has_Record_Rep_Clause", Flag65 (Id));
7031 W ("Has_Recursive_Call", Flag143 (Id));
7032 W ("Has_Size_Clause", Flag29 (Id));
7033 W ("Has_Small_Clause", Flag67 (Id));
7034 W ("Has_Specified_Layout", Flag100 (Id));
7035 W ("Has_Specified_Stream_Input", Flag190 (Id));
7036 W ("Has_Specified_Stream_Output", Flag191 (Id));
7037 W ("Has_Specified_Stream_Read", Flag192 (Id));
7038 W ("Has_Specified_Stream_Write", Flag193 (Id));
7039 W ("Has_Static_Discriminants", Flag211 (Id));
7040 W ("Has_Storage_Size_Clause", Flag23 (Id));
7041 W ("Has_Stream_Size_Clause", Flag184 (Id));
7042 W ("Has_Subprogram_Descriptor", Flag93 (Id));
7043 W ("Has_Task", Flag30 (Id));
7044 W ("Has_Unchecked_Union", Flag123 (Id));
7045 W ("Has_Unknown_Discriminants", Flag72 (Id));
7046 W ("Has_Up_Level_Access", Flag215 (Id));
7047 W ("Has_Volatile_Components", Flag87 (Id));
7048 W ("Has_Xref_Entry", Flag182 (Id));
7049 W ("In_Package_Body", Flag48 (Id));
7050 W ("In_Private_Part", Flag45 (Id));
7051 W ("In_Use", Flag8 (Id));
7052 W ("Is_AST_Entry", Flag132 (Id));
7053 W ("Is_Abstract_Subprogram", Flag19 (Id));
7054 W ("Is_Abstract_Type", Flag146 (Id));
7055 W ("Is_Local_Anonymous_Access", Flag194 (Id));
7056 W ("Is_Access_Constant", Flag69 (Id));
7057 W ("Is_Ada_2005_Only", Flag185 (Id));
7058 W ("Is_Aliased", Flag15 (Id));
7059 W ("Is_Asynchronous", Flag81 (Id));
7060 W ("Is_Atomic", Flag85 (Id));
7061 W ("Is_Bit_Packed_Array", Flag122 (Id));
7062 W ("Is_CPP_Class", Flag74 (Id));
7063 W ("Is_Called", Flag102 (Id));
7064 W ("Is_Character_Type", Flag63 (Id));
7065 W ("Is_Child_Unit", Flag73 (Id));
7066 W ("Is_Class_Wide_Equivalent_Type", Flag35 (Id));
7067 W ("Is_Compilation_Unit", Flag149 (Id));
7068 W ("Is_Completely_Hidden", Flag103 (Id));
7069 W ("Is_Concurrent_Record_Type", Flag20 (Id));
7070 W ("Is_Constr_Subt_For_UN_Aliased", Flag141 (Id));
7071 W ("Is_Constr_Subt_For_U_Nominal", Flag80 (Id));
7072 W ("Is_Constrained", Flag12 (Id));
7073 W ("Is_Constructor", Flag76 (Id));
7074 W ("Is_Controlled", Flag42 (Id));
7075 W ("Is_Controlling_Formal", Flag97 (Id));
7076 W ("Is_Discrim_SO_Function", Flag176 (Id));
7077 W ("Is_Dispatching_Operation", Flag6 (Id));
7078 W ("Is_Eliminated", Flag124 (Id));
7079 W ("Is_Entry_Formal", Flag52 (Id));
7080 W ("Is_Exported", Flag99 (Id));
7081 W ("Is_First_Subtype", Flag70 (Id));
7082 W ("Is_For_Access_Subtype", Flag118 (Id));
7083 W ("Is_Formal_Subprogram", Flag111 (Id));
7084 W ("Is_Frozen", Flag4 (Id));
7085 W ("Is_Generic_Actual_Type", Flag94 (Id));
7086 W ("Is_Generic_Instance", Flag130 (Id));
7087 W ("Is_Generic_Type", Flag13 (Id));
7088 W ("Is_Hidden", Flag57 (Id));
7089 W ("Is_Hidden_Open_Scope", Flag171 (Id));
7090 W ("Is_Immediately_Visible", Flag7 (Id));
7091 W ("Is_Imported", Flag24 (Id));
7092 W ("Is_Inlined", Flag11 (Id));
7093 W ("Is_Instantiated", Flag126 (Id));
7094 W ("Is_Interface", Flag186 (Id));
7095 W ("Is_Internal", Flag17 (Id));
7096 W ("Is_Interrupt_Handler", Flag89 (Id));
7097 W ("Is_Intrinsic_Subprogram", Flag64 (Id));
7098 W ("Is_Itype", Flag91 (Id));
7099 W ("Is_Known_Non_Null", Flag37 (Id));
7100 W ("Is_Known_Null", Flag204 (Id));
7101 W ("Is_Known_Valid", Flag170 (Id));
7102 W ("Is_Limited_Composite", Flag106 (Id));
7103 W ("Is_Limited_Interface", Flag197 (Id));
7104 W ("Is_Limited_Record", Flag25 (Id));
7105 W ("Is_Machine_Code_Subprogram", Flag137 (Id));
7106 W ("Is_Non_Static_Subtype", Flag109 (Id));
7107 W ("Is_Null_Init_Proc", Flag178 (Id));
7108 W ("Is_Obsolescent", Flag153 (Id));
7109 W ("Is_Optional_Parameter", Flag134 (Id));
7110 W ("Is_Overriding_Operation", Flag39 (Id));
7111 W ("Is_Package_Body_Entity", Flag160 (Id));
7112 W ("Is_Packed", Flag51 (Id));
7113 W ("Is_Packed_Array_Type", Flag138 (Id));
7114 W ("Is_Potentially_Use_Visible", Flag9 (Id));
7115 W ("Is_Preelaborated", Flag59 (Id));
7116 W ("Is_Primitive_Wrapper", Flag195 (Id));
7117 W ("Is_Private_Composite", Flag107 (Id));
7118 W ("Is_Private_Descendant", Flag53 (Id));
7119 W ("Is_Protected_Interface", Flag198 (Id));
7120 W ("Is_Public", Flag10 (Id));
7121 W ("Is_Pure", Flag44 (Id));
7122 W ("Is_Pure_Unit_Access_Type", Flag189 (Id));
7123 W ("Is_Remote_Call_Interface", Flag62 (Id));
7124 W ("Is_Remote_Types", Flag61 (Id));
7125 W ("Is_Renaming_Of_Object", Flag112 (Id));
7126 W ("Is_Return_Object", Flag209 (Id));
7127 W ("Is_Shared_Passive", Flag60 (Id));
7128 W ("Is_Synchronized_Interface", Flag199 (Id));
7129 W ("Is_Statically_Allocated", Flag28 (Id));
7130 W ("Is_Tag", Flag78 (Id));
7131 W ("Is_Tagged_Type", Flag55 (Id));
7132 W ("Is_Task_Interface", Flag200 (Id));
7133 W ("Is_True_Constant", Flag163 (Id));
7134 W ("Is_Unchecked_Union", Flag117 (Id));
7135 W ("Is_Unsigned_Type", Flag144 (Id));
7136 W ("Is_VMS_Exception", Flag133 (Id));
7137 W ("Is_Valued_Procedure", Flag127 (Id));
7138 W ("Is_Visible_Child_Unit", Flag116 (Id));
7139 W ("Is_Visible_Formal", Flag206 (Id));
7140 W ("Is_Volatile", Flag16 (Id));
7141 W ("Itype_Printed", Flag202 (Id));
7142 W ("Kill_Elaboration_Checks", Flag32 (Id));
7143 W ("Kill_Range_Checks", Flag33 (Id));
7144 W ("Kill_Tag_Checks", Flag34 (Id));
7145 W ("Known_To_Have_Preelab_Init", Flag207 (Id));
7146 W ("Low_Bound_Known", Flag205 (Id));
7147 W ("Machine_Radix_10", Flag84 (Id));
7148 W ("Materialize_Entity", Flag168 (Id));
7149 W ("Must_Be_On_Byte_Boundary", Flag183 (Id));
7150 W ("Must_Have_Preelab_Init", Flag208 (Id));
7151 W ("Needs_Debug_Info", Flag147 (Id));
7152 W ("Needs_No_Actuals", Flag22 (Id));
7153 W ("Never_Set_In_Source", Flag115 (Id));
7154 W ("No_Pool_Assigned", Flag131 (Id));
7155 W ("No_Return", Flag113 (Id));
7156 W ("No_Strict_Aliasing", Flag136 (Id));
7157 W ("Non_Binary_Modulus", Flag58 (Id));
7158 W ("Nonzero_Is_True", Flag162 (Id));
7159 W ("Reachable", Flag49 (Id));
7160 W ("Referenced", Flag156 (Id));
7161 W ("Referenced_As_LHS", Flag36 (Id));
7162 W ("Requires_Overriding", Flag213 (Id));
7163 W ("Return_Present", Flag54 (Id));
7164 W ("Returns_By_Ref", Flag90 (Id));
7165 W ("Reverse_Bit_Order", Flag164 (Id));
7166 W ("Sec_Stack_Needed_For_Return", Flag167 (Id));
7167 W ("Size_Depends_On_Discriminant", Flag177 (Id));
7168 W ("Size_Known_At_Compile_Time", Flag92 (Id));
7169 W ("Static_Elaboration_Desired", Flag77 (Id));
7170 W ("Strict_Alignment", Flag145 (Id));
7171 W ("Suppress_Elaboration_Warnings", Flag148 (Id));
7172 W ("Suppress_Init_Proc", Flag105 (Id));
7173 W ("Suppress_Style_Checks", Flag165 (Id));
7174 W ("Suppress_Value_Tracking_On_Call", Flag217 (Id));
7175 W ("Treat_As_Volatile", Flag41 (Id));
7176 W ("Universal_Aliasing", Flag216 (Id));
7177 W ("Uses_Sec_Stack", Flag95 (Id));
7178 W ("Vax_Float", Flag151 (Id));
7179 W ("Warnings_Off", Flag96 (Id));
7180 W ("Was_Hidden", Flag196 (Id));
7181 end Write_Entity_Flags;
7183 -----------------------
7184 -- Write_Entity_Info --
7185 -----------------------
7187 procedure Write_Entity_Info (Id : Entity_Id; Prefix : String) is
7189 procedure Write_Attribute (Which : String; Nam : E);
7190 -- Write attribute value with given string name
7192 procedure Write_Kind (Id : Entity_Id);
7193 -- Write Ekind field of entity
7195 ---------------------
7196 -- Write_Attribute --
7197 ---------------------
7199 procedure Write_Attribute (Which : String; Nam : E) is
7203 Write_Int (Int (Nam));
7205 Write_Name (Chars (Nam));
7207 end Write_Attribute;
7213 procedure Write_Kind (Id : Entity_Id) is
7214 K : constant String := Entity_Kind'Image (Ekind (Id));
7218 Write_Str (" Kind ");
7220 if Is_Type (Id) and then Is_Tagged_Type (Id) then
7221 Write_Str ("TAGGED ");
7224 Write_Str (K (3 .. K'Length));
7227 if Is_Type (Id) and then Depends_On_Private (Id) then
7228 Write_Str ("Depends_On_Private ");
7232 -- Start of processing for Write_Entity_Info
7236 Write_Attribute ("Name ", Id);
7237 Write_Int (Int (Id));
7241 Write_Attribute (" Type ", Etype (Id));
7243 Write_Attribute (" Scope ", Scope (Id));
7248 when Discrete_Kind =>
7249 Write_Str ("Bounds: Id = ");
7251 if Present (Scalar_Range (Id)) then
7252 Write_Int (Int (Type_Low_Bound (Id)));
7253 Write_Str (" .. Id = ");
7254 Write_Int (Int (Type_High_Bound (Id)));
7256 Write_Str ("Empty");
7267 (" Component Type ", Component_Type (Id));
7270 Write_Str (" Indices ");
7272 Index := First_Index (Id);
7273 while Present (Index) loop
7274 Write_Attribute (" ", Etype (Index));
7275 Index := Next_Index (Index);
7283 (" Directly Designated Type ",
7284 Directly_Designated_Type (Id));
7287 when Overloadable_Kind =>
7288 if Present (Homonym (Id)) then
7289 Write_Str (" Homonym ");
7290 Write_Name (Chars (Homonym (Id)));
7292 Write_Int (Int (Homonym (Id)));
7299 if Ekind (Scope (Id)) in Record_Kind then
7301 " Original_Record_Component ",
7302 Original_Record_Component (Id));
7303 Write_Int (Int (Original_Record_Component (Id)));
7307 when others => null;
7309 end Write_Entity_Info;
7311 -----------------------
7312 -- Write_Field6_Name --
7313 -----------------------
7315 procedure Write_Field6_Name (Id : Entity_Id) is
7316 pragma Warnings (Off, Id);
7318 Write_Str ("First_Rep_Item");
7319 end Write_Field6_Name;
7321 -----------------------
7322 -- Write_Field7_Name --
7323 -----------------------
7325 procedure Write_Field7_Name (Id : Entity_Id) is
7326 pragma Warnings (Off, Id);
7328 Write_Str ("Freeze_Node");
7329 end Write_Field7_Name;
7331 -----------------------
7332 -- Write_Field8_Name --
7333 -----------------------
7335 procedure Write_Field8_Name (Id : Entity_Id) is
7340 Write_Str ("Normalized_First_Bit");
7344 E_Subprogram_Body =>
7345 Write_Str ("Mechanism");
7348 Write_Str ("Associated_Node_For_Itype");
7351 Write_Str ("Dependent_Instances");
7353 when E_Return_Statement =>
7354 Write_Str ("Return_Applies_To");
7357 Write_Str ("Hiding_Loop_Variable");
7360 Write_Str ("Field8??");
7362 end Write_Field8_Name;
7364 -----------------------
7365 -- Write_Field9_Name --
7366 -----------------------
7368 procedure Write_Field9_Name (Id : Entity_Id) is
7372 Write_Str ("Class_Wide_Type");
7375 E_Generic_Function |
7377 E_Generic_Procedure |
7380 Write_Str ("Renaming_Map");
7383 Write_Str ("Current_Value");
7386 Write_Str ("Field9??");
7388 end Write_Field9_Name;
7390 ------------------------
7391 -- Write_Field10_Name --
7392 ------------------------
7394 procedure Write_Field10_Name (Id : Entity_Id) is
7398 Write_Str ("Referenced_Object");
7400 when E_In_Parameter |
7402 Write_Str ("Discriminal_Link");
7408 Write_Str ("Handler_Records");
7412 Write_Str ("Normalized_Position_Max");
7415 Write_Str ("Field10??");
7417 end Write_Field10_Name;
7419 ------------------------
7420 -- Write_Field11_Name --
7421 ------------------------
7423 procedure Write_Field11_Name (Id : Entity_Id) is
7427 Write_Str ("Entry_Component");
7431 Write_Str ("Component_Bit_Offset");
7434 Write_Str ("Full_View");
7436 when E_Enumeration_Literal =>
7437 Write_Str ("Enumeration_Pos");
7440 Write_Str ("Block_Node");
7446 Write_Str ("Protected_Body_Subprogram");
7448 when E_Generic_Package =>
7449 Write_Str ("Generic_Homonym");
7452 Write_Str ("Full_View");
7455 Write_Str ("Field11??");
7457 end Write_Field11_Name;
7459 ------------------------
7460 -- Write_Field12_Name --
7461 ------------------------
7463 procedure Write_Field12_Name (Id : Entity_Id) is
7467 Write_Str ("Barrier_Function");
7469 when E_Enumeration_Literal =>
7470 Write_Str ("Enumeration_Rep");
7478 E_In_Out_Parameter |
7482 Write_Str ("Esize");
7486 Write_Str ("Next_Inlined_Subprogram");
7489 Write_Str ("Associated_Formal_Package");
7492 Write_Str ("Field12??");
7494 end Write_Field12_Name;
7496 ------------------------
7497 -- Write_Field13_Name --
7498 ------------------------
7500 procedure Write_Field13_Name (Id : Entity_Id) is
7504 Write_Str ("RM_Size");
7508 Write_Str ("Component_Clause");
7510 when E_Enumeration_Literal =>
7511 Write_Str ("Debug_Renaming_Link");
7514 if not Comes_From_Source (Id)
7516 Chars (Id) = Name_Op_Ne
7518 Write_Str ("Corresponding_Equality");
7520 elsif Comes_From_Source (Id) then
7521 Write_Str ("Elaboration_Entity");
7524 Write_Str ("Field13??");
7529 Write_Str ("Extra_Accessibility");
7533 Generic_Unit_Kind =>
7534 Write_Str ("Elaboration_Entity");
7537 Write_Str ("Field13??");
7539 end Write_Field13_Name;
7541 -----------------------
7542 -- Write_Field14_Name --
7543 -----------------------
7545 procedure Write_Field14_Name (Id : Entity_Id) is
7554 Write_Str ("Alignment");
7558 Write_Str ("Normalized_Position");
7562 Write_Str ("First_Optional_Parameter");
7565 E_Generic_Package =>
7566 Write_Str ("Shadow_Entities");
7569 Write_Str ("Field14??");
7571 end Write_Field14_Name;
7573 ------------------------
7574 -- Write_Field15_Name --
7575 ------------------------
7577 procedure Write_Field15_Name (Id : Entity_Id) is
7582 Write_Str ("Storage_Size_Variable");
7584 when Class_Wide_Kind |
7588 Write_Str ("Primitive_Operations");
7591 Write_Str ("DT_Entry_Count");
7593 when Decimal_Fixed_Point_Kind =>
7594 Write_Str ("Scale_Value");
7596 when E_Discriminant =>
7597 Write_Str ("Discriminant_Number");
7600 Write_Str ("Extra_Formal");
7604 Write_Str ("DT_Position");
7607 Write_Str ("Entry_Parameters_Type");
7609 when Enumeration_Kind =>
7610 Write_Str ("Lit_Indexes");
7614 Write_Str ("Related_Instance");
7616 when E_Protected_Type =>
7617 Write_Str ("Entry_Bodies_Array");
7619 when E_String_Literal_Subtype =>
7620 Write_Str ("String_Literal_Low_Bound");
7623 Write_Str ("Shared_Var_Read_Proc");
7626 Write_Str ("Field15??");
7628 end Write_Field15_Name;
7630 ------------------------
7631 -- Write_Field16_Name --
7632 ------------------------
7634 procedure Write_Field16_Name (Id : Entity_Id) is
7638 Write_Str ("Entry_Formal");
7642 Write_Str ("DTC_Entity");
7647 Write_Str ("First_Private_Entity");
7649 when E_Record_Type |
7650 E_Record_Type_With_Private =>
7651 Write_Str ("Access_Disp_Table");
7653 when E_String_Literal_Subtype =>
7654 Write_Str ("String_Literal_Length");
7656 when Enumeration_Kind =>
7657 Write_Str ("Lit_Strings");
7661 Write_Str ("Unset_Reference");
7663 when E_Record_Subtype |
7664 E_Class_Wide_Subtype =>
7665 Write_Str ("Cloned_Subtype");
7668 Write_Str ("Field16??");
7670 end Write_Field16_Name;
7672 ------------------------
7673 -- Write_Field17_Name --
7674 ------------------------
7676 procedure Write_Field17_Name (Id : Entity_Id) is
7680 Write_Str ("Digits_Value");
7683 Write_Str ("Prival");
7685 when E_Discriminant =>
7686 Write_Str ("Discriminal");
7695 E_Generic_Function |
7697 E_Generic_Procedure |
7705 E_Return_Statement |
7707 E_Subprogram_Type =>
7708 Write_Str ("First_Entity");
7711 Write_Str ("First_Index");
7713 when E_Protected_Body =>
7714 Write_Str ("Object_Ref");
7716 when Enumeration_Kind =>
7717 Write_Str ("First_Literal");
7720 Write_Str ("Master_Id");
7722 when Modular_Integer_Kind =>
7723 Write_Str ("Modulus");
7727 E_Generic_In_Out_Parameter |
7729 Write_Str ("Actual_Subtype");
7731 when E_Incomplete_Type =>
7732 Write_Str ("Non_Limited_View");
7734 when E_Incomplete_Subtype =>
7735 if From_With_Type (Id) then
7736 Write_Str ("Non_Limited_View");
7740 Write_Str ("Field17??");
7742 end Write_Field17_Name;
7744 -----------------------
7745 -- Write_Field18_Name --
7746 -----------------------
7748 procedure Write_Field18_Name (Id : Entity_Id) is
7751 when E_Enumeration_Literal |
7755 Write_Str ("Alias");
7757 when E_Record_Type =>
7758 Write_Str ("Corresponding_Concurrent_Type");
7760 when E_Entry_Index_Parameter =>
7761 Write_Str ("Entry_Index_Constant");
7763 when E_Class_Wide_Subtype |
7764 E_Access_Protected_Subprogram_Type |
7765 E_Anonymous_Access_Protected_Subprogram_Type |
7766 E_Access_Subprogram_Type |
7768 Write_Str ("Equivalent_Type");
7770 when Fixed_Point_Kind =>
7771 Write_Str ("Delta_Value");
7775 Write_Str ("Renamed_Object");
7779 E_Generic_Function |
7780 E_Generic_Procedure |
7781 E_Generic_Package =>
7782 Write_Str ("Renamed_Entity");
7784 when Incomplete_Or_Private_Kind =>
7785 Write_Str ("Private_Dependents");
7787 when Concurrent_Kind =>
7788 Write_Str ("Corresponding_Record_Type");
7793 Write_Str ("Enclosing_Scope");
7796 Write_Str ("Field18??");
7798 end Write_Field18_Name;
7800 -----------------------
7801 -- Write_Field19_Name --
7802 -----------------------
7804 procedure Write_Field19_Name (Id : Entity_Id) is
7809 Write_Str ("Related_Array_Object");
7815 E_Return_Statement |
7817 Write_Str ("Finalization_Chain_Entity");
7819 when E_Constant | E_Variable =>
7820 Write_Str ("Size_Check_Code");
7822 when E_Discriminant =>
7823 Write_Str ("Corresponding_Discriminant");
7826 E_Generic_Package =>
7827 Write_Str ("Body_Entity");
7829 when E_Package_Body |
7831 Write_Str ("Spec_Entity");
7833 when Private_Kind =>
7834 Write_Str ("Underlying_Full_View");
7836 when E_Record_Type =>
7837 Write_Str ("Parent_Subtype");
7840 Write_Str ("Field19??");
7842 end Write_Field19_Name;
7844 -----------------------
7845 -- Write_Field20_Name --
7846 -----------------------
7848 procedure Write_Field20_Name (Id : Entity_Id) is
7852 Write_Str ("Component_Type");
7854 when E_In_Parameter |
7855 E_Generic_In_Parameter =>
7856 Write_Str ("Default_Value");
7859 Write_Str ("Directly_Designated_Type");
7862 Write_Str ("Discriminant_Checking_Func");
7864 when E_Discriminant =>
7865 Write_Str ("Discriminant_Default_Value");
7874 E_Generic_Function |
7876 E_Generic_Procedure |
7884 E_Return_Statement |
7886 E_Subprogram_Type =>
7888 Write_Str ("Last_Entity");
7891 Write_Str ("Scalar_Range");
7894 Write_Str ("Register_Exception_Call");
7897 Write_Str ("Last_Assignment");
7900 Write_Str ("Field20??");
7902 end Write_Field20_Name;
7904 -----------------------
7905 -- Write_Field21_Name --
7906 -----------------------
7908 procedure Write_Field21_Name (Id : Entity_Id) is
7914 E_Generic_Function |
7916 E_Generic_Procedure |
7918 Write_Str ("Interface_Name");
7920 when Concurrent_Kind |
7921 Incomplete_Or_Private_Kind |
7925 Write_Str ("Discriminant_Constraint");
7928 Write_Str ("Accept_Address");
7930 when Fixed_Point_Kind =>
7931 Write_Str ("Small_Value");
7933 when E_In_Parameter =>
7934 Write_Str ("Default_Expr_Function");
7937 Modular_Integer_Kind =>
7938 Write_Str ("Original_Array_Type");
7941 Write_Str ("Field21??");
7943 end Write_Field21_Name;
7945 -----------------------
7946 -- Write_Field22_Name --
7947 -----------------------
7949 procedure Write_Field22_Name (Id : Entity_Id) is
7953 Write_Str ("Associated_Storage_Pool");
7956 Write_Str ("Component_Size");
7960 Write_Str ("Original_Record_Component");
7962 when E_Enumeration_Literal =>
7963 Write_Str ("Enumeration_Rep_Expr");
7966 Write_Str ("Exception_Code");
7969 Write_Str ("Protected_Formal");
7971 when E_Record_Type =>
7972 Write_Str ("Corresponding_Remote_Type");
7982 E_Generic_Function |
7983 E_Generic_Procedure |
7986 E_Return_Statement |
7989 Write_Str ("Scope_Depth_Value");
7991 when E_Record_Type_With_Private |
7992 E_Record_Subtype_With_Private |
7995 E_Limited_Private_Type |
7996 E_Limited_Private_Subtype =>
7997 Write_Str ("Private_View");
8000 Write_Str ("Shared_Var_Assign_Proc");
8003 Write_Str ("Field22??");
8005 end Write_Field22_Name;
8007 ------------------------
8008 -- Write_Field23_Name --
8009 ------------------------
8011 procedure Write_Field23_Name (Id : Entity_Id) is
8015 Write_Str ("Associated_Final_Chain");
8018 Write_Str ("Packed_Array_Type");
8021 Write_Str ("Entry_Cancel_Parameter");
8024 Write_Str ("Protected_Operation");
8026 when E_Discriminant =>
8027 Write_Str ("CR_Discriminant");
8029 when E_Enumeration_Type =>
8030 Write_Str ("Enum_Pos_To_Rep");
8034 Write_Str ("Extra_Constrained");
8036 when E_Generic_Function |
8038 E_Generic_Procedure =>
8039 Write_Str ("Inner_Instances");
8041 when Concurrent_Kind |
8042 Incomplete_Or_Private_Kind |
8046 Write_Str ("Stored_Constraint");
8050 Write_Str ("Generic_Renamings");
8053 if Is_Generic_Instance (Id) then
8054 Write_Str ("Generic_Renamings");
8056 Write_Str ("Limited Views");
8059 -- What about Privals_Chain for protected operations ???
8062 Write_Str ("Privals_Chain");
8065 Write_Str ("Field23??");
8067 end Write_Field23_Name;
8069 ------------------------
8070 -- Write_Field24_Name --
8071 ------------------------
8073 procedure Write_Field24_Name (Id : Entity_Id) is
8074 pragma Warnings (Off, Id);
8076 Write_Str ("Obsolescent_Warning");
8077 end Write_Field24_Name;
8079 ------------------------
8080 -- Write_Field25_Name --
8081 ------------------------
8083 procedure Write_Field25_Name (Id : Entity_Id) is
8087 Write_Str ("DT_Offset_To_Top_Func");
8091 Write_Str ("Abstract_Interface_Alias");
8094 Write_Str ("Current_Use_Clause");
8096 when E_Record_Type |
8098 E_Record_Type_With_Private |
8099 E_Record_Subtype_With_Private =>
8100 Write_Str ("Abstract_Interfaces");
8103 Write_Str ("Task_Body_Procedure");
8106 Write_Str ("Field25??");
8108 end Write_Field25_Name;
8110 ------------------------
8111 -- Write_Field26_Name --
8112 ------------------------
8114 procedure Write_Field26_Name (Id : Entity_Id) is
8118 Write_Str ("Related_Interface");
8120 when E_Generic_Package |
8122 Write_Str ("Package_Instantiation");
8127 if Is_Dispatching_Operation (Id) then
8128 Write_Str ("Overridden_Operation");
8130 Write_Str ("Static_Initialization");
8134 Write_Str ("Field26??");
8136 end Write_Field26_Name;
8138 ------------------------
8139 -- Write_Field27_Name --
8140 ------------------------
8142 procedure Write_Field27_Name (Id : Entity_Id) is
8146 Write_Str ("Wrapped_Entity");
8149 Write_Str ("Field27??");
8151 end Write_Field27_Name;
8153 ------------------------
8154 -- Write_Field28_Name --
8155 ------------------------
8157 procedure Write_Field28_Name (Id : Entity_Id) is
8160 when E_Procedure | E_Function | E_Entry =>
8161 Write_Str ("Extra_Formals");
8164 Write_Str ("Field28??");
8166 end Write_Field28_Name;
8168 -------------------------
8169 -- Iterator Procedures --
8170 -------------------------
8172 procedure Proc_Next_Component (N : in out Node_Id) is
8174 N := Next_Component (N);
8175 end Proc_Next_Component;
8177 procedure Proc_Next_Component_Or_Discriminant (N : in out Node_Id) is
8179 N := Next_Component (N);
8180 end Proc_Next_Component_Or_Discriminant;
8182 procedure Proc_Next_Discriminant (N : in out Node_Id) is
8184 N := Next_Discriminant (N);
8185 end Proc_Next_Discriminant;
8187 procedure Proc_Next_Formal (N : in out Node_Id) is
8189 N := Next_Formal (N);
8190 end Proc_Next_Formal;
8192 procedure Proc_Next_Formal_With_Extras (N : in out Node_Id) is
8194 N := Next_Formal_With_Extras (N);
8195 end Proc_Next_Formal_With_Extras;
8197 procedure Proc_Next_Index (N : in out Node_Id) is
8199 N := Next_Index (N);
8200 end Proc_Next_Index;
8202 procedure Proc_Next_Inlined_Subprogram (N : in out Node_Id) is
8204 N := Next_Inlined_Subprogram (N);
8205 end Proc_Next_Inlined_Subprogram;
8207 procedure Proc_Next_Literal (N : in out Node_Id) is
8209 N := Next_Literal (N);
8210 end Proc_Next_Literal;
8212 procedure Proc_Next_Stored_Discriminant (N : in out Node_Id) is
8214 N := Next_Stored_Discriminant (N);
8215 end Proc_Next_Stored_Discriminant;