1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
32 ------------------------------------------------------------------------------
34 pragma Style_Checks (All_Checks);
35 -- Turn off subprogram ordering, not used for this unit
37 with Atree; use Atree;
38 with Namet; use Namet;
39 with Nlists; use Nlists;
40 with Sinfo; use Sinfo;
41 with Stand; use Stand;
42 with Output; use Output;
46 use Atree.Unchecked_Access;
47 -- This is one of the packages that is allowed direct untyped access to
48 -- the fields in a node, since it provides the next level abstraction
49 -- which incorporates appropriate checks.
51 ----------------------------------------------
52 -- Usage of Fields in Defining Entity Nodes --
53 ----------------------------------------------
55 -- Four of these fields are defined in Sinfo, since they in are the
56 -- base part of the node. The access routines for these fields and
57 -- the corresponding set procedures are defined in Sinfo. These fields
58 -- are present in all entities. Note that Homonym is also in the base
59 -- part of the node, but has access routines that are more properly
60 -- part of Einfo, which is why they are defined here.
67 -- Remaining fields are present only in extended nodes (i.e. entities)
69 -- The following fields are present in all entities
72 -- First_Rep_Item Node6
75 -- The usage of each field (and the entity kinds to which it applies)
76 -- depends on the particular field (see Einfo spec for details).
78 -- Associated_Node_For_Itype Node8
79 -- Dependent_Instances Elist8
80 -- Hiding_Loop_Variable Node8
81 -- Mechanism Uint8 (but returns Mechanism_Type)
82 -- Normalized_First_Bit Uint8
84 -- Class_Wide_Type Node9
85 -- Current_Value Node9
88 -- Discriminal_Link Node10
89 -- Handler_Records List10
90 -- Normalized_Position_Max Uint10
91 -- Referenced_Object Node10
93 -- Component_Bit_Offset Uint11
95 -- Entry_Component Node11
96 -- Enumeration_Pos Uint11
97 -- Generic_Homonym Node11
98 -- Protected_Body_Subprogram Node11
101 -- Barrier_Function Node12
102 -- Enumeration_Rep Uint12
104 -- Next_Inlined_Subprogram Node12
106 -- Corresponding_Equality Node13
107 -- Component_Clause Node13
108 -- Debug_Renaming_Link Node13
109 -- Elaboration_Entity Node13
110 -- Extra_Accessibility Node13
114 -- First_Optional_Parameter Node14
115 -- Normalized_Position Uint14
116 -- Shadow_Entities List14
118 -- Discriminant_Number Uint15
119 -- DT_Position Uint15
120 -- DT_Entry_Count Uint15
121 -- Entry_Bodies_Array Node15
122 -- Entry_Parameters_Type Node15
123 -- Extra_Formal Node15
124 -- Lit_Indexes Node15
125 -- Primitive_Operations Elist15
126 -- Related_Instance Node15
127 -- Scale_Value Uint15
128 -- Storage_Size_Variable Node15
129 -- String_Literal_Low_Bound Node15
130 -- Shared_Var_Read_Proc Node15
132 -- Access_Disp_Table Elist16
133 -- Cloned_Subtype Node16
135 -- Entry_Formal Node16
136 -- First_Private_Entity Node16
137 -- Lit_Strings Node16
138 -- String_Literal_Length Uint16
139 -- Unset_Reference Node16
141 -- Actual_Subtype Node17
142 -- Digits_Value Uint17
143 -- Discriminal Node17
144 -- First_Entity Node17
145 -- First_Index Node17
146 -- First_Literal Node17
149 -- Non_Limited_View Node17
154 -- Corresponding_Concurrent_Type Node18
155 -- Corresponding_Record_Type Node18
156 -- Delta_Value Ureal18
157 -- Enclosing_Scope Node18
158 -- Equivalent_Type Node18
159 -- Private_Dependents Elist18
160 -- Renamed_Entity Node18
161 -- Renamed_Object Node18
163 -- Body_Entity Node19
164 -- Corresponding_Discriminant Node19
165 -- Finalization_Chain_Entity Node19
166 -- Parent_Subtype Node19
167 -- Related_Array_Object Node19
168 -- Size_Check_Code Node19
169 -- Spec_Entity Node19
170 -- Underlying_Full_View Node19
172 -- Component_Type Node20
173 -- Default_Value Node20
174 -- Directly_Designated_Type Node20
175 -- Discriminant_Checking_Func Node20
176 -- Discriminant_Default_Value Node20
177 -- Last_Entity Node20
178 -- Register_Exception_Call Node20
179 -- Scalar_Range Node20
181 -- Accept_Address Elist21
182 -- Default_Expr_Function Node21
183 -- Discriminant_Constraint Elist21
184 -- Interface_Name Node21
185 -- Original_Array_Type Node21
186 -- Small_Value Ureal21
188 -- Associated_Storage_Pool Node22
189 -- Component_Size Uint22
190 -- Corresponding_Remote_Type Node22
191 -- Enumeration_Rep_Expr Node22
192 -- Exception_Code Uint22
193 -- Original_Record_Component Node22
194 -- Private_View Node22
195 -- Protected_Formal Node22
196 -- Scope_Depth_Value Uint22
197 -- Shared_Var_Assign_Proc Node22
199 -- Associated_Final_Chain Node23
200 -- CR_Discriminant Node23
201 -- Stored_Constraint Elist23
202 -- Entry_Cancel_Parameter Node23
203 -- Extra_Constrained Node23
204 -- Generic_Renamings Elist23
205 -- Inner_Instances Elist23
206 -- Enum_Pos_To_Rep Node23
207 -- Packed_Array_Type Node23
208 -- Limited_View Node23
209 -- Privals_Chain Elist23
210 -- Protected_Operation Node23
212 -- Obsolescent_Warning Node24
213 -- Task_Body_Procedure Node24
214 -- Abstract_Interfaces Node24
216 -- Abstract_Interface_Alias Node25
222 ---------------------------------------------
223 -- Usage of Flags in Defining Entity Nodes --
224 ---------------------------------------------
226 -- All flags are unique, there is no overlaying, so each flag is physically
227 -- present in every entity. However, for many of the flags, it only makes
228 -- sense for them to be set true for certain subsets of entity kinds. See
229 -- the spec of Einfo for further details.
231 -- Note: Flag1-Flag3 are absent from this list, since these flag positions
232 -- are used for the flags Analyzed, Comes_From_Source, and Error_Posted,
233 -- which are common to all nodes, including entity nodes.
236 -- Has_Discriminants Flag5
237 -- Is_Dispatching_Operation Flag6
238 -- Is_Immediately_Visible Flag7
240 -- Is_Potentially_Use_Visible Flag9
244 -- Is_Constrained Flag12
245 -- Is_Generic_Type Flag13
246 -- Depends_On_Private Flag14
248 -- Is_Volatile Flag16
249 -- Is_Internal Flag17
250 -- Has_Delayed_Freeze Flag18
251 -- Is_Abstract Flag19
252 -- Is_Concurrent_Record_Type Flag20
254 -- Has_Master_Entity Flag21
255 -- Needs_No_Actuals Flag22
256 -- Has_Storage_Size_Clause Flag23
257 -- Is_Imported Flag24
258 -- Is_Limited_Record Flag25
259 -- Has_Completion Flag26
260 -- Has_Pragma_Controlled Flag27
261 -- Is_Statically_Allocated Flag28
262 -- Has_Size_Clause Flag29
265 -- Checks_May_Be_Suppressed Flag31
266 -- Kill_Elaboration_Checks Flag32
267 -- Kill_Range_Checks Flag33
268 -- Kill_Tag_Checks Flag34
269 -- Is_Class_Wide_Equivalent_Type Flag35
270 -- Referenced_As_LHS Flag36
271 -- Is_Known_Non_Null Flag37
272 -- Can_Never_Be_Null Flag38
273 -- Is_Overriding_Operation Flag39
274 -- Body_Needed_For_SAL Flag40
276 -- Treat_As_Volatile Flag41
277 -- Is_Controlled Flag42
278 -- Has_Controlled_Component Flag43
280 -- In_Private_Part Flag45
281 -- Has_Alignment_Clause Flag46
283 -- In_Package_Body Flag48
285 -- Delay_Subprogram_Descriptors Flag50
288 -- Is_Entry_Formal Flag52
289 -- Is_Private_Descendant Flag53
290 -- Return_Present Flag54
291 -- Is_Tagged_Type Flag55
292 -- Has_Homonym Flag56
294 -- Non_Binary_Modulus Flag58
295 -- Is_Preelaborated Flag59
296 -- Is_Shared_Passive Flag60
298 -- Is_Remote_Types Flag61
299 -- Is_Remote_Call_Interface Flag62
300 -- Is_Character_Type Flag63
301 -- Is_Intrinsic_Subprogram Flag64
302 -- Has_Record_Rep_Clause Flag65
303 -- Has_Enumeration_Rep_Clause Flag66
304 -- Has_Small_Clause Flag67
305 -- Has_Component_Size_Clause Flag68
306 -- Is_Access_Constant Flag69
307 -- Is_First_Subtype Flag70
309 -- Has_Completion_In_Body Flag71
310 -- Has_Unknown_Discriminants Flag72
311 -- Is_Child_Unit Flag73
312 -- Is_CPP_Class Flag74
313 -- Has_Non_Standard_Rep Flag75
314 -- Is_Constructor Flag76
315 -- Is_Thread_Body Flag77
317 -- Has_All_Calls_Remote Flag79
318 -- Is_Constr_Subt_For_U_Nominal Flag80
320 -- Is_Asynchronous Flag81
321 -- Has_Gigi_Rep_Item Flag82
322 -- Has_Machine_Radix_Clause Flag83
323 -- Machine_Radix_10 Flag84
325 -- Has_Atomic_Components Flag86
326 -- Has_Volatile_Components Flag87
327 -- Discard_Names Flag88
328 -- Is_Interrupt_Handler Flag89
329 -- Returns_By_Ref Flag90
332 -- Size_Known_At_Compile_Time Flag92
333 -- Has_Subprogram_Descriptor Flag93
334 -- Is_Generic_Actual_Type Flag94
335 -- Uses_Sec_Stack Flag95
336 -- Warnings_Off Flag96
337 -- Is_Controlling_Formal Flag97
338 -- Has_Controlling_Result Flag98
339 -- Is_Exported Flag99
340 -- Has_Specified_Layout Flag100
342 -- Has_Nested_Block_With_Handler Flag101
344 -- Is_Completely_Hidden Flag103
345 -- Address_Taken Flag104
346 -- Suppress_Init_Proc Flag105
347 -- Is_Limited_Composite Flag106
348 -- Is_Private_Composite Flag107
349 -- Default_Expressions_Processed Flag108
350 -- Is_Non_Static_Subtype Flag109
351 -- Has_External_Tag_Rep_Clause Flag110
353 -- Is_Formal_Subprogram Flag111
354 -- Is_Renaming_Of_Object Flag112
356 -- Delay_Cleanups Flag114
357 -- Never_Set_In_Source Flag115
358 -- Is_Visible_Child_Unit Flag116
359 -- Is_Unchecked_Union Flag117
360 -- Is_For_Access_Subtype Flag118
361 -- Has_Convention_Pragma Flag119
362 -- Has_Primitive_Operations Flag120
364 -- Has_Pragma_Pack Flag121
365 -- Is_Bit_Packed_Array Flag122
366 -- Has_Unchecked_Union Flag123
367 -- Is_Eliminated Flag124
368 -- C_Pass_By_Copy Flag125
369 -- Is_Instantiated Flag126
370 -- Is_Valued_Procedure Flag127
371 -- (used for Component_Alignment) Flag128
372 -- (used for Component_Alignment) Flag129
373 -- Is_Generic_Instance Flag130
375 -- No_Pool_Assigned Flag131
376 -- Is_AST_Entry Flag132
377 -- Is_VMS_Exception Flag133
378 -- Is_Optional_Parameter Flag134
379 -- Has_Aliased_Components Flag135
380 -- No_Strict_Aliasing Flag136
381 -- Is_Machine_Code_Subprogram Flag137
382 -- Is_Packed_Array_Type Flag138
383 -- Has_Biased_Representation Flag139
384 -- Has_Complex_Representation Flag140
386 -- Is_Constr_Subt_For_UN_Aliased Flag141
387 -- Has_Missing_Return Flag142
388 -- Has_Recursive_Call Flag143
389 -- Is_Unsigned_Type Flag144
390 -- Strict_Alignment Flag145
391 -- Elaborate_All_Desirable Flag146
392 -- Needs_Debug_Info Flag147
393 -- Suppress_Elaboration_Warnings Flag148
394 -- Is_Compilation_Unit Flag149
395 -- Has_Pragma_Elaborate_Body Flag150
398 -- Entry_Accepted Flag152
399 -- Is_Obsolescent Flag153
400 -- Has_Per_Object_Constraint Flag154
401 -- Has_Private_Declaration Flag155
402 -- Referenced Flag156
403 -- Has_Pragma_Inline Flag157
404 -- Finalize_Storage_Only Flag158
405 -- From_With_Type Flag159
406 -- Is_Package_Body_Entity Flag160
408 -- Has_Qualified_Name Flag161
409 -- Nonzero_Is_True Flag162
410 -- Is_True_Constant Flag163
411 -- Reverse_Bit_Order Flag164
412 -- Suppress_Style_Checks Flag165
413 -- Debug_Info_Off Flag166
414 -- Sec_Stack_Needed_For_Return Flag167
415 -- Materialize_Entity Flag168
416 -- Function_Returns_With_DSP Flag169
417 -- Is_Known_Valid Flag170
419 -- Is_Hidden_Open_Scope Flag171
420 -- Has_Object_Size_Clause Flag172
421 -- Has_Fully_Qualified_Name Flag173
422 -- Elaboration_Entity_Required Flag174
423 -- Has_Forward_Instantiation Flag175
424 -- Is_Discrim_SO_Function Flag176
425 -- Size_Depends_On_Discriminant Flag177
426 -- Is_Null_Init_Proc Flag178
427 -- Has_Pragma_Pure_Function Flag179
428 -- Has_Pragma_Unreferenced Flag180
430 -- Has_Contiguous_Rep Flag181
431 -- Has_Xref_Entry Flag182
432 -- Must_Be_On_Byte_Boundary Flag183
433 -- Has_Stream_Size_Clause Flag184
434 -- Is_Ada_2005 Flag185
435 -- Is_Interface Flag186
467 -----------------------
468 -- Local subprograms --
469 -----------------------
471 function Rep_Clause (Id : E; Rep_Name : Name_Id) return N;
472 -- Returns the attribute definition clause whose name is Rep_Name. Returns
473 -- Empty if not found.
479 function Rep_Clause (Id : E; Rep_Name : Name_Id) return N is
483 Ritem := First_Rep_Item (Id);
484 while Present (Ritem) loop
485 if Nkind (Ritem) = N_Attribute_Definition_Clause
486 and then Chars (Ritem) = Rep_Name
490 Ritem := Next_Rep_Item (Ritem);
497 --------------------------------
498 -- Attribute Access Functions --
499 --------------------------------
501 function Abstract_Interfaces (Id : E) return L is
503 pragma Assert (Ekind (Id) = E_Record_Type
504 or else Ekind (Id) = E_Record_Subtype
505 or else Ekind (Id) = E_Record_Type_With_Private
506 or else Ekind (Id) = E_Record_Subtype_With_Private);
508 end Abstract_Interfaces;
510 function Abstract_Interface_Alias (Id : E) return E is
513 (Ekind (Id) = E_Procedure or Ekind (Id) = E_Function);
515 end Abstract_Interface_Alias;
517 function Accept_Address (Id : E) return L is
522 function Access_Disp_Table (Id : E) return L is
524 pragma Assert (Is_Tagged_Type (Id));
525 return Elist16 (Implementation_Base_Type (Id));
526 end Access_Disp_Table;
528 function Actual_Subtype (Id : E) return E is
531 (Ekind (Id) = E_Constant
532 or else Ekind (Id) = E_Variable
533 or else Ekind (Id) = E_Generic_In_Out_Parameter
534 or else Ekind (Id) in E_In_Parameter .. E_In_Out_Parameter);
538 function Address_Taken (Id : E) return B is
543 function Alias (Id : E) return E is
546 (Is_Overloadable (Id) or else Ekind (Id) = E_Subprogram_Type);
550 function Alignment (Id : E) return U is
552 pragma Assert (Is_Type (Id)
553 or else Is_Formal (Id)
554 or else Ekind (Id) = E_Loop_Parameter
555 or else Ekind (Id) = E_Constant
556 or else Ekind (Id) = E_Exception
557 or else Ekind (Id) = E_Variable);
561 function Associated_Final_Chain (Id : E) return E is
563 pragma Assert (Is_Access_Type (Id));
565 end Associated_Final_Chain;
567 function Associated_Formal_Package (Id : E) return E is
569 pragma Assert (Ekind (Id) = E_Package);
571 end Associated_Formal_Package;
573 function Associated_Node_For_Itype (Id : E) return N is
576 end Associated_Node_For_Itype;
578 function Associated_Storage_Pool (Id : E) return E is
580 pragma Assert (Is_Access_Type (Id));
581 return Node22 (Root_Type (Id));
582 end Associated_Storage_Pool;
584 function Barrier_Function (Id : E) return N is
586 pragma Assert (Is_Entry (Id));
588 end Barrier_Function;
590 function Block_Node (Id : E) return N is
592 pragma Assert (Ekind (Id) = E_Block);
596 function Body_Entity (Id : E) return E is
599 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
603 function Body_Needed_For_SAL (Id : E) return B is
606 (Ekind (Id) = E_Package
607 or else Is_Subprogram (Id)
608 or else Is_Generic_Unit (Id));
610 end Body_Needed_For_SAL;
612 function C_Pass_By_Copy (Id : E) return B is
614 pragma Assert (Is_Record_Type (Id));
615 return Flag125 (Implementation_Base_Type (Id));
618 function Can_Never_Be_Null (Id : E) return B is
621 end Can_Never_Be_Null;
623 function Checks_May_Be_Suppressed (Id : E) return B is
626 end Checks_May_Be_Suppressed;
628 function Class_Wide_Type (Id : E) return E is
630 pragma Assert (Is_Type (Id));
634 function Cloned_Subtype (Id : E) return E is
637 (Ekind (Id) = E_Record_Subtype
638 or else Ekind (Id) = E_Class_Wide_Subtype);
642 function Component_Bit_Offset (Id : E) return U is
645 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
647 end Component_Bit_Offset;
649 function Component_Clause (Id : E) return N is
652 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
654 end Component_Clause;
656 function Component_Size (Id : E) return U is
658 pragma Assert (Is_Array_Type (Id));
659 return Uint22 (Implementation_Base_Type (Id));
662 function Component_Type (Id : E) return E is
664 return Node20 (Implementation_Base_Type (Id));
667 function Corresponding_Concurrent_Type (Id : E) return E is
669 pragma Assert (Ekind (Id) = E_Record_Type);
671 end Corresponding_Concurrent_Type;
673 function Corresponding_Discriminant (Id : E) return E is
675 pragma Assert (Ekind (Id) = E_Discriminant);
677 end Corresponding_Discriminant;
679 function Corresponding_Equality (Id : E) return E is
682 (Ekind (Id) = E_Function
683 and then not Comes_From_Source (Id)
684 and then Chars (Id) = Name_Op_Ne);
686 end Corresponding_Equality;
688 function Corresponding_Record_Type (Id : E) return E is
690 pragma Assert (Is_Concurrent_Type (Id));
692 end Corresponding_Record_Type;
694 function Corresponding_Remote_Type (Id : E) return E is
697 end Corresponding_Remote_Type;
699 function Current_Value (Id : E) return N is
701 pragma Assert (Ekind (Id) in Object_Kind);
705 function CR_Discriminant (Id : E) return E is
710 function Debug_Info_Off (Id : E) return B is
715 function Debug_Renaming_Link (Id : E) return E is
718 end Debug_Renaming_Link;
720 function Default_Expr_Function (Id : E) return E is
722 pragma Assert (Is_Formal (Id));
724 end Default_Expr_Function;
726 function Default_Expressions_Processed (Id : E) return B is
729 end Default_Expressions_Processed;
731 function Default_Value (Id : E) return N is
733 pragma Assert (Is_Formal (Id));
737 function Delay_Cleanups (Id : E) return B is
742 function Delay_Subprogram_Descriptors (Id : E) return B is
745 end Delay_Subprogram_Descriptors;
747 function Delta_Value (Id : E) return R is
749 pragma Assert (Is_Fixed_Point_Type (Id));
753 function Dependent_Instances (Id : E) return L is
755 pragma Assert (Is_Generic_Instance (Id));
757 end Dependent_Instances;
759 function Depends_On_Private (Id : E) return B is
761 pragma Assert (Nkind (Id) in N_Entity);
763 end Depends_On_Private;
765 function Digits_Value (Id : E) return U is
768 (Is_Floating_Point_Type (Id)
769 or else Is_Decimal_Fixed_Point_Type (Id));
773 function Directly_Designated_Type (Id : E) return E is
776 end Directly_Designated_Type;
778 function Discard_Names (Id : E) return B is
783 function Discriminal (Id : E) return E is
785 pragma Assert (Ekind (Id) = E_Discriminant);
789 function Discriminal_Link (Id : E) return N is
792 end Discriminal_Link;
794 function Discriminant_Checking_Func (Id : E) return E is
796 pragma Assert (Ekind (Id) = E_Component);
798 end Discriminant_Checking_Func;
800 function Discriminant_Constraint (Id : E) return L is
802 pragma Assert (Is_Composite_Type (Id) and then Has_Discriminants (Id));
804 end Discriminant_Constraint;
806 function Discriminant_Default_Value (Id : E) return N is
808 pragma Assert (Ekind (Id) = E_Discriminant);
810 end Discriminant_Default_Value;
812 function Discriminant_Number (Id : E) return U is
814 pragma Assert (Ekind (Id) = E_Discriminant);
816 end Discriminant_Number;
818 function DT_Entry_Count (Id : E) return U is
820 pragma Assert (Ekind (Id) = E_Component and then Is_Tag (Id));
824 function DT_Position (Id : E) return U is
827 ((Ekind (Id) = E_Function
828 or else Ekind (Id) = E_Procedure)
829 and then Present (DTC_Entity (Id)));
833 function DTC_Entity (Id : E) return E is
836 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
840 function Elaborate_All_Desirable (Id : E) return B is
843 end Elaborate_All_Desirable;
845 function Elaboration_Entity (Id : E) return E is
850 Ekind (Id) = E_Package
852 Is_Generic_Unit (Id));
854 end Elaboration_Entity;
856 function Elaboration_Entity_Required (Id : E) return B is
861 Ekind (Id) = E_Package
863 Is_Generic_Unit (Id));
865 end Elaboration_Entity_Required;
867 function Enclosing_Scope (Id : E) return E is
872 function Entry_Accepted (Id : E) return B is
874 pragma Assert (Is_Entry (Id));
878 function Entry_Bodies_Array (Id : E) return E is
881 end Entry_Bodies_Array;
883 function Entry_Cancel_Parameter (Id : E) return E is
886 end Entry_Cancel_Parameter;
888 function Entry_Component (Id : E) return E is
893 function Entry_Formal (Id : E) return E is
898 function Entry_Index_Constant (Id : E) return N is
900 pragma Assert (Ekind (Id) = E_Entry_Index_Parameter);
902 end Entry_Index_Constant;
904 function Entry_Parameters_Type (Id : E) return E is
907 end Entry_Parameters_Type;
909 function Enum_Pos_To_Rep (Id : E) return E is
911 pragma Assert (Ekind (Id) = E_Enumeration_Type);
915 function Enumeration_Pos (Id : E) return Uint is
917 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
921 function Enumeration_Rep (Id : E) return U is
923 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
927 function Enumeration_Rep_Expr (Id : E) return N is
929 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
931 end Enumeration_Rep_Expr;
933 function Equivalent_Type (Id : E) return E is
936 (Ekind (Id) = E_Class_Wide_Subtype or else
937 Ekind (Id) = E_Access_Protected_Subprogram_Type or else
938 Ekind (Id) = E_Access_Subprogram_Type or else
939 Ekind (Id) = E_Exception_Type);
943 function Esize (Id : E) return Uint is
948 function Exception_Code (Id : E) return Uint is
950 pragma Assert (Ekind (Id) = E_Exception);
954 function Extra_Accessibility (Id : E) return E is
956 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
958 end Extra_Accessibility;
960 function Extra_Constrained (Id : E) return E is
962 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
964 end Extra_Constrained;
966 function Extra_Formal (Id : E) return E is
971 function Finalization_Chain_Entity (Id : E) return E is
974 end Finalization_Chain_Entity;
976 function Finalize_Storage_Only (Id : E) return B is
978 pragma Assert (Is_Type (Id));
979 return Flag158 (Base_Type (Id));
980 end Finalize_Storage_Only;
982 function First_Entity (Id : E) return E is
987 function First_Index (Id : E) return N is
992 function First_Literal (Id : E) return E is
997 function First_Optional_Parameter (Id : E) return E is
1000 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
1002 end First_Optional_Parameter;
1004 function First_Private_Entity (Id : E) return E is
1006 pragma Assert (Ekind (Id) = E_Package
1007 or else Ekind (Id) = E_Generic_Package
1008 or else Ekind (Id) = E_Protected_Type
1009 or else Ekind (Id) = E_Protected_Subtype
1010 or else Ekind (Id) = E_Task_Type
1011 or else Ekind (Id) = E_Task_Subtype);
1013 end First_Private_Entity;
1015 function First_Rep_Item (Id : E) return E is
1020 function Freeze_Node (Id : E) return N is
1025 function From_With_Type (Id : E) return B is
1027 return Flag159 (Id);
1030 function Full_View (Id : E) return E is
1032 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Constant);
1036 function Function_Returns_With_DSP (Id : E) return B is
1039 (Is_Subprogram (Id) or else Ekind (Id) = E_Subprogram_Type);
1040 return Flag169 (Id);
1041 end Function_Returns_With_DSP;
1043 function Generic_Homonym (Id : E) return E is
1045 pragma Assert (Ekind (Id) = E_Generic_Package);
1047 end Generic_Homonym;
1049 function Generic_Renamings (Id : E) return L is
1051 return Elist23 (Id);
1052 end Generic_Renamings;
1054 function Handler_Records (Id : E) return S is
1057 end Handler_Records;
1059 function Has_Aliased_Components (Id : E) return B is
1061 return Flag135 (Implementation_Base_Type (Id));
1062 end Has_Aliased_Components;
1064 function Has_Alignment_Clause (Id : E) return B is
1067 end Has_Alignment_Clause;
1069 function Has_All_Calls_Remote (Id : E) return B is
1072 end Has_All_Calls_Remote;
1074 function Has_Atomic_Components (Id : E) return B is
1076 return Flag86 (Implementation_Base_Type (Id));
1077 end Has_Atomic_Components;
1079 function Has_Biased_Representation (Id : E) return B is
1081 return Flag139 (Id);
1082 end Has_Biased_Representation;
1084 function Has_Completion (Id : E) return B is
1089 function Has_Completion_In_Body (Id : E) return B is
1091 pragma Assert (Is_Type (Id));
1093 end Has_Completion_In_Body;
1095 function Has_Complex_Representation (Id : E) return B is
1097 pragma Assert (Is_Type (Id));
1098 return Flag140 (Implementation_Base_Type (Id));
1099 end Has_Complex_Representation;
1101 function Has_Component_Size_Clause (Id : E) return B is
1103 pragma Assert (Is_Array_Type (Id));
1104 return Flag68 (Implementation_Base_Type (Id));
1105 end Has_Component_Size_Clause;
1107 function Has_Controlled_Component (Id : E) return B is
1109 return Flag43 (Base_Type (Id));
1110 end Has_Controlled_Component;
1112 function Has_Contiguous_Rep (Id : E) return B is
1114 return Flag181 (Id);
1115 end Has_Contiguous_Rep;
1117 function Has_Controlling_Result (Id : E) return B is
1120 end Has_Controlling_Result;
1122 function Has_Convention_Pragma (Id : E) return B is
1124 return Flag119 (Id);
1125 end Has_Convention_Pragma;
1127 function Has_Delayed_Freeze (Id : E) return B is
1129 pragma Assert (Nkind (Id) in N_Entity);
1131 end Has_Delayed_Freeze;
1133 function Has_Discriminants (Id : E) return B is
1135 pragma Assert (Nkind (Id) in N_Entity);
1137 end Has_Discriminants;
1139 function Has_Enumeration_Rep_Clause (Id : E) return B is
1141 pragma Assert (Is_Enumeration_Type (Id));
1143 end Has_Enumeration_Rep_Clause;
1145 function Has_Exit (Id : E) return B is
1150 function Has_External_Tag_Rep_Clause (Id : E) return B is
1152 pragma Assert (Is_Tagged_Type (Id));
1153 return Flag110 (Id);
1154 end Has_External_Tag_Rep_Clause;
1156 function Has_Forward_Instantiation (Id : E) return B is
1158 return Flag175 (Id);
1159 end Has_Forward_Instantiation;
1161 function Has_Fully_Qualified_Name (Id : E) return B is
1163 return Flag173 (Id);
1164 end Has_Fully_Qualified_Name;
1166 function Has_Gigi_Rep_Item (Id : E) return B is
1169 end Has_Gigi_Rep_Item;
1171 function Has_Homonym (Id : E) return B is
1176 function Has_Machine_Radix_Clause (Id : E) return B is
1178 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
1180 end Has_Machine_Radix_Clause;
1182 function Has_Master_Entity (Id : E) return B is
1185 end Has_Master_Entity;
1187 function Has_Missing_Return (Id : E) return B is
1190 (Ekind (Id) = E_Function or else Ekind (Id) = E_Generic_Function);
1191 return Flag142 (Id);
1192 end Has_Missing_Return;
1194 function Has_Nested_Block_With_Handler (Id : E) return B is
1196 return Flag101 (Id);
1197 end Has_Nested_Block_With_Handler;
1199 function Has_Non_Standard_Rep (Id : E) return B is
1201 return Flag75 (Implementation_Base_Type (Id));
1202 end Has_Non_Standard_Rep;
1204 function Has_Object_Size_Clause (Id : E) return B is
1206 pragma Assert (Is_Type (Id));
1207 return Flag172 (Id);
1208 end Has_Object_Size_Clause;
1210 function Has_Per_Object_Constraint (Id : E) return B is
1212 return Flag154 (Id);
1213 end Has_Per_Object_Constraint;
1215 function Has_Pragma_Controlled (Id : E) return B is
1217 pragma Assert (Is_Access_Type (Id));
1218 return Flag27 (Implementation_Base_Type (Id));
1219 end Has_Pragma_Controlled;
1221 function Has_Pragma_Elaborate_Body (Id : E) return B is
1223 return Flag150 (Id);
1224 end Has_Pragma_Elaborate_Body;
1226 function Has_Pragma_Inline (Id : E) return B is
1228 return Flag157 (Id);
1229 end Has_Pragma_Inline;
1231 function Has_Pragma_Pack (Id : E) return B is
1233 pragma Assert (Is_Record_Type (Id) or else Is_Array_Type (Id));
1234 return Flag121 (Implementation_Base_Type (Id));
1235 end Has_Pragma_Pack;
1237 function Has_Pragma_Pure_Function (Id : E) return B is
1239 pragma Assert (Is_Subprogram (Id));
1240 return Flag179 (Id);
1241 end Has_Pragma_Pure_Function;
1243 function Has_Pragma_Unreferenced (Id : E) return B is
1245 return Flag180 (Id);
1246 end Has_Pragma_Unreferenced;
1248 function Has_Primitive_Operations (Id : E) return B is
1250 pragma Assert (Is_Type (Id));
1251 return Flag120 (Base_Type (Id));
1252 end Has_Primitive_Operations;
1254 function Has_Private_Declaration (Id : E) return B is
1256 return Flag155 (Id);
1257 end Has_Private_Declaration;
1259 function Has_Qualified_Name (Id : E) return B is
1261 return Flag161 (Id);
1262 end Has_Qualified_Name;
1264 function Has_Record_Rep_Clause (Id : E) return B is
1266 pragma Assert (Is_Record_Type (Id));
1267 return Flag65 (Implementation_Base_Type (Id));
1268 end Has_Record_Rep_Clause;
1270 function Has_Recursive_Call (Id : E) return B is
1272 pragma Assert (Is_Subprogram (Id));
1273 return Flag143 (Id);
1274 end Has_Recursive_Call;
1276 function Has_Size_Clause (Id : E) return B is
1279 end Has_Size_Clause;
1281 function Has_Small_Clause (Id : E) return B is
1284 end Has_Small_Clause;
1286 function Has_Specified_Layout (Id : E) return B is
1288 pragma Assert (Is_Type (Id));
1289 return Flag100 (Implementation_Base_Type (Id));
1290 end Has_Specified_Layout;
1292 function Has_Storage_Size_Clause (Id : E) return B is
1294 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
1295 return Flag23 (Implementation_Base_Type (Id));
1296 end Has_Storage_Size_Clause;
1298 function Has_Stream_Size_Clause (Id : E) return B is
1300 pragma Assert (Is_Elementary_Type (Id));
1301 return Flag184 (Id);
1302 end Has_Stream_Size_Clause;
1304 function Has_Subprogram_Descriptor (Id : E) return B is
1307 end Has_Subprogram_Descriptor;
1309 function Has_Task (Id : E) return B is
1311 return Flag30 (Base_Type (Id));
1314 function Has_Unchecked_Union (Id : E) return B is
1316 return Flag123 (Base_Type (Id));
1317 end Has_Unchecked_Union;
1319 function Has_Unknown_Discriminants (Id : E) return B is
1321 pragma Assert (Is_Type (Id));
1323 end Has_Unknown_Discriminants;
1325 function Has_Volatile_Components (Id : E) return B is
1327 return Flag87 (Implementation_Base_Type (Id));
1328 end Has_Volatile_Components;
1330 function Has_Xref_Entry (Id : E) return B is
1332 return Flag182 (Implementation_Base_Type (Id));
1335 function Hiding_Loop_Variable (Id : E) return E is
1337 pragma Assert (Ekind (Id) = E_Variable);
1339 end Hiding_Loop_Variable;
1341 function Homonym (Id : E) return E is
1346 function In_Package_Body (Id : E) return B is
1349 end In_Package_Body;
1351 function In_Private_Part (Id : E) return B is
1354 end In_Private_Part;
1356 function In_Use (Id : E) return B is
1358 pragma Assert (Nkind (Id) in N_Entity);
1362 function Inner_Instances (Id : E) return L is
1364 return Elist23 (Id);
1365 end Inner_Instances;
1367 function Interface_Name (Id : E) return N is
1372 function Is_Abstract (Id : E) return B is
1377 function Is_Access_Constant (Id : E) return B is
1379 pragma Assert (Is_Access_Type (Id));
1381 end Is_Access_Constant;
1383 function Is_Ada_2005 (Id : E) return B is
1385 return Flag185 (Id);
1388 function Is_Aliased (Id : E) return B is
1390 pragma Assert (Nkind (Id) in N_Entity);
1394 function Is_AST_Entry (Id : E) return B is
1396 pragma Assert (Is_Entry (Id));
1397 return Flag132 (Id);
1400 function Is_Asynchronous (Id : E) return B is
1403 (Ekind (Id) = E_Procedure or else Is_Type (Id));
1405 end Is_Asynchronous;
1407 function Is_Atomic (Id : E) return B is
1412 function Is_Bit_Packed_Array (Id : E) return B is
1414 return Flag122 (Implementation_Base_Type (Id));
1415 end Is_Bit_Packed_Array;
1417 function Is_Called (Id : E) return B is
1420 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Function);
1421 return Flag102 (Id);
1424 function Is_Character_Type (Id : E) return B is
1427 end Is_Character_Type;
1429 function Is_Child_Unit (Id : E) return B is
1434 function Is_Class_Wide_Equivalent_Type (Id : E) return B is
1437 end Is_Class_Wide_Equivalent_Type;
1439 function Is_Compilation_Unit (Id : E) return B is
1441 return Flag149 (Id);
1442 end Is_Compilation_Unit;
1444 function Is_Completely_Hidden (Id : E) return B is
1446 pragma Assert (Ekind (Id) = E_Discriminant);
1447 return Flag103 (Id);
1448 end Is_Completely_Hidden;
1450 function Is_Constr_Subt_For_U_Nominal (Id : E) return B is
1453 end Is_Constr_Subt_For_U_Nominal;
1455 function Is_Constr_Subt_For_UN_Aliased (Id : E) return B is
1457 return Flag141 (Id);
1458 end Is_Constr_Subt_For_UN_Aliased;
1460 function Is_Constrained (Id : E) return B is
1462 pragma Assert (Nkind (Id) in N_Entity);
1466 function Is_Constructor (Id : E) return B is
1471 function Is_Controlled (Id : E) return B is
1473 return Flag42 (Base_Type (Id));
1476 function Is_Controlling_Formal (Id : E) return B is
1478 pragma Assert (Is_Formal (Id));
1480 end Is_Controlling_Formal;
1482 function Is_CPP_Class (Id : E) return B is
1487 function Is_Discrim_SO_Function (Id : E) return B is
1489 return Flag176 (Id);
1490 end Is_Discrim_SO_Function;
1492 function Is_Dispatching_Operation (Id : E) return B is
1494 pragma Assert (Nkind (Id) in N_Entity);
1496 end Is_Dispatching_Operation;
1498 function Is_Eliminated (Id : E) return B is
1500 return Flag124 (Id);
1503 function Is_Entry_Formal (Id : E) return B is
1506 end Is_Entry_Formal;
1508 function Is_Exported (Id : E) return B is
1513 function Is_First_Subtype (Id : E) return B is
1516 end Is_First_Subtype;
1518 function Is_For_Access_Subtype (Id : E) return B is
1521 (Ekind (Id) = E_Record_Subtype
1523 Ekind (Id) = E_Private_Subtype);
1524 return Flag118 (Id);
1525 end Is_For_Access_Subtype;
1527 function Is_Formal_Subprogram (Id : E) return B is
1529 return Flag111 (Id);
1530 end Is_Formal_Subprogram;
1532 function Is_Frozen (Id : E) return B is
1537 function Is_Generic_Actual_Type (Id : E) return B is
1539 pragma Assert (Is_Type (Id));
1541 end Is_Generic_Actual_Type;
1543 function Is_Generic_Instance (Id : E) return B is
1545 return Flag130 (Id);
1546 end Is_Generic_Instance;
1548 function Is_Generic_Type (Id : E) return B is
1550 pragma Assert (Nkind (Id) in N_Entity);
1552 end Is_Generic_Type;
1554 function Is_Hidden (Id : E) return B is
1559 function Is_Hidden_Open_Scope (Id : E) return B is
1561 return Flag171 (Id);
1562 end Is_Hidden_Open_Scope;
1564 function Is_Immediately_Visible (Id : E) return B is
1566 pragma Assert (Nkind (Id) in N_Entity);
1568 end Is_Immediately_Visible;
1570 function Is_Imported (Id : E) return B is
1575 function Is_Inlined (Id : E) return B is
1580 function Is_Interface (Id : E) return B is
1582 pragma Assert (Ekind (Id) = E_Record_Type
1583 or else Ekind (Id) = E_Record_Subtype
1584 or else Ekind (Id) = E_Record_Type_With_Private
1585 or else Ekind (Id) = E_Record_Subtype_With_Private
1586 or else Ekind (Id) = E_Class_Wide_Type);
1587 return Flag186 (Id);
1590 function Is_Instantiated (Id : E) return B is
1592 return Flag126 (Id);
1593 end Is_Instantiated;
1595 function Is_Internal (Id : E) return B is
1597 pragma Assert (Nkind (Id) in N_Entity);
1601 function Is_Interrupt_Handler (Id : E) return B is
1603 pragma Assert (Nkind (Id) in N_Entity);
1605 end Is_Interrupt_Handler;
1607 function Is_Intrinsic_Subprogram (Id : E) return B is
1610 end Is_Intrinsic_Subprogram;
1612 function Is_Itype (Id : E) return B is
1617 function Is_Known_Non_Null (Id : E) return B is
1620 end Is_Known_Non_Null;
1622 function Is_Known_Valid (Id : E) return B is
1624 return Flag170 (Id);
1627 function Is_Limited_Composite (Id : E) return B is
1629 return Flag106 (Id);
1630 end Is_Limited_Composite;
1632 function Is_Limited_Record (Id : E) return B is
1635 end Is_Limited_Record;
1637 function Is_Machine_Code_Subprogram (Id : E) return B is
1639 pragma Assert (Is_Subprogram (Id));
1640 return Flag137 (Id);
1641 end Is_Machine_Code_Subprogram;
1643 function Is_Non_Static_Subtype (Id : E) return B is
1645 pragma Assert (Is_Type (Id));
1646 return Flag109 (Id);
1647 end Is_Non_Static_Subtype;
1649 function Is_Null_Init_Proc (Id : E) return B is
1651 pragma Assert (Ekind (Id) = E_Procedure);
1652 return Flag178 (Id);
1653 end Is_Null_Init_Proc;
1655 function Is_Obsolescent (Id : E) return B is
1657 pragma Assert (Is_Subprogram (Id));
1658 return Flag153 (Id);
1661 function Is_Optional_Parameter (Id : E) return B is
1663 pragma Assert (Is_Formal (Id));
1664 return Flag134 (Id);
1665 end Is_Optional_Parameter;
1667 function Is_Overriding_Operation (Id : E) return B is
1669 pragma Assert (Is_Subprogram (Id));
1671 end Is_Overriding_Operation;
1673 function Is_Package_Body_Entity (Id : E) return B is
1675 return Flag160 (Id);
1676 end Is_Package_Body_Entity;
1678 function Is_Packed (Id : E) return B is
1680 return Flag51 (Implementation_Base_Type (Id));
1683 function Is_Packed_Array_Type (Id : E) return B is
1685 return Flag138 (Id);
1686 end Is_Packed_Array_Type;
1688 function Is_Potentially_Use_Visible (Id : E) return B is
1690 pragma Assert (Nkind (Id) in N_Entity);
1692 end Is_Potentially_Use_Visible;
1694 function Is_Preelaborated (Id : E) return B is
1697 end Is_Preelaborated;
1699 function Is_Private_Composite (Id : E) return B is
1701 pragma Assert (Is_Type (Id));
1702 return Flag107 (Id);
1703 end Is_Private_Composite;
1705 function Is_Private_Descendant (Id : E) return B is
1708 end Is_Private_Descendant;
1710 function Is_Public (Id : E) return B is
1712 pragma Assert (Nkind (Id) in N_Entity);
1716 function Is_Pure (Id : E) return B is
1721 function Is_Remote_Call_Interface (Id : E) return B is
1724 end Is_Remote_Call_Interface;
1726 function Is_Remote_Types (Id : E) return B is
1729 end Is_Remote_Types;
1731 function Is_Renaming_Of_Object (Id : E) return B is
1733 return Flag112 (Id);
1734 end Is_Renaming_Of_Object;
1736 function Is_Shared_Passive (Id : E) return B is
1739 end Is_Shared_Passive;
1741 function Is_Statically_Allocated (Id : E) return B is
1744 end Is_Statically_Allocated;
1746 function Is_Tag (Id : E) return B is
1748 pragma Assert (Nkind (Id) in N_Entity);
1752 function Is_Tagged_Type (Id : E) return B is
1757 function Is_Thread_Body (Id : E) return B is
1762 function Is_True_Constant (Id : E) return B is
1764 return Flag163 (Id);
1765 end Is_True_Constant;
1767 function Is_Unchecked_Union (Id : E) return B is
1769 return Flag117 (Id);
1770 end Is_Unchecked_Union;
1772 function Is_Unsigned_Type (Id : E) return B is
1774 pragma Assert (Is_Type (Id));
1775 return Flag144 (Id);
1776 end Is_Unsigned_Type;
1778 function Is_Valued_Procedure (Id : E) return B is
1780 pragma Assert (Ekind (Id) = E_Procedure);
1781 return Flag127 (Id);
1782 end Is_Valued_Procedure;
1784 function Is_Visible_Child_Unit (Id : E) return B is
1786 pragma Assert (Is_Child_Unit (Id));
1787 return Flag116 (Id);
1788 end Is_Visible_Child_Unit;
1790 function Is_VMS_Exception (Id : E) return B is
1792 return Flag133 (Id);
1793 end Is_VMS_Exception;
1795 function Is_Volatile (Id : E) return B is
1797 pragma Assert (Nkind (Id) in N_Entity);
1798 if Is_Type (Id) then
1799 return Flag16 (Base_Type (Id));
1805 function Kill_Elaboration_Checks (Id : E) return B is
1808 end Kill_Elaboration_Checks;
1810 function Kill_Range_Checks (Id : E) return B is
1813 end Kill_Range_Checks;
1815 function Kill_Tag_Checks (Id : E) return B is
1818 end Kill_Tag_Checks;
1820 function Last_Entity (Id : E) return E is
1825 function Limited_View (Id : E) return E is
1827 pragma Assert (Ekind (Id) = E_Package);
1831 function Lit_Indexes (Id : E) return E is
1833 pragma Assert (Is_Enumeration_Type (Id));
1837 function Lit_Strings (Id : E) return E is
1839 pragma Assert (Is_Enumeration_Type (Id));
1843 function Machine_Radix_10 (Id : E) return B is
1845 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
1847 end Machine_Radix_10;
1849 function Master_Id (Id : E) return E is
1854 function Materialize_Entity (Id : E) return B is
1856 return Flag168 (Id);
1857 end Materialize_Entity;
1859 function Mechanism (Id : E) return M is
1861 pragma Assert (Ekind (Id) = E_Function or else Is_Formal (Id));
1862 return UI_To_Int (Uint8 (Id));
1865 function Modulus (Id : E) return Uint is
1867 pragma Assert (Is_Modular_Integer_Type (Id));
1868 return Uint17 (Base_Type (Id));
1871 function Must_Be_On_Byte_Boundary (Id : E) return B is
1873 pragma Assert (Is_Type (Id));
1874 return Flag183 (Id);
1875 end Must_Be_On_Byte_Boundary;
1877 function Needs_Debug_Info (Id : E) return B is
1879 return Flag147 (Id);
1880 end Needs_Debug_Info;
1882 function Needs_No_Actuals (Id : E) return B is
1885 (Is_Overloadable (Id)
1886 or else Ekind (Id) = E_Subprogram_Type
1887 or else Ekind (Id) = E_Entry_Family);
1889 end Needs_No_Actuals;
1891 function Never_Set_In_Source (Id : E) return B is
1893 return Flag115 (Id);
1894 end Never_Set_In_Source;
1896 function Next_Inlined_Subprogram (Id : E) return E is
1899 end Next_Inlined_Subprogram;
1901 function No_Pool_Assigned (Id : E) return B is
1903 pragma Assert (Is_Access_Type (Id));
1904 return Flag131 (Root_Type (Id));
1905 end No_Pool_Assigned;
1907 function No_Return (Id : E) return B is
1911 or else Ekind (Id) = E_Procedure
1912 or else Ekind (Id) = E_Generic_Procedure);
1913 return Flag113 (Id);
1916 function No_Strict_Aliasing (Id : E) return B is
1918 pragma Assert (Is_Access_Type (Id));
1919 return Flag136 (Base_Type (Id));
1920 end No_Strict_Aliasing;
1922 function Non_Binary_Modulus (Id : E) return B is
1924 pragma Assert (Is_Modular_Integer_Type (Id));
1925 return Flag58 (Base_Type (Id));
1926 end Non_Binary_Modulus;
1928 function Non_Limited_View (Id : E) return E is
1930 pragma Assert (False
1931 or else Ekind (Id) = E_Incomplete_Type);
1933 end Non_Limited_View;
1935 function Nonzero_Is_True (Id : E) return B is
1937 pragma Assert (Root_Type (Id) = Standard_Boolean);
1938 return Flag162 (Base_Type (Id));
1939 end Nonzero_Is_True;
1941 function Normalized_First_Bit (Id : E) return U is
1944 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
1946 end Normalized_First_Bit;
1948 function Normalized_Position (Id : E) return U is
1951 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
1953 end Normalized_Position;
1955 function Normalized_Position_Max (Id : E) return U is
1958 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
1960 end Normalized_Position_Max;
1962 function Object_Ref (Id : E) return E is
1964 pragma Assert (Ekind (Id) = E_Protected_Body);
1968 function Obsolescent_Warning (Id : E) return N is
1970 pragma Assert (Is_Subprogram (Id));
1972 end Obsolescent_Warning;
1974 function Original_Access_Type (Id : E) return E is
1977 (Ekind (Id) = E_Access_Subprogram_Type
1978 or else Ekind (Id) = E_Access_Protected_Subprogram_Type);
1980 end Original_Access_Type;
1982 function Original_Array_Type (Id : E) return E is
1984 pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id));
1986 end Original_Array_Type;
1988 function Original_Record_Component (Id : E) return E is
1991 (Ekind (Id) = E_Void
1992 or else Ekind (Id) = E_Component
1993 or else Ekind (Id) = E_Discriminant);
1995 end Original_Record_Component;
1997 function Packed_Array_Type (Id : E) return E is
1999 pragma Assert (Is_Array_Type (Id));
2001 end Packed_Array_Type;
2003 function Parent_Subtype (Id : E) return E is
2005 pragma Assert (Ekind (Id) = E_Record_Type);
2009 function Primitive_Operations (Id : E) return L is
2011 pragma Assert (Is_Tagged_Type (Id));
2012 return Elist15 (Id);
2013 end Primitive_Operations;
2015 function Prival (Id : E) return E is
2017 pragma Assert (Is_Protected_Private (Id));
2021 function Privals_Chain (Id : E) return L is
2023 pragma Assert (Is_Overloadable (Id)
2024 or else Ekind (Id) = E_Entry_Family);
2025 return Elist23 (Id);
2028 function Private_Dependents (Id : E) return L is
2030 pragma Assert (Is_Incomplete_Or_Private_Type (Id));
2031 return Elist18 (Id);
2032 end Private_Dependents;
2034 function Private_View (Id : E) return N is
2036 pragma Assert (Is_Private_Type (Id));
2040 function Protected_Body_Subprogram (Id : E) return E is
2042 pragma Assert (Is_Subprogram (Id) or else Is_Entry (Id));
2044 end Protected_Body_Subprogram;
2046 function Protected_Formal (Id : E) return E is
2048 pragma Assert (Is_Formal (Id));
2050 end Protected_Formal;
2052 function Protected_Operation (Id : E) return N is
2054 pragma Assert (Is_Protected_Private (Id));
2056 end Protected_Operation;
2058 function Reachable (Id : E) return B is
2063 function Referenced (Id : E) return B is
2065 return Flag156 (Id);
2068 function Referenced_As_LHS (Id : E) return B is
2071 end Referenced_As_LHS;
2073 function Referenced_Object (Id : E) return N is
2075 pragma Assert (Is_Type (Id));
2077 end Referenced_Object;
2079 function Register_Exception_Call (Id : E) return N is
2081 pragma Assert (Ekind (Id) = E_Exception);
2083 end Register_Exception_Call;
2085 function Related_Array_Object (Id : E) return E is
2087 pragma Assert (Is_Array_Type (Id));
2089 end Related_Array_Object;
2091 function Related_Instance (Id : E) return E is
2094 (Ekind (Id) = E_Package or else Ekind (Id) = E_Package_Body);
2096 end Related_Instance;
2098 function Renamed_Entity (Id : E) return N is
2103 function Renamed_Object (Id : E) return N is
2108 function Renaming_Map (Id : E) return U is
2113 function Return_Present (Id : E) return B is
2118 function Returns_By_Ref (Id : E) return B is
2123 function Reverse_Bit_Order (Id : E) return B is
2125 pragma Assert (Is_Record_Type (Id));
2126 return Flag164 (Base_Type (Id));
2127 end Reverse_Bit_Order;
2129 function RM_Size (Id : E) return U is
2131 pragma Assert (Is_Type (Id));
2135 function Scalar_Range (Id : E) return N is
2140 function Scale_Value (Id : E) return U is
2145 function Scope_Depth_Value (Id : E) return U is
2148 end Scope_Depth_Value;
2150 function Sec_Stack_Needed_For_Return (Id : E) return B is
2152 return Flag167 (Id);
2153 end Sec_Stack_Needed_For_Return;
2155 function Shadow_Entities (Id : E) return S is
2158 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
2160 end Shadow_Entities;
2162 function Shared_Var_Assign_Proc (Id : E) return E is
2164 pragma Assert (Ekind (Id) = E_Variable);
2166 end Shared_Var_Assign_Proc;
2168 function Shared_Var_Read_Proc (Id : E) return E is
2170 pragma Assert (Ekind (Id) = E_Variable);
2172 end Shared_Var_Read_Proc;
2174 function Size_Check_Code (Id : E) return N is
2176 pragma Assert (Ekind (Id) = E_Constant or else Ekind (Id) = E_Variable);
2178 end Size_Check_Code;
2180 function Size_Depends_On_Discriminant (Id : E) return B is
2182 return Flag177 (Id);
2183 end Size_Depends_On_Discriminant;
2185 function Size_Known_At_Compile_Time (Id : E) return B is
2188 end Size_Known_At_Compile_Time;
2190 function Small_Value (Id : E) return R is
2192 pragma Assert (Is_Fixed_Point_Type (Id));
2193 return Ureal21 (Id);
2196 function Spec_Entity (Id : E) return E is
2199 (Ekind (Id) = E_Package_Body or else Is_Formal (Id));
2203 function Storage_Size_Variable (Id : E) return E is
2205 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
2206 return Node15 (Implementation_Base_Type (Id));
2207 end Storage_Size_Variable;
2209 function Stored_Constraint (Id : E) return L is
2212 (Is_Composite_Type (Id) and then not Is_Array_Type (Id));
2213 return Elist23 (Id);
2214 end Stored_Constraint;
2216 function Strict_Alignment (Id : E) return B is
2218 return Flag145 (Implementation_Base_Type (Id));
2219 end Strict_Alignment;
2221 function String_Literal_Length (Id : E) return U is
2224 end String_Literal_Length;
2226 function String_Literal_Low_Bound (Id : E) return N is
2229 end String_Literal_Low_Bound;
2231 function Suppress_Elaboration_Warnings (Id : E) return B is
2233 return Flag148 (Id);
2234 end Suppress_Elaboration_Warnings;
2236 function Suppress_Init_Proc (Id : E) return B is
2238 return Flag105 (Base_Type (Id));
2239 end Suppress_Init_Proc;
2241 function Suppress_Style_Checks (Id : E) return B is
2243 return Flag165 (Id);
2244 end Suppress_Style_Checks;
2246 function Task_Body_Procedure (Id : E) return N is
2248 pragma Assert (Ekind (Id) = E_Task_Type
2249 or else Ekind (Id) = E_Task_Subtype);
2251 end Task_Body_Procedure;
2253 function Treat_As_Volatile (Id : E) return B is
2256 end Treat_As_Volatile;
2258 function Underlying_Full_View (Id : E) return E is
2260 pragma Assert (Ekind (Id) in Private_Kind);
2262 end Underlying_Full_View;
2264 function Unset_Reference (Id : E) return N is
2267 end Unset_Reference;
2269 function Uses_Sec_Stack (Id : E) return B is
2274 function Vax_Float (Id : E) return B is
2276 return Flag151 (Base_Type (Id));
2279 function Warnings_Off (Id : E) return B is
2284 ------------------------------
2285 -- Classification Functions --
2286 ------------------------------
2288 function Is_Access_Type (Id : E) return B is
2290 return Ekind (Id) in Access_Kind;
2293 function Is_Array_Type (Id : E) return B is
2295 return Ekind (Id) in Array_Kind;
2298 function Is_Class_Wide_Type (Id : E) return B is
2300 return Ekind (Id) in Class_Wide_Kind;
2301 end Is_Class_Wide_Type;
2303 function Is_Composite_Type (Id : E) return B is
2305 return Ekind (Id) in Composite_Kind;
2306 end Is_Composite_Type;
2308 function Is_Concurrent_Body (Id : E) return B is
2310 return Ekind (Id) in
2311 Concurrent_Body_Kind;
2312 end Is_Concurrent_Body;
2314 function Is_Concurrent_Record_Type (Id : E) return B is
2317 end Is_Concurrent_Record_Type;
2319 function Is_Concurrent_Type (Id : E) return B is
2321 return Ekind (Id) in Concurrent_Kind;
2322 end Is_Concurrent_Type;
2324 function Is_Decimal_Fixed_Point_Type (Id : E) return B is
2326 return Ekind (Id) in
2327 Decimal_Fixed_Point_Kind;
2328 end Is_Decimal_Fixed_Point_Type;
2330 function Is_Digits_Type (Id : E) return B is
2332 return Ekind (Id) in Digits_Kind;
2335 function Is_Discrete_Or_Fixed_Point_Type (Id : E) return B is
2337 return Ekind (Id) in Discrete_Or_Fixed_Point_Kind;
2338 end Is_Discrete_Or_Fixed_Point_Type;
2340 function Is_Discrete_Type (Id : E) return B is
2342 return Ekind (Id) in Discrete_Kind;
2343 end Is_Discrete_Type;
2345 function Is_Elementary_Type (Id : E) return B is
2347 return Ekind (Id) in Elementary_Kind;
2348 end Is_Elementary_Type;
2350 function Is_Entry (Id : E) return B is
2352 return Ekind (Id) in Entry_Kind;
2355 function Is_Enumeration_Type (Id : E) return B is
2357 return Ekind (Id) in
2359 end Is_Enumeration_Type;
2361 function Is_Fixed_Point_Type (Id : E) return B is
2363 return Ekind (Id) in
2365 end Is_Fixed_Point_Type;
2367 function Is_Floating_Point_Type (Id : E) return B is
2369 return Ekind (Id) in Float_Kind;
2370 end Is_Floating_Point_Type;
2372 function Is_Formal (Id : E) return B is
2374 return Ekind (Id) in Formal_Kind;
2377 function Is_Generic_Subprogram (Id : E) return B is
2379 return Ekind (Id) in Generic_Subprogram_Kind;
2380 end Is_Generic_Subprogram;
2382 function Is_Generic_Unit (Id : E) return B is
2384 return Ekind (Id) in Generic_Unit_Kind;
2385 end Is_Generic_Unit;
2387 function Is_Incomplete_Or_Private_Type (Id : E) return B is
2389 return Ekind (Id) in
2390 Incomplete_Or_Private_Kind;
2391 end Is_Incomplete_Or_Private_Type;
2393 function Is_Integer_Type (Id : E) return B is
2395 return Ekind (Id) in Integer_Kind;
2396 end Is_Integer_Type;
2398 function Is_Modular_Integer_Type (Id : E) return B is
2400 return Ekind (Id) in
2401 Modular_Integer_Kind;
2402 end Is_Modular_Integer_Type;
2404 function Is_Named_Number (Id : E) return B is
2406 return Ekind (Id) in Named_Kind;
2407 end Is_Named_Number;
2409 function Is_Numeric_Type (Id : E) return B is
2411 return Ekind (Id) in Numeric_Kind;
2412 end Is_Numeric_Type;
2414 function Is_Object (Id : E) return B is
2416 return Ekind (Id) in Object_Kind;
2419 function Is_Ordinary_Fixed_Point_Type (Id : E) return B is
2421 return Ekind (Id) in
2422 Ordinary_Fixed_Point_Kind;
2423 end Is_Ordinary_Fixed_Point_Type;
2425 function Is_Overloadable (Id : E) return B is
2427 return Ekind (Id) in Overloadable_Kind;
2428 end Is_Overloadable;
2430 function Is_Private_Type (Id : E) return B is
2432 return Ekind (Id) in Private_Kind;
2433 end Is_Private_Type;
2435 function Is_Protected_Type (Id : E) return B is
2437 return Ekind (Id) in Protected_Kind;
2438 end Is_Protected_Type;
2440 function Is_Real_Type (Id : E) return B is
2442 return Ekind (Id) in Real_Kind;
2445 function Is_Record_Type (Id : E) return B is
2447 return Ekind (Id) in Record_Kind;
2450 function Is_Scalar_Type (Id : E) return B is
2452 return Ekind (Id) in Scalar_Kind;
2455 function Is_Signed_Integer_Type (Id : E) return B is
2457 return Ekind (Id) in
2458 Signed_Integer_Kind;
2459 end Is_Signed_Integer_Type;
2461 function Is_Subprogram (Id : E) return B is
2463 return Ekind (Id) in Subprogram_Kind;
2466 function Is_Task_Type (Id : E) return B is
2468 return Ekind (Id) in Task_Kind;
2471 function Is_Type (Id : E) return B is
2473 return Ekind (Id) in Type_Kind;
2476 ------------------------------
2477 -- Attribute Set Procedures --
2478 ------------------------------
2480 procedure Set_Abstract_Interfaces (Id : E; V : L) is
2482 pragma Assert (Ekind (Id) = E_Record_Type
2483 or else Ekind (Id) = E_Record_Subtype
2484 or else Ekind (Id) = E_Record_Type_With_Private
2485 or else Ekind (Id) = E_Record_Subtype_With_Private);
2486 Set_Elist24 (Id, V);
2487 end Set_Abstract_Interfaces;
2489 procedure Set_Abstract_Interface_Alias (Id : E; V : E) is
2492 (Ekind (Id) = E_Procedure or Ekind (Id) = E_Function);
2494 end Set_Abstract_Interface_Alias;
2496 procedure Set_Accept_Address (Id : E; V : L) is
2498 Set_Elist21 (Id, V);
2499 end Set_Accept_Address;
2501 procedure Set_Access_Disp_Table (Id : E; V : L) is
2503 pragma Assert (Is_Tagged_Type (Id) and then Id = Base_Type (Id));
2504 Set_Elist16 (Id, V);
2505 end Set_Access_Disp_Table;
2507 procedure Set_Associated_Final_Chain (Id : E; V : E) is
2509 pragma Assert (Is_Access_Type (Id));
2511 end Set_Associated_Final_Chain;
2513 procedure Set_Associated_Formal_Package (Id : E; V : E) is
2516 end Set_Associated_Formal_Package;
2518 procedure Set_Associated_Node_For_Itype (Id : E; V : E) is
2521 end Set_Associated_Node_For_Itype;
2523 procedure Set_Associated_Storage_Pool (Id : E; V : E) is
2525 pragma Assert (Is_Access_Type (Id) and then Id = Base_Type (Id));
2527 end Set_Associated_Storage_Pool;
2529 procedure Set_Actual_Subtype (Id : E; V : E) is
2532 (Ekind (Id) = E_Constant
2533 or else Ekind (Id) = E_Variable
2534 or else Ekind (Id) = E_Generic_In_Out_Parameter
2535 or else Ekind (Id) in E_In_Parameter .. E_In_Out_Parameter);
2537 end Set_Actual_Subtype;
2539 procedure Set_Address_Taken (Id : E; V : B := True) is
2541 Set_Flag104 (Id, V);
2542 end Set_Address_Taken;
2544 procedure Set_Alias (Id : E; V : E) is
2547 (Is_Overloadable (Id) or else Ekind (Id) = E_Subprogram_Type);
2551 procedure Set_Alignment (Id : E; V : U) is
2553 pragma Assert (Is_Type (Id)
2554 or else Is_Formal (Id)
2555 or else Ekind (Id) = E_Loop_Parameter
2556 or else Ekind (Id) = E_Constant
2557 or else Ekind (Id) = E_Exception
2558 or else Ekind (Id) = E_Variable);
2562 procedure Set_Barrier_Function (Id : E; V : N) is
2564 pragma Assert (Is_Entry (Id));
2566 end Set_Barrier_Function;
2568 procedure Set_Block_Node (Id : E; V : N) is
2570 pragma Assert (Ekind (Id) = E_Block);
2574 procedure Set_Body_Entity (Id : E; V : E) is
2577 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
2579 end Set_Body_Entity;
2581 procedure Set_Body_Needed_For_SAL (Id : E; V : B := True) is
2584 (Ekind (Id) = E_Package
2585 or else Is_Subprogram (Id)
2586 or else Is_Generic_Unit (Id));
2588 end Set_Body_Needed_For_SAL;
2590 procedure Set_C_Pass_By_Copy (Id : E; V : B := True) is
2592 pragma Assert (Is_Record_Type (Id) and then Id = Base_Type (Id));
2593 Set_Flag125 (Id, V);
2594 end Set_C_Pass_By_Copy;
2596 procedure Set_Can_Never_Be_Null (Id : E; V : B := True) is
2599 end Set_Can_Never_Be_Null;
2601 procedure Set_Checks_May_Be_Suppressed (Id : E; V : B := True) is
2604 end Set_Checks_May_Be_Suppressed;
2606 procedure Set_Class_Wide_Type (Id : E; V : E) is
2608 pragma Assert (Is_Type (Id));
2610 end Set_Class_Wide_Type;
2612 procedure Set_Cloned_Subtype (Id : E; V : E) is
2615 (Ekind (Id) = E_Record_Subtype
2616 or else Ekind (Id) = E_Class_Wide_Subtype);
2618 end Set_Cloned_Subtype;
2620 procedure Set_Component_Bit_Offset (Id : E; V : U) is
2623 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
2625 end Set_Component_Bit_Offset;
2627 procedure Set_Component_Clause (Id : E; V : N) is
2630 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
2632 end Set_Component_Clause;
2634 procedure Set_Component_Size (Id : E; V : U) is
2636 pragma Assert (Is_Array_Type (Id) and then Id = Base_Type (Id));
2638 end Set_Component_Size;
2640 procedure Set_Component_Type (Id : E; V : E) is
2642 pragma Assert (Is_Array_Type (Id) and then Id = Base_Type (Id));
2644 end Set_Component_Type;
2646 procedure Set_Corresponding_Concurrent_Type (Id : E; V : E) is
2649 (Ekind (Id) = E_Record_Type and then Is_Concurrent_Type (V));
2651 end Set_Corresponding_Concurrent_Type;
2653 procedure Set_Corresponding_Discriminant (Id : E; V : E) is
2655 pragma Assert (Ekind (Id) = E_Discriminant);
2657 end Set_Corresponding_Discriminant;
2659 procedure Set_Corresponding_Equality (Id : E; V : E) is
2662 (Ekind (Id) = E_Function
2663 and then not Comes_From_Source (Id)
2664 and then Chars (Id) = Name_Op_Ne);
2666 end Set_Corresponding_Equality;
2668 procedure Set_Corresponding_Record_Type (Id : E; V : E) is
2670 pragma Assert (Is_Concurrent_Type (Id));
2672 end Set_Corresponding_Record_Type;
2674 procedure Set_Corresponding_Remote_Type (Id : E; V : E) is
2677 end Set_Corresponding_Remote_Type;
2679 procedure Set_Current_Value (Id : E; V : E) is
2681 pragma Assert (Ekind (Id) in Object_Kind or else Ekind (Id) = E_Void);
2683 end Set_Current_Value;
2685 procedure Set_CR_Discriminant (Id : E; V : E) is
2688 end Set_CR_Discriminant;
2690 procedure Set_Debug_Info_Off (Id : E; V : B := True) is
2692 Set_Flag166 (Id, V);
2693 end Set_Debug_Info_Off;
2695 procedure Set_Debug_Renaming_Link (Id : E; V : E) is
2698 end Set_Debug_Renaming_Link;
2700 procedure Set_Default_Expr_Function (Id : E; V : E) is
2702 pragma Assert (Is_Formal (Id));
2704 end Set_Default_Expr_Function;
2706 procedure Set_Default_Expressions_Processed (Id : E; V : B := True) is
2708 Set_Flag108 (Id, V);
2709 end Set_Default_Expressions_Processed;
2711 procedure Set_Default_Value (Id : E; V : N) is
2713 pragma Assert (Is_Formal (Id));
2715 end Set_Default_Value;
2717 procedure Set_Delay_Cleanups (Id : E; V : B := True) is
2721 or else Is_Task_Type (Id)
2722 or else Ekind (Id) = E_Block);
2723 Set_Flag114 (Id, V);
2724 end Set_Delay_Cleanups;
2726 procedure Set_Delay_Subprogram_Descriptors (Id : E; V : B := True) is
2730 or else Ekind (Id) = E_Package
2731 or else Ekind (Id) = E_Package_Body);
2733 end Set_Delay_Subprogram_Descriptors;
2735 procedure Set_Delta_Value (Id : E; V : R) is
2737 pragma Assert (Is_Fixed_Point_Type (Id));
2738 Set_Ureal18 (Id, V);
2739 end Set_Delta_Value;
2741 procedure Set_Dependent_Instances (Id : E; V : L) is
2743 pragma Assert (Is_Generic_Instance (Id));
2745 end Set_Dependent_Instances;
2747 procedure Set_Depends_On_Private (Id : E; V : B := True) is
2749 pragma Assert (Nkind (Id) in N_Entity);
2751 end Set_Depends_On_Private;
2753 procedure Set_Digits_Value (Id : E; V : U) is
2756 (Is_Floating_Point_Type (Id)
2757 or else Is_Decimal_Fixed_Point_Type (Id));
2759 end Set_Digits_Value;
2761 procedure Set_Directly_Designated_Type (Id : E; V : E) is
2764 end Set_Directly_Designated_Type;
2766 procedure Set_Discard_Names (Id : E; V : B := True) is
2769 end Set_Discard_Names;
2771 procedure Set_Discriminal (Id : E; V : E) is
2773 pragma Assert (Ekind (Id) = E_Discriminant);
2775 end Set_Discriminal;
2777 procedure Set_Discriminal_Link (Id : E; V : E) is
2780 end Set_Discriminal_Link;
2782 procedure Set_Discriminant_Checking_Func (Id : E; V : E) is
2784 pragma Assert (Ekind (Id) = E_Component);
2786 end Set_Discriminant_Checking_Func;
2788 procedure Set_Discriminant_Constraint (Id : E; V : L) is
2790 pragma Assert (Nkind (Id) in N_Entity);
2791 Set_Elist21 (Id, V);
2792 end Set_Discriminant_Constraint;
2794 procedure Set_Discriminant_Default_Value (Id : E; V : N) is
2797 end Set_Discriminant_Default_Value;
2799 procedure Set_Discriminant_Number (Id : E; V : U) is
2802 end Set_Discriminant_Number;
2804 procedure Set_DT_Entry_Count (Id : E; V : U) is
2806 pragma Assert (Ekind (Id) = E_Component);
2808 end Set_DT_Entry_Count;
2810 procedure Set_DT_Position (Id : E; V : U) is
2812 pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2814 end Set_DT_Position;
2816 procedure Set_DTC_Entity (Id : E; V : E) is
2819 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2823 procedure Set_Elaborate_All_Desirable (Id : E; V : B := True) is
2825 Set_Flag146 (Id, V);
2826 end Set_Elaborate_All_Desirable;
2828 procedure Set_Elaboration_Entity (Id : E; V : E) is
2833 Ekind (Id) = E_Package
2835 Is_Generic_Unit (Id));
2837 end Set_Elaboration_Entity;
2839 procedure Set_Elaboration_Entity_Required (Id : E; V : B := True) is
2844 Ekind (Id) = E_Package
2846 Is_Generic_Unit (Id));
2847 Set_Flag174 (Id, V);
2848 end Set_Elaboration_Entity_Required;
2850 procedure Set_Enclosing_Scope (Id : E; V : E) is
2853 end Set_Enclosing_Scope;
2855 procedure Set_Entry_Accepted (Id : E; V : B := True) is
2857 pragma Assert (Is_Entry (Id));
2858 Set_Flag152 (Id, V);
2859 end Set_Entry_Accepted;
2861 procedure Set_Entry_Bodies_Array (Id : E; V : E) is
2864 end Set_Entry_Bodies_Array;
2866 procedure Set_Entry_Cancel_Parameter (Id : E; V : E) is
2869 end Set_Entry_Cancel_Parameter;
2871 procedure Set_Entry_Component (Id : E; V : E) is
2874 end Set_Entry_Component;
2876 procedure Set_Entry_Formal (Id : E; V : E) is
2879 end Set_Entry_Formal;
2881 procedure Set_Entry_Index_Constant (Id : E; V : E) is
2883 pragma Assert (Ekind (Id) = E_Entry_Index_Parameter);
2885 end Set_Entry_Index_Constant;
2887 procedure Set_Entry_Parameters_Type (Id : E; V : E) is
2890 end Set_Entry_Parameters_Type;
2892 procedure Set_Enum_Pos_To_Rep (Id : E; V : E) is
2894 pragma Assert (Ekind (Id) = E_Enumeration_Type);
2896 end Set_Enum_Pos_To_Rep;
2898 procedure Set_Enumeration_Pos (Id : E; V : U) is
2900 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2902 end Set_Enumeration_Pos;
2904 procedure Set_Enumeration_Rep (Id : E; V : U) is
2906 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2908 end Set_Enumeration_Rep;
2910 procedure Set_Enumeration_Rep_Expr (Id : E; V : N) is
2912 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
2914 end Set_Enumeration_Rep_Expr;
2916 procedure Set_Equivalent_Type (Id : E; V : E) is
2919 (Ekind (Id) = E_Class_Wide_Type or else
2920 Ekind (Id) = E_Class_Wide_Subtype or else
2921 Ekind (Id) = E_Access_Protected_Subprogram_Type or else
2922 Ekind (Id) = E_Access_Subprogram_Type or else
2923 Ekind (Id) = E_Exception_Type);
2925 end Set_Equivalent_Type;
2927 procedure Set_Esize (Id : E; V : U) is
2932 procedure Set_Exception_Code (Id : E; V : U) is
2934 pragma Assert (Ekind (Id) = E_Exception);
2936 end Set_Exception_Code;
2938 procedure Set_Extra_Accessibility (Id : E; V : E) is
2940 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
2942 end Set_Extra_Accessibility;
2944 procedure Set_Extra_Constrained (Id : E; V : E) is
2946 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
2948 end Set_Extra_Constrained;
2950 procedure Set_Extra_Formal (Id : E; V : E) is
2953 end Set_Extra_Formal;
2955 procedure Set_Finalization_Chain_Entity (Id : E; V : E) is
2958 end Set_Finalization_Chain_Entity;
2960 procedure Set_Finalize_Storage_Only (Id : E; V : B := True) is
2962 pragma Assert (Is_Type (Id) and then Id = Base_Type (Id));
2963 Set_Flag158 (Id, V);
2964 end Set_Finalize_Storage_Only;
2966 procedure Set_First_Entity (Id : E; V : E) is
2969 end Set_First_Entity;
2971 procedure Set_First_Index (Id : E; V : N) is
2974 end Set_First_Index;
2976 procedure Set_First_Literal (Id : E; V : E) is
2979 end Set_First_Literal;
2981 procedure Set_First_Optional_Parameter (Id : E; V : E) is
2984 (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2986 end Set_First_Optional_Parameter;
2988 procedure Set_First_Private_Entity (Id : E; V : E) is
2990 pragma Assert (Ekind (Id) = E_Package
2991 or else Ekind (Id) = E_Generic_Package
2992 or else Ekind (Id) = E_Protected_Type
2993 or else Ekind (Id) = E_Protected_Subtype
2994 or else Ekind (Id) = E_Task_Type
2995 or else Ekind (Id) = E_Task_Subtype);
2997 end Set_First_Private_Entity;
2999 procedure Set_First_Rep_Item (Id : E; V : N) is
3002 end Set_First_Rep_Item;
3004 procedure Set_Freeze_Node (Id : E; V : N) is
3007 end Set_Freeze_Node;
3009 procedure Set_From_With_Type (Id : E; V : B := True) is
3013 or else Ekind (Id) = E_Package);
3014 Set_Flag159 (Id, V);
3015 end Set_From_With_Type;
3017 procedure Set_Full_View (Id : E; V : E) is
3019 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Constant);
3023 procedure Set_Function_Returns_With_DSP (Id : E; V : B := True) is
3026 (Is_Subprogram (Id) or else Ekind (Id) = E_Subprogram_Type);
3027 Set_Flag169 (Id, V);
3028 end Set_Function_Returns_With_DSP;
3030 procedure Set_Generic_Homonym (Id : E; V : E) is
3033 end Set_Generic_Homonym;
3035 procedure Set_Generic_Renamings (Id : E; V : L) is
3037 Set_Elist23 (Id, V);
3038 end Set_Generic_Renamings;
3040 procedure Set_Handler_Records (Id : E; V : S) is
3043 end Set_Handler_Records;
3045 procedure Set_Has_Aliased_Components (Id : E; V : B := True) is
3047 pragma Assert (Base_Type (Id) = Id);
3048 Set_Flag135 (Id, V);
3049 end Set_Has_Aliased_Components;
3051 procedure Set_Has_Alignment_Clause (Id : E; V : B := True) is
3054 end Set_Has_Alignment_Clause;
3056 procedure Set_Has_All_Calls_Remote (Id : E; V : B := True) is
3059 end Set_Has_All_Calls_Remote;
3061 procedure Set_Has_Atomic_Components (Id : E; V : B := True) is
3063 pragma Assert (not Is_Type (Id) or else Base_Type (Id) = Id);
3065 end Set_Has_Atomic_Components;
3067 procedure Set_Has_Biased_Representation (Id : E; V : B := True) is
3070 ((V = False) or else (Is_Discrete_Type (Id) or Is_Object (Id)));
3071 Set_Flag139 (Id, V);
3072 end Set_Has_Biased_Representation;
3074 procedure Set_Has_Completion (Id : E; V : B := True) is
3077 end Set_Has_Completion;
3079 procedure Set_Has_Completion_In_Body (Id : E; V : B := True) is
3081 pragma Assert (Ekind (Id) = E_Incomplete_Type);
3083 end Set_Has_Completion_In_Body;
3085 procedure Set_Has_Complex_Representation (Id : E; V : B := True) is
3087 pragma Assert (Ekind (Id) = E_Record_Type);
3088 Set_Flag140 (Id, V);
3089 end Set_Has_Complex_Representation;
3091 procedure Set_Has_Component_Size_Clause (Id : E; V : B := True) is
3093 pragma Assert (Ekind (Id) = E_Array_Type);
3095 end Set_Has_Component_Size_Clause;
3097 procedure Set_Has_Contiguous_Rep (Id : E; V : B := True) is
3099 Set_Flag181 (Id, V);
3100 end Set_Has_Contiguous_Rep;
3102 procedure Set_Has_Controlled_Component (Id : E; V : B := True) is
3104 pragma Assert (Base_Type (Id) = Id);
3106 end Set_Has_Controlled_Component;
3108 procedure Set_Has_Controlling_Result (Id : E; V : B := True) is
3111 end Set_Has_Controlling_Result;
3113 procedure Set_Has_Convention_Pragma (Id : E; V : B := True) is
3115 Set_Flag119 (Id, V);
3116 end Set_Has_Convention_Pragma;
3118 procedure Set_Has_Delayed_Freeze (Id : E; V : B := True) is
3120 pragma Assert (Nkind (Id) in N_Entity);
3122 end Set_Has_Delayed_Freeze;
3124 procedure Set_Has_Discriminants (Id : E; V : B := True) is
3126 pragma Assert (Nkind (Id) in N_Entity);
3128 end Set_Has_Discriminants;
3130 procedure Set_Has_Enumeration_Rep_Clause (Id : E; V : B := True) is
3132 pragma Assert (Is_Enumeration_Type (Id));
3134 end Set_Has_Enumeration_Rep_Clause;
3136 procedure Set_Has_Exit (Id : E; V : B := True) is
3141 procedure Set_Has_External_Tag_Rep_Clause (Id : E; V : B := True) is
3143 pragma Assert (Is_Tagged_Type (Id));
3144 Set_Flag110 (Id, V);
3145 end Set_Has_External_Tag_Rep_Clause;
3147 procedure Set_Has_Forward_Instantiation (Id : E; V : B := True) is
3149 Set_Flag175 (Id, V);
3150 end Set_Has_Forward_Instantiation;
3152 procedure Set_Has_Fully_Qualified_Name (Id : E; V : B := True) is
3154 Set_Flag173 (Id, V);
3155 end Set_Has_Fully_Qualified_Name;
3157 procedure Set_Has_Gigi_Rep_Item (Id : E; V : B := True) is
3160 end Set_Has_Gigi_Rep_Item;
3162 procedure Set_Has_Homonym (Id : E; V : B := True) is
3165 end Set_Has_Homonym;
3167 procedure Set_Has_Machine_Radix_Clause (Id : E; V : B := True) is
3169 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
3171 end Set_Has_Machine_Radix_Clause;
3173 procedure Set_Has_Master_Entity (Id : E; V : B := True) is
3176 end Set_Has_Master_Entity;
3178 procedure Set_Has_Missing_Return (Id : E; V : B := True) is
3181 (Ekind (Id) = E_Function or else Ekind (Id) = E_Generic_Function);
3182 Set_Flag142 (Id, V);
3183 end Set_Has_Missing_Return;
3185 procedure Set_Has_Nested_Block_With_Handler (Id : E; V : B := True) is
3187 Set_Flag101 (Id, V);
3188 end Set_Has_Nested_Block_With_Handler;
3190 procedure Set_Has_Non_Standard_Rep (Id : E; V : B := True) is
3192 pragma Assert (Base_Type (Id) = Id);
3194 end Set_Has_Non_Standard_Rep;
3196 procedure Set_Has_Object_Size_Clause (Id : E; V : B := True) is
3198 pragma Assert (Is_Type (Id));
3199 Set_Flag172 (Id, V);
3200 end Set_Has_Object_Size_Clause;
3202 procedure Set_Has_Per_Object_Constraint (Id : E; V : B := True) is
3204 Set_Flag154 (Id, V);
3205 end Set_Has_Per_Object_Constraint;
3207 procedure Set_Has_Pragma_Controlled (Id : E; V : B := True) is
3209 pragma Assert (Is_Access_Type (Id));
3210 Set_Flag27 (Base_Type (Id), V);
3211 end Set_Has_Pragma_Controlled;
3213 procedure Set_Has_Pragma_Elaborate_Body (Id : E; V : B := True) is
3215 Set_Flag150 (Id, V);
3216 end Set_Has_Pragma_Elaborate_Body;
3218 procedure Set_Has_Pragma_Inline (Id : E; V : B := True) is
3220 Set_Flag157 (Id, V);
3221 end Set_Has_Pragma_Inline;
3223 procedure Set_Has_Pragma_Pack (Id : E; V : B := True) is
3225 pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id));
3226 pragma Assert (Id = Base_Type (Id));
3227 Set_Flag121 (Id, V);
3228 end Set_Has_Pragma_Pack;
3230 procedure Set_Has_Pragma_Pure_Function (Id : E; V : B := True) is
3232 pragma Assert (Is_Subprogram (Id));
3233 Set_Flag179 (Id, V);
3234 end Set_Has_Pragma_Pure_Function;
3236 procedure Set_Has_Pragma_Unreferenced (Id : E; V : B := True) is
3238 Set_Flag180 (Id, V);
3239 end Set_Has_Pragma_Unreferenced;
3241 procedure Set_Has_Primitive_Operations (Id : E; V : B := True) is
3243 pragma Assert (Id = Base_Type (Id));
3244 Set_Flag120 (Id, V);
3245 end Set_Has_Primitive_Operations;
3247 procedure Set_Has_Private_Declaration (Id : E; V : B := True) is
3249 Set_Flag155 (Id, V);
3250 end Set_Has_Private_Declaration;
3252 procedure Set_Has_Qualified_Name (Id : E; V : B := True) is
3254 Set_Flag161 (Id, V);
3255 end Set_Has_Qualified_Name;
3257 procedure Set_Has_Record_Rep_Clause (Id : E; V : B := True) is
3259 pragma Assert (Id = Base_Type (Id));
3261 end Set_Has_Record_Rep_Clause;
3263 procedure Set_Has_Recursive_Call (Id : E; V : B := True) is
3265 pragma Assert (Is_Subprogram (Id));
3266 Set_Flag143 (Id, V);
3267 end Set_Has_Recursive_Call;
3269 procedure Set_Has_Size_Clause (Id : E; V : B := True) is
3272 end Set_Has_Size_Clause;
3274 procedure Set_Has_Small_Clause (Id : E; V : B := True) is
3277 end Set_Has_Small_Clause;
3279 procedure Set_Has_Specified_Layout (Id : E; V : B := True) is
3281 pragma Assert (Id = Base_Type (Id));
3282 Set_Flag100 (Id, V);
3283 end Set_Has_Specified_Layout;
3285 procedure Set_Has_Storage_Size_Clause (Id : E; V : B := True) is
3287 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
3288 pragma Assert (Base_Type (Id) = Id);
3290 end Set_Has_Storage_Size_Clause;
3292 procedure Set_Has_Stream_Size_Clause (Id : E; V : B := True) is
3294 pragma Assert (Is_Elementary_Type (Id));
3295 Set_Flag184 (Id, V);
3296 end Set_Has_Stream_Size_Clause;
3298 procedure Set_Has_Subprogram_Descriptor (Id : E; V : B := True) is
3301 end Set_Has_Subprogram_Descriptor;
3303 procedure Set_Has_Task (Id : E; V : B := True) is
3305 pragma Assert (Base_Type (Id) = Id);
3309 procedure Set_Has_Unchecked_Union (Id : E; V : B := True) is
3311 pragma Assert (Base_Type (Id) = Id);
3312 Set_Flag123 (Id, V);
3313 end Set_Has_Unchecked_Union;
3315 procedure Set_Has_Unknown_Discriminants (Id : E; V : B := True) is
3317 pragma Assert (Is_Type (Id));
3319 end Set_Has_Unknown_Discriminants;
3321 procedure Set_Has_Volatile_Components (Id : E; V : B := True) is
3323 pragma Assert (not Is_Type (Id) or else Base_Type (Id) = Id);
3325 end Set_Has_Volatile_Components;
3327 procedure Set_Has_Xref_Entry (Id : E; V : B := True) is
3329 Set_Flag182 (Id, V);
3330 end Set_Has_Xref_Entry;
3332 procedure Set_Hiding_Loop_Variable (Id : E; V : E) is
3334 pragma Assert (Ekind (Id) = E_Variable);
3336 end Set_Hiding_Loop_Variable;
3338 procedure Set_Homonym (Id : E; V : E) is
3340 pragma Assert (Id /= V);
3344 procedure Set_In_Package_Body (Id : E; V : B := True) is
3347 end Set_In_Package_Body;
3349 procedure Set_In_Private_Part (Id : E; V : B := True) is
3352 end Set_In_Private_Part;
3354 procedure Set_In_Use (Id : E; V : B := True) is
3356 pragma Assert (Nkind (Id) in N_Entity);
3360 procedure Set_Inner_Instances (Id : E; V : L) is
3362 Set_Elist23 (Id, V);
3363 end Set_Inner_Instances;
3365 procedure Set_Interface_Name (Id : E; V : N) is
3368 end Set_Interface_Name;
3370 procedure Set_Is_Abstract (Id : E; V : B := True) is
3373 end Set_Is_Abstract;
3375 procedure Set_Is_Access_Constant (Id : E; V : B := True) is
3377 pragma Assert (Is_Access_Type (Id));
3379 end Set_Is_Access_Constant;
3381 procedure Set_Is_Ada_2005 (Id : E; V : B := True) is
3383 Set_Flag185 (Id, V);
3384 end Set_Is_Ada_2005;
3386 procedure Set_Is_Aliased (Id : E; V : B := True) is
3388 pragma Assert (Nkind (Id) in N_Entity);
3392 procedure Set_Is_AST_Entry (Id : E; V : B := True) is
3394 pragma Assert (Is_Entry (Id));
3395 Set_Flag132 (Id, V);
3396 end Set_Is_AST_Entry;
3398 procedure Set_Is_Asynchronous (Id : E; V : B := True) is
3401 (Ekind (Id) = E_Procedure or else Is_Type (Id));
3403 end Set_Is_Asynchronous;
3405 procedure Set_Is_Atomic (Id : E; V : B := True) is
3410 procedure Set_Is_Bit_Packed_Array (Id : E; V : B := True) is
3412 pragma Assert ((not V)
3413 or else (Is_Array_Type (Id) and then Id = Base_Type (Id)));
3415 Set_Flag122 (Id, V);
3416 end Set_Is_Bit_Packed_Array;
3418 procedure Set_Is_Called (Id : E; V : B := True) is
3421 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Function);
3422 Set_Flag102 (Id, V);
3425 procedure Set_Is_Character_Type (Id : E; V : B := True) is
3428 end Set_Is_Character_Type;
3430 procedure Set_Is_Child_Unit (Id : E; V : B := True) is
3433 end Set_Is_Child_Unit;
3435 procedure Set_Is_Class_Wide_Equivalent_Type (Id : E; V : B := True) is
3438 end Set_Is_Class_Wide_Equivalent_Type;
3440 procedure Set_Is_Compilation_Unit (Id : E; V : B := True) is
3442 Set_Flag149 (Id, V);
3443 end Set_Is_Compilation_Unit;
3445 procedure Set_Is_Completely_Hidden (Id : E; V : B := True) is
3447 pragma Assert (Ekind (Id) = E_Discriminant);
3448 Set_Flag103 (Id, V);
3449 end Set_Is_Completely_Hidden;
3451 procedure Set_Is_Concurrent_Record_Type (Id : E; V : B := True) is
3454 end Set_Is_Concurrent_Record_Type;
3456 procedure Set_Is_Constr_Subt_For_U_Nominal (Id : E; V : B := True) is
3459 end Set_Is_Constr_Subt_For_U_Nominal;
3461 procedure Set_Is_Constr_Subt_For_UN_Aliased (Id : E; V : B := True) is
3463 Set_Flag141 (Id, V);
3464 end Set_Is_Constr_Subt_For_UN_Aliased;
3466 procedure Set_Is_Constrained (Id : E; V : B := True) is
3468 pragma Assert (Nkind (Id) in N_Entity);
3470 end Set_Is_Constrained;
3472 procedure Set_Is_Constructor (Id : E; V : B := True) is
3475 end Set_Is_Constructor;
3477 procedure Set_Is_Controlled (Id : E; V : B := True) is
3479 pragma Assert (Id = Base_Type (Id));
3481 end Set_Is_Controlled;
3483 procedure Set_Is_Controlling_Formal (Id : E; V : B := True) is
3485 pragma Assert (Is_Formal (Id));
3487 end Set_Is_Controlling_Formal;
3489 procedure Set_Is_CPP_Class (Id : E; V : B := True) is
3492 end Set_Is_CPP_Class;
3494 procedure Set_Is_Discrim_SO_Function (Id : E; V : B := True) is
3496 Set_Flag176 (Id, V);
3497 end Set_Is_Discrim_SO_Function;
3499 procedure Set_Is_Dispatching_Operation (Id : E; V : B := True) is
3504 Is_Overloadable (Id)
3506 Ekind (Id) = E_Subprogram_Type);
3509 end Set_Is_Dispatching_Operation;
3511 procedure Set_Is_Eliminated (Id : E; V : B := True) is
3513 Set_Flag124 (Id, V);
3514 end Set_Is_Eliminated;
3516 procedure Set_Is_Entry_Formal (Id : E; V : B := True) is
3519 end Set_Is_Entry_Formal;
3521 procedure Set_Is_Exported (Id : E; V : B := True) is
3524 end Set_Is_Exported;
3526 procedure Set_Is_First_Subtype (Id : E; V : B := True) is
3529 end Set_Is_First_Subtype;
3531 procedure Set_Is_For_Access_Subtype (Id : E; V : B := True) is
3534 (Ekind (Id) = E_Record_Subtype
3536 Ekind (Id) = E_Private_Subtype);
3537 Set_Flag118 (Id, V);
3538 end Set_Is_For_Access_Subtype;
3540 procedure Set_Is_Formal_Subprogram (Id : E; V : B := True) is
3542 Set_Flag111 (Id, V);
3543 end Set_Is_Formal_Subprogram;
3545 procedure Set_Is_Frozen (Id : E; V : B := True) is
3547 pragma Assert (Nkind (Id) in N_Entity);
3551 procedure Set_Is_Generic_Actual_Type (Id : E; V : B := True) is
3553 pragma Assert (Is_Type (Id));
3555 end Set_Is_Generic_Actual_Type;
3557 procedure Set_Is_Generic_Instance (Id : E; V : B := True) is
3559 Set_Flag130 (Id, V);
3560 end Set_Is_Generic_Instance;
3562 procedure Set_Is_Generic_Type (Id : E; V : B := True) is
3564 pragma Assert (Nkind (Id) in N_Entity);
3566 end Set_Is_Generic_Type;
3568 procedure Set_Is_Hidden (Id : E; V : B := True) is
3573 procedure Set_Is_Hidden_Open_Scope (Id : E; V : B := True) is
3575 Set_Flag171 (Id, V);
3576 end Set_Is_Hidden_Open_Scope;
3578 procedure Set_Is_Immediately_Visible (Id : E; V : B := True) is
3580 pragma Assert (Nkind (Id) in N_Entity);
3582 end Set_Is_Immediately_Visible;
3584 procedure Set_Is_Imported (Id : E; V : B := True) is
3587 end Set_Is_Imported;
3589 procedure Set_Is_Inlined (Id : E; V : B := True) is
3594 procedure Set_Is_Interface (Id : E; V : B := True) is
3596 pragma Assert (Ekind (Id) = E_Record_Type
3597 or else Ekind (Id) = E_Record_Subtype
3598 or else Ekind (Id) = E_Record_Type_With_Private
3599 or else Ekind (Id) = E_Record_Subtype_With_Private);
3600 Set_Flag186 (Id, V);
3601 end Set_Is_Interface;
3603 procedure Set_Is_Instantiated (Id : E; V : B := True) is
3605 Set_Flag126 (Id, V);
3606 end Set_Is_Instantiated;
3608 procedure Set_Is_Internal (Id : E; V : B := True) is
3610 pragma Assert (Nkind (Id) in N_Entity);
3612 end Set_Is_Internal;
3614 procedure Set_Is_Interrupt_Handler (Id : E; V : B := True) is
3616 pragma Assert (Nkind (Id) in N_Entity);
3618 end Set_Is_Interrupt_Handler;
3620 procedure Set_Is_Intrinsic_Subprogram (Id : E; V : B := True) is
3623 end Set_Is_Intrinsic_Subprogram;
3625 procedure Set_Is_Itype (Id : E; V : B := True) is
3630 procedure Set_Is_Known_Non_Null (Id : E; V : B := True) is
3633 end Set_Is_Known_Non_Null;
3635 procedure Set_Is_Known_Valid (Id : E; V : B := True) is
3637 Set_Flag170 (Id, V);
3638 end Set_Is_Known_Valid;
3640 procedure Set_Is_Limited_Composite (Id : E; V : B := True) is
3642 pragma Assert (Is_Type (Id));
3643 Set_Flag106 (Id, V);
3644 end Set_Is_Limited_Composite;
3646 procedure Set_Is_Limited_Record (Id : E; V : B := True) is
3649 end Set_Is_Limited_Record;
3651 procedure Set_Is_Machine_Code_Subprogram (Id : E; V : B := True) is
3653 pragma Assert (Is_Subprogram (Id));
3654 Set_Flag137 (Id, V);
3655 end Set_Is_Machine_Code_Subprogram;
3657 procedure Set_Is_Non_Static_Subtype (Id : E; V : B := True) is
3659 pragma Assert (Is_Type (Id));
3660 Set_Flag109 (Id, V);
3661 end Set_Is_Non_Static_Subtype;
3663 procedure Set_Is_Null_Init_Proc (Id : E; V : B := True) is
3665 pragma Assert (Ekind (Id) = E_Procedure);
3666 Set_Flag178 (Id, V);
3667 end Set_Is_Null_Init_Proc;
3669 procedure Set_Is_Obsolescent (Id : E; V : B := True) is
3671 pragma Assert (Is_Subprogram (Id));
3672 Set_Flag153 (Id, V);
3673 end Set_Is_Obsolescent;
3675 procedure Set_Is_Optional_Parameter (Id : E; V : B := True) is
3677 pragma Assert (Is_Formal (Id));
3678 Set_Flag134 (Id, V);
3679 end Set_Is_Optional_Parameter;
3681 procedure Set_Is_Overriding_Operation (Id : E; V : B := True) is
3683 pragma Assert (Is_Subprogram (Id));
3685 end Set_Is_Overriding_Operation;
3687 procedure Set_Is_Package_Body_Entity (Id : E; V : B := True) is
3689 Set_Flag160 (Id, V);
3690 end Set_Is_Package_Body_Entity;
3692 procedure Set_Is_Packed (Id : E; V : B := True) is
3694 pragma Assert (Base_Type (Id) = Id);
3698 procedure Set_Is_Packed_Array_Type (Id : E; V : B := True) is
3700 Set_Flag138 (Id, V);
3701 end Set_Is_Packed_Array_Type;
3703 procedure Set_Is_Potentially_Use_Visible (Id : E; V : B := True) is
3705 pragma Assert (Nkind (Id) in N_Entity);
3707 end Set_Is_Potentially_Use_Visible;
3709 procedure Set_Is_Preelaborated (Id : E; V : B := True) is
3712 end Set_Is_Preelaborated;
3714 procedure Set_Is_Private_Composite (Id : E; V : B := True) is
3716 pragma Assert (Is_Type (Id));
3717 Set_Flag107 (Id, V);
3718 end Set_Is_Private_Composite;
3720 procedure Set_Is_Private_Descendant (Id : E; V : B := True) is
3723 end Set_Is_Private_Descendant;
3725 procedure Set_Is_Public (Id : E; V : B := True) is
3727 pragma Assert (Nkind (Id) in N_Entity);
3731 procedure Set_Is_Pure (Id : E; V : B := True) is
3736 procedure Set_Is_Remote_Call_Interface (Id : E; V : B := True) is
3739 end Set_Is_Remote_Call_Interface;
3741 procedure Set_Is_Remote_Types (Id : E; V : B := True) is
3744 end Set_Is_Remote_Types;
3746 procedure Set_Is_Renaming_Of_Object (Id : E; V : B := True) is
3748 Set_Flag112 (Id, V);
3749 end Set_Is_Renaming_Of_Object;
3751 procedure Set_Is_Shared_Passive (Id : E; V : B := True) is
3754 end Set_Is_Shared_Passive;
3756 procedure Set_Is_Statically_Allocated (Id : E; V : B := True) is
3759 (Ekind (Id) = E_Exception
3760 or else Ekind (Id) = E_Variable
3761 or else Ekind (Id) = E_Constant
3762 or else Is_Type (Id)
3763 or else Ekind (Id) = E_Void);
3765 end Set_Is_Statically_Allocated;
3767 procedure Set_Is_Tag (Id : E; V : B := True) is
3769 pragma Assert (Nkind (Id) in N_Entity);
3773 procedure Set_Is_Tagged_Type (Id : E; V : B := True) is
3776 end Set_Is_Tagged_Type;
3778 procedure Set_Is_Thread_Body (Id : E; V : B := True) is
3781 end Set_Is_Thread_Body;
3783 procedure Set_Is_True_Constant (Id : E; V : B := True) is
3785 Set_Flag163 (Id, V);
3786 end Set_Is_True_Constant;
3788 procedure Set_Is_Unchecked_Union (Id : E; V : B := True) is
3790 pragma Assert (Base_Type (Id) = Id);
3791 Set_Flag117 (Id, V);
3792 end Set_Is_Unchecked_Union;
3794 procedure Set_Is_Unsigned_Type (Id : E; V : B := True) is
3796 pragma Assert (Is_Discrete_Or_Fixed_Point_Type (Id));
3797 Set_Flag144 (Id, V);
3798 end Set_Is_Unsigned_Type;
3800 procedure Set_Is_Valued_Procedure (Id : E; V : B := True) is
3802 pragma Assert (Ekind (Id) = E_Procedure);
3803 Set_Flag127 (Id, V);
3804 end Set_Is_Valued_Procedure;
3806 procedure Set_Is_Visible_Child_Unit (Id : E; V : B := True) is
3808 pragma Assert (Is_Child_Unit (Id));
3809 Set_Flag116 (Id, V);
3810 end Set_Is_Visible_Child_Unit;
3812 procedure Set_Is_VMS_Exception (Id : E; V : B := True) is
3814 pragma Assert (Ekind (Id) = E_Exception);
3815 Set_Flag133 (Id, V);
3816 end Set_Is_VMS_Exception;
3818 procedure Set_Is_Volatile (Id : E; V : B := True) is
3820 pragma Assert (Nkind (Id) in N_Entity);
3822 end Set_Is_Volatile;
3824 procedure Set_Kill_Elaboration_Checks (Id : E; V : B := True) is
3827 end Set_Kill_Elaboration_Checks;
3829 procedure Set_Kill_Range_Checks (Id : E; V : B := True) is
3832 end Set_Kill_Range_Checks;
3834 procedure Set_Kill_Tag_Checks (Id : E; V : B := True) is
3837 end Set_Kill_Tag_Checks;
3839 procedure Set_Last_Entity (Id : E; V : E) is
3842 end Set_Last_Entity;
3844 procedure Set_Limited_View (Id : E; V : E) is
3846 pragma Assert (Ekind (Id) = E_Package);
3848 end Set_Limited_View;
3850 procedure Set_Lit_Indexes (Id : E; V : E) is
3852 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
3854 end Set_Lit_Indexes;
3856 procedure Set_Lit_Strings (Id : E; V : E) is
3858 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
3860 end Set_Lit_Strings;
3862 procedure Set_Machine_Radix_10 (Id : E; V : B := True) is
3864 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
3866 end Set_Machine_Radix_10;
3868 procedure Set_Master_Id (Id : E; V : E) is
3873 procedure Set_Materialize_Entity (Id : E; V : B := True) is
3875 Set_Flag168 (Id, V);
3876 end Set_Materialize_Entity;
3878 procedure Set_Mechanism (Id : E; V : M) is
3880 pragma Assert (Ekind (Id) = E_Function or else Is_Formal (Id));
3881 Set_Uint8 (Id, UI_From_Int (V));
3884 procedure Set_Modulus (Id : E; V : U) is
3886 pragma Assert (Ekind (Id) = E_Modular_Integer_Type);
3890 procedure Set_Must_Be_On_Byte_Boundary (Id : E; V : B := True) is
3892 pragma Assert (Is_Type (Id));
3893 Set_Flag183 (Id, V);
3894 end Set_Must_Be_On_Byte_Boundary;
3896 procedure Set_Needs_Debug_Info (Id : E; V : B := True) is
3898 Set_Flag147 (Id, V);
3899 end Set_Needs_Debug_Info;
3901 procedure Set_Needs_No_Actuals (Id : E; V : B := True) is
3904 (Is_Overloadable (Id)
3905 or else Ekind (Id) = E_Subprogram_Type
3906 or else Ekind (Id) = E_Entry_Family);
3908 end Set_Needs_No_Actuals;
3910 procedure Set_Never_Set_In_Source (Id : E; V : B := True) is
3912 Set_Flag115 (Id, V);
3913 end Set_Never_Set_In_Source;
3915 procedure Set_Next_Inlined_Subprogram (Id : E; V : E) is
3918 end Set_Next_Inlined_Subprogram;
3920 procedure Set_No_Pool_Assigned (Id : E; V : B := True) is
3922 pragma Assert (Is_Access_Type (Id) and then Base_Type (Id) = Id);
3923 Set_Flag131 (Id, V);
3924 end Set_No_Pool_Assigned;
3926 procedure Set_No_Return (Id : E; V : B := True) is
3929 (Ekind (Id) = E_Procedure or else Ekind (Id) = E_Generic_Procedure);
3930 Set_Flag113 (Id, V);
3933 procedure Set_No_Strict_Aliasing (Id : E; V : B := True) is
3935 pragma Assert (Is_Access_Type (Id) and then Base_Type (Id) = Id);
3936 Set_Flag136 (Id, V);
3937 end Set_No_Strict_Aliasing;
3939 procedure Set_Non_Binary_Modulus (Id : E; V : B := True) is
3941 pragma Assert (Ekind (Id) = E_Modular_Integer_Type);
3943 end Set_Non_Binary_Modulus;
3945 procedure Set_Non_Limited_View (Id : E; V : E) is
3946 pragma Assert (False
3947 or else Ekind (Id) = E_Incomplete_Type);
3950 end Set_Non_Limited_View;
3952 procedure Set_Nonzero_Is_True (Id : E; V : B := True) is
3955 (Root_Type (Id) = Standard_Boolean
3956 and then Ekind (Id) = E_Enumeration_Type);
3957 Set_Flag162 (Id, V);
3958 end Set_Nonzero_Is_True;
3960 procedure Set_Normalized_First_Bit (Id : E; V : U) is
3963 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
3965 end Set_Normalized_First_Bit;
3967 procedure Set_Normalized_Position (Id : E; V : U) is
3970 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
3972 end Set_Normalized_Position;
3974 procedure Set_Normalized_Position_Max (Id : E; V : U) is
3977 (Ekind (Id) = E_Component or else Ekind (Id) = E_Discriminant);
3979 end Set_Normalized_Position_Max;
3981 procedure Set_Object_Ref (Id : E; V : E) is
3983 pragma Assert (Ekind (Id) = E_Protected_Body);
3987 procedure Set_Obsolescent_Warning (Id : E; V : N) is
3989 pragma Assert (Is_Subprogram (Id));
3991 end Set_Obsolescent_Warning;
3993 procedure Set_Original_Access_Type (Id : E; V : E) is
3996 (Ekind (Id) = E_Access_Subprogram_Type
3997 or else Ekind (Id) = E_Access_Protected_Subprogram_Type);
3999 end Set_Original_Access_Type;
4001 procedure Set_Original_Array_Type (Id : E; V : E) is
4003 pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id));
4005 end Set_Original_Array_Type;
4007 procedure Set_Original_Record_Component (Id : E; V : E) is
4010 (Ekind (Id) = E_Void
4011 or else Ekind (Id) = E_Component
4012 or else Ekind (Id) = E_Discriminant);
4014 end Set_Original_Record_Component;
4016 procedure Set_Packed_Array_Type (Id : E; V : E) is
4018 pragma Assert (Is_Array_Type (Id));
4020 end Set_Packed_Array_Type;
4022 procedure Set_Parent_Subtype (Id : E; V : E) is
4024 pragma Assert (Ekind (Id) = E_Record_Type);
4026 end Set_Parent_Subtype;
4028 procedure Set_Primitive_Operations (Id : E; V : L) is
4030 pragma Assert (Is_Tagged_Type (Id));
4031 Set_Elist15 (Id, V);
4032 end Set_Primitive_Operations;
4034 procedure Set_Prival (Id : E; V : E) is
4036 pragma Assert (Is_Protected_Private (Id));
4040 procedure Set_Privals_Chain (Id : E; V : L) is
4042 pragma Assert (Is_Overloadable (Id)
4043 or else Ekind (Id) = E_Entry_Family);
4044 Set_Elist23 (Id, V);
4045 end Set_Privals_Chain;
4047 procedure Set_Private_Dependents (Id : E; V : L) is
4049 pragma Assert (Is_Incomplete_Or_Private_Type (Id));
4050 Set_Elist18 (Id, V);
4051 end Set_Private_Dependents;
4053 procedure Set_Private_View (Id : E; V : N) is
4055 pragma Assert (Is_Private_Type (Id));
4057 end Set_Private_View;
4059 procedure Set_Protected_Body_Subprogram (Id : E; V : E) is
4061 pragma Assert (Is_Subprogram (Id) or else Is_Entry (Id));
4063 end Set_Protected_Body_Subprogram;
4065 procedure Set_Protected_Formal (Id : E; V : E) is
4067 pragma Assert (Is_Formal (Id));
4069 end Set_Protected_Formal;
4071 procedure Set_Protected_Operation (Id : E; V : N) is
4073 pragma Assert (Is_Protected_Private (Id));
4075 end Set_Protected_Operation;
4077 procedure Set_Reachable (Id : E; V : B := True) is
4082 procedure Set_Referenced (Id : E; V : B := True) is
4084 Set_Flag156 (Id, V);
4087 procedure Set_Referenced_As_LHS (Id : E; V : B := True) is
4090 end Set_Referenced_As_LHS;
4092 procedure Set_Referenced_Object (Id : E; V : N) is
4094 pragma Assert (Is_Type (Id));
4096 end Set_Referenced_Object;
4098 procedure Set_Register_Exception_Call (Id : E; V : N) is
4100 pragma Assert (Ekind (Id) = E_Exception);
4102 end Set_Register_Exception_Call;
4104 procedure Set_Related_Array_Object (Id : E; V : E) is
4106 pragma Assert (Is_Array_Type (Id));
4108 end Set_Related_Array_Object;
4110 procedure Set_Related_Instance (Id : E; V : E) is
4113 (Ekind (Id) = E_Package or else Ekind (Id) = E_Package_Body);
4115 end Set_Related_Instance;
4117 procedure Set_Renamed_Entity (Id : E; V : N) is
4120 end Set_Renamed_Entity;
4122 procedure Set_Renamed_Object (Id : E; V : N) is
4125 end Set_Renamed_Object;
4127 procedure Set_Renaming_Map (Id : E; V : U) is
4130 end Set_Renaming_Map;
4132 procedure Set_Return_Present (Id : E; V : B := True) is
4135 end Set_Return_Present;
4137 procedure Set_Returns_By_Ref (Id : E; V : B := True) is
4140 end Set_Returns_By_Ref;
4142 procedure Set_Reverse_Bit_Order (Id : E; V : B := True) is
4145 (Is_Record_Type (Id) and then Id = Base_Type (Id));
4146 Set_Flag164 (Id, V);
4147 end Set_Reverse_Bit_Order;
4149 procedure Set_RM_Size (Id : E; V : U) is
4151 pragma Assert (Is_Type (Id));
4155 procedure Set_Scalar_Range (Id : E; V : N) is
4158 end Set_Scalar_Range;
4160 procedure Set_Scale_Value (Id : E; V : U) is
4163 end Set_Scale_Value;
4165 procedure Set_Scope_Depth_Value (Id : E; V : U) is
4167 pragma Assert (not Is_Record_Type (Id));
4169 end Set_Scope_Depth_Value;
4171 procedure Set_Sec_Stack_Needed_For_Return (Id : E; V : B := True) is
4173 Set_Flag167 (Id, V);
4174 end Set_Sec_Stack_Needed_For_Return;
4176 procedure Set_Shadow_Entities (Id : E; V : S) is
4179 (Ekind (Id) = E_Package or else Ekind (Id) = E_Generic_Package);
4181 end Set_Shadow_Entities;
4183 procedure Set_Shared_Var_Assign_Proc (Id : E; V : E) is
4185 pragma Assert (Ekind (Id) = E_Variable);
4187 end Set_Shared_Var_Assign_Proc;
4189 procedure Set_Shared_Var_Read_Proc (Id : E; V : E) is
4191 pragma Assert (Ekind (Id) = E_Variable);
4193 end Set_Shared_Var_Read_Proc;
4195 procedure Set_Size_Check_Code (Id : E; V : N) is
4197 pragma Assert (Ekind (Id) = E_Constant or else Ekind (Id) = E_Variable);
4199 end Set_Size_Check_Code;
4201 procedure Set_Size_Depends_On_Discriminant (Id : E; V : B := True) is
4203 Set_Flag177 (Id, V);
4204 end Set_Size_Depends_On_Discriminant;
4206 procedure Set_Size_Known_At_Compile_Time (Id : E; V : B := True) is
4209 end Set_Size_Known_At_Compile_Time;
4211 procedure Set_Small_Value (Id : E; V : R) is
4213 pragma Assert (Is_Fixed_Point_Type (Id));
4214 Set_Ureal21 (Id, V);
4215 end Set_Small_Value;
4217 procedure Set_Spec_Entity (Id : E; V : E) is
4219 pragma Assert (Ekind (Id) = E_Package_Body or else Is_Formal (Id));
4221 end Set_Spec_Entity;
4223 procedure Set_Storage_Size_Variable (Id : E; V : E) is
4225 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
4226 pragma Assert (Base_Type (Id) = Id);
4228 end Set_Storage_Size_Variable;
4230 procedure Set_Stored_Constraint (Id : E; V : L) is
4232 pragma Assert (Nkind (Id) in N_Entity);
4233 Set_Elist23 (Id, V);
4234 end Set_Stored_Constraint;
4236 procedure Set_Strict_Alignment (Id : E; V : B := True) is
4238 pragma Assert (Base_Type (Id) = Id);
4239 Set_Flag145 (Id, V);
4240 end Set_Strict_Alignment;
4242 procedure Set_String_Literal_Length (Id : E; V : U) is
4244 pragma Assert (Ekind (Id) = E_String_Literal_Subtype);
4246 end Set_String_Literal_Length;
4248 procedure Set_String_Literal_Low_Bound (Id : E; V : N) is
4250 pragma Assert (Ekind (Id) = E_String_Literal_Subtype);
4252 end Set_String_Literal_Low_Bound;
4254 procedure Set_Suppress_Elaboration_Warnings (Id : E; V : B := True) is
4256 Set_Flag148 (Id, V);
4257 end Set_Suppress_Elaboration_Warnings;
4259 procedure Set_Suppress_Init_Proc (Id : E; V : B := True) is
4261 pragma Assert (Id = Base_Type (Id));
4262 Set_Flag105 (Id, V);
4263 end Set_Suppress_Init_Proc;
4265 procedure Set_Suppress_Style_Checks (Id : E; V : B := True) is
4267 Set_Flag165 (Id, V);
4268 end Set_Suppress_Style_Checks;
4270 procedure Set_Task_Body_Procedure (Id : E; V : N) is
4272 pragma Assert (Ekind (Id) = E_Task_Type
4273 or else Ekind (Id) = E_Task_Subtype);
4275 end Set_Task_Body_Procedure;
4277 procedure Set_Treat_As_Volatile (Id : E; V : B := True) is
4280 end Set_Treat_As_Volatile;
4282 procedure Set_Underlying_Full_View (Id : E; V : E) is
4284 pragma Assert (Ekind (Id) in Private_Kind);
4286 end Set_Underlying_Full_View;
4288 procedure Set_Unset_Reference (Id : E; V : N) is
4291 end Set_Unset_Reference;
4293 procedure Set_Uses_Sec_Stack (Id : E; V : B := True) is
4296 end Set_Uses_Sec_Stack;
4298 procedure Set_Vax_Float (Id : E; V : B := True) is
4300 pragma Assert (Id = Base_Type (Id));
4301 Set_Flag151 (Id, V);
4304 procedure Set_Warnings_Off (Id : E; V : B := True) is
4307 end Set_Warnings_Off;
4309 -----------------------------------
4310 -- Field Initialization Routines --
4311 -----------------------------------
4313 procedure Init_Alignment (Id : E) is
4315 Set_Uint14 (Id, Uint_0);
4318 procedure Init_Alignment (Id : E; V : Int) is
4320 Set_Uint14 (Id, UI_From_Int (V));
4323 procedure Init_Component_Bit_Offset (Id : E) is
4325 Set_Uint11 (Id, No_Uint);
4326 end Init_Component_Bit_Offset;
4328 procedure Init_Component_Bit_Offset (Id : E; V : Int) is
4330 Set_Uint11 (Id, UI_From_Int (V));
4331 end Init_Component_Bit_Offset;
4333 procedure Init_Component_Size (Id : E) is
4335 Set_Uint22 (Id, Uint_0);
4336 end Init_Component_Size;
4338 procedure Init_Component_Size (Id : E; V : Int) is
4340 Set_Uint22 (Id, UI_From_Int (V));
4341 end Init_Component_Size;
4343 procedure Init_Digits_Value (Id : E) is
4345 Set_Uint17 (Id, Uint_0);
4346 end Init_Digits_Value;
4348 procedure Init_Digits_Value (Id : E; V : Int) is
4350 Set_Uint17 (Id, UI_From_Int (V));
4351 end Init_Digits_Value;
4353 procedure Init_Esize (Id : E) is
4355 Set_Uint12 (Id, Uint_0);
4358 procedure Init_Esize (Id : E; V : Int) is
4360 Set_Uint12 (Id, UI_From_Int (V));
4363 procedure Init_Normalized_First_Bit (Id : E) is
4365 Set_Uint8 (Id, No_Uint);
4366 end Init_Normalized_First_Bit;
4368 procedure Init_Normalized_First_Bit (Id : E; V : Int) is
4370 Set_Uint8 (Id, UI_From_Int (V));
4371 end Init_Normalized_First_Bit;
4373 procedure Init_Normalized_Position (Id : E) is
4375 Set_Uint14 (Id, No_Uint);
4376 end Init_Normalized_Position;
4378 procedure Init_Normalized_Position (Id : E; V : Int) is
4380 Set_Uint14 (Id, UI_From_Int (V));
4381 end Init_Normalized_Position;
4383 procedure Init_Normalized_Position_Max (Id : E) is
4385 Set_Uint10 (Id, No_Uint);
4386 end Init_Normalized_Position_Max;
4388 procedure Init_Normalized_Position_Max (Id : E; V : Int) is
4390 Set_Uint10 (Id, UI_From_Int (V));
4391 end Init_Normalized_Position_Max;
4393 procedure Init_RM_Size (Id : E) is
4395 Set_Uint13 (Id, Uint_0);
4398 procedure Init_RM_Size (Id : E; V : Int) is
4400 Set_Uint13 (Id, UI_From_Int (V));
4403 -----------------------------
4404 -- Init_Component_Location --
4405 -----------------------------
4407 procedure Init_Component_Location (Id : E) is
4409 Set_Uint8 (Id, No_Uint); -- Normalized_First_Bit
4410 Set_Uint10 (Id, No_Uint); -- Normalized_Position_Max
4411 Set_Uint11 (Id, No_Uint); -- Component_First_Bit
4412 Set_Uint12 (Id, Uint_0); -- Esize
4413 Set_Uint14 (Id, No_Uint); -- Normalized_Position
4414 end Init_Component_Location;
4420 procedure Init_Size (Id : E; V : Int) is
4422 Set_Uint12 (Id, UI_From_Int (V)); -- Esize
4423 Set_Uint13 (Id, UI_From_Int (V)); -- RM_Size
4426 ---------------------
4427 -- Init_Size_Align --
4428 ---------------------
4430 procedure Init_Size_Align (Id : E) is
4432 Set_Uint12 (Id, Uint_0); -- Esize
4433 Set_Uint13 (Id, Uint_0); -- RM_Size
4434 Set_Uint14 (Id, Uint_0); -- Alignment
4435 end Init_Size_Align;
4437 ----------------------------------------------
4438 -- Type Representation Attribute Predicates --
4439 ----------------------------------------------
4441 function Known_Alignment (E : Entity_Id) return B is
4443 return Uint14 (E) /= Uint_0
4444 and then Uint14 (E) /= No_Uint;
4445 end Known_Alignment;
4447 function Known_Component_Bit_Offset (E : Entity_Id) return B is
4449 return Uint11 (E) /= No_Uint;
4450 end Known_Component_Bit_Offset;
4452 function Known_Component_Size (E : Entity_Id) return B is
4454 return Uint22 (Base_Type (E)) /= Uint_0
4455 and then Uint22 (Base_Type (E)) /= No_Uint;
4456 end Known_Component_Size;
4458 function Known_Esize (E : Entity_Id) return B is
4460 return Uint12 (E) /= Uint_0
4461 and then Uint12 (E) /= No_Uint;
4464 function Known_Normalized_First_Bit (E : Entity_Id) return B is
4466 return Uint8 (E) /= No_Uint;
4467 end Known_Normalized_First_Bit;
4469 function Known_Normalized_Position (E : Entity_Id) return B is
4471 return Uint14 (E) /= No_Uint;
4472 end Known_Normalized_Position;
4474 function Known_Normalized_Position_Max (E : Entity_Id) return B is
4476 return Uint10 (E) /= No_Uint;
4477 end Known_Normalized_Position_Max;
4479 function Known_RM_Size (E : Entity_Id) return B is
4481 return Uint13 (E) /= No_Uint
4482 and then (Uint13 (E) /= Uint_0
4483 or else Is_Discrete_Type (E)
4484 or else Is_Fixed_Point_Type (E));
4487 function Known_Static_Component_Bit_Offset (E : Entity_Id) return B is
4489 return Uint11 (E) /= No_Uint
4490 and then Uint11 (E) >= Uint_0;
4491 end Known_Static_Component_Bit_Offset;
4493 function Known_Static_Component_Size (E : Entity_Id) return B is
4495 return Uint22 (Base_Type (E)) > Uint_0;
4496 end Known_Static_Component_Size;
4498 function Known_Static_Esize (E : Entity_Id) return B is
4500 return Uint12 (E) > Uint_0;
4501 end Known_Static_Esize;
4503 function Known_Static_Normalized_First_Bit (E : Entity_Id) return B is
4505 return Uint8 (E) /= No_Uint
4506 and then Uint8 (E) >= Uint_0;
4507 end Known_Static_Normalized_First_Bit;
4509 function Known_Static_Normalized_Position (E : Entity_Id) return B is
4511 return Uint14 (E) /= No_Uint
4512 and then Uint14 (E) >= Uint_0;
4513 end Known_Static_Normalized_Position;
4515 function Known_Static_Normalized_Position_Max (E : Entity_Id) return B is
4517 return Uint10 (E) /= No_Uint
4518 and then Uint10 (E) >= Uint_0;
4519 end Known_Static_Normalized_Position_Max;
4521 function Known_Static_RM_Size (E : Entity_Id) return B is
4523 return Uint13 (E) > Uint_0
4524 or else Is_Discrete_Type (E)
4525 or else Is_Fixed_Point_Type (E);
4526 end Known_Static_RM_Size;
4528 function Unknown_Alignment (E : Entity_Id) return B is
4530 return Uint14 (E) = Uint_0
4531 or else Uint14 (E) = No_Uint;
4532 end Unknown_Alignment;
4534 function Unknown_Component_Bit_Offset (E : Entity_Id) return B is
4536 return Uint11 (E) = No_Uint;
4537 end Unknown_Component_Bit_Offset;
4539 function Unknown_Component_Size (E : Entity_Id) return B is
4541 return Uint22 (Base_Type (E)) = Uint_0
4543 Uint22 (Base_Type (E)) = No_Uint;
4544 end Unknown_Component_Size;
4546 function Unknown_Esize (E : Entity_Id) return B is
4548 return Uint12 (E) = No_Uint
4550 Uint12 (E) = Uint_0;
4553 function Unknown_Normalized_First_Bit (E : Entity_Id) return B is
4555 return Uint8 (E) = No_Uint;
4556 end Unknown_Normalized_First_Bit;
4558 function Unknown_Normalized_Position (E : Entity_Id) return B is
4560 return Uint14 (E) = No_Uint;
4561 end Unknown_Normalized_Position;
4563 function Unknown_Normalized_Position_Max (E : Entity_Id) return B is
4565 return Uint10 (E) = No_Uint;
4566 end Unknown_Normalized_Position_Max;
4568 function Unknown_RM_Size (E : Entity_Id) return B is
4570 return (Uint13 (E) = Uint_0
4571 and then not Is_Discrete_Type (E)
4572 and then not Is_Fixed_Point_Type (E))
4573 or else Uint13 (E) = No_Uint;
4574 end Unknown_RM_Size;
4576 --------------------
4577 -- Address_Clause --
4578 --------------------
4580 function Address_Clause (Id : E) return N is
4582 return Rep_Clause (Id, Name_Address);
4585 ----------------------
4586 -- Alignment_Clause --
4587 ----------------------
4589 function Alignment_Clause (Id : E) return N is
4591 return Rep_Clause (Id, Name_Alignment);
4592 end Alignment_Clause;
4594 ----------------------
4595 -- Ancestor_Subtype --
4596 ----------------------
4598 function Ancestor_Subtype (Id : E) return E is
4600 -- If this is first subtype, or is a base type, then there is no
4601 -- ancestor subtype, so we return Empty to indicate this fact.
4603 if Is_First_Subtype (Id) or else Id = Base_Type (Id) then
4608 D : constant Node_Id := Declaration_Node (Id);
4611 -- If we have a subtype declaration, get the ancestor subtype
4613 if Nkind (D) = N_Subtype_Declaration then
4614 if Nkind (Subtype_Indication (D)) = N_Subtype_Indication then
4615 return Entity (Subtype_Mark (Subtype_Indication (D)));
4617 return Entity (Subtype_Indication (D));
4620 -- If not, then no subtype indication is available
4626 end Ancestor_Subtype;
4632 procedure Append_Entity (Id : Entity_Id; V : Entity_Id) is
4634 if Last_Entity (V) = Empty then
4635 Set_First_Entity (V, Id);
4637 Set_Next_Entity (Last_Entity (V), Id);
4640 Set_Next_Entity (Id, Empty);
4642 Set_Last_Entity (V, Id);
4649 function Base_Type (Id : E) return E is
4652 when E_Enumeration_Subtype |
4654 E_Signed_Integer_Subtype |
4655 E_Modular_Integer_Subtype |
4656 E_Floating_Point_Subtype |
4657 E_Ordinary_Fixed_Point_Subtype |
4658 E_Decimal_Fixed_Point_Subtype |
4663 E_Record_Subtype_With_Private |
4664 E_Limited_Private_Subtype |
4666 E_Protected_Subtype |
4668 E_String_Literal_Subtype |
4669 E_Class_Wide_Subtype =>
4677 -------------------------
4678 -- Component_Alignment --
4679 -------------------------
4681 -- Component Alignment is encoded using two flags, Flag128/129 as
4682 -- follows. Note that both flags False = Align_Default, so that the
4683 -- default initialization of flags to False initializes component
4684 -- alignment to the default value as required.
4686 -- Flag128 Flag129 Value
4687 -- ------- ------- -----
4688 -- False False Calign_Default
4689 -- False True Calign_Component_Size
4690 -- True False Calign_Component_Size_4
4691 -- True True Calign_Storage_Unit
4693 function Component_Alignment (Id : E) return C is
4694 BT : constant Node_Id := Base_Type (Id);
4697 pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id));
4699 if Flag128 (BT) then
4700 if Flag129 (BT) then
4701 return Calign_Storage_Unit;
4703 return Calign_Component_Size_4;
4707 if Flag129 (BT) then
4708 return Calign_Component_Size;
4710 return Calign_Default;
4713 end Component_Alignment;
4715 --------------------
4716 -- Constant_Value --
4717 --------------------
4719 function Constant_Value (Id : E) return N is
4720 D : constant Node_Id := Declaration_Node (Id);
4724 -- If we have no declaration node, then return no constant value.
4725 -- Not clear how this can happen, but it does sometimes ???
4726 -- To investigate, remove this check and compile discrim_po.adb.
4731 -- Normal case where a declaration node is present
4733 elsif Nkind (D) = N_Object_Renaming_Declaration then
4734 return Renamed_Object (Id);
4736 -- If this is a component declaration whose entity is constant, it
4737 -- is a prival within a protected function. It does not have
4738 -- a constant value.
4740 elsif Nkind (D) = N_Component_Declaration then
4743 -- If there is an expression, return it
4745 elsif Present (Expression (D)) then
4746 return (Expression (D));
4748 -- For a constant, see if we have a full view
4750 elsif Ekind (Id) = E_Constant
4751 and then Present (Full_View (Id))
4753 Full_D := Parent (Full_View (Id));
4755 -- The full view may have been rewritten as an object renaming
4757 if Nkind (Full_D) = N_Object_Renaming_Declaration then
4758 return Name (Full_D);
4760 return Expression (Full_D);
4763 -- Otherwise we have no expression to return
4770 ----------------------
4771 -- Declaration_Node --
4772 ----------------------
4774 function Declaration_Node (Id : E) return N is
4778 if Ekind (Id) = E_Incomplete_Type
4779 and then Present (Full_View (Id))
4781 P := Parent (Full_View (Id));
4787 if Nkind (P) /= N_Selected_Component
4788 and then Nkind (P) /= N_Expanded_Name
4790 not (Nkind (P) = N_Defining_Program_Unit_Name
4791 and then Is_Child_Unit (Id))
4799 end Declaration_Node;
4801 ---------------------
4802 -- Designated_Type --
4803 ---------------------
4805 function Designated_Type (Id : E) return E is
4809 Desig_Type := Directly_Designated_Type (Id);
4811 if Ekind (Desig_Type) = E_Incomplete_Type
4812 and then Present (Full_View (Desig_Type))
4814 return Full_View (Desig_Type);
4816 elsif Is_Class_Wide_Type (Desig_Type)
4817 and then Ekind (Etype (Desig_Type)) = E_Incomplete_Type
4818 and then Present (Full_View (Etype (Desig_Type)))
4819 and then Present (Class_Wide_Type (Full_View (Etype (Desig_Type))))
4821 return Class_Wide_Type (Full_View (Etype (Desig_Type)));
4826 end Designated_Type;
4828 -----------------------------
4829 -- Enclosing_Dynamic_Scope --
4830 -----------------------------
4832 function Enclosing_Dynamic_Scope (Id : E) return E is
4836 -- The following test is an error defense against some syntax
4837 -- errors that can leave scopes very messed up.
4839 if Id = Standard_Standard then
4843 -- Normal case, search enclosing scopes
4846 while S /= Standard_Standard
4847 and then not Is_Dynamic_Scope (S)
4853 end Enclosing_Dynamic_Scope;
4855 ----------------------
4856 -- Entry_Index_Type --
4857 ----------------------
4859 function Entry_Index_Type (Id : E) return N is
4861 pragma Assert (Ekind (Id) = E_Entry_Family);
4862 return Etype (Discrete_Subtype_Definition (Parent (Id)));
4863 end Entry_Index_Type;
4865 ---------------------
4867 ---------------------
4869 function First_Component (Id : E) return E is
4874 (Is_Record_Type (Id) or else Is_Incomplete_Or_Private_Type (Id));
4876 Comp_Id := First_Entity (Id);
4877 while Present (Comp_Id) loop
4878 exit when Ekind (Comp_Id) = E_Component;
4879 Comp_Id := Next_Entity (Comp_Id);
4883 end First_Component;
4885 ------------------------
4886 -- First_Discriminant --
4887 ------------------------
4889 function First_Discriminant (Id : E) return E is
4894 (Has_Discriminants (Id)
4895 or else Has_Unknown_Discriminants (Id));
4897 Ent := First_Entity (Id);
4899 -- The discriminants are not necessarily contiguous, because access
4900 -- discriminants will generate itypes. They are not the first entities
4901 -- either, because tag and controller record must be ahead of them.
4903 if Chars (Ent) = Name_uTag then
4904 Ent := Next_Entity (Ent);
4907 if Chars (Ent) = Name_uController then
4908 Ent := Next_Entity (Ent);
4911 -- Skip all hidden stored discriminants if any
4913 while Present (Ent) loop
4914 exit when Ekind (Ent) = E_Discriminant
4915 and then not Is_Completely_Hidden (Ent);
4917 Ent := Next_Entity (Ent);
4920 pragma Assert (Ekind (Ent) = E_Discriminant);
4923 end First_Discriminant;
4929 function First_Formal (Id : E) return E is
4934 (Is_Overloadable (Id)
4935 or else Ekind (Id) = E_Entry_Family
4936 or else Ekind (Id) = E_Subprogram_Body
4937 or else Ekind (Id) = E_Subprogram_Type);
4939 if Ekind (Id) = E_Enumeration_Literal then
4943 Formal := First_Entity (Id);
4945 if Present (Formal) and then Is_Formal (Formal) then
4953 -------------------------------
4954 -- First_Stored_Discriminant --
4955 -------------------------------
4957 function First_Stored_Discriminant (Id : E) return E is
4960 function Has_Completely_Hidden_Discriminant (Id : E) return Boolean;
4961 -- Scans the Discriminants to see whether any are Completely_Hidden
4962 -- (the mechanism for describing non-specified stored discriminants)
4964 ----------------------------------------
4965 -- Has_Completely_Hidden_Discriminant --
4966 ----------------------------------------
4968 function Has_Completely_Hidden_Discriminant (Id : E) return Boolean is
4969 Ent : Entity_Id := Id;
4972 pragma Assert (Ekind (Id) = E_Discriminant);
4974 while Present (Ent) and then Ekind (Ent) = E_Discriminant loop
4975 if Is_Completely_Hidden (Ent) then
4979 Ent := Next_Entity (Ent);
4983 end Has_Completely_Hidden_Discriminant;
4985 -- Start of processing for First_Stored_Discriminant
4989 (Has_Discriminants (Id)
4990 or else Has_Unknown_Discriminants (Id));
4992 Ent := First_Entity (Id);
4994 if Chars (Ent) = Name_uTag then
4995 Ent := Next_Entity (Ent);
4998 if Chars (Ent) = Name_uController then
4999 Ent := Next_Entity (Ent);
5002 if Has_Completely_Hidden_Discriminant (Ent) then
5004 while Present (Ent) loop
5005 exit when Is_Completely_Hidden (Ent);
5006 Ent := Next_Entity (Ent);
5011 pragma Assert (Ekind (Ent) = E_Discriminant);
5014 end First_Stored_Discriminant;
5020 function First_Subtype (Id : E) return E is
5021 B : constant Entity_Id := Base_Type (Id);
5022 F : constant Node_Id := Freeze_Node (B);
5026 -- If the base type has no freeze node, it is a type in standard,
5027 -- and always acts as its own first subtype unless it is one of
5028 -- the predefined integer types. If the type is formal, it is also
5029 -- a first subtype, and its base type has no freeze node. On the other
5030 -- hand, a subtype of a generic formal is not its own first_subtype.
5031 -- Its base type, if anonymous, is attached to the formal type decl.
5032 -- from which the first subtype is obtained.
5036 if B = Base_Type (Standard_Integer) then
5037 return Standard_Integer;
5039 elsif B = Base_Type (Standard_Long_Integer) then
5040 return Standard_Long_Integer;
5042 elsif B = Base_Type (Standard_Short_Short_Integer) then
5043 return Standard_Short_Short_Integer;
5045 elsif B = Base_Type (Standard_Short_Integer) then
5046 return Standard_Short_Integer;
5048 elsif B = Base_Type (Standard_Long_Long_Integer) then
5049 return Standard_Long_Long_Integer;
5051 elsif Is_Generic_Type (Id) then
5052 if Present (Parent (B)) then
5053 return Defining_Identifier (Parent (B));
5055 return Defining_Identifier (Associated_Node_For_Itype (B));
5062 -- Otherwise we check the freeze node, if it has a First_Subtype_Link
5063 -- then we use that link, otherwise (happens with some Itypes), we use
5064 -- the base type itself.
5067 Ent := First_Subtype_Link (F);
5069 if Present (Ent) then
5077 -------------------------------------
5078 -- Get_Attribute_Definition_Clause --
5079 -------------------------------------
5081 function Get_Attribute_Definition_Clause
5083 Id : Attribute_Id) return Node_Id
5088 N := First_Rep_Item (E);
5089 while Present (N) loop
5090 if Nkind (N) = N_Attribute_Definition_Clause
5091 and then Get_Attribute_Id (Chars (N)) = Id
5100 end Get_Attribute_Definition_Clause;
5102 --------------------
5103 -- Get_Rep_Pragma --
5104 --------------------
5106 function Get_Rep_Pragma (E : Entity_Id; Nam : Name_Id) return Node_Id is
5110 N := First_Rep_Item (E);
5111 while Present (N) loop
5112 if Nkind (N) = N_Pragma and then Chars (N) = Nam then
5122 ------------------------
5123 -- Has_Attach_Handler --
5124 ------------------------
5126 function Has_Attach_Handler (Id : E) return B is
5130 pragma Assert (Is_Protected_Type (Id));
5132 Ritem := First_Rep_Item (Id);
5133 while Present (Ritem) loop
5134 if Nkind (Ritem) = N_Pragma
5135 and then Chars (Ritem) = Name_Attach_Handler
5139 Ritem := Next_Rep_Item (Ritem);
5144 end Has_Attach_Handler;
5146 -------------------------------------
5147 -- Has_Attribute_Definition_Clause --
5148 -------------------------------------
5150 function Has_Attribute_Definition_Clause
5152 Id : Attribute_Id) return Boolean
5155 return Present (Get_Attribute_Definition_Clause (E, Id));
5156 end Has_Attribute_Definition_Clause;
5162 function Has_Entries (Id : E) return B is
5163 Result : Boolean := False;
5167 pragma Assert (Is_Concurrent_Type (Id));
5169 Ent := First_Entity (Id);
5170 while Present (Ent) loop
5171 if Is_Entry (Ent) then
5176 Ent := Next_Entity (Ent);
5182 ----------------------------
5183 -- Has_Foreign_Convention --
5184 ----------------------------
5186 function Has_Foreign_Convention (Id : E) return B is
5188 return Convention (Id) >= Foreign_Convention'First;
5189 end Has_Foreign_Convention;
5191 ---------------------------
5192 -- Has_Interrupt_Handler --
5193 ---------------------------
5195 function Has_Interrupt_Handler (Id : E) return B is
5199 pragma Assert (Is_Protected_Type (Id));
5201 Ritem := First_Rep_Item (Id);
5202 while Present (Ritem) loop
5203 if Nkind (Ritem) = N_Pragma
5204 and then Chars (Ritem) = Name_Interrupt_Handler
5208 Ritem := Next_Rep_Item (Ritem);
5213 end Has_Interrupt_Handler;
5215 --------------------------
5216 -- Has_Private_Ancestor --
5217 --------------------------
5219 function Has_Private_Ancestor (Id : E) return B is
5220 R : constant Entity_Id := Root_Type (Id);
5221 T1 : Entity_Id := Id;
5225 if Is_Private_Type (T1) then
5235 end Has_Private_Ancestor;
5237 --------------------
5238 -- Has_Rep_Pragma --
5239 --------------------
5241 function Has_Rep_Pragma (E : Entity_Id; Nam : Name_Id) return Boolean is
5243 return Present (Get_Rep_Pragma (E, Nam));
5246 ------------------------------
5247 -- Implementation_Base_Type --
5248 ------------------------------
5250 function Implementation_Base_Type (Id : E) return E is
5255 Bastyp := Base_Type (Id);
5257 if Is_Incomplete_Or_Private_Type (Bastyp) then
5258 Imptyp := Underlying_Type (Bastyp);
5260 -- If we have an implementation type, then just return it,
5261 -- otherwise we return the Base_Type anyway. This can only
5262 -- happen in error situations and should avoid some error bombs.
5264 if Present (Imptyp) then
5265 return Base_Type (Imptyp);
5273 end Implementation_Base_Type;
5275 -----------------------
5276 -- Is_Always_Inlined --
5277 -----------------------
5279 function Is_Always_Inlined (Id : E) return B is
5283 Item := First_Rep_Item (Id);
5284 while Present (Item) loop
5285 if Nkind (Item) = N_Pragma
5286 and then Get_Pragma_Id (Chars (Item)) = Pragma_Inline_Always
5291 Next_Rep_Item (Item);
5295 end Is_Always_Inlined;
5297 ---------------------
5298 -- Is_Boolean_Type --
5299 ---------------------
5301 function Is_Boolean_Type (Id : E) return B is
5303 return Root_Type (Id) = Standard_Boolean;
5304 end Is_Boolean_Type;
5306 ---------------------
5307 -- Is_By_Copy_Type --
5308 ---------------------
5310 function Is_By_Copy_Type (Id : E) return B is
5312 -- If Id is a private type whose full declaration has not been seen,
5313 -- we assume for now that it is not a By_Copy type. Clearly this
5314 -- attribute should not be used before the type is frozen, but it is
5315 -- needed to build the associated record of a protected type. Another
5316 -- place where some lookahead for a full view is needed ???
5319 Is_Elementary_Type (Id)
5320 or else (Is_Private_Type (Id)
5321 and then Present (Underlying_Type (Id))
5322 and then Is_Elementary_Type (Underlying_Type (Id)));
5323 end Is_By_Copy_Type;
5325 --------------------------
5326 -- Is_By_Reference_Type --
5327 --------------------------
5329 function Is_By_Reference_Type (Id : E) return B is
5330 Btype : constant Entity_Id := Base_Type (Id);
5333 if Error_Posted (Id)
5334 or else Error_Posted (Btype)
5338 elsif Is_Private_Type (Btype) then
5340 Utyp : constant Entity_Id := Underlying_Type (Btype);
5346 return Is_By_Reference_Type (Utyp);
5350 elsif Is_Concurrent_Type (Btype) then
5353 elsif Is_Record_Type (Btype) then
5354 if Is_Limited_Record (Btype)
5355 or else Is_Tagged_Type (Btype)
5356 or else Is_Volatile (Btype)
5365 C := First_Component (Btype);
5366 while Present (C) loop
5367 if Is_By_Reference_Type (Etype (C))
5368 or else Is_Volatile (Etype (C))
5373 C := Next_Component (C);
5380 elsif Is_Array_Type (Btype) then
5383 or else Is_By_Reference_Type (Component_Type (Btype))
5384 or else Is_Volatile (Component_Type (Btype))
5385 or else Has_Volatile_Components (Btype);
5390 end Is_By_Reference_Type;
5392 ---------------------
5393 -- Is_Derived_Type --
5394 ---------------------
5396 function Is_Derived_Type (Id : E) return B is
5400 if Base_Type (Id) /= Root_Type (Id)
5401 and then not Is_Generic_Type (Id)
5402 and then not Is_Class_Wide_Type (Id)
5404 if not Is_Numeric_Type (Root_Type (Id)) then
5408 Par := Parent (First_Subtype (Id));
5410 return Present (Par)
5411 and then Nkind (Par) = N_Full_Type_Declaration
5412 and then Nkind (Type_Definition (Par))
5413 = N_Derived_Type_Definition;
5419 end Is_Derived_Type;
5421 ----------------------
5422 -- Is_Dynamic_Scope --
5423 ----------------------
5425 function Is_Dynamic_Scope (Id : E) return B is
5428 Ekind (Id) = E_Block
5430 Ekind (Id) = E_Function
5432 Ekind (Id) = E_Procedure
5434 Ekind (Id) = E_Subprogram_Body
5436 Ekind (Id) = E_Task_Type
5438 Ekind (Id) = E_Entry
5440 Ekind (Id) = E_Entry_Family;
5441 end Is_Dynamic_Scope;
5443 --------------------
5444 -- Is_Entity_Name --
5445 --------------------
5447 function Is_Entity_Name (N : Node_Id) return Boolean is
5448 Kind : constant Node_Kind := Nkind (N);
5451 -- Identifiers, operator symbols, expanded names are entity names
5453 return Kind = N_Identifier
5454 or else Kind = N_Operator_Symbol
5455 or else Kind = N_Expanded_Name
5457 -- Attribute references are entity names if they refer to an entity.
5458 -- Note that we don't do this by testing for the presence of the
5459 -- Entity field in the N_Attribute_Reference node, since it may not
5460 -- have been set yet.
5462 or else (Kind = N_Attribute_Reference
5463 and then Is_Entity_Attribute_Name (Attribute_Name (N)));
5466 ---------------------------
5467 -- Is_Indefinite_Subtype --
5468 ---------------------------
5470 function Is_Indefinite_Subtype (Id : Entity_Id) return B is
5471 K : constant Entity_Kind := Ekind (Id);
5474 if Is_Constrained (Id) then
5477 elsif K in Array_Kind
5478 or else K in Class_Wide_Kind
5479 or else Has_Unknown_Discriminants (Id)
5483 -- Known discriminants: indefinite if there are no default values
5485 elsif K in Record_Kind
5486 or else Is_Incomplete_Or_Private_Type (Id)
5487 or else Is_Concurrent_Type (Id)
5489 return (Has_Discriminants (Id)
5490 and then No (Discriminant_Default_Value (First_Discriminant (Id))));
5495 end Is_Indefinite_Subtype;
5497 ---------------------
5498 -- Is_Limited_Type --
5499 ---------------------
5501 function Is_Limited_Type (Id : E) return B is
5502 Btype : constant E := Base_Type (Id);
5505 if not Is_Type (Id) then
5508 elsif Ekind (Btype) = E_Limited_Private_Type
5509 or else Is_Limited_Composite (Btype)
5513 elsif Is_Concurrent_Type (Btype) then
5516 -- Otherwise we will look around to see if there is some other reason
5517 -- for it to be limited, except that if an error was posted on the
5518 -- entity, then just assume it is non-limited, because it can cause
5519 -- trouble to recurse into a murky erroneous entity!
5521 elsif Error_Posted (Id) then
5524 elsif Is_Record_Type (Btype) then
5525 if Is_Limited_Record (Root_Type (Btype)) then
5528 elsif Is_Class_Wide_Type (Btype) then
5529 return Is_Limited_Type (Root_Type (Btype));
5536 C := First_Component (Btype);
5537 while Present (C) loop
5538 if Is_Limited_Type (Etype (C)) then
5542 C := Next_Component (C);
5549 elsif Is_Array_Type (Btype) then
5550 return Is_Limited_Type (Component_Type (Btype));
5555 end Is_Limited_Type;
5561 function Is_Package (Id : E) return B is
5564 Ekind (Id) = E_Package
5566 Ekind (Id) = E_Generic_Package;
5569 --------------------------
5570 -- Is_Protected_Private --
5571 --------------------------
5573 function Is_Protected_Private (Id : E) return B is
5575 pragma Assert (Ekind (Id) = E_Component);
5576 return Is_Protected_Type (Scope (Id));
5577 end Is_Protected_Private;
5579 ------------------------------
5580 -- Is_Protected_Record_Type --
5581 ------------------------------
5583 function Is_Protected_Record_Type (Id : E) return B is
5586 Is_Concurrent_Record_Type (Id)
5587 and then Is_Protected_Type (Corresponding_Concurrent_Type (Id));
5588 end Is_Protected_Record_Type;
5590 ---------------------------------
5591 -- Is_Return_By_Reference_Type --
5592 ---------------------------------
5594 function Is_Return_By_Reference_Type (Id : E) return B is
5595 Btype : constant Entity_Id := Base_Type (Id);
5598 if Is_Private_Type (Btype) then
5600 Utyp : constant Entity_Id := Underlying_Type (Btype);
5606 return Is_Return_By_Reference_Type (Utyp);
5610 elsif Is_Concurrent_Type (Btype) then
5613 elsif Is_Record_Type (Btype) then
5614 if Is_Limited_Record (Btype) then
5617 elsif Is_Class_Wide_Type (Btype) then
5618 return Is_Return_By_Reference_Type (Root_Type (Btype));
5625 C := First_Component (Btype);
5626 while Present (C) loop
5627 if Is_Return_By_Reference_Type (Etype (C)) then
5631 C := Next_Component (C);
5638 elsif Is_Array_Type (Btype) then
5639 return Is_Return_By_Reference_Type (Component_Type (Btype));
5644 end Is_Return_By_Reference_Type;
5646 --------------------
5647 -- Is_String_Type --
5648 --------------------
5650 function Is_String_Type (Id : E) return B is
5652 return Ekind (Id) in String_Kind
5653 or else (Is_Array_Type (Id)
5654 and then Number_Dimensions (Id) = 1
5655 and then Is_Character_Type (Component_Type (Id)));
5658 -------------------------
5659 -- Is_Task_Record_Type --
5660 -------------------------
5662 function Is_Task_Record_Type (Id : E) return B is
5665 Is_Concurrent_Record_Type (Id)
5666 and then Is_Task_Type (Corresponding_Concurrent_Type (Id));
5667 end Is_Task_Record_Type;
5669 ------------------------
5670 -- Is_Wrapper_Package --
5671 ------------------------
5673 function Is_Wrapper_Package (Id : E) return B is
5675 return (Ekind (Id) = E_Package
5676 and then Present (Related_Instance (Id)));
5677 end Is_Wrapper_Package;
5679 --------------------
5680 -- Next_Component --
5681 --------------------
5683 function Next_Component (Id : E) return E is
5687 Comp_Id := Next_Entity (Id);
5688 while Present (Comp_Id) loop
5689 exit when Ekind (Comp_Id) = E_Component;
5690 Comp_Id := Next_Entity (Comp_Id);
5696 -----------------------
5697 -- Next_Discriminant --
5698 -----------------------
5700 -- This function actually implements both Next_Discriminant and
5701 -- Next_Stored_Discriminant by making sure that the Discriminant
5702 -- returned is of the same variety as Id.
5704 function Next_Discriminant (Id : E) return E is
5706 -- Derived Tagged types with private extensions look like this...
5708 -- E_Discriminant d1
5709 -- E_Discriminant d2
5711 -- E_Discriminant d1
5712 -- E_Discriminant d2
5715 -- so it is critical not to go past the leading discriminants
5720 pragma Assert (Ekind (Id) = E_Discriminant);
5723 D := Next_Entity (D);
5725 or else (Ekind (D) /= E_Discriminant
5726 and then not Is_Itype (D))
5731 exit when Ekind (D) = E_Discriminant
5732 and then (Is_Completely_Hidden (D) = Is_Completely_Hidden (Id));
5736 end Next_Discriminant;
5742 function Next_Formal (Id : E) return E is
5746 -- Follow the chain of declared entities as long as the kind of
5747 -- the entity corresponds to a formal parameter. Skip internal
5748 -- entities that may have been created for implicit subtypes,
5749 -- in the process of analyzing default expressions.
5754 P := Next_Entity (P);
5756 if No (P) or else Is_Formal (P) then
5758 elsif not Is_Internal (P) then
5764 -----------------------------
5765 -- Next_Formal_With_Extras --
5766 -----------------------------
5768 function Next_Formal_With_Extras (Id : E) return E is
5770 if Present (Extra_Formal (Id)) then
5771 return Extra_Formal (Id);
5773 return Next_Formal (Id);
5775 end Next_Formal_With_Extras;
5781 function Next_Index (Id : Node_Id) return Node_Id is
5790 function Next_Literal (Id : E) return E is
5792 pragma Assert (Nkind (Id) in N_Entity);
5796 ------------------------------
5797 -- Next_Stored_Discriminant --
5798 ------------------------------
5800 function Next_Stored_Discriminant (Id : E) return E is
5802 -- See comment in Next_Discriminant
5804 return Next_Discriminant (Id);
5805 end Next_Stored_Discriminant;
5807 -----------------------
5808 -- Number_Dimensions --
5809 -----------------------
5811 function Number_Dimensions (Id : E) return Pos is
5816 if Ekind (Id) in String_Kind then
5821 T := First_Index (Id);
5822 while Present (T) loop
5829 end Number_Dimensions;
5831 --------------------------
5832 -- Number_Discriminants --
5833 --------------------------
5835 function Number_Discriminants (Id : E) return Pos is
5841 Discr := First_Discriminant (Id);
5842 while Present (Discr) loop
5844 Discr := Next_Discriminant (Discr);
5848 end Number_Discriminants;
5850 --------------------
5851 -- Number_Entries --
5852 --------------------
5854 function Number_Entries (Id : E) return Nat is
5859 pragma Assert (Is_Concurrent_Type (Id));
5862 Ent := First_Entity (Id);
5863 while Present (Ent) loop
5864 if Is_Entry (Ent) then
5868 Ent := Next_Entity (Ent);
5874 --------------------
5875 -- Number_Formals --
5876 --------------------
5878 function Number_Formals (Id : E) return Pos is
5884 Formal := First_Formal (Id);
5885 while Present (Formal) loop
5887 Formal := Next_Formal (Formal);
5893 --------------------
5894 -- Parameter_Mode --
5895 --------------------
5897 function Parameter_Mode (Id : E) return Formal_Kind is
5902 ---------------------
5903 -- Record_Rep_Item --
5904 ---------------------
5906 procedure Record_Rep_Item (E : Entity_Id; N : Node_Id) is
5908 Set_Next_Rep_Item (N, First_Rep_Item (E));
5909 Set_First_Rep_Item (E, N);
5910 end Record_Rep_Item;
5916 function Root_Type (Id : E) return E is
5920 pragma Assert (Nkind (Id) in N_Entity);
5922 T := Base_Type (Id);
5924 if Ekind (T) = E_Class_Wide_Type then
5936 -- Following test catches some error cases resulting from
5939 elsif No (Etyp) then
5942 elsif Is_Private_Type (T) and then Etyp = Full_View (T) then
5945 elsif Is_Private_Type (Etyp) and then Full_View (Etyp) = T then
5951 -- Return if there is a circularity in the inheritance chain.
5952 -- This happens in some error situations and we do not want
5953 -- to get stuck in this loop.
5955 if T = Base_Type (Id) then
5961 raise Program_Error;
5968 function Scope_Depth (Id : E) return Uint is
5973 while Is_Record_Type (Scop) loop
5974 Scop := Scope (Scop);
5977 return Scope_Depth_Value (Scop);
5980 ---------------------
5981 -- Scope_Depth_Set --
5982 ---------------------
5984 function Scope_Depth_Set (Id : E) return B is
5986 return not Is_Record_Type (Id)
5987 and then Field22 (Id) /= Union_Id (Empty);
5988 end Scope_Depth_Set;
5990 -----------------------------
5991 -- Set_Component_Alignment --
5992 -----------------------------
5994 -- Component Alignment is encoded using two flags, Flag128/129 as
5995 -- follows. Note that both flags False = Align_Default, so that the
5996 -- default initialization of flags to False initializes component
5997 -- alignment to the default value as required.
5999 -- Flag128 Flag129 Value
6000 -- ------- ------- -----
6001 -- False False Calign_Default
6002 -- False True Calign_Component_Size
6003 -- True False Calign_Component_Size_4
6004 -- True True Calign_Storage_Unit
6006 procedure Set_Component_Alignment (Id : E; V : C) is
6008 pragma Assert ((Is_Array_Type (Id) or else Is_Record_Type (Id))
6009 and then Id = Base_Type (Id));
6012 when Calign_Default =>
6013 Set_Flag128 (Id, False);
6014 Set_Flag129 (Id, False);
6016 when Calign_Component_Size =>
6017 Set_Flag128 (Id, False);
6018 Set_Flag129 (Id, True);
6020 when Calign_Component_Size_4 =>
6021 Set_Flag128 (Id, True);
6022 Set_Flag129 (Id, False);
6024 when Calign_Storage_Unit =>
6025 Set_Flag128 (Id, True);
6026 Set_Flag129 (Id, True);
6028 end Set_Component_Alignment;
6034 function Size_Clause (Id : E) return N is
6036 return Rep_Clause (Id, Name_Size);
6039 ------------------------
6040 -- Stream_Size_Clause --
6041 ------------------------
6043 function Stream_Size_Clause (Id : E) return N is
6045 return Rep_Clause (Id, Name_Stream_Size);
6046 end Stream_Size_Clause;
6052 function Subtype_Kind (K : Entity_Kind) return Entity_Kind is
6058 Kind := E_Access_Subtype;
6062 Kind := E_Array_Subtype;
6064 when E_Class_Wide_Type |
6065 E_Class_Wide_Subtype =>
6066 Kind := E_Class_Wide_Subtype;
6068 when E_Decimal_Fixed_Point_Type |
6069 E_Decimal_Fixed_Point_Subtype =>
6070 Kind := E_Decimal_Fixed_Point_Subtype;
6072 when E_Ordinary_Fixed_Point_Type |
6073 E_Ordinary_Fixed_Point_Subtype =>
6074 Kind := E_Ordinary_Fixed_Point_Subtype;
6076 when E_Private_Type |
6077 E_Private_Subtype =>
6078 Kind := E_Private_Subtype;
6080 when E_Limited_Private_Type |
6081 E_Limited_Private_Subtype =>
6082 Kind := E_Limited_Private_Subtype;
6084 when E_Record_Type_With_Private |
6085 E_Record_Subtype_With_Private =>
6086 Kind := E_Record_Subtype_With_Private;
6088 when E_Record_Type |
6090 Kind := E_Record_Subtype;
6092 when E_String_Type |
6094 Kind := E_String_Subtype;
6096 when Enumeration_Kind =>
6097 Kind := E_Enumeration_Subtype;
6100 Kind := E_Floating_Point_Subtype;
6102 when Signed_Integer_Kind =>
6103 Kind := E_Signed_Integer_Subtype;
6105 when Modular_Integer_Kind =>
6106 Kind := E_Modular_Integer_Subtype;
6108 when Protected_Kind =>
6109 Kind := E_Protected_Subtype;
6112 Kind := E_Task_Subtype;
6116 raise Program_Error;
6122 -------------------------
6123 -- First_Tag_Component --
6124 -------------------------
6126 function First_Tag_Component (Id : E) return E is
6128 Typ : Entity_Id := Id;
6131 pragma Assert (Is_Tagged_Type (Typ));
6133 if Is_Class_Wide_Type (Typ) then
6134 Typ := Root_Type (Typ);
6137 if Is_Private_Type (Typ) then
6138 Typ := Underlying_Type (Typ);
6141 Comp := First_Entity (Typ);
6142 while Present (Comp) loop
6143 if Is_Tag (Comp) then
6147 Comp := Next_Entity (Comp);
6150 -- No tag component found
6153 end First_Tag_Component;
6155 ------------------------
6156 -- Next_Tag_Component --
6157 ------------------------
6159 function Next_Tag_Component (Id : E) return E is
6161 Typ : constant Entity_Id := Scope (Id);
6164 pragma Assert (Ekind (Id) = E_Component
6165 and then Is_Tagged_Type (Typ));
6167 Comp := Next_Entity (Id);
6168 while Present (Comp) loop
6169 if Is_Tag (Comp) then
6170 pragma Assert (Chars (Comp) /= Name_uTag);
6174 Comp := Next_Entity (Comp);
6177 -- No tag component found
6180 end Next_Tag_Component;
6182 ---------------------
6183 -- Type_High_Bound --
6184 ---------------------
6186 function Type_High_Bound (Id : E) return Node_Id is
6188 if Nkind (Scalar_Range (Id)) = N_Subtype_Indication then
6189 return High_Bound (Range_Expression (Constraint (Scalar_Range (Id))));
6191 return High_Bound (Scalar_Range (Id));
6193 end Type_High_Bound;
6195 --------------------
6196 -- Type_Low_Bound --
6197 --------------------
6199 function Type_Low_Bound (Id : E) return Node_Id is
6201 if Nkind (Scalar_Range (Id)) = N_Subtype_Indication then
6202 return Low_Bound (Range_Expression (Constraint (Scalar_Range (Id))));
6204 return Low_Bound (Scalar_Range (Id));
6208 ---------------------
6209 -- Underlying_Type --
6210 ---------------------
6212 function Underlying_Type (Id : E) return E is
6214 -- For record_with_private the underlying type is always the direct
6215 -- full view. Never try to take the full view of the parent it
6216 -- doesn't make sense.
6218 if Ekind (Id) = E_Record_Type_With_Private then
6219 return Full_View (Id);
6221 elsif Ekind (Id) in Incomplete_Or_Private_Kind then
6223 -- If we have an incomplete or private type with a full view,
6224 -- then we return the Underlying_Type of this full view
6226 if Present (Full_View (Id)) then
6227 if Id = Full_View (Id) then
6229 -- Previous error in declaration
6234 return Underlying_Type (Full_View (Id));
6237 -- Otherwise check for the case where we have a derived type or
6238 -- subtype, and if so get the Underlying_Type of the parent type.
6240 elsif Etype (Id) /= Id then
6241 return Underlying_Type (Etype (Id));
6243 -- Otherwise we have an incomplete or private type that has
6244 -- no full view, which means that we have not encountered the
6245 -- completion, so return Empty to indicate the underlying type
6246 -- is not yet known.
6252 -- For non-incomplete, non-private types, return the type itself
6253 -- Also for entities that are not types at all return the entity
6259 end Underlying_Type;
6261 ------------------------
6262 -- Write_Entity_Flags --
6263 ------------------------
6265 procedure Write_Entity_Flags (Id : Entity_Id; Prefix : String) is
6267 procedure W (Flag_Name : String; Flag : Boolean);
6268 -- Write out given flag if it is set
6274 procedure W (Flag_Name : String; Flag : Boolean) is
6278 Write_Str (Flag_Name);
6279 Write_Str (" = True");
6284 -- Start of processing for Write_Entity_Flags
6287 if (Is_Array_Type (Id) or else Is_Record_Type (Id))
6288 and then Base_Type (Id) = Id
6291 Write_Str ("Component_Alignment = ");
6293 case Component_Alignment (Id) is
6294 when Calign_Default =>
6295 Write_Str ("Calign_Default");
6297 when Calign_Component_Size =>
6298 Write_Str ("Calign_Component_Size");
6300 when Calign_Component_Size_4 =>
6301 Write_Str ("Calign_Component_Size_4");
6303 when Calign_Storage_Unit =>
6304 Write_Str ("Calign_Storage_Unit");
6310 W ("Address_Taken", Flag104 (Id));
6311 W ("Body_Needed_For_SAL", Flag40 (Id));
6312 W ("C_Pass_By_Copy", Flag125 (Id));
6313 W ("Can_Never_Be_Null", Flag38 (Id));
6314 W ("Checks_May_Be_Suppressed", Flag31 (Id));
6315 W ("Debug_Info_Off", Flag166 (Id));
6316 W ("Default_Expressions_Processed", Flag108 (Id));
6317 W ("Delay_Cleanups", Flag114 (Id));
6318 W ("Delay_Subprogram_Descriptors", Flag50 (Id));
6319 W ("Depends_On_Private", Flag14 (Id));
6320 W ("Discard_Names", Flag88 (Id));
6321 W ("Elaborate_All_Desirable", Flag146 (Id));
6322 W ("Elaboration_Entity_Required", Flag174 (Id));
6323 W ("Entry_Accepted", Flag152 (Id));
6324 W ("Finalize_Storage_Only", Flag158 (Id));
6325 W ("From_With_Type", Flag159 (Id));
6326 W ("Function_Returns_With_DSP", Flag169 (Id));
6327 W ("Has_Aliased_Components", Flag135 (Id));
6328 W ("Has_Alignment_Clause", Flag46 (Id));
6329 W ("Has_All_Calls_Remote", Flag79 (Id));
6330 W ("Has_Atomic_Components", Flag86 (Id));
6331 W ("Has_Biased_Representation", Flag139 (Id));
6332 W ("Has_Completion", Flag26 (Id));
6333 W ("Has_Completion_In_Body", Flag71 (Id));
6334 W ("Has_Complex_Representation", Flag140 (Id));
6335 W ("Has_Component_Size_Clause", Flag68 (Id));
6336 W ("Has_Contiguous_Rep", Flag181 (Id));
6337 W ("Has_Controlled_Component", Flag43 (Id));
6338 W ("Has_Controlling_Result", Flag98 (Id));
6339 W ("Has_Convention_Pragma", Flag119 (Id));
6340 W ("Has_Delayed_Freeze", Flag18 (Id));
6341 W ("Has_Discriminants", Flag5 (Id));
6342 W ("Has_Enumeration_Rep_Clause", Flag66 (Id));
6343 W ("Has_Exit", Flag47 (Id));
6344 W ("Has_External_Tag_Rep_Clause", Flag110 (Id));
6345 W ("Has_Forward_Instantiation", Flag175 (Id));
6346 W ("Has_Fully_Qualified_Name", Flag173 (Id));
6347 W ("Has_Gigi_Rep_Item", Flag82 (Id));
6348 W ("Has_Homonym", Flag56 (Id));
6349 W ("Has_Machine_Radix_Clause", Flag83 (Id));
6350 W ("Has_Master_Entity", Flag21 (Id));
6351 W ("Has_Missing_Return", Flag142 (Id));
6352 W ("Has_Nested_Block_With_Handler", Flag101 (Id));
6353 W ("Has_Non_Standard_Rep", Flag75 (Id));
6354 W ("Has_Object_Size_Clause", Flag172 (Id));
6355 W ("Has_Per_Object_Constraint", Flag154 (Id));
6356 W ("Has_Pragma_Controlled", Flag27 (Id));
6357 W ("Has_Pragma_Elaborate_Body", Flag150 (Id));
6358 W ("Has_Pragma_Inline", Flag157 (Id));
6359 W ("Has_Pragma_Pack", Flag121 (Id));
6360 W ("Has_Pragma_Pure_Function", Flag179 (Id));
6361 W ("Has_Pragma_Unreferenced", Flag180 (Id));
6362 W ("Has_Primitive_Operations", Flag120 (Id));
6363 W ("Has_Private_Declaration", Flag155 (Id));
6364 W ("Has_Qualified_Name", Flag161 (Id));
6365 W ("Has_Record_Rep_Clause", Flag65 (Id));
6366 W ("Has_Recursive_Call", Flag143 (Id));
6367 W ("Has_Size_Clause", Flag29 (Id));
6368 W ("Has_Small_Clause", Flag67 (Id));
6369 W ("Has_Specified_Layout", Flag100 (Id));
6370 W ("Has_Storage_Size_Clause", Flag23 (Id));
6371 W ("Has_Stream_Size_Clause", Flag184 (Id));
6372 W ("Has_Subprogram_Descriptor", Flag93 (Id));
6373 W ("Has_Task", Flag30 (Id));
6374 W ("Has_Unchecked_Union", Flag123 (Id));
6375 W ("Has_Unknown_Discriminants", Flag72 (Id));
6376 W ("Has_Volatile_Components", Flag87 (Id));
6377 W ("Has_Xref_Entry", Flag182 (Id));
6378 W ("In_Package_Body", Flag48 (Id));
6379 W ("In_Private_Part", Flag45 (Id));
6380 W ("In_Use", Flag8 (Id));
6381 W ("Is_AST_Entry", Flag132 (Id));
6382 W ("Is_Abstract", Flag19 (Id));
6383 W ("Is_Access_Constant", Flag69 (Id));
6384 W ("Is_Ada_2005", Flag185 (Id));
6385 W ("Is_Aliased", Flag15 (Id));
6386 W ("Is_Asynchronous", Flag81 (Id));
6387 W ("Is_Atomic", Flag85 (Id));
6388 W ("Is_Bit_Packed_Array", Flag122 (Id));
6389 W ("Is_CPP_Class", Flag74 (Id));
6390 W ("Is_Called", Flag102 (Id));
6391 W ("Is_Character_Type", Flag63 (Id));
6392 W ("Is_Child_Unit", Flag73 (Id));
6393 W ("Is_Class_Wide_Equivalent_Type", Flag35 (Id));
6394 W ("Is_Compilation_Unit", Flag149 (Id));
6395 W ("Is_Completely_Hidden", Flag103 (Id));
6396 W ("Is_Concurrent_Record_Type", Flag20 (Id));
6397 W ("Is_Constr_Subt_For_UN_Aliased", Flag141 (Id));
6398 W ("Is_Constr_Subt_For_U_Nominal", Flag80 (Id));
6399 W ("Is_Constrained", Flag12 (Id));
6400 W ("Is_Constructor", Flag76 (Id));
6401 W ("Is_Controlled", Flag42 (Id));
6402 W ("Is_Controlling_Formal", Flag97 (Id));
6403 W ("Is_Discrim_SO_Function", Flag176 (Id));
6404 W ("Is_Dispatching_Operation", Flag6 (Id));
6405 W ("Is_Eliminated", Flag124 (Id));
6406 W ("Is_Entry_Formal", Flag52 (Id));
6407 W ("Is_Exported", Flag99 (Id));
6408 W ("Is_First_Subtype", Flag70 (Id));
6409 W ("Is_For_Access_Subtype", Flag118 (Id));
6410 W ("Is_Formal_Subprogram", Flag111 (Id));
6411 W ("Is_Frozen", Flag4 (Id));
6412 W ("Is_Generic_Actual_Type", Flag94 (Id));
6413 W ("Is_Generic_Instance", Flag130 (Id));
6414 W ("Is_Generic_Type", Flag13 (Id));
6415 W ("Is_Hidden", Flag57 (Id));
6416 W ("Is_Hidden_Open_Scope", Flag171 (Id));
6417 W ("Is_Immediately_Visible", Flag7 (Id));
6418 W ("Is_Imported", Flag24 (Id));
6419 W ("Is_Inlined", Flag11 (Id));
6420 W ("Is_Instantiated", Flag126 (Id));
6421 W ("Is_Interface", Flag186 (Id));
6422 W ("Is_Internal", Flag17 (Id));
6423 W ("Is_Interrupt_Handler", Flag89 (Id));
6424 W ("Is_Intrinsic_Subprogram", Flag64 (Id));
6425 W ("Is_Itype", Flag91 (Id));
6426 W ("Is_Known_Valid", Flag37 (Id));
6427 W ("Is_Known_Valid", Flag170 (Id));
6428 W ("Is_Limited_Composite", Flag106 (Id));
6429 W ("Is_Limited_Record", Flag25 (Id));
6430 W ("Is_Machine_Code_Subprogram", Flag137 (Id));
6431 W ("Is_Non_Static_Subtype", Flag109 (Id));
6432 W ("Is_Null_Init_Proc", Flag178 (Id));
6433 W ("Is_Obsolescent", Flag153 (Id));
6434 W ("Is_Optional_Parameter", Flag134 (Id));
6435 W ("Is_Overriding_Operation", Flag39 (Id));
6436 W ("Is_Package_Body_Entity", Flag160 (Id));
6437 W ("Is_Packed", Flag51 (Id));
6438 W ("Is_Packed_Array_Type", Flag138 (Id));
6439 W ("Is_Potentially_Use_Visible", Flag9 (Id));
6440 W ("Is_Preelaborated", Flag59 (Id));
6441 W ("Is_Private_Composite", Flag107 (Id));
6442 W ("Is_Private_Descendant", Flag53 (Id));
6443 W ("Is_Public", Flag10 (Id));
6444 W ("Is_Pure", Flag44 (Id));
6445 W ("Is_Remote_Call_Interface", Flag62 (Id));
6446 W ("Is_Remote_Types", Flag61 (Id));
6447 W ("Is_Renaming_Of_Object", Flag112 (Id));
6448 W ("Is_Shared_Passive", Flag60 (Id));
6449 W ("Is_Statically_Allocated", Flag28 (Id));
6450 W ("Is_Tag", Flag78 (Id));
6451 W ("Is_Tagged_Type", Flag55 (Id));
6452 W ("Is_Thread_Body", Flag77 (Id));
6453 W ("Is_True_Constant", Flag163 (Id));
6454 W ("Is_Unchecked_Union", Flag117 (Id));
6455 W ("Is_Unsigned_Type", Flag144 (Id));
6456 W ("Is_VMS_Exception", Flag133 (Id));
6457 W ("Is_Valued_Procedure", Flag127 (Id));
6458 W ("Is_Visible_Child_Unit", Flag116 (Id));
6459 W ("Is_Volatile", Flag16 (Id));
6460 W ("Kill_Elaboration_Checks", Flag32 (Id));
6461 W ("Kill_Range_Checks", Flag33 (Id));
6462 W ("Kill_Tag_Checks", Flag34 (Id));
6463 W ("Machine_Radix_10", Flag84 (Id));
6464 W ("Materialize_Entity", Flag168 (Id));
6465 W ("Must_Be_On_Byte_Boundary", Flag183 (Id));
6466 W ("Needs_Debug_Info", Flag147 (Id));
6467 W ("Needs_No_Actuals", Flag22 (Id));
6468 W ("Never_Set_In_Source", Flag115 (Id));
6469 W ("No_Pool_Assigned", Flag131 (Id));
6470 W ("No_Return", Flag113 (Id));
6471 W ("No_Strict_Aliasing", Flag136 (Id));
6472 W ("Non_Binary_Modulus", Flag58 (Id));
6473 W ("Nonzero_Is_True", Flag162 (Id));
6474 W ("Reachable", Flag49 (Id));
6475 W ("Referenced", Flag156 (Id));
6476 W ("Referenced_As_LHS", Flag36 (Id));
6477 W ("Return_Present", Flag54 (Id));
6478 W ("Returns_By_Ref", Flag90 (Id));
6479 W ("Reverse_Bit_Order", Flag164 (Id));
6480 W ("Sec_Stack_Needed_For_Return", Flag167 (Id));
6481 W ("Size_Depends_On_Discriminant", Flag177 (Id));
6482 W ("Size_Known_At_Compile_Time", Flag92 (Id));
6483 W ("Strict_Alignment", Flag145 (Id));
6484 W ("Suppress_Elaboration_Warnings", Flag148 (Id));
6485 W ("Suppress_Init_Proc", Flag105 (Id));
6486 W ("Suppress_Style_Checks", Flag165 (Id));
6487 W ("Treat_As_Volatile", Flag41 (Id));
6488 W ("Uses_Sec_Stack", Flag95 (Id));
6489 W ("Vax_Float", Flag151 (Id));
6490 W ("Warnings_Off", Flag96 (Id));
6491 end Write_Entity_Flags;
6493 -----------------------
6494 -- Write_Entity_Info --
6495 -----------------------
6497 procedure Write_Entity_Info (Id : Entity_Id; Prefix : String) is
6499 procedure Write_Attribute (Which : String; Nam : E);
6500 -- Write attribute value with given string name
6502 procedure Write_Kind (Id : Entity_Id);
6503 -- Write Ekind field of entity
6505 procedure Write_Attribute (Which : String; Nam : E) is
6509 Write_Int (Int (Nam));
6511 Write_Name (Chars (Nam));
6513 end Write_Attribute;
6515 procedure Write_Kind (Id : Entity_Id) is
6516 K : constant String := Entity_Kind'Image (Ekind (Id));
6520 Write_Str (" Kind ");
6522 if Is_Type (Id) and then Is_Tagged_Type (Id) then
6523 Write_Str ("TAGGED ");
6526 Write_Str (K (3 .. K'Length));
6529 if Is_Type (Id) and then Depends_On_Private (Id) then
6530 Write_Str ("Depends_On_Private ");
6534 -- Start of processing for Write_Entity_Info
6538 Write_Attribute ("Name ", Id);
6539 Write_Int (Int (Id));
6543 Write_Attribute (" Type ", Etype (Id));
6545 Write_Attribute (" Scope ", Scope (Id));
6550 when Discrete_Kind =>
6551 Write_Str ("Bounds: Id = ");
6553 if Present (Scalar_Range (Id)) then
6554 Write_Int (Int (Type_Low_Bound (Id)));
6555 Write_Str (" .. Id = ");
6556 Write_Int (Int (Type_High_Bound (Id)));
6558 Write_Str ("Empty");
6569 (" Component Type ", Component_Type (Id));
6572 Write_Str (" Indices ");
6574 Index := First_Index (Id);
6575 while Present (Index) loop
6576 Write_Attribute (" ", Etype (Index));
6577 Index := Next_Index (Index);
6585 (" Directly Designated Type ",
6586 Directly_Designated_Type (Id));
6589 when Overloadable_Kind =>
6590 if Present (Homonym (Id)) then
6591 Write_Str (" Homonym ");
6592 Write_Name (Chars (Homonym (Id)));
6594 Write_Int (Int (Homonym (Id)));
6601 if Ekind (Scope (Id)) in Record_Kind then
6603 " Original_Record_Component ",
6604 Original_Record_Component (Id));
6605 Write_Int (Int (Original_Record_Component (Id)));
6609 when others => null;
6611 end Write_Entity_Info;
6613 -----------------------
6614 -- Write_Field6_Name --
6615 -----------------------
6617 procedure Write_Field6_Name (Id : Entity_Id) is
6618 pragma Warnings (Off, Id);
6621 Write_Str ("First_Rep_Item");
6622 end Write_Field6_Name;
6624 -----------------------
6625 -- Write_Field7_Name --
6626 -----------------------
6628 procedure Write_Field7_Name (Id : Entity_Id) is
6629 pragma Warnings (Off, Id);
6632 Write_Str ("Freeze_Node");
6633 end Write_Field7_Name;
6635 -----------------------
6636 -- Write_Field8_Name --
6637 -----------------------
6639 procedure Write_Field8_Name (Id : Entity_Id) is
6644 Write_Str ("Normalized_First_Bit");
6648 E_Subprogram_Body =>
6649 Write_Str ("Mechanism");
6652 Write_Str ("Associated_Node_For_Itype");
6655 Write_Str ("Dependent_Instances");
6658 Write_Str ("Hiding_Loop_Variable");
6661 Write_Str ("Field8??");
6663 end Write_Field8_Name;
6665 -----------------------
6666 -- Write_Field9_Name --
6667 -----------------------
6669 procedure Write_Field9_Name (Id : Entity_Id) is
6673 Write_Str ("Class_Wide_Type");
6676 E_Generic_Function |
6678 E_Generic_Procedure |
6681 Write_Str ("Renaming_Map");
6684 Write_Str ("Current_Value");
6687 Write_Str ("Field9??");
6689 end Write_Field9_Name;
6691 ------------------------
6692 -- Write_Field10_Name --
6693 ------------------------
6695 procedure Write_Field10_Name (Id : Entity_Id) is
6699 Write_Str ("Referenced_Object");
6701 when E_In_Parameter |
6703 Write_Str ("Discriminal_Link");
6709 Write_Str ("Handler_Records");
6713 Write_Str ("Normalized_Position_Max");
6716 Write_Str ("Field10??");
6718 end Write_Field10_Name;
6720 ------------------------
6721 -- Write_Field11_Name --
6722 ------------------------
6724 procedure Write_Field11_Name (Id : Entity_Id) is
6728 Write_Str ("Entry_Component");
6732 Write_Str ("Component_Bit_Offset");
6735 Write_Str ("Full_View");
6737 when E_Enumeration_Literal =>
6738 Write_Str ("Enumeration_Pos");
6741 Write_Str ("Block_Node");
6747 Write_Str ("Protected_Body_Subprogram");
6749 when E_Generic_Package =>
6750 Write_Str ("Generic_Homonym");
6753 Write_Str ("Full_View");
6756 Write_Str ("Field11??");
6758 end Write_Field11_Name;
6760 ------------------------
6761 -- Write_Field12_Name --
6762 ------------------------
6764 procedure Write_Field12_Name (Id : Entity_Id) is
6768 Write_Str ("Barrier_Function");
6770 when E_Enumeration_Literal =>
6771 Write_Str ("Enumeration_Rep");
6778 E_In_Out_Parameter |
6782 Write_Str ("Esize");
6786 Write_Str ("Next_Inlined_Subprogram");
6789 Write_Str ("Associated_Formal_Package");
6792 Write_Str ("Field12??");
6794 end Write_Field12_Name;
6796 ------------------------
6797 -- Write_Field13_Name --
6798 ------------------------
6800 procedure Write_Field13_Name (Id : Entity_Id) is
6804 Write_Str ("RM_Size");
6808 Write_Str ("Component_Clause");
6810 when E_Enumeration_Literal =>
6811 Write_Str ("Debug_Renaming_Link");
6814 if not Comes_From_Source (Id)
6816 Chars (Id) = Name_Op_Ne
6818 Write_Str ("Corresponding_Equality");
6820 elsif Comes_From_Source (Id) then
6821 Write_Str ("Elaboration_Entity");
6824 Write_Str ("Field13??");
6829 Write_Str ("Extra_Accessibility");
6833 Generic_Unit_Kind =>
6834 Write_Str ("Elaboration_Entity");
6837 Write_Str ("Field13??");
6839 end Write_Field13_Name;
6841 -----------------------
6842 -- Write_Field14_Name --
6843 -----------------------
6845 procedure Write_Field14_Name (Id : Entity_Id) is
6853 Write_Str ("Alignment");
6857 Write_Str ("Normalized_Position");
6861 Write_Str ("First_Optional_Parameter");
6864 E_Generic_Package =>
6865 Write_Str ("Shadow_Entities");
6868 Write_Str ("Field14??");
6870 end Write_Field14_Name;
6872 ------------------------
6873 -- Write_Field15_Name --
6874 ------------------------
6876 procedure Write_Field15_Name (Id : Entity_Id) is
6881 Write_Str ("Storage_Size_Variable");
6883 when Class_Wide_Kind |
6887 Write_Str ("Primitive_Operations");
6890 Write_Str ("DT_Entry_Count");
6892 when Decimal_Fixed_Point_Kind =>
6893 Write_Str ("Scale_Value");
6895 when E_Discriminant =>
6896 Write_Str ("Discriminant_Number");
6899 Write_Str ("Extra_Formal");
6903 Write_Str ("DT_Position");
6906 Write_Str ("Entry_Parameters_Type");
6908 when Enumeration_Kind =>
6909 Write_Str ("Lit_Indexes");
6913 Write_Str ("Related_Instance");
6915 when E_Protected_Type =>
6916 Write_Str ("Entry_Bodies_Array");
6918 when E_String_Literal_Subtype =>
6919 Write_Str ("String_Literal_Low_Bound");
6922 Write_Str ("Shared_Var_Read_Proc");
6925 Write_Str ("Field15??");
6927 end Write_Field15_Name;
6929 ------------------------
6930 -- Write_Field16_Name --
6931 ------------------------
6933 procedure Write_Field16_Name (Id : Entity_Id) is
6937 Write_Str ("Entry_Formal");
6941 Write_Str ("DTC_Entity");
6946 Write_Str ("First_Private_Entity");
6948 when E_Record_Type |
6949 E_Record_Type_With_Private =>
6950 Write_Str ("Access_Disp_Table");
6952 when E_String_Literal_Subtype =>
6953 Write_Str ("String_Literal_Length");
6955 when Enumeration_Kind =>
6956 Write_Str ("Lit_Strings");
6960 Write_Str ("Unset_Reference");
6962 when E_Record_Subtype |
6963 E_Class_Wide_Subtype =>
6964 Write_Str ("Cloned_Subtype");
6967 Write_Str ("Field16??");
6969 end Write_Field16_Name;
6971 ------------------------
6972 -- Write_Field17_Name --
6973 ------------------------
6975 procedure Write_Field17_Name (Id : Entity_Id) is
6979 Write_Str ("Digits_Value");
6982 Write_Str ("Prival");
6984 when E_Discriminant =>
6985 Write_Str ("Discriminal");
6994 E_Generic_Function |
6996 E_Generic_Procedure |
7005 E_Subprogram_Type =>
7006 Write_Str ("First_Entity");
7009 Write_Str ("First_Index");
7011 when E_Protected_Body =>
7012 Write_Str ("Object_Ref");
7014 when Enumeration_Kind =>
7015 Write_Str ("First_Literal");
7018 Write_Str ("Master_Id");
7020 when Modular_Integer_Kind =>
7021 Write_Str ("Modulus");
7025 E_Generic_In_Out_Parameter |
7027 Write_Str ("Actual_Subtype");
7029 when E_Incomplete_Type =>
7030 Write_Str ("Non-limited view");
7033 Write_Str ("Field17??");
7035 end Write_Field17_Name;
7037 -----------------------
7038 -- Write_Field18_Name --
7039 -----------------------
7041 procedure Write_Field18_Name (Id : Entity_Id) is
7044 when E_Enumeration_Literal |
7048 Write_Str ("Alias");
7050 when E_Record_Type =>
7051 Write_Str ("Corresponding_Concurrent_Type");
7053 when E_Entry_Index_Parameter =>
7054 Write_Str ("Entry_Index_Constant");
7056 when E_Class_Wide_Subtype |
7057 E_Access_Protected_Subprogram_Type |
7058 E_Access_Subprogram_Type |
7060 Write_Str ("Equivalent_Type");
7062 when Fixed_Point_Kind =>
7063 Write_Str ("Delta_Value");
7067 Write_Str ("Renamed_Object");
7071 E_Generic_Function |
7072 E_Generic_Procedure |
7073 E_Generic_Package =>
7074 Write_Str ("Renamed_Entity");
7076 when Incomplete_Or_Private_Kind =>
7077 Write_Str ("Private_Dependents");
7079 when Concurrent_Kind =>
7080 Write_Str ("Corresponding_Record_Type");
7085 Write_Str ("Enclosing_Scope");
7088 Write_Str ("Field18??");
7090 end Write_Field18_Name;
7092 -----------------------
7093 -- Write_Field19_Name --
7094 -----------------------
7096 procedure Write_Field19_Name (Id : Entity_Id) is
7101 Write_Str ("Related_Array_Object");
7108 Write_Str ("Finalization_Chain_Entity");
7110 when E_Constant | E_Variable =>
7111 Write_Str ("Size_Check_Code");
7113 when E_Discriminant =>
7114 Write_Str ("Corresponding_Discriminant");
7117 E_Generic_Package =>
7118 Write_Str ("Body_Entity");
7120 when E_Package_Body |
7122 Write_Str ("Spec_Entity");
7124 when Private_Kind =>
7125 Write_Str ("Underlying_Full_View");
7127 when E_Record_Type =>
7128 Write_Str ("Parent_Subtype");
7131 Write_Str ("Field19??");
7133 end Write_Field19_Name;
7135 -----------------------
7136 -- Write_Field20_Name --
7137 -----------------------
7139 procedure Write_Field20_Name (Id : Entity_Id) is
7143 Write_Str ("Component_Type");
7145 when E_In_Parameter |
7146 E_Generic_In_Parameter =>
7147 Write_Str ("Default_Value");
7150 Write_Str ("Directly_Designated_Type");
7153 Write_Str ("Discriminant_Checking_Func");
7155 when E_Discriminant =>
7156 Write_Str ("Discriminant_Default_Value");
7165 E_Generic_Function |
7167 E_Generic_Procedure |
7176 E_Subprogram_Type =>
7178 Write_Str ("Last_Entity");
7181 Write_Str ("Scalar_Range");
7184 Write_Str ("Register_Exception_Call");
7187 Write_Str ("Field20??");
7189 end Write_Field20_Name;
7191 -----------------------
7192 -- Write_Field21_Name --
7193 -----------------------
7195 procedure Write_Field21_Name (Id : Entity_Id) is
7201 E_Generic_Function |
7203 E_Generic_Procedure |
7205 Write_Str ("Interface_Name");
7207 when Concurrent_Kind |
7208 Incomplete_Or_Private_Kind |
7212 Write_Str ("Discriminant_Constraint");
7215 Write_Str ("Accept_Address");
7217 when Fixed_Point_Kind =>
7218 Write_Str ("Small_Value");
7220 when E_In_Parameter =>
7221 Write_Str ("Default_Expr_Function");
7224 Modular_Integer_Kind =>
7225 Write_Str ("Original_Array_Type");
7227 when E_Access_Subprogram_Type |
7228 E_Access_Protected_Subprogram_Type =>
7229 Write_Str ("Original_Access_Type");
7232 Write_Str ("Field21??");
7234 end Write_Field21_Name;
7236 -----------------------
7237 -- Write_Field22_Name --
7238 -----------------------
7240 procedure Write_Field22_Name (Id : Entity_Id) is
7244 Write_Str ("Associated_Storage_Pool");
7247 Write_Str ("Component_Size");
7251 Write_Str ("Original_Record_Component");
7253 when E_Enumeration_Literal =>
7254 Write_Str ("Enumeration_Rep_Expr");
7257 Write_Str ("Exception_Code");
7260 Write_Str ("Protected_Formal");
7262 when E_Record_Type =>
7263 Write_Str ("Corresponding_Remote_Type");
7273 E_Generic_Function |
7274 E_Generic_Procedure |
7279 Write_Str ("Scope_Depth_Value");
7281 when E_Record_Type_With_Private |
7282 E_Record_Subtype_With_Private |
7285 E_Limited_Private_Type |
7286 E_Limited_Private_Subtype =>
7287 Write_Str ("Private_View");
7290 Write_Str ("Shared_Var_Assign_Proc");
7293 Write_Str ("Field22??");
7295 end Write_Field22_Name;
7297 ------------------------
7298 -- Write_Field23_Name --
7299 ------------------------
7301 procedure Write_Field23_Name (Id : Entity_Id) is
7305 Write_Str ("Associated_Final_Chain");
7308 Write_Str ("Packed_Array_Type");
7311 Write_Str ("Entry_Cancel_Parameter");
7314 Write_Str ("Protected_Operation");
7316 when E_Discriminant =>
7317 Write_Str ("CR_Discriminant");
7319 when E_Enumeration_Type =>
7320 Write_Str ("Enum_Pos_To_Rep");
7324 Write_Str ("Extra_Constrained");
7326 when E_Generic_Function |
7328 E_Generic_Procedure =>
7329 Write_Str ("Inner_Instances");
7331 when Concurrent_Kind |
7332 Incomplete_Or_Private_Kind |
7336 Write_Str ("Stored_Constraint");
7340 Write_Str ("Generic_Renamings");
7343 if Is_Generic_Instance (Id) then
7344 Write_Str ("Generic_Renamings");
7346 Write_Str ("Limited Views");
7349 -- What about Privals_Chain for protected operations ???
7352 Write_Str ("Privals_Chain");
7355 Write_Str ("Field23??");
7357 end Write_Field23_Name;
7359 ------------------------
7360 -- Write_Field24_Name --
7361 ------------------------
7363 procedure Write_Field24_Name (Id : Entity_Id) is
7366 when E_Record_Type |
7368 E_Record_Type_With_Private |
7369 E_Record_Subtype_With_Private =>
7370 Write_Str ("Abstract_Interfaces");
7372 when Subprogram_Kind =>
7373 Write_Str ("Obsolescent_Warning");
7376 Write_Str ("Task_Body_Procedure");
7379 Write_Str ("Field24??");
7381 end Write_Field24_Name;
7383 ------------------------
7384 -- Write_Field25_Name --
7385 ------------------------
7387 procedure Write_Field25_Name (Id : Entity_Id) is
7392 Write_Str ("Abstract_Interface_Alias");
7395 Write_Str ("Field25??");
7397 end Write_Field25_Name;
7399 ------------------------
7400 -- Write_Field26_Name --
7401 ------------------------
7403 procedure Write_Field26_Name (Id : Entity_Id) is
7407 Write_Str ("Field26??");
7409 end Write_Field26_Name;
7411 ------------------------
7412 -- Write_Field27_Name --
7413 ------------------------
7415 procedure Write_Field27_Name (Id : Entity_Id) is
7419 Write_Str ("Field27??");
7421 end Write_Field27_Name;
7423 -------------------------
7424 -- Iterator Procedures --
7425 -------------------------
7427 procedure Proc_Next_Component (N : in out Node_Id) is
7429 N := Next_Component (N);
7430 end Proc_Next_Component;
7432 procedure Proc_Next_Discriminant (N : in out Node_Id) is
7434 N := Next_Discriminant (N);
7435 end Proc_Next_Discriminant;
7437 procedure Proc_Next_Formal (N : in out Node_Id) is
7439 N := Next_Formal (N);
7440 end Proc_Next_Formal;
7442 procedure Proc_Next_Formal_With_Extras (N : in out Node_Id) is
7444 N := Next_Formal_With_Extras (N);
7445 end Proc_Next_Formal_With_Extras;
7447 procedure Proc_Next_Index (N : in out Node_Id) is
7449 N := Next_Index (N);
7450 end Proc_Next_Index;
7452 procedure Proc_Next_Inlined_Subprogram (N : in out Node_Id) is
7454 N := Next_Inlined_Subprogram (N);
7455 end Proc_Next_Inlined_Subprogram;
7457 procedure Proc_Next_Literal (N : in out Node_Id) is
7459 N := Next_Literal (N);
7460 end Proc_Next_Literal;
7462 procedure Proc_Next_Stored_Discriminant (N : in out Node_Id) is
7464 N := Next_Stored_Discriminant (N);
7465 end Proc_Next_Stored_Discriminant;