1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2014, 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 3, 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. --
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
19 -- additional permissions described in the GCC Runtime Library Exception, --
20 -- version 3.1, as published by the Free Software Foundation. --
22 -- You should have received a copy of the GNU General Public License and --
23 -- a copy of the GCC Runtime Library Exception along with this program; --
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
25 -- <http://www.gnu.org/licenses/>. --
27 -- GNAT was originally developed by the GNAT team at New York University. --
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
30 ------------------------------------------------------------------------------
32 pragma Style_Checks (All_Checks);
33 -- Turn off subprogram ordering, not used for this unit
35 with Atree; use Atree;
36 with Elists; use Elists;
37 with Namet; use Namet;
38 with Nlists; use Nlists;
39 with Output; use Output;
40 with Sinfo; use Sinfo;
41 with Stand; use Stand;
45 use Atree.Unchecked_Access;
46 -- This is one of the packages that is allowed direct untyped access to
47 -- the fields in a node, since it provides the next level abstraction
48 -- which incorporates appropriate checks.
50 ----------------------------------------------
51 -- Usage of Fields in Defining Entity Nodes --
52 ----------------------------------------------
54 -- Four of these fields are defined in Sinfo, since they in are the base
55 -- part of the node. The access routines for these four fields and the
56 -- corresponding set procedures are defined in Sinfo. These fields are
57 -- present in all entities. Note that Homonym is also in the base part of
58 -- the node, but has access routines that are more properly part of Einfo,
59 -- which is why they are defined here.
66 -- Remaining fields are present only in extended nodes (i.e. entities)
68 -- The following fields are present in all entities
71 -- First_Rep_Item Node6
74 -- The usage of other fields (and the entity kinds to which it applies)
75 -- depends on the particular field (see Einfo spec for details).
77 -- Associated_Node_For_Itype Node8
78 -- Dependent_Instances Elist8
79 -- Hiding_Loop_Variable Node8
80 -- Mechanism Uint8 (but returns Mechanism_Type)
81 -- Normalized_First_Bit Uint8
82 -- Postcondition_Proc Node8
83 -- Refinement_Constituents Elist8
84 -- Return_Applies_To Node8
85 -- First_Exit_Statement Node8
87 -- Class_Wide_Type Node9
88 -- Current_Value Node9
89 -- Part_Of_Constituents Elist9
92 -- Encapsulating_State Node10
93 -- Direct_Primitive_Operations Elist10
94 -- Discriminal_Link Node10
95 -- Float_Rep Uint10 (but returns Float_Rep_Kind)
96 -- Handler_Records List10
97 -- Normalized_Position_Max Uint10
99 -- Component_Bit_Offset Uint11
101 -- Entry_Component Node11
102 -- Enumeration_Pos Uint11
103 -- Generic_Homonym Node11
104 -- Protected_Body_Subprogram Node11
107 -- Barrier_Function Node12
108 -- Enumeration_Rep Uint12
110 -- Next_Inlined_Subprogram Node12
112 -- Component_Clause Node13
113 -- Elaboration_Entity Node13
114 -- Extra_Accessibility Node13
118 -- Normalized_Position Uint14
119 -- Shadow_Entities List14
121 -- Discriminant_Number Uint15
122 -- DT_Position Uint15
123 -- DT_Entry_Count Uint15
124 -- Entry_Bodies_Array Node15
125 -- Entry_Parameters_Type Node15
126 -- Extra_Formal Node15
127 -- Lit_Indexes Node15
128 -- Related_Instance Node15
129 -- Status_Flag_Or_Transient_Decl Node15
130 -- Scale_Value Uint15
131 -- Storage_Size_Variable Node15
132 -- String_Literal_Low_Bound Node15
134 -- Access_Disp_Table Elist16
135 -- Body_References Elist16
136 -- Cloned_Subtype Node16
138 -- Entry_Formal Node16
139 -- First_Private_Entity Node16
140 -- Lit_Strings Node16
141 -- String_Literal_Length Uint16
142 -- Unset_Reference Node16
144 -- Actual_Subtype Node17
145 -- Digits_Value Uint17
146 -- Discriminal Node17
147 -- First_Entity Node17
148 -- First_Index Node17
149 -- First_Literal Node17
152 -- Non_Limited_View Node17
156 -- Corresponding_Concurrent_Type Node18
157 -- Corresponding_Protected_Entry Node18
158 -- Corresponding_Record_Type Node18
159 -- Delta_Value Ureal18
160 -- Enclosing_Scope Node18
161 -- Equivalent_Type Node18
162 -- Private_Dependents Elist18
163 -- Renamed_Entity Node18
164 -- Renamed_Object Node18
166 -- Body_Entity Node19
167 -- Corresponding_Discriminant Node19
168 -- Default_Aspect_Component_Value Node19
169 -- Default_Aspect_Value Node19
170 -- Extra_Accessibility_Of_Result Node19
171 -- Parent_Subtype Node19
172 -- Size_Check_Code Node19
173 -- Spec_Entity Node19
174 -- Underlying_Full_View Node19
176 -- Component_Type Node20
177 -- Default_Value Node20
178 -- Directly_Designated_Type Node20
179 -- Discriminant_Checking_Func Node20
180 -- Discriminant_Default_Value Node20
181 -- Last_Entity Node20
182 -- Prival_Link Node20
183 -- Register_Exception_Call Node20
184 -- Scalar_Range Node20
186 -- Accept_Address Elist21
187 -- Default_Expr_Function Node21
188 -- Discriminant_Constraint Elist21
189 -- Interface_Name Node21
190 -- Original_Array_Type Node21
191 -- Small_Value Ureal21
193 -- Associated_Storage_Pool Node22
194 -- Component_Size Uint22
195 -- Corresponding_Remote_Type Node22
196 -- Enumeration_Rep_Expr Node22
197 -- Original_Record_Component Node22
198 -- Private_View Node22
199 -- Protected_Formal Node22
200 -- Scope_Depth_Value Uint22
201 -- Shared_Var_Procs_Instance Node22
203 -- CR_Discriminant Node23
204 -- Entry_Cancel_Parameter Node23
205 -- Enum_Pos_To_Rep Node23
206 -- Extra_Constrained Node23
207 -- Finalization_Master Node23
208 -- Generic_Renamings Elist23
209 -- Inner_Instances Elist23
210 -- Limited_View Node23
211 -- Packed_Array_Impl_Type Node23
212 -- Protection_Object Node23
213 -- Stored_Constraint Elist23
215 -- Related_Expression Node24
217 -- Interface_Alias Node25
218 -- Interfaces Elist25
219 -- Debug_Renaming_Link Node25
220 -- DT_Offset_To_Top_Func Node25
221 -- PPC_Wrapper Node25
222 -- Related_Array_Object Node25
223 -- Static_Discrete_Predicate List25
224 -- Static_Real_Or_String_Predicate Node25
225 -- Task_Body_Procedure Node25
227 -- Dispatch_Table_Wrappers Elist26
228 -- Last_Assignment Node26
229 -- Original_Access_Type Node26
230 -- Overridden_Operation Node26
231 -- Package_Instantiation Node26
232 -- Relative_Deadline_Variable Node26
234 -- Current_Use_Clause Node27
235 -- Related_Type Node27
236 -- Wrapped_Entity Node27
238 -- Extra_Formals Node28
240 -- Initialization_Statements Node28
241 -- Underlying_Record_View Node28
243 -- BIP_Initialization_Call Node29
244 -- Subprograms_For_Type Node29
246 -- Corresponding_Equality Node30
247 -- Last_Aggregate_Assignment Node30
248 -- Static_Initialization Node30
250 -- Derived_Type_Link Node31
251 -- Thunk_Entity Node31
253 -- SPARK_Pragma Node32
255 -- Linker_Section_Pragma Node33
256 -- SPARK_Aux_Pragma Node33
260 -- Import_Pragma Node35
262 ---------------------------------------------
263 -- Usage of Flags in Defining Entity Nodes --
264 ---------------------------------------------
266 -- All flags are unique, there is no overlaying, so each flag is physically
267 -- present in every entity. However, for many of the flags, it only makes
268 -- sense for them to be set true for certain subsets of entity kinds. See
269 -- the spec of Einfo for further details.
271 -- Is_Inlined_Always Flag1
272 -- Is_Hidden_Non_Overridden_Subpgm Flag2
274 -- Has_Discriminants Flag5
275 -- Is_Dispatching_Operation Flag6
276 -- Is_Immediately_Visible Flag7
278 -- Is_Potentially_Use_Visible Flag9
282 -- Is_Constrained Flag12
283 -- Is_Generic_Type Flag13
284 -- Depends_On_Private Flag14
286 -- Is_Volatile Flag16
287 -- Is_Internal Flag17
288 -- Has_Delayed_Freeze Flag18
289 -- Is_Abstract_Subprogram Flag19
290 -- Is_Concurrent_Record_Type Flag20
292 -- Has_Master_Entity Flag21
293 -- Needs_No_Actuals Flag22
294 -- Has_Storage_Size_Clause Flag23
295 -- Is_Imported Flag24
296 -- Is_Limited_Record Flag25
297 -- Has_Completion Flag26
298 -- Has_Pragma_Controlled Flag27
299 -- Is_Statically_Allocated Flag28
300 -- Has_Size_Clause Flag29
303 -- Checks_May_Be_Suppressed Flag31
304 -- Kill_Elaboration_Checks Flag32
305 -- Kill_Range_Checks Flag33
306 -- Has_Independent_Components Flag34
307 -- Is_Class_Wide_Equivalent_Type Flag35
308 -- Referenced_As_LHS Flag36
309 -- Is_Known_Non_Null Flag37
310 -- Can_Never_Be_Null Flag38
311 -- Has_Default_Aspect Flag39
312 -- Body_Needed_For_SAL Flag40
314 -- Treat_As_Volatile Flag41
315 -- Is_Controlled Flag42
316 -- Has_Controlled_Component Flag43
318 -- In_Private_Part Flag45
319 -- Has_Alignment_Clause Flag46
321 -- In_Package_Body Flag48
323 -- Delay_Subprogram_Descriptors Flag50
326 -- Is_Entry_Formal Flag52
327 -- Is_Private_Descendant Flag53
328 -- Return_Present Flag54
329 -- Is_Tagged_Type Flag55
330 -- Has_Homonym Flag56
332 -- Non_Binary_Modulus Flag58
333 -- Is_Preelaborated Flag59
334 -- Is_Shared_Passive Flag60
336 -- Is_Remote_Types Flag61
337 -- Is_Remote_Call_Interface Flag62
338 -- Is_Character_Type Flag63
339 -- Is_Intrinsic_Subprogram Flag64
340 -- Has_Record_Rep_Clause Flag65
341 -- Has_Enumeration_Rep_Clause Flag66
342 -- Has_Small_Clause Flag67
343 -- Has_Component_Size_Clause Flag68
344 -- Is_Access_Constant Flag69
345 -- Is_First_Subtype Flag70
347 -- Has_Completion_In_Body Flag71
348 -- Has_Unknown_Discriminants Flag72
349 -- Is_Child_Unit Flag73
350 -- Is_CPP_Class Flag74
351 -- Has_Non_Standard_Rep Flag75
352 -- Is_Constructor Flag76
353 -- Static_Elaboration_Desired Flag77
355 -- Has_All_Calls_Remote Flag79
356 -- Is_Constr_Subt_For_U_Nominal Flag80
358 -- Is_Asynchronous Flag81
359 -- Has_Gigi_Rep_Item Flag82
360 -- Has_Machine_Radix_Clause Flag83
361 -- Machine_Radix_10 Flag84
363 -- Has_Atomic_Components Flag86
364 -- Has_Volatile_Components Flag87
365 -- Discard_Names Flag88
366 -- Is_Interrupt_Handler Flag89
367 -- Returns_By_Ref Flag90
370 -- Size_Known_At_Compile_Time Flag92
371 -- Reverse_Storage_Order Flag93
372 -- Is_Generic_Actual_Type Flag94
373 -- Uses_Sec_Stack Flag95
374 -- Warnings_Off Flag96
375 -- Is_Controlling_Formal Flag97
376 -- Has_Controlling_Result Flag98
377 -- Is_Exported Flag99
378 -- Has_Specified_Layout Flag100
380 -- Has_Nested_Block_With_Handler Flag101
382 -- Is_Completely_Hidden Flag103
383 -- Address_Taken Flag104
384 -- Suppress_Initialization Flag105
385 -- Is_Limited_Composite Flag106
386 -- Is_Private_Composite Flag107
387 -- Default_Expressions_Processed Flag108
388 -- Is_Non_Static_Subtype Flag109
389 -- Has_Out_Or_In_Out_Parameter Flag110
391 -- Is_Formal_Subprogram Flag111
392 -- Is_Renaming_Of_Object Flag112
394 -- Delay_Cleanups Flag114
395 -- Never_Set_In_Source Flag115
396 -- Is_Visible_Lib_Unit Flag116
397 -- Is_Unchecked_Union Flag117
398 -- Is_For_Access_Subtype Flag118
399 -- Has_Convention_Pragma Flag119
400 -- Has_Primitive_Operations Flag120
402 -- Has_Pragma_Pack Flag121
403 -- Is_Bit_Packed_Array Flag122
404 -- Has_Unchecked_Union Flag123
405 -- Is_Eliminated Flag124
406 -- C_Pass_By_Copy Flag125
407 -- Is_Instantiated Flag126
408 -- Is_Valued_Procedure Flag127
409 -- (used for Component_Alignment) Flag128
410 -- (used for Component_Alignment) Flag129
411 -- Is_Generic_Instance Flag130
413 -- No_Pool_Assigned Flag131
414 -- Has_Aliased_Components Flag135
415 -- No_Strict_Aliasing Flag136
416 -- Is_Machine_Code_Subprogram Flag137
417 -- Is_Packed_Array_Impl_Type Flag138
418 -- Has_Biased_Representation Flag139
419 -- Has_Complex_Representation Flag140
421 -- Is_Constr_Subt_For_UN_Aliased Flag141
422 -- Has_Missing_Return Flag142
423 -- Has_Recursive_Call Flag143
424 -- Is_Unsigned_Type Flag144
425 -- Strict_Alignment Flag145
426 -- Is_Abstract_Type Flag146
427 -- Needs_Debug_Info Flag147
428 -- Suppress_Elaboration_Warnings Flag148
429 -- Is_Compilation_Unit Flag149
430 -- Has_Pragma_Elaborate_Body Flag150
432 -- Has_Private_Ancestor Flag151
433 -- Entry_Accepted Flag152
434 -- Is_Obsolescent Flag153
435 -- Has_Per_Object_Constraint Flag154
436 -- Has_Private_Declaration Flag155
437 -- Referenced Flag156
438 -- Has_Pragma_Inline Flag157
439 -- Finalize_Storage_Only Flag158
440 -- From_Limited_With Flag159
441 -- Is_Package_Body_Entity Flag160
443 -- Has_Qualified_Name Flag161
444 -- Nonzero_Is_True Flag162
445 -- Is_True_Constant Flag163
446 -- Reverse_Bit_Order Flag164
447 -- Suppress_Style_Checks Flag165
448 -- Debug_Info_Off Flag166
449 -- Sec_Stack_Needed_For_Return Flag167
450 -- Materialize_Entity Flag168
451 -- Has_Pragma_Thread_Local_Storage Flag169
452 -- Is_Known_Valid Flag170
454 -- Is_Hidden_Open_Scope Flag171
455 -- Has_Object_Size_Clause Flag172
456 -- Has_Fully_Qualified_Name Flag173
457 -- Elaboration_Entity_Required Flag174
458 -- Has_Forward_Instantiation Flag175
459 -- Is_Discrim_SO_Function Flag176
460 -- Size_Depends_On_Discriminant Flag177
461 -- Is_Null_Init_Proc Flag178
462 -- Has_Pragma_Pure_Function Flag179
463 -- Has_Pragma_Unreferenced Flag180
465 -- Has_Contiguous_Rep Flag181
466 -- Has_Xref_Entry Flag182
467 -- Must_Be_On_Byte_Boundary Flag183
468 -- Has_Stream_Size_Clause Flag184
469 -- Is_Ada_2005_Only Flag185
470 -- Is_Interface Flag186
471 -- Has_Constrained_Partial_View Flag187
472 -- Uses_Lock_Free Flag188
473 -- Is_Pure_Unit_Access_Type Flag189
474 -- Has_Specified_Stream_Input Flag190
476 -- Has_Specified_Stream_Output Flag191
477 -- Has_Specified_Stream_Read Flag192
478 -- Has_Specified_Stream_Write Flag193
479 -- Is_Local_Anonymous_Access Flag194
480 -- Is_Primitive_Wrapper Flag195
481 -- Was_Hidden Flag196
482 -- Is_Limited_Interface Flag197
483 -- Has_Pragma_Ordered Flag198
484 -- Is_Ada_2012_Only Flag199
486 -- Has_Delayed_Aspects Flag200
487 -- Has_Pragma_No_Inline Flag201
488 -- Itype_Printed Flag202
489 -- Has_Pragma_Pure Flag203
490 -- Is_Known_Null Flag204
491 -- Low_Bound_Tested Flag205
492 -- Is_Visible_Formal Flag206
493 -- Known_To_Have_Preelab_Init Flag207
494 -- Must_Have_Preelab_Init Flag208
495 -- Is_Return_Object Flag209
496 -- Elaborate_Body_Desirable Flag210
498 -- Has_Static_Discriminants Flag211
499 -- Has_Pragma_Unreferenced_Objects Flag212
500 -- Requires_Overriding Flag213
502 -- Has_Up_Level_Access Flag215
503 -- Universal_Aliasing Flag216
504 -- Suppress_Value_Tracking_On_Call Flag217
505 -- Is_Primitive Flag218
506 -- Has_Initial_Value Flag219
507 -- Has_Dispatch_Table Flag220
509 -- Has_Pragma_Preelab_Init Flag221
510 -- Used_As_Generic_Actual Flag222
511 -- Is_Descendent_Of_Address Flag223
514 -- Is_Only_Out_Parameter Flag226
515 -- Referenced_As_Out_Parameter Flag227
516 -- Has_Thunks Flag228
517 -- Can_Use_Internal_Rep Flag229
518 -- Has_Pragma_Inline_Always Flag230
520 -- Renamed_In_Spec Flag231
521 -- Has_Invariants Flag232
522 -- Has_Pragma_Unmodified Flag233
523 -- Is_Dispatch_Table_Entity Flag234
524 -- Is_Trivial_Subprogram Flag235
525 -- Warnings_Off_Used Flag236
526 -- Warnings_Off_Used_Unmodified Flag237
527 -- Warnings_Off_Used_Unreferenced Flag238
528 -- OK_To_Reorder_Components Flag239
529 -- Has_Postconditions Flag240
531 -- Optimize_Alignment_Space Flag241
532 -- Optimize_Alignment_Time Flag242
533 -- Overlays_Constant Flag243
534 -- Is_RACW_Stub_Type Flag244
535 -- Is_Private_Primitive Flag245
536 -- Is_Underlying_Record_View Flag246
537 -- OK_To_Rename Flag247
538 -- Has_Inheritable_Invariants Flag248
539 -- Is_Safe_To_Reevaluate Flag249
540 -- Has_Predicates Flag250
542 -- Has_Implicit_Dereference Flag251
543 -- Is_Processed_Transient Flag252
544 -- Has_Anonymous_Master Flag253
545 -- Is_Implementation_Defined Flag254
546 -- Is_Predicate_Function Flag255
547 -- Is_Predicate_Function_M Flag256
548 -- Is_Invariant_Procedure Flag257
549 -- Has_Dynamic_Predicate_Aspect Flag258
550 -- Has_Static_Predicate_Aspect Flag259
551 -- Has_Loop_Entry_Attributes Flag260
553 -- Has_Delayed_Rep_Aspects Flag261
554 -- May_Inherit_Delayed_Rep_Aspects Flag262
555 -- Has_Visible_Refinement Flag263
556 -- Is_Discriminant_Check_Function Flag264
557 -- SPARK_Pragma_Inherited Flag265
558 -- SPARK_Aux_Pragma_Inherited Flag266
559 -- Has_Shift_Operator Flag267
560 -- Is_Independent Flag268
561 -- Has_Static_Predicate Flag269
562 -- Stores_Attribute_Old_Prefix Flag270
564 -- (Has_Protected) Flag271
565 -- (SSO_Set_Low_By_Default) Flag272
566 -- (SSO_Set_Low_By_Default) Flag273
568 -- Is_Generic_Actual_Subprogram Flag274
569 -- No_Predicate_On_Actual Flag275
570 -- No_Dynamic_Predicate_On_Actual Flag276
592 -- Note: Flag287-317 are defined in atree.ads/adb, but not yet in atree.h
594 -----------------------
595 -- Local subprograms --
596 -----------------------
599 (State_Id : Entity_Id;
600 Option_Nam : Name_Id) return Boolean;
601 -- Determine whether abstract state State_Id has particular option denoted
602 -- by the name Option_Nam.
608 function Float_Rep (Id : E) return F is
609 pragma Assert (Is_Floating_Point_Type (Id));
611 return F'Val (UI_To_Int (Uint10 (Base_Type (Id))));
619 (State_Id : Entity_Id;
620 Option_Nam : Name_Id) return Boolean
622 Decl : constant Node_Id := Parent (State_Id);
627 pragma Assert (Ekind (State_Id) = E_Abstract_State);
629 -- The declaration of abstract states with options appear as an
630 -- extension aggregate. If this is not the case, the option is not
633 if Nkind (Decl) /= N_Extension_Aggregate then
639 Opt := First (Expressions (Decl));
640 while Present (Opt) loop
642 -- Currently the only simple option allowed is External
644 if Nkind (Opt) = N_Identifier
645 and then Chars (Opt) = Name_External
646 and then Chars (Opt) = Option_Nam
654 -- Complex options with various specifiers
656 Opt := First (Component_Associations (Decl));
657 while Present (Opt) loop
658 Opt_Nam := First (Choices (Opt));
660 if Nkind (Opt_Nam) = N_Identifier
661 and then Chars (Opt_Nam) = Option_Nam
672 --------------------------------
673 -- Attribute Access Functions --
674 --------------------------------
676 function Abstract_States (Id : E) return L is
678 pragma Assert (Ekind_In (Id, E_Generic_Package, E_Package));
682 function Accept_Address (Id : E) return L is
687 function Access_Disp_Table (Id : E) return L is
689 pragma Assert (Ekind_In (Id, E_Record_Type,
691 return Elist16 (Implementation_Base_Type (Id));
692 end Access_Disp_Table;
694 function Actual_Subtype (Id : E) return E is
697 (Ekind_In (Id, E_Constant, E_Variable, E_Generic_In_Out_Parameter)
698 or else Is_Formal (Id));
702 function Address_Taken (Id : E) return B is
707 function Alias (Id : E) return E is
710 (Is_Overloadable (Id) or else Ekind (Id) = E_Subprogram_Type);
714 function Alignment (Id : E) return U is
716 pragma Assert (Is_Type (Id)
717 or else Is_Formal (Id)
718 or else Ekind_In (Id, E_Loop_Parameter,
725 function Associated_Formal_Package (Id : E) return E is
727 pragma Assert (Ekind (Id) = E_Package);
729 end Associated_Formal_Package;
731 function Associated_Node_For_Itype (Id : E) return N is
734 end Associated_Node_For_Itype;
736 function Associated_Storage_Pool (Id : E) return E is
738 pragma Assert (Is_Access_Type (Id));
739 return Node22 (Root_Type (Id));
740 end Associated_Storage_Pool;
742 function Barrier_Function (Id : E) return N is
744 pragma Assert (Is_Entry (Id));
746 end Barrier_Function;
748 function Block_Node (Id : E) return N is
750 pragma Assert (Ekind (Id) = E_Block);
754 function Body_Entity (Id : E) return E is
756 pragma Assert (Ekind_In (Id, E_Package, E_Generic_Package));
760 function Body_Needed_For_SAL (Id : E) return B is
763 (Ekind (Id) = E_Package
764 or else Is_Subprogram (Id)
765 or else Is_Generic_Unit (Id));
767 end Body_Needed_For_SAL;
769 function Body_References (Id : E) return L is
771 pragma Assert (Ekind (Id) = E_Abstract_State);
775 function BIP_Initialization_Call (Id : E) return N is
777 pragma Assert (Ekind_In (Id, E_Constant, E_Variable));
779 end BIP_Initialization_Call;
781 function C_Pass_By_Copy (Id : E) return B is
783 pragma Assert (Is_Record_Type (Id));
784 return Flag125 (Implementation_Base_Type (Id));
787 function Can_Never_Be_Null (Id : E) return B is
790 end Can_Never_Be_Null;
792 function Checks_May_Be_Suppressed (Id : E) return B is
795 end Checks_May_Be_Suppressed;
797 function Class_Wide_Type (Id : E) return E is
799 pragma Assert (Is_Type (Id));
803 function Cloned_Subtype (Id : E) return E is
805 pragma Assert (Ekind_In (Id, E_Record_Subtype, E_Class_Wide_Subtype));
809 function Component_Bit_Offset (Id : E) return U is
811 pragma Assert (Ekind_In (Id, E_Component, E_Discriminant));
813 end Component_Bit_Offset;
815 function Component_Clause (Id : E) return N is
817 pragma Assert (Ekind_In (Id, E_Component, E_Discriminant));
819 end Component_Clause;
821 function Component_Size (Id : E) return U is
823 pragma Assert (Is_Array_Type (Id));
824 return Uint22 (Implementation_Base_Type (Id));
827 function Component_Type (Id : E) return E is
829 pragma Assert (Is_Array_Type (Id) or else Is_String_Type (Id));
830 return Node20 (Implementation_Base_Type (Id));
833 function Corresponding_Concurrent_Type (Id : E) return E is
835 pragma Assert (Ekind (Id) = E_Record_Type);
837 end Corresponding_Concurrent_Type;
839 function Corresponding_Discriminant (Id : E) return E is
841 pragma Assert (Ekind (Id) = E_Discriminant);
843 end Corresponding_Discriminant;
845 function Corresponding_Equality (Id : E) return E is
848 (Ekind (Id) = E_Function
849 and then not Comes_From_Source (Id)
850 and then Chars (Id) = Name_Op_Ne);
852 end Corresponding_Equality;
854 function Corresponding_Protected_Entry (Id : E) return E is
856 pragma Assert (Ekind (Id) = E_Subprogram_Body);
858 end Corresponding_Protected_Entry;
860 function Corresponding_Record_Type (Id : E) return E is
862 pragma Assert (Is_Concurrent_Type (Id));
864 end Corresponding_Record_Type;
866 function Corresponding_Remote_Type (Id : E) return E is
869 end Corresponding_Remote_Type;
871 function Current_Use_Clause (Id : E) return E is
873 pragma Assert (Ekind (Id) = E_Package or else Is_Type (Id));
875 end Current_Use_Clause;
877 function Current_Value (Id : E) return N is
879 pragma Assert (Ekind (Id) in Object_Kind);
883 function CR_Discriminant (Id : E) return E is
888 function Debug_Info_Off (Id : E) return B is
893 function Debug_Renaming_Link (Id : E) return E is
896 end Debug_Renaming_Link;
898 function Default_Aspect_Component_Value (Id : E) return N is
900 pragma Assert (Is_Array_Type (Id));
901 return Node19 (Base_Type (Id));
902 end Default_Aspect_Component_Value;
904 function Default_Aspect_Value (Id : E) return N is
906 pragma Assert (Is_Scalar_Type (Id));
907 return Node19 (Base_Type (Id));
908 end Default_Aspect_Value;
910 function Default_Expr_Function (Id : E) return E is
912 pragma Assert (Is_Formal (Id));
914 end Default_Expr_Function;
916 function Default_Expressions_Processed (Id : E) return B is
919 end Default_Expressions_Processed;
921 function Default_Value (Id : E) return N is
923 pragma Assert (Is_Formal (Id));
927 function Delay_Cleanups (Id : E) return B is
932 function Delay_Subprogram_Descriptors (Id : E) return B is
935 end Delay_Subprogram_Descriptors;
937 function Delta_Value (Id : E) return R is
939 pragma Assert (Is_Fixed_Point_Type (Id));
943 function Dependent_Instances (Id : E) return L is
945 pragma Assert (Is_Generic_Instance (Id));
947 end Dependent_Instances;
949 function Depends_On_Private (Id : E) return B is
951 pragma Assert (Nkind (Id) in N_Entity);
953 end Depends_On_Private;
955 function Derived_Type_Link (Id : E) return E is
957 pragma Assert (Is_Type (Id));
958 return Node31 (Base_Type (Id));
959 end Derived_Type_Link;
961 function Digits_Value (Id : E) return U is
964 (Is_Floating_Point_Type (Id)
965 or else Is_Decimal_Fixed_Point_Type (Id));
969 function Direct_Primitive_Operations (Id : E) return L is
971 pragma Assert (Is_Tagged_Type (Id));
973 end Direct_Primitive_Operations;
975 function Directly_Designated_Type (Id : E) return E is
977 pragma Assert (Is_Access_Type (Id));
979 end Directly_Designated_Type;
981 function Discard_Names (Id : E) return B is
986 function Discriminal (Id : E) return E is
988 pragma Assert (Ekind (Id) = E_Discriminant);
992 function Discriminal_Link (Id : E) return N is
995 end Discriminal_Link;
997 function Discriminant_Checking_Func (Id : E) return E is
999 pragma Assert (Ekind (Id) = E_Component);
1001 end Discriminant_Checking_Func;
1003 function Discriminant_Constraint (Id : E) return L is
1005 pragma Assert (Is_Composite_Type (Id) and then Has_Discriminants (Id));
1006 return Elist21 (Id);
1007 end Discriminant_Constraint;
1009 function Discriminant_Default_Value (Id : E) return N is
1011 pragma Assert (Ekind (Id) = E_Discriminant);
1013 end Discriminant_Default_Value;
1015 function Discriminant_Number (Id : E) return U is
1017 pragma Assert (Ekind (Id) = E_Discriminant);
1019 end Discriminant_Number;
1021 function Dispatch_Table_Wrappers (Id : E) return L is
1023 pragma Assert (Ekind_In (Id, E_Record_Type,
1025 return Elist26 (Implementation_Base_Type (Id));
1026 end Dispatch_Table_Wrappers;
1028 function DT_Entry_Count (Id : E) return U is
1030 pragma Assert (Ekind (Id) = E_Component and then Is_Tag (Id));
1034 function DT_Offset_To_Top_Func (Id : E) return E is
1036 pragma Assert (Ekind (Id) = E_Component and then Is_Tag (Id));
1038 end DT_Offset_To_Top_Func;
1040 function DT_Position (Id : E) return U is
1042 pragma Assert (Ekind_In (Id, E_Function, E_Procedure)
1043 and then Present (DTC_Entity (Id)));
1047 function DTC_Entity (Id : E) return E is
1049 pragma Assert (Ekind_In (Id, E_Function, E_Procedure));
1053 function Elaborate_Body_Desirable (Id : E) return B is
1055 pragma Assert (Ekind (Id) = E_Package);
1056 return Flag210 (Id);
1057 end Elaborate_Body_Desirable;
1059 function Elaboration_Entity (Id : E) return E is
1064 Ekind (Id) = E_Package
1066 Is_Generic_Unit (Id));
1068 end Elaboration_Entity;
1070 function Elaboration_Entity_Required (Id : E) return B is
1075 Ekind (Id) = E_Package
1077 Is_Generic_Unit (Id));
1078 return Flag174 (Id);
1079 end Elaboration_Entity_Required;
1081 function Encapsulating_State (Id : E) return N is
1083 pragma Assert (Ekind_In (Id, E_Abstract_State, E_Variable));
1085 end Encapsulating_State;
1087 function Enclosing_Scope (Id : E) return E is
1090 end Enclosing_Scope;
1092 function Entry_Accepted (Id : E) return B is
1094 pragma Assert (Is_Entry (Id));
1095 return Flag152 (Id);
1098 function Entry_Bodies_Array (Id : E) return E is
1101 end Entry_Bodies_Array;
1103 function Entry_Cancel_Parameter (Id : E) return E is
1106 end Entry_Cancel_Parameter;
1108 function Entry_Component (Id : E) return E is
1111 end Entry_Component;
1113 function Entry_Formal (Id : E) return E is
1118 function Entry_Index_Constant (Id : E) return N is
1120 pragma Assert (Ekind (Id) = E_Entry_Index_Parameter);
1122 end Entry_Index_Constant;
1124 function Contract (Id : E) return N is
1127 (Ekind_In (Id, E_Entry,
1134 or else Is_Generic_Subprogram (Id)
1135 or else Is_Subprogram (Id));
1139 function Entry_Parameters_Type (Id : E) return E is
1142 end Entry_Parameters_Type;
1144 function Enum_Pos_To_Rep (Id : E) return E is
1146 pragma Assert (Ekind (Id) = E_Enumeration_Type);
1148 end Enum_Pos_To_Rep;
1150 function Enumeration_Pos (Id : E) return Uint is
1152 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
1154 end Enumeration_Pos;
1156 function Enumeration_Rep (Id : E) return U is
1158 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
1160 end Enumeration_Rep;
1162 function Enumeration_Rep_Expr (Id : E) return N is
1164 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
1166 end Enumeration_Rep_Expr;
1168 function Equivalent_Type (Id : E) return E is
1171 (Ekind_In (Id, E_Class_Wide_Type,
1172 E_Class_Wide_Subtype,
1173 E_Access_Subprogram_Type,
1174 E_Access_Protected_Subprogram_Type,
1175 E_Anonymous_Access_Protected_Subprogram_Type,
1176 E_Access_Subprogram_Type,
1179 end Equivalent_Type;
1181 function Esize (Id : E) return Uint is
1186 function Extra_Accessibility (Id : E) return E is
1189 (Is_Formal (Id) or else Ekind_In (Id, E_Variable, E_Constant));
1191 end Extra_Accessibility;
1193 function Extra_Accessibility_Of_Result (Id : E) return E is
1195 pragma Assert (Ekind_In (Id, E_Function, E_Operator, E_Subprogram_Type));
1197 end Extra_Accessibility_Of_Result;
1199 function Extra_Constrained (Id : E) return E is
1201 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
1203 end Extra_Constrained;
1205 function Extra_Formal (Id : E) return E is
1210 function Extra_Formals (Id : E) return E is
1213 (Is_Overloadable (Id)
1214 or else Ekind_In (Id, E_Entry_Family,
1216 E_Subprogram_Type));
1220 function Can_Use_Internal_Rep (Id : E) return B is
1222 pragma Assert (Is_Access_Subprogram_Type (Base_Type (Id)));
1223 return Flag229 (Base_Type (Id));
1224 end Can_Use_Internal_Rep;
1226 function Finalization_Master (Id : E) return E is
1228 pragma Assert (Is_Access_Type (Id));
1229 return Node23 (Root_Type (Id));
1230 end Finalization_Master;
1232 function Finalize_Storage_Only (Id : E) return B is
1234 pragma Assert (Is_Type (Id));
1235 return Flag158 (Base_Type (Id));
1236 end Finalize_Storage_Only;
1238 function Finalizer (Id : E) return E is
1240 pragma Assert (Ekind_In (Id, E_Package, E_Package_Body));
1244 function First_Entity (Id : E) return E is
1249 function First_Exit_Statement (Id : E) return N is
1251 pragma Assert (Ekind (Id) = E_Loop);
1253 end First_Exit_Statement;
1255 function First_Index (Id : E) return N is
1257 pragma Assert (Is_Array_Type (Id) or else Is_String_Type (Id));
1261 function First_Literal (Id : E) return E is
1263 pragma Assert (Is_Enumeration_Type (Id));
1267 function First_Private_Entity (Id : E) return E is
1269 pragma Assert (Ekind_In (Id, E_Package, E_Generic_Package)
1270 or else Ekind (Id) in Concurrent_Kind);
1272 end First_Private_Entity;
1274 function First_Rep_Item (Id : E) return E is
1279 function Freeze_Node (Id : E) return N is
1284 function From_Limited_With (Id : E) return B is
1286 return Flag159 (Id);
1287 end From_Limited_With;
1289 function Full_View (Id : E) return E is
1291 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Constant);
1295 function Generic_Homonym (Id : E) return E is
1297 pragma Assert (Ekind (Id) = E_Generic_Package);
1299 end Generic_Homonym;
1301 function Generic_Renamings (Id : E) return L is
1303 return Elist23 (Id);
1304 end Generic_Renamings;
1306 function Handler_Records (Id : E) return S is
1309 end Handler_Records;
1311 function Has_Aliased_Components (Id : E) return B is
1313 return Flag135 (Implementation_Base_Type (Id));
1314 end Has_Aliased_Components;
1316 function Has_Alignment_Clause (Id : E) return B is
1319 end Has_Alignment_Clause;
1321 function Has_All_Calls_Remote (Id : E) return B is
1324 end Has_All_Calls_Remote;
1326 function Has_Anonymous_Master (Id : E) return B is
1329 (Ekind_In (Id, E_Function, E_Package, E_Package_Body, E_Procedure));
1330 return Flag253 (Id);
1331 end Has_Anonymous_Master;
1333 function Has_Atomic_Components (Id : E) return B is
1335 return Flag86 (Implementation_Base_Type (Id));
1336 end Has_Atomic_Components;
1338 function Has_Biased_Representation (Id : E) return B is
1340 return Flag139 (Id);
1341 end Has_Biased_Representation;
1343 function Has_Completion (Id : E) return B is
1348 function Has_Completion_In_Body (Id : E) return B is
1350 pragma Assert (Is_Type (Id));
1352 end Has_Completion_In_Body;
1354 function Has_Complex_Representation (Id : E) return B is
1356 pragma Assert (Is_Type (Id));
1357 return Flag140 (Implementation_Base_Type (Id));
1358 end Has_Complex_Representation;
1360 function Has_Component_Size_Clause (Id : E) return B is
1362 pragma Assert (Is_Array_Type (Id));
1363 return Flag68 (Implementation_Base_Type (Id));
1364 end Has_Component_Size_Clause;
1366 function Has_Constrained_Partial_View (Id : E) return B is
1368 pragma Assert (Is_Type (Id));
1369 return Flag187 (Id);
1370 end Has_Constrained_Partial_View;
1372 function Has_Controlled_Component (Id : E) return B is
1374 return Flag43 (Base_Type (Id));
1375 end Has_Controlled_Component;
1377 function Has_Contiguous_Rep (Id : E) return B is
1379 return Flag181 (Id);
1380 end Has_Contiguous_Rep;
1382 function Has_Controlling_Result (Id : E) return B is
1385 end Has_Controlling_Result;
1387 function Has_Convention_Pragma (Id : E) return B is
1389 return Flag119 (Id);
1390 end Has_Convention_Pragma;
1392 function Has_Default_Aspect (Id : E) return B is
1394 return Flag39 (Base_Type (Id));
1395 end Has_Default_Aspect;
1397 function Has_Delayed_Aspects (Id : E) return B is
1399 pragma Assert (Nkind (Id) in N_Entity);
1400 return Flag200 (Id);
1401 end Has_Delayed_Aspects;
1403 function Has_Delayed_Freeze (Id : E) return B is
1405 pragma Assert (Nkind (Id) in N_Entity);
1407 end Has_Delayed_Freeze;
1409 function Has_Delayed_Rep_Aspects (Id : E) return B is
1411 pragma Assert (Nkind (Id) in N_Entity);
1412 return Flag261 (Id);
1413 end Has_Delayed_Rep_Aspects;
1415 function Has_Discriminants (Id : E) return B is
1417 pragma Assert (Nkind (Id) in N_Entity);
1419 end Has_Discriminants;
1421 function Has_Dispatch_Table (Id : E) return B is
1423 pragma Assert (Is_Tagged_Type (Id));
1424 return Flag220 (Id);
1425 end Has_Dispatch_Table;
1427 function Has_Dynamic_Predicate_Aspect (Id : E) return B is
1429 pragma Assert (Is_Type (Id));
1430 return Flag258 (Id);
1431 end Has_Dynamic_Predicate_Aspect;
1433 function Has_Enumeration_Rep_Clause (Id : E) return B is
1435 pragma Assert (Is_Enumeration_Type (Id));
1437 end Has_Enumeration_Rep_Clause;
1439 function Has_Exit (Id : E) return B is
1444 function Has_Forward_Instantiation (Id : E) return B is
1446 return Flag175 (Id);
1447 end Has_Forward_Instantiation;
1449 function Has_Fully_Qualified_Name (Id : E) return B is
1451 return Flag173 (Id);
1452 end Has_Fully_Qualified_Name;
1454 function Has_Gigi_Rep_Item (Id : E) return B is
1457 end Has_Gigi_Rep_Item;
1459 function Has_Homonym (Id : E) return B is
1464 function Has_Implicit_Dereference (Id : E) return B is
1466 return Flag251 (Id);
1467 end Has_Implicit_Dereference;
1469 function Has_Independent_Components (Id : E) return B is
1471 pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id));
1472 return Flag34 (Base_Type (Id));
1473 end Has_Independent_Components;
1475 function Has_Inheritable_Invariants (Id : E) return B is
1477 pragma Assert (Is_Type (Id));
1478 return Flag248 (Id);
1479 end Has_Inheritable_Invariants;
1481 function Has_Initial_Value (Id : E) return B is
1483 pragma Assert (Ekind (Id) = E_Variable or else Is_Formal (Id));
1484 return Flag219 (Id);
1485 end Has_Initial_Value;
1487 function Has_Invariants (Id : E) return B is
1489 pragma Assert (Is_Type (Id));
1490 return Flag232 (Id);
1493 function Has_Loop_Entry_Attributes (Id : E) return B is
1495 pragma Assert (Ekind (Id) = E_Loop);
1496 return Flag260 (Id);
1497 end Has_Loop_Entry_Attributes;
1499 function Has_Machine_Radix_Clause (Id : E) return B is
1501 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
1503 end Has_Machine_Radix_Clause;
1505 function Has_Master_Entity (Id : E) return B is
1508 end Has_Master_Entity;
1510 function Has_Missing_Return (Id : E) return B is
1512 pragma Assert (Ekind_In (Id, E_Function, E_Generic_Function));
1513 return Flag142 (Id);
1514 end Has_Missing_Return;
1516 function Has_Nested_Block_With_Handler (Id : E) return B is
1518 return Flag101 (Id);
1519 end Has_Nested_Block_With_Handler;
1521 function Has_Non_Standard_Rep (Id : E) return B is
1523 return Flag75 (Implementation_Base_Type (Id));
1524 end Has_Non_Standard_Rep;
1526 function Has_Object_Size_Clause (Id : E) return B is
1528 pragma Assert (Is_Type (Id));
1529 return Flag172 (Id);
1530 end Has_Object_Size_Clause;
1532 function Has_Out_Or_In_Out_Parameter (Id : E) return B is
1534 pragma Assert (Ekind_In (Id, E_Function, E_Generic_Function));
1535 return Flag110 (Id);
1536 end Has_Out_Or_In_Out_Parameter;
1538 function Has_Per_Object_Constraint (Id : E) return B is
1540 return Flag154 (Id);
1541 end Has_Per_Object_Constraint;
1543 function Has_Postconditions (Id : E) return B is
1545 pragma Assert (Is_Subprogram (Id));
1546 return Flag240 (Id);
1547 end Has_Postconditions;
1549 function Has_Pragma_Controlled (Id : E) return B is
1551 pragma Assert (Is_Access_Type (Id));
1552 return Flag27 (Implementation_Base_Type (Id));
1553 end Has_Pragma_Controlled;
1555 function Has_Pragma_Elaborate_Body (Id : E) return B is
1557 return Flag150 (Id);
1558 end Has_Pragma_Elaborate_Body;
1560 function Has_Pragma_Inline (Id : E) return B is
1562 return Flag157 (Id);
1563 end Has_Pragma_Inline;
1565 function Has_Pragma_Inline_Always (Id : E) return B is
1567 return Flag230 (Id);
1568 end Has_Pragma_Inline_Always;
1570 function Has_Pragma_No_Inline (Id : E) return B is
1572 return Flag201 (Id);
1573 end Has_Pragma_No_Inline;
1575 function Has_Pragma_Ordered (Id : E) return B is
1577 pragma Assert (Is_Enumeration_Type (Id));
1578 return Flag198 (Implementation_Base_Type (Id));
1579 end Has_Pragma_Ordered;
1581 function Has_Pragma_Pack (Id : E) return B is
1583 pragma Assert (Is_Record_Type (Id) or else Is_Array_Type (Id));
1584 return Flag121 (Implementation_Base_Type (Id));
1585 end Has_Pragma_Pack;
1587 function Has_Pragma_Preelab_Init (Id : E) return B is
1589 return Flag221 (Id);
1590 end Has_Pragma_Preelab_Init;
1592 function Has_Pragma_Pure (Id : E) return B is
1594 return Flag203 (Id);
1595 end Has_Pragma_Pure;
1597 function Has_Pragma_Pure_Function (Id : E) return B is
1599 return Flag179 (Id);
1600 end Has_Pragma_Pure_Function;
1602 function Has_Pragma_Thread_Local_Storage (Id : E) return B is
1604 return Flag169 (Id);
1605 end Has_Pragma_Thread_Local_Storage;
1607 function Has_Pragma_Unmodified (Id : E) return B is
1609 return Flag233 (Id);
1610 end Has_Pragma_Unmodified;
1612 function Has_Pragma_Unreferenced (Id : E) return B is
1614 return Flag180 (Id);
1615 end Has_Pragma_Unreferenced;
1617 function Has_Pragma_Unreferenced_Objects (Id : E) return B is
1619 pragma Assert (Is_Type (Id));
1620 return Flag212 (Id);
1621 end Has_Pragma_Unreferenced_Objects;
1623 function Has_Predicates (Id : E) return B is
1625 pragma Assert (Is_Type (Id));
1626 return Flag250 (Id);
1629 function Has_Primitive_Operations (Id : E) return B is
1631 pragma Assert (Is_Type (Id));
1632 return Flag120 (Base_Type (Id));
1633 end Has_Primitive_Operations;
1635 function Has_Private_Ancestor (Id : E) return B is
1637 return Flag151 (Id);
1638 end Has_Private_Ancestor;
1640 function Has_Private_Declaration (Id : E) return B is
1642 return Flag155 (Id);
1643 end Has_Private_Declaration;
1645 function Has_Protected (Id : E) return B is
1647 return Flag271 (Base_Type (Id));
1650 function Has_Qualified_Name (Id : E) return B is
1652 return Flag161 (Id);
1653 end Has_Qualified_Name;
1655 function Has_RACW (Id : E) return B is
1657 pragma Assert (Ekind (Id) = E_Package);
1658 return Flag214 (Id);
1661 function Has_Record_Rep_Clause (Id : E) return B is
1663 pragma Assert (Is_Record_Type (Id));
1664 return Flag65 (Implementation_Base_Type (Id));
1665 end Has_Record_Rep_Clause;
1667 function Has_Recursive_Call (Id : E) return B is
1669 pragma Assert (Is_Subprogram (Id));
1670 return Flag143 (Id);
1671 end Has_Recursive_Call;
1673 function Has_Shift_Operator (Id : E) return B is
1675 pragma Assert (Is_Integer_Type (Id));
1676 return Flag267 (Base_Type (Id));
1677 end Has_Shift_Operator;
1679 function Has_Size_Clause (Id : E) return B is
1682 end Has_Size_Clause;
1684 function Has_Small_Clause (Id : E) return B is
1687 end Has_Small_Clause;
1689 function Has_Specified_Layout (Id : E) return B is
1691 pragma Assert (Is_Type (Id));
1692 return Flag100 (Implementation_Base_Type (Id));
1693 end Has_Specified_Layout;
1695 function Has_Specified_Stream_Input (Id : E) return B is
1697 pragma Assert (Is_Type (Id));
1698 return Flag190 (Id);
1699 end Has_Specified_Stream_Input;
1701 function Has_Specified_Stream_Output (Id : E) return B is
1703 pragma Assert (Is_Type (Id));
1704 return Flag191 (Id);
1705 end Has_Specified_Stream_Output;
1707 function Has_Specified_Stream_Read (Id : E) return B is
1709 pragma Assert (Is_Type (Id));
1710 return Flag192 (Id);
1711 end Has_Specified_Stream_Read;
1713 function Has_Specified_Stream_Write (Id : E) return B is
1715 pragma Assert (Is_Type (Id));
1716 return Flag193 (Id);
1717 end Has_Specified_Stream_Write;
1719 function Has_Static_Discriminants (Id : E) return B is
1721 pragma Assert (Is_Type (Id));
1722 return Flag211 (Id);
1723 end Has_Static_Discriminants;
1725 function Has_Static_Predicate (Id : E) return B is
1727 pragma Assert (Is_Type (Id));
1728 return Flag269 (Id);
1729 end Has_Static_Predicate;
1731 function Has_Static_Predicate_Aspect (Id : E) return B is
1733 pragma Assert (Is_Type (Id));
1734 return Flag259 (Id);
1735 end Has_Static_Predicate_Aspect;
1737 function Has_Storage_Size_Clause (Id : E) return B is
1739 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
1740 return Flag23 (Implementation_Base_Type (Id));
1741 end Has_Storage_Size_Clause;
1743 function Has_Stream_Size_Clause (Id : E) return B is
1745 return Flag184 (Id);
1746 end Has_Stream_Size_Clause;
1748 function Has_Task (Id : E) return B is
1750 return Flag30 (Base_Type (Id));
1753 function Has_Thunks (Id : E) return B is
1755 return Flag228 (Id);
1758 function Has_Unchecked_Union (Id : E) return B is
1760 return Flag123 (Base_Type (Id));
1761 end Has_Unchecked_Union;
1763 function Has_Unknown_Discriminants (Id : E) return B is
1765 pragma Assert (Is_Type (Id));
1767 end Has_Unknown_Discriminants;
1769 function Has_Up_Level_Access (Id : E) return B is
1772 (Ekind_In (Id, E_Variable, E_Constant, E_Loop_Parameter));
1773 return Flag215 (Id);
1774 end Has_Up_Level_Access;
1776 function Has_Visible_Refinement (Id : E) return B is
1778 pragma Assert (Ekind (Id) = E_Abstract_State);
1779 return Flag263 (Id);
1780 end Has_Visible_Refinement;
1782 function Has_Volatile_Components (Id : E) return B is
1784 return Flag87 (Implementation_Base_Type (Id));
1785 end Has_Volatile_Components;
1787 function Has_Xref_Entry (Id : E) return B is
1789 return Flag182 (Id);
1792 function Hiding_Loop_Variable (Id : E) return E is
1794 pragma Assert (Ekind (Id) = E_Variable);
1796 end Hiding_Loop_Variable;
1798 function Homonym (Id : E) return E is
1803 function Import_Pragma (Id : E) return E is
1805 pragma Assert (Is_Subprogram (Id));
1809 function Interface_Alias (Id : E) return E is
1811 pragma Assert (Is_Subprogram (Id));
1813 end Interface_Alias;
1815 function Interfaces (Id : E) return L is
1817 pragma Assert (Is_Record_Type (Id));
1818 return Elist25 (Id);
1821 function In_Package_Body (Id : E) return B is
1824 end In_Package_Body;
1826 function In_Private_Part (Id : E) return B is
1829 end In_Private_Part;
1831 function In_Use (Id : E) return B is
1833 pragma Assert (Nkind (Id) in N_Entity);
1837 function Initialization_Statements (Id : E) return N is
1839 pragma Assert (Ekind_In (Id, E_Constant, E_Variable));
1841 end Initialization_Statements;
1843 function Inner_Instances (Id : E) return L is
1845 return Elist23 (Id);
1846 end Inner_Instances;
1848 function Interface_Name (Id : E) return N is
1853 function Is_Abstract_Subprogram (Id : E) return B is
1855 pragma Assert (Is_Overloadable (Id));
1857 end Is_Abstract_Subprogram;
1859 function Is_Abstract_Type (Id : E) return B is
1861 pragma Assert (Is_Type (Id));
1862 return Flag146 (Id);
1863 end Is_Abstract_Type;
1865 function Is_Local_Anonymous_Access (Id : E) return B is
1867 pragma Assert (Is_Access_Type (Id));
1868 return Flag194 (Id);
1869 end Is_Local_Anonymous_Access;
1871 function Is_Access_Constant (Id : E) return B is
1873 pragma Assert (Is_Access_Type (Id));
1875 end Is_Access_Constant;
1877 function Is_Ada_2005_Only (Id : E) return B is
1879 return Flag185 (Id);
1880 end Is_Ada_2005_Only;
1882 function Is_Ada_2012_Only (Id : E) return B is
1884 return Flag199 (Id);
1885 end Is_Ada_2012_Only;
1887 function Is_Aliased (Id : E) return B is
1889 pragma Assert (Nkind (Id) in N_Entity);
1893 function Is_Asynchronous (Id : E) return B is
1895 pragma Assert (Ekind (Id) = E_Procedure or else Is_Type (Id));
1897 end Is_Asynchronous;
1899 function Is_Atomic (Id : E) return B is
1904 function Is_Bit_Packed_Array (Id : E) return B is
1906 return Flag122 (Implementation_Base_Type (Id));
1907 end Is_Bit_Packed_Array;
1909 function Is_Called (Id : E) return B is
1911 pragma Assert (Ekind_In (Id, E_Procedure, E_Function));
1912 return Flag102 (Id);
1915 function Is_Character_Type (Id : E) return B is
1918 end Is_Character_Type;
1920 function Is_Child_Unit (Id : E) return B is
1925 function Is_Class_Wide_Equivalent_Type (Id : E) return B is
1928 end Is_Class_Wide_Equivalent_Type;
1930 function Is_Compilation_Unit (Id : E) return B is
1932 return Flag149 (Id);
1933 end Is_Compilation_Unit;
1935 function Is_Completely_Hidden (Id : E) return B is
1937 pragma Assert (Ekind (Id) = E_Discriminant);
1938 return Flag103 (Id);
1939 end Is_Completely_Hidden;
1941 function Is_Constr_Subt_For_U_Nominal (Id : E) return B is
1944 end Is_Constr_Subt_For_U_Nominal;
1946 function Is_Constr_Subt_For_UN_Aliased (Id : E) return B is
1948 return Flag141 (Id);
1949 end Is_Constr_Subt_For_UN_Aliased;
1951 function Is_Constrained (Id : E) return B is
1953 pragma Assert (Nkind (Id) in N_Entity);
1957 function Is_Constructor (Id : E) return B is
1962 function Is_Controlled (Id : E) return B is
1964 return Flag42 (Base_Type (Id));
1967 function Is_Controlling_Formal (Id : E) return B is
1969 pragma Assert (Is_Formal (Id));
1971 end Is_Controlling_Formal;
1973 function Is_CPP_Class (Id : E) return B is
1978 function Is_Descendent_Of_Address (Id : E) return B is
1980 return Flag223 (Id);
1981 end Is_Descendent_Of_Address;
1983 function Is_Discrim_SO_Function (Id : E) return B is
1985 return Flag176 (Id);
1986 end Is_Discrim_SO_Function;
1988 function Is_Discriminant_Check_Function (Id : E) return B is
1990 return Flag264 (Id);
1991 end Is_Discriminant_Check_Function;
1993 function Is_Dispatch_Table_Entity (Id : E) return B is
1995 return Flag234 (Id);
1996 end Is_Dispatch_Table_Entity;
1998 function Is_Dispatching_Operation (Id : E) return B is
2000 pragma Assert (Nkind (Id) in N_Entity);
2002 end Is_Dispatching_Operation;
2004 function Is_Eliminated (Id : E) return B is
2006 return Flag124 (Id);
2009 function Is_Entry_Formal (Id : E) return B is
2012 end Is_Entry_Formal;
2014 function Is_Exported (Id : E) return B is
2019 function Is_First_Subtype (Id : E) return B is
2022 end Is_First_Subtype;
2024 function Is_For_Access_Subtype (Id : E) return B is
2026 pragma Assert (Ekind_In (Id, E_Record_Subtype, E_Private_Subtype));
2027 return Flag118 (Id);
2028 end Is_For_Access_Subtype;
2030 function Is_Formal_Subprogram (Id : E) return B is
2032 return Flag111 (Id);
2033 end Is_Formal_Subprogram;
2035 function Is_Frozen (Id : E) return B is
2040 function Is_Generic_Actual_Subprogram (Id : E) return B is
2042 pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2043 return Flag274 (Id);
2044 end Is_Generic_Actual_Subprogram;
2046 function Is_Generic_Actual_Type (Id : E) return B is
2048 pragma Assert (Is_Type (Id));
2050 end Is_Generic_Actual_Type;
2052 function Is_Generic_Instance (Id : E) return B is
2054 return Flag130 (Id);
2055 end Is_Generic_Instance;
2057 function Is_Generic_Type (Id : E) return B is
2059 pragma Assert (Nkind (Id) in N_Entity);
2061 end Is_Generic_Type;
2063 function Is_Hidden (Id : E) return B is
2068 function Is_Hidden_Non_Overridden_Subpgm (Id : E) return B is
2071 end Is_Hidden_Non_Overridden_Subpgm;
2073 function Is_Hidden_Open_Scope (Id : E) return B is
2075 return Flag171 (Id);
2076 end Is_Hidden_Open_Scope;
2078 function Is_Immediately_Visible (Id : E) return B is
2080 pragma Assert (Nkind (Id) in N_Entity);
2082 end Is_Immediately_Visible;
2084 function Is_Implementation_Defined (Id : E) return B is
2086 return Flag254 (Id);
2087 end Is_Implementation_Defined;
2089 function Is_Imported (Id : E) return B is
2094 function Is_Independent (Id : E) return B is
2096 pragma Assert (Ekind (Id) = E_Component);
2097 return Flag268 (Id);
2100 function Is_Inlined (Id : E) return B is
2105 function Is_Inlined_Always (Id : E) return B is
2107 pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2109 end Is_Inlined_Always;
2111 function Is_Interface (Id : E) return B is
2113 return Flag186 (Id);
2116 function Is_Instantiated (Id : E) return B is
2118 return Flag126 (Id);
2119 end Is_Instantiated;
2121 function Is_Internal (Id : E) return B is
2123 pragma Assert (Nkind (Id) in N_Entity);
2127 function Is_Interrupt_Handler (Id : E) return B is
2129 pragma Assert (Nkind (Id) in N_Entity);
2131 end Is_Interrupt_Handler;
2133 function Is_Intrinsic_Subprogram (Id : E) return B is
2136 end Is_Intrinsic_Subprogram;
2138 function Is_Invariant_Procedure (Id : E) return B is
2140 pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2141 return Flag257 (Id);
2142 end Is_Invariant_Procedure;
2144 function Is_Itype (Id : E) return B is
2149 function Is_Known_Non_Null (Id : E) return B is
2152 end Is_Known_Non_Null;
2154 function Is_Known_Null (Id : E) return B is
2156 return Flag204 (Id);
2159 function Is_Known_Valid (Id : E) return B is
2161 return Flag170 (Id);
2164 function Is_Limited_Composite (Id : E) return B is
2166 return Flag106 (Id);
2167 end Is_Limited_Composite;
2169 function Is_Limited_Interface (Id : E) return B is
2171 return Flag197 (Id);
2172 end Is_Limited_Interface;
2174 function Is_Limited_Record (Id : E) return B is
2177 end Is_Limited_Record;
2179 function Is_Machine_Code_Subprogram (Id : E) return B is
2181 pragma Assert (Is_Subprogram (Id));
2182 return Flag137 (Id);
2183 end Is_Machine_Code_Subprogram;
2185 function Is_Non_Static_Subtype (Id : E) return B is
2187 pragma Assert (Is_Type (Id));
2188 return Flag109 (Id);
2189 end Is_Non_Static_Subtype;
2191 function Is_Null_Init_Proc (Id : E) return B is
2193 pragma Assert (Ekind (Id) = E_Procedure);
2194 return Flag178 (Id);
2195 end Is_Null_Init_Proc;
2197 function Is_Obsolescent (Id : E) return B is
2199 return Flag153 (Id);
2202 function Is_Only_Out_Parameter (Id : E) return B is
2204 pragma Assert (Is_Formal (Id));
2205 return Flag226 (Id);
2206 end Is_Only_Out_Parameter;
2208 function Is_Package_Body_Entity (Id : E) return B is
2210 return Flag160 (Id);
2211 end Is_Package_Body_Entity;
2213 function Is_Packed (Id : E) return B is
2215 return Flag51 (Implementation_Base_Type (Id));
2218 function Is_Packed_Array_Impl_Type (Id : E) return B is
2220 return Flag138 (Id);
2221 end Is_Packed_Array_Impl_Type;
2223 function Is_Potentially_Use_Visible (Id : E) return B is
2225 pragma Assert (Nkind (Id) in N_Entity);
2227 end Is_Potentially_Use_Visible;
2229 function Is_Predicate_Function (Id : E) return B is
2231 pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2232 return Flag255 (Id);
2233 end Is_Predicate_Function;
2235 function Is_Predicate_Function_M (Id : E) return B is
2237 pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
2238 return Flag256 (Id);
2239 end Is_Predicate_Function_M;
2241 function Is_Preelaborated (Id : E) return B is
2244 end Is_Preelaborated;
2246 function Is_Primitive (Id : E) return B is
2249 (Is_Overloadable (Id)
2250 or else Ekind_In (Id, E_Generic_Function, E_Generic_Procedure));
2251 return Flag218 (Id);
2254 function Is_Primitive_Wrapper (Id : E) return B is
2256 pragma Assert (Ekind_In (Id, E_Function, E_Procedure));
2257 return Flag195 (Id);
2258 end Is_Primitive_Wrapper;
2260 function Is_Private_Composite (Id : E) return B is
2262 pragma Assert (Is_Type (Id));
2263 return Flag107 (Id);
2264 end Is_Private_Composite;
2266 function Is_Private_Descendant (Id : E) return B is
2269 end Is_Private_Descendant;
2271 function Is_Private_Primitive (Id : E) return B is
2273 pragma Assert (Ekind_In (Id, E_Function, E_Procedure));
2274 return Flag245 (Id);
2275 end Is_Private_Primitive;
2277 function Is_Processed_Transient (Id : E) return B is
2279 pragma Assert (Ekind_In (Id, E_Constant, E_Variable));
2280 return Flag252 (Id);
2281 end Is_Processed_Transient;
2283 function Is_Public (Id : E) return B is
2285 pragma Assert (Nkind (Id) in N_Entity);
2289 function Is_Pure (Id : E) return B is
2294 function Is_Pure_Unit_Access_Type (Id : E) return B is
2296 pragma Assert (Is_Access_Type (Id));
2297 return Flag189 (Id);
2298 end Is_Pure_Unit_Access_Type;
2300 function Is_RACW_Stub_Type (Id : E) return B is
2302 pragma Assert (Is_Type (Id));
2303 return Flag244 (Id);
2304 end Is_RACW_Stub_Type;
2306 function Is_Raised (Id : E) return B is
2308 pragma Assert (Ekind (Id) = E_Exception);
2309 return Flag224 (Id);
2312 function Is_Remote_Call_Interface (Id : E) return B is
2315 end Is_Remote_Call_Interface;
2317 function Is_Remote_Types (Id : E) return B is
2320 end Is_Remote_Types;
2322 function Is_Renaming_Of_Object (Id : E) return B is
2324 return Flag112 (Id);
2325 end Is_Renaming_Of_Object;
2327 function Is_Return_Object (Id : E) return B is
2329 return Flag209 (Id);
2330 end Is_Return_Object;
2332 function Is_Safe_To_Reevaluate (Id : E) return B is
2334 return Flag249 (Id);
2335 end Is_Safe_To_Reevaluate;
2337 function Is_Shared_Passive (Id : E) return B is
2340 end Is_Shared_Passive;
2342 function Is_Statically_Allocated (Id : E) return B is
2345 end Is_Statically_Allocated;
2347 function Is_Tag (Id : E) return B is
2349 pragma Assert (Nkind (Id) in N_Entity);
2353 function Is_Tagged_Type (Id : E) return B is
2358 function Is_Thunk (Id : E) return B is
2360 return Flag225 (Id);
2363 function Is_Trivial_Subprogram (Id : E) return B is
2365 return Flag235 (Id);
2366 end Is_Trivial_Subprogram;
2368 function Is_True_Constant (Id : E) return B is
2370 return Flag163 (Id);
2371 end Is_True_Constant;
2373 function Is_Unchecked_Union (Id : E) return B is
2375 return Flag117 (Implementation_Base_Type (Id));
2376 end Is_Unchecked_Union;
2378 function Is_Underlying_Record_View (Id : E) return B is
2380 return Flag246 (Id);
2381 end Is_Underlying_Record_View;
2383 function Is_Unsigned_Type (Id : E) return B is
2385 pragma Assert (Is_Type (Id));
2386 return Flag144 (Id);
2387 end Is_Unsigned_Type;
2389 function Is_Valued_Procedure (Id : E) return B is
2391 pragma Assert (Ekind (Id) = E_Procedure);
2392 return Flag127 (Id);
2393 end Is_Valued_Procedure;
2395 function Is_Visible_Formal (Id : E) return B is
2397 return Flag206 (Id);
2398 end Is_Visible_Formal;
2400 function Is_Visible_Lib_Unit (Id : E) return B is
2402 return Flag116 (Id);
2403 end Is_Visible_Lib_Unit;
2405 function Is_Volatile (Id : E) return B is
2407 pragma Assert (Nkind (Id) in N_Entity);
2409 if Is_Type (Id) then
2410 return Flag16 (Base_Type (Id));
2416 function Itype_Printed (Id : E) return B is
2418 pragma Assert (Is_Itype (Id));
2419 return Flag202 (Id);
2422 function Kill_Elaboration_Checks (Id : E) return B is
2425 end Kill_Elaboration_Checks;
2427 function Kill_Range_Checks (Id : E) return B is
2430 end Kill_Range_Checks;
2432 function Known_To_Have_Preelab_Init (Id : E) return B is
2434 pragma Assert (Is_Type (Id));
2435 return Flag207 (Id);
2436 end Known_To_Have_Preelab_Init;
2438 function Last_Aggregate_Assignment (Id : E) return N is
2440 pragma Assert (Ekind_In (Id, E_Constant, E_Variable));
2442 end Last_Aggregate_Assignment;
2444 function Last_Assignment (Id : E) return N is
2446 pragma Assert (Is_Assignable (Id));
2448 end Last_Assignment;
2450 function Last_Entity (Id : E) return E is
2455 function Limited_View (Id : E) return E is
2457 pragma Assert (Ekind (Id) = E_Package);
2461 function Linker_Section_Pragma (Id : E) return N is
2464 (Is_Type (Id) or else Is_Object (Id) or else Is_Subprogram (Id));
2466 end Linker_Section_Pragma;
2468 function Lit_Indexes (Id : E) return E is
2470 pragma Assert (Is_Enumeration_Type (Id));
2474 function Lit_Strings (Id : E) return E is
2476 pragma Assert (Is_Enumeration_Type (Id));
2480 function Low_Bound_Tested (Id : E) return B is
2482 return Flag205 (Id);
2483 end Low_Bound_Tested;
2485 function Machine_Radix_10 (Id : E) return B is
2487 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
2489 end Machine_Radix_10;
2491 function Master_Id (Id : E) return E is
2493 pragma Assert (Is_Access_Type (Id));
2497 function Materialize_Entity (Id : E) return B is
2499 return Flag168 (Id);
2500 end Materialize_Entity;
2502 function May_Inherit_Delayed_Rep_Aspects (Id : E) return B is
2504 return Flag262 (Id);
2505 end May_Inherit_Delayed_Rep_Aspects;
2507 function Mechanism (Id : E) return M is
2509 pragma Assert (Ekind (Id) = E_Function or else Is_Formal (Id));
2510 return UI_To_Int (Uint8 (Id));
2513 function Modulus (Id : E) return Uint is
2515 pragma Assert (Is_Modular_Integer_Type (Id));
2516 return Uint17 (Base_Type (Id));
2519 function Must_Be_On_Byte_Boundary (Id : E) return B is
2521 pragma Assert (Is_Type (Id));
2522 return Flag183 (Id);
2523 end Must_Be_On_Byte_Boundary;
2525 function Must_Have_Preelab_Init (Id : E) return B is
2527 pragma Assert (Is_Type (Id));
2528 return Flag208 (Id);
2529 end Must_Have_Preelab_Init;
2531 function Needs_Debug_Info (Id : E) return B is
2533 return Flag147 (Id);
2534 end Needs_Debug_Info;
2536 function Needs_No_Actuals (Id : E) return B is
2539 (Is_Overloadable (Id)
2540 or else Ekind_In (Id, E_Subprogram_Type, E_Entry_Family));
2542 end Needs_No_Actuals;
2544 function Never_Set_In_Source (Id : E) return B is
2546 return Flag115 (Id);
2547 end Never_Set_In_Source;
2549 function Next_Inlined_Subprogram (Id : E) return E is
2552 end Next_Inlined_Subprogram;
2554 function No_Dynamic_Predicate_On_Actual (Id : E) return Boolean is
2556 pragma Assert (Is_Discrete_Type (Id));
2557 return Flag276 (Id);
2558 end No_Dynamic_Predicate_On_Actual;
2560 function No_Pool_Assigned (Id : E) return B is
2562 pragma Assert (Is_Access_Type (Id));
2563 return Flag131 (Root_Type (Id));
2564 end No_Pool_Assigned;
2566 function No_Predicate_On_Actual (Id : E) return Boolean is
2568 pragma Assert (Is_Discrete_Type (Id));
2569 return Flag275 (Id);
2570 end No_Predicate_On_Actual;
2572 function No_Return (Id : E) return B is
2574 return Flag113 (Id);
2577 function No_Strict_Aliasing (Id : E) return B is
2579 pragma Assert (Is_Access_Type (Id));
2580 return Flag136 (Base_Type (Id));
2581 end No_Strict_Aliasing;
2583 function Non_Binary_Modulus (Id : E) return B is
2585 pragma Assert (Is_Type (Id));
2586 return Flag58 (Base_Type (Id));
2587 end Non_Binary_Modulus;
2589 function Non_Limited_View (Id : E) return E is
2592 (Ekind (Id) in Incomplete_Kind or else Ekind (Id) = E_Abstract_State);
2594 end Non_Limited_View;
2596 function Nonzero_Is_True (Id : E) return B is
2598 pragma Assert (Root_Type (Id) = Standard_Boolean);
2599 return Flag162 (Base_Type (Id));
2600 end Nonzero_Is_True;
2602 function Normalized_First_Bit (Id : E) return U is
2604 pragma Assert (Ekind_In (Id, E_Component, E_Discriminant));
2606 end Normalized_First_Bit;
2608 function Normalized_Position (Id : E) return U is
2610 pragma Assert (Ekind_In (Id, E_Component, E_Discriminant));
2612 end Normalized_Position;
2614 function Normalized_Position_Max (Id : E) return U is
2616 pragma Assert (Ekind_In (Id, E_Component, E_Discriminant));
2618 end Normalized_Position_Max;
2620 function OK_To_Rename (Id : E) return B is
2622 pragma Assert (Ekind (Id) = E_Variable);
2623 return Flag247 (Id);
2626 function OK_To_Reorder_Components (Id : E) return B is
2628 pragma Assert (Is_Record_Type (Id));
2629 return Flag239 (Base_Type (Id));
2630 end OK_To_Reorder_Components;
2632 function Optimize_Alignment_Space (Id : E) return B is
2635 (Is_Type (Id) or else Ekind_In (Id, E_Constant, E_Variable));
2636 return Flag241 (Id);
2637 end Optimize_Alignment_Space;
2639 function Optimize_Alignment_Time (Id : E) return B is
2642 (Is_Type (Id) or else Ekind_In (Id, E_Constant, E_Variable));
2643 return Flag242 (Id);
2644 end Optimize_Alignment_Time;
2646 function Original_Access_Type (Id : E) return E is
2648 pragma Assert (Ekind (Id) = E_Access_Subprogram_Type);
2650 end Original_Access_Type;
2652 function Original_Array_Type (Id : E) return E is
2654 pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id));
2656 end Original_Array_Type;
2658 function Original_Record_Component (Id : E) return E is
2660 pragma Assert (Ekind_In (Id, E_Void, E_Component, E_Discriminant));
2662 end Original_Record_Component;
2664 function Overlays_Constant (Id : E) return B is
2666 return Flag243 (Id);
2667 end Overlays_Constant;
2669 function Overridden_Operation (Id : E) return E is
2672 end Overridden_Operation;
2674 function Package_Instantiation (Id : E) return N is
2676 pragma Assert (Ekind_In (Id, E_Package, E_Generic_Package));
2678 end Package_Instantiation;
2680 function Packed_Array_Impl_Type (Id : E) return E is
2682 pragma Assert (Is_Array_Type (Id));
2684 end Packed_Array_Impl_Type;
2686 function Parent_Subtype (Id : E) return E is
2688 pragma Assert (Is_Record_Type (Id));
2689 return Node19 (Base_Type (Id));
2692 function Part_Of_Constituents (Id : E) return L is
2694 pragma Assert (Ekind (Id) = E_Abstract_State);
2696 end Part_Of_Constituents;
2698 function Postcondition_Proc (Id : E) return E is
2700 pragma Assert (Ekind (Id) = E_Procedure);
2702 end Postcondition_Proc;
2704 function PPC_Wrapper (Id : E) return E is
2706 pragma Assert (Ekind_In (Id, E_Entry, E_Entry_Family));
2710 function Prival (Id : E) return E is
2712 pragma Assert (Is_Protected_Component (Id));
2716 function Prival_Link (Id : E) return E is
2718 pragma Assert (Ekind_In (Id, E_Constant, E_Variable));
2722 function Private_Dependents (Id : E) return L is
2724 pragma Assert (Is_Incomplete_Or_Private_Type (Id));
2725 return Elist18 (Id);
2726 end Private_Dependents;
2728 function Private_View (Id : E) return N is
2730 pragma Assert (Is_Private_Type (Id));
2734 function Protected_Body_Subprogram (Id : E) return E is
2736 pragma Assert (Is_Subprogram (Id) or else Is_Entry (Id));
2738 end Protected_Body_Subprogram;
2740 function Protected_Formal (Id : E) return E is
2742 pragma Assert (Is_Formal (Id));
2744 end Protected_Formal;
2746 function Protection_Object (Id : E) return E is
2749 (Ekind_In (Id, E_Entry, E_Entry_Family, E_Function, E_Procedure));
2751 end Protection_Object;
2753 function Reachable (Id : E) return B is
2758 function Referenced (Id : E) return B is
2760 return Flag156 (Id);
2763 function Referenced_As_LHS (Id : E) return B is
2766 end Referenced_As_LHS;
2768 function Referenced_As_Out_Parameter (Id : E) return B is
2770 return Flag227 (Id);
2771 end Referenced_As_Out_Parameter;
2773 function Refinement_Constituents (Id : E) return L is
2775 pragma Assert (Ekind (Id) = E_Abstract_State);
2777 end Refinement_Constituents;
2779 function Register_Exception_Call (Id : E) return N is
2781 pragma Assert (Ekind (Id) = E_Exception);
2783 end Register_Exception_Call;
2785 function Related_Array_Object (Id : E) return E is
2787 pragma Assert (Is_Array_Type (Id));
2789 end Related_Array_Object;
2791 function Related_Expression (Id : E) return N is
2793 pragma Assert (Ekind (Id) in Type_Kind
2794 or else Ekind_In (Id, E_Constant, E_Variable));
2796 end Related_Expression;
2798 function Related_Instance (Id : E) return E is
2800 pragma Assert (Ekind_In (Id, E_Package, E_Package_Body));
2802 end Related_Instance;
2804 function Related_Type (Id : E) return E is
2806 pragma Assert (Ekind_In (Id, E_Component, E_Constant, E_Variable));
2810 function Relative_Deadline_Variable (Id : E) return E is
2812 pragma Assert (Is_Task_Type (Id));
2813 return Node26 (Implementation_Base_Type (Id));
2814 end Relative_Deadline_Variable;
2816 function Renamed_Entity (Id : E) return N is
2821 function Renamed_In_Spec (Id : E) return B is
2823 pragma Assert (Ekind (Id) = E_Package);
2824 return Flag231 (Id);
2825 end Renamed_In_Spec;
2827 function Renamed_Object (Id : E) return N is
2832 function Renaming_Map (Id : E) return U is
2837 function Requires_Overriding (Id : E) return B is
2839 pragma Assert (Is_Overloadable (Id));
2840 return Flag213 (Id);
2841 end Requires_Overriding;
2843 function Return_Present (Id : E) return B is
2848 function Return_Applies_To (Id : E) return N is
2851 end Return_Applies_To;
2853 function Returns_By_Ref (Id : E) return B is
2858 function Reverse_Bit_Order (Id : E) return B is
2860 pragma Assert (Is_Record_Type (Id));
2861 return Flag164 (Base_Type (Id));
2862 end Reverse_Bit_Order;
2864 function Reverse_Storage_Order (Id : E) return B is
2866 pragma Assert (Is_Record_Type (Id) or else Is_Array_Type (Id));
2867 return Flag93 (Base_Type (Id));
2868 end Reverse_Storage_Order;
2870 function RM_Size (Id : E) return U is
2872 pragma Assert (Is_Type (Id));
2876 function Scalar_Range (Id : E) return N is
2881 function Scale_Value (Id : E) return U is
2886 function Scope_Depth_Value (Id : E) return U is
2889 end Scope_Depth_Value;
2891 function Sec_Stack_Needed_For_Return (Id : E) return B is
2893 return Flag167 (Id);
2894 end Sec_Stack_Needed_For_Return;
2896 function Shadow_Entities (Id : E) return S is
2898 pragma Assert (Ekind_In (Id, E_Package, E_Generic_Package));
2900 end Shadow_Entities;
2902 function Shared_Var_Procs_Instance (Id : E) return E is
2904 pragma Assert (Ekind (Id) = E_Variable);
2906 end Shared_Var_Procs_Instance;
2908 function Size_Check_Code (Id : E) return N is
2910 pragma Assert (Ekind_In (Id, E_Constant, E_Variable));
2912 end Size_Check_Code;
2914 function Size_Depends_On_Discriminant (Id : E) return B is
2916 return Flag177 (Id);
2917 end Size_Depends_On_Discriminant;
2919 function Size_Known_At_Compile_Time (Id : E) return B is
2922 end Size_Known_At_Compile_Time;
2924 function Small_Value (Id : E) return R is
2926 pragma Assert (Is_Fixed_Point_Type (Id));
2927 return Ureal21 (Id);
2930 function SPARK_Aux_Pragma (Id : E) return N is
2933 (Ekind_In (Id, E_Generic_Package, -- package variants
2937 end SPARK_Aux_Pragma;
2939 function SPARK_Aux_Pragma_Inherited (Id : E) return B is
2942 (Ekind_In (Id, E_Generic_Package, -- package variants
2945 return Flag266 (Id);
2946 end SPARK_Aux_Pragma_Inherited;
2948 function SPARK_Pragma (Id : E) return N is
2951 (Ekind_In (Id, E_Function, -- subprogram variants
2953 E_Generic_Procedure,
2957 Ekind_In (Id, E_Generic_Package, -- package variants
2963 function SPARK_Pragma_Inherited (Id : E) return B is
2966 (Ekind_In (Id, E_Function, -- subprogram variants
2968 E_Generic_Procedure,
2972 Ekind_In (Id, E_Generic_Package, -- package variants
2975 return Flag265 (Id);
2976 end SPARK_Pragma_Inherited;
2978 function Spec_Entity (Id : E) return E is
2980 pragma Assert (Ekind (Id) = E_Package_Body or else Is_Formal (Id));
2984 function SSO_Set_High_By_Default (Id : E) return B is
2986 pragma Assert (Is_Record_Type (Id) or else Is_Array_Type (Id));
2987 return Flag273 (Base_Type (Id));
2988 end SSO_Set_High_By_Default;
2990 function SSO_Set_Low_By_Default (Id : E) return B is
2992 pragma Assert (Is_Record_Type (Id) or else Is_Array_Type (Id));
2993 return Flag272 (Base_Type (Id));
2994 end SSO_Set_Low_By_Default;
2996 function Static_Discrete_Predicate (Id : E) return S is
2998 pragma Assert (Is_Discrete_Type (Id));
3000 end Static_Discrete_Predicate;
3002 function Static_Real_Or_String_Predicate (Id : E) return N is
3004 pragma Assert (Is_Real_Type (Id) or else Is_String_Type (Id));
3006 end Static_Real_Or_String_Predicate;
3008 function Status_Flag_Or_Transient_Decl (Id : E) return N is
3010 pragma Assert (Ekind_In (Id, E_Constant, E_Variable));
3012 end Status_Flag_Or_Transient_Decl;
3014 function Storage_Size_Variable (Id : E) return E is
3016 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
3017 return Node15 (Implementation_Base_Type (Id));
3018 end Storage_Size_Variable;
3020 function Static_Elaboration_Desired (Id : E) return B is
3022 pragma Assert (Ekind (Id) = E_Package);
3024 end Static_Elaboration_Desired;
3026 function Static_Initialization (Id : E) return N is
3029 (Ekind (Id) = E_Procedure and then not Is_Dispatching_Operation (Id));
3031 end Static_Initialization;
3033 function Stored_Constraint (Id : E) return L is
3036 (Is_Composite_Type (Id) and then not Is_Array_Type (Id));
3037 return Elist23 (Id);
3038 end Stored_Constraint;
3040 function Stores_Attribute_Old_Prefix (Id : E) return B is
3042 return Flag270 (Id);
3043 end Stores_Attribute_Old_Prefix;
3045 function Strict_Alignment (Id : E) return B is
3047 return Flag145 (Implementation_Base_Type (Id));
3048 end Strict_Alignment;
3050 function String_Literal_Length (Id : E) return U is
3053 end String_Literal_Length;
3055 function String_Literal_Low_Bound (Id : E) return N is
3058 end String_Literal_Low_Bound;
3060 function Subprograms_For_Type (Id : E) return E is
3062 pragma Assert (Is_Type (Id) or else Is_Subprogram (Id));
3064 end Subprograms_For_Type;
3066 function Suppress_Elaboration_Warnings (Id : E) return B is
3068 return Flag148 (Id);
3069 end Suppress_Elaboration_Warnings;
3071 function Suppress_Initialization (Id : E) return B is
3073 pragma Assert (Is_Type (Id));
3074 return Flag105 (Id);
3075 end Suppress_Initialization;
3077 function Suppress_Style_Checks (Id : E) return B is
3079 return Flag165 (Id);
3080 end Suppress_Style_Checks;
3082 function Suppress_Value_Tracking_On_Call (Id : E) return B is
3084 return Flag217 (Id);
3085 end Suppress_Value_Tracking_On_Call;
3087 function Task_Body_Procedure (Id : E) return N is
3089 pragma Assert (Ekind (Id) in Task_Kind);
3091 end Task_Body_Procedure;
3093 function Thunk_Entity (Id : E) return E is
3095 pragma Assert (Ekind_In (Id, E_Function, E_Procedure)
3096 and then Is_Thunk (Id));
3100 function Treat_As_Volatile (Id : E) return B is
3103 end Treat_As_Volatile;
3105 function Underlying_Full_View (Id : E) return E is
3107 pragma Assert (Ekind (Id) in Private_Kind);
3109 end Underlying_Full_View;
3111 function Underlying_Record_View (Id : E) return E is
3114 end Underlying_Record_View;
3116 function Universal_Aliasing (Id : E) return B is
3118 pragma Assert (Is_Type (Id));
3119 return Flag216 (Implementation_Base_Type (Id));
3120 end Universal_Aliasing;
3122 function Unset_Reference (Id : E) return N is
3125 end Unset_Reference;
3127 function Used_As_Generic_Actual (Id : E) return B is
3129 return Flag222 (Id);
3130 end Used_As_Generic_Actual;
3132 function Uses_Lock_Free (Id : E) return B is
3134 pragma Assert (Is_Protected_Type (Id));
3135 return Flag188 (Id);
3138 function Uses_Sec_Stack (Id : E) return B is
3143 function Warnings_Off (Id : E) return B is
3148 function Warnings_Off_Used (Id : E) return B is
3150 return Flag236 (Id);
3151 end Warnings_Off_Used;
3153 function Warnings_Off_Used_Unmodified (Id : E) return B is
3155 return Flag237 (Id);
3156 end Warnings_Off_Used_Unmodified;
3158 function Warnings_Off_Used_Unreferenced (Id : E) return B is
3160 return Flag238 (Id);
3161 end Warnings_Off_Used_Unreferenced;
3163 function Wrapped_Entity (Id : E) return E is
3165 pragma Assert (Ekind_In (Id, E_Function, E_Procedure)
3166 and then Is_Primitive_Wrapper (Id));
3170 function Was_Hidden (Id : E) return B is
3172 return Flag196 (Id);
3175 ------------------------------
3176 -- Classification Functions --
3177 ------------------------------
3179 function Is_Access_Type (Id : E) return B is
3181 return Ekind (Id) in Access_Kind;
3184 function Is_Access_Protected_Subprogram_Type (Id : E) return B is
3186 return Ekind (Id) in Access_Protected_Kind;
3187 end Is_Access_Protected_Subprogram_Type;
3189 function Is_Access_Subprogram_Type (Id : E) return B is
3191 return Ekind (Id) in Access_Subprogram_Kind;
3192 end Is_Access_Subprogram_Type;
3194 function Is_Aggregate_Type (Id : E) return B is
3196 return Ekind (Id) in Aggregate_Kind;
3197 end Is_Aggregate_Type;
3199 function Is_Array_Type (Id : E) return B is
3201 return Ekind (Id) in Array_Kind;
3204 function Is_Assignable (Id : E) return B is
3206 return Ekind (Id) in Assignable_Kind;
3209 function Is_Class_Wide_Type (Id : E) return B is
3211 return Ekind (Id) in Class_Wide_Kind;
3212 end Is_Class_Wide_Type;
3214 function Is_Composite_Type (Id : E) return B is
3216 return Ekind (Id) in Composite_Kind;
3217 end Is_Composite_Type;
3219 function Is_Concurrent_Body (Id : E) return B is
3221 return Ekind (Id) in
3222 Concurrent_Body_Kind;
3223 end Is_Concurrent_Body;
3225 function Is_Concurrent_Record_Type (Id : E) return B is
3228 end Is_Concurrent_Record_Type;
3230 function Is_Concurrent_Type (Id : E) return B is
3232 return Ekind (Id) in Concurrent_Kind;
3233 end Is_Concurrent_Type;
3235 function Is_Decimal_Fixed_Point_Type (Id : E) return B is
3237 return Ekind (Id) in
3238 Decimal_Fixed_Point_Kind;
3239 end Is_Decimal_Fixed_Point_Type;
3241 function Is_Digits_Type (Id : E) return B is
3243 return Ekind (Id) in Digits_Kind;
3246 function Is_Discrete_Or_Fixed_Point_Type (Id : E) return B is
3248 return Ekind (Id) in Discrete_Or_Fixed_Point_Kind;
3249 end Is_Discrete_Or_Fixed_Point_Type;
3251 function Is_Discrete_Type (Id : E) return B is
3253 return Ekind (Id) in Discrete_Kind;
3254 end Is_Discrete_Type;
3256 function Is_Elementary_Type (Id : E) return B is
3258 return Ekind (Id) in Elementary_Kind;
3259 end Is_Elementary_Type;
3261 function Is_Entry (Id : E) return B is
3263 return Ekind (Id) in Entry_Kind;
3266 function Is_Enumeration_Type (Id : E) return B is
3268 return Ekind (Id) in
3270 end Is_Enumeration_Type;
3272 function Is_Fixed_Point_Type (Id : E) return B is
3274 return Ekind (Id) in
3276 end Is_Fixed_Point_Type;
3278 function Is_Floating_Point_Type (Id : E) return B is
3280 return Ekind (Id) in Float_Kind;
3281 end Is_Floating_Point_Type;
3283 function Is_Formal (Id : E) return B is
3285 return Ekind (Id) in Formal_Kind;
3288 function Is_Formal_Object (Id : E) return B is
3290 return Ekind (Id) in Formal_Object_Kind;
3291 end Is_Formal_Object;
3293 function Is_Generic_Subprogram (Id : E) return B is
3295 return Ekind (Id) in Generic_Subprogram_Kind;
3296 end Is_Generic_Subprogram;
3298 function Is_Generic_Unit (Id : E) return B is
3300 return Ekind (Id) in Generic_Unit_Kind;
3301 end Is_Generic_Unit;
3303 function Is_Incomplete_Or_Private_Type (Id : E) return B is
3305 return Ekind (Id) in
3306 Incomplete_Or_Private_Kind;
3307 end Is_Incomplete_Or_Private_Type;
3309 function Is_Incomplete_Type (Id : E) return B is
3311 return Ekind (Id) in
3313 end Is_Incomplete_Type;
3315 function Is_Integer_Type (Id : E) return B is
3317 return Ekind (Id) in Integer_Kind;
3318 end Is_Integer_Type;
3320 function Is_Modular_Integer_Type (Id : E) return B is
3322 return Ekind (Id) in
3323 Modular_Integer_Kind;
3324 end Is_Modular_Integer_Type;
3326 function Is_Named_Number (Id : E) return B is
3328 return Ekind (Id) in Named_Kind;
3329 end Is_Named_Number;
3331 function Is_Numeric_Type (Id : E) return B is
3333 return Ekind (Id) in Numeric_Kind;
3334 end Is_Numeric_Type;
3336 function Is_Object (Id : E) return B is
3338 return Ekind (Id) in Object_Kind;
3341 function Is_Ordinary_Fixed_Point_Type (Id : E) return B is
3343 return Ekind (Id) in
3344 Ordinary_Fixed_Point_Kind;
3345 end Is_Ordinary_Fixed_Point_Type;
3347 function Is_Overloadable (Id : E) return B is
3349 return Ekind (Id) in Overloadable_Kind;
3350 end Is_Overloadable;
3352 function Is_Private_Type (Id : E) return B is
3354 return Ekind (Id) in Private_Kind;
3355 end Is_Private_Type;
3357 function Is_Protected_Type (Id : E) return B is
3359 return Ekind (Id) in Protected_Kind;
3360 end Is_Protected_Type;
3362 function Is_Real_Type (Id : E) return B is
3364 return Ekind (Id) in Real_Kind;
3367 function Is_Record_Type (Id : E) return B is
3369 return Ekind (Id) in Record_Kind;
3372 function Is_Scalar_Type (Id : E) return B is
3374 return Ekind (Id) in Scalar_Kind;
3377 function Is_Signed_Integer_Type (Id : E) return B is
3379 return Ekind (Id) in Signed_Integer_Kind;
3380 end Is_Signed_Integer_Type;
3382 function Is_Subprogram (Id : E) return B is
3384 return Ekind (Id) in Subprogram_Kind;
3387 function Is_Task_Type (Id : E) return B is
3389 return Ekind (Id) in Task_Kind;
3392 function Is_Type (Id : E) return B is
3394 return Ekind (Id) in Type_Kind;
3397 ------------------------------
3398 -- Attribute Set Procedures --
3399 ------------------------------
3401 -- Note: in many of these set procedures an "obvious" assertion is missing.
3402 -- The reason for this is that in many cases, a field is set before the
3403 -- Ekind field is set, so that the field is set when Ekind = E_Void. It
3404 -- it is possible to add assertions that specifically include the E_Void
3405 -- possibility, but in some cases, we just omit the assertions.
3407 procedure Set_Abstract_States (Id : E; V : L) is
3409 pragma Assert (Ekind_In (Id, E_Generic_Package, E_Package));
3410 Set_Elist25 (Id, V);
3411 end Set_Abstract_States;
3413 procedure Set_Accept_Address (Id : E; V : L) is
3415 Set_Elist21 (Id, V);
3416 end Set_Accept_Address;
3418 procedure Set_Access_Disp_Table (Id : E; V : L) is
3420 pragma Assert (Ekind (Id) = E_Record_Type
3421 and then Id = Implementation_Base_Type (Id));
3422 pragma Assert (V = No_Elist or else Is_Tagged_Type (Id));
3423 Set_Elist16 (Id, V);
3424 end Set_Access_Disp_Table;
3426 procedure Set_Associated_Formal_Package (Id : E; V : E) is
3429 end Set_Associated_Formal_Package;
3431 procedure Set_Associated_Node_For_Itype (Id : E; V : E) is
3434 end Set_Associated_Node_For_Itype;
3436 procedure Set_Associated_Storage_Pool (Id : E; V : E) is
3438 pragma Assert (Is_Access_Type (Id) and then Is_Base_Type (Id));
3440 end Set_Associated_Storage_Pool;
3442 procedure Set_Actual_Subtype (Id : E; V : E) is
3445 (Ekind_In (Id, E_Constant, E_Variable, E_Generic_In_Out_Parameter)
3446 or else Is_Formal (Id));
3448 end Set_Actual_Subtype;
3450 procedure Set_Address_Taken (Id : E; V : B := True) is
3452 Set_Flag104 (Id, V);
3453 end Set_Address_Taken;
3455 procedure Set_Alias (Id : E; V : E) is
3458 (Is_Overloadable (Id) or else Ekind (Id) = E_Subprogram_Type);
3462 procedure Set_Alignment (Id : E; V : U) is
3464 pragma Assert (Is_Type (Id)
3465 or else Is_Formal (Id)
3466 or else Ekind_In (Id, E_Loop_Parameter,
3473 procedure Set_Barrier_Function (Id : E; V : N) is
3475 pragma Assert (Is_Entry (Id));
3477 end Set_Barrier_Function;
3479 procedure Set_Block_Node (Id : E; V : N) is
3481 pragma Assert (Ekind (Id) = E_Block);
3485 procedure Set_Body_Entity (Id : E; V : E) is
3487 pragma Assert (Ekind_In (Id, E_Package, E_Generic_Package));
3489 end Set_Body_Entity;
3491 procedure Set_Body_Needed_For_SAL (Id : E; V : B := True) is
3494 (Ekind (Id) = E_Package
3495 or else Is_Subprogram (Id)
3496 or else Is_Generic_Unit (Id));
3498 end Set_Body_Needed_For_SAL;
3500 procedure Set_Body_References (Id : E; V : L) is
3502 pragma Assert (Ekind (Id) = E_Abstract_State);
3503 Set_Elist16 (Id, V);
3504 end Set_Body_References;
3506 procedure Set_BIP_Initialization_Call (Id : E; V : N) is
3508 pragma Assert (Ekind_In (Id, E_Constant, E_Variable));
3510 end Set_BIP_Initialization_Call;
3512 procedure Set_C_Pass_By_Copy (Id : E; V : B := True) is
3514 pragma Assert (Is_Record_Type (Id) and then Is_Base_Type (Id));
3515 Set_Flag125 (Id, V);
3516 end Set_C_Pass_By_Copy;
3518 procedure Set_Can_Never_Be_Null (Id : E; V : B := True) is
3521 end Set_Can_Never_Be_Null;
3523 procedure Set_Can_Use_Internal_Rep (Id : E; V : B := True) is
3526 (Is_Access_Subprogram_Type (Id) and then Is_Base_Type (Id));
3527 Set_Flag229 (Id, V);
3528 end Set_Can_Use_Internal_Rep;
3530 procedure Set_Checks_May_Be_Suppressed (Id : E; V : B := True) is
3533 end Set_Checks_May_Be_Suppressed;
3535 procedure Set_Class_Wide_Type (Id : E; V : E) is
3537 pragma Assert (Is_Type (Id));
3539 end Set_Class_Wide_Type;
3541 procedure Set_Cloned_Subtype (Id : E; V : E) is
3543 pragma Assert (Ekind_In (Id, E_Record_Subtype, E_Class_Wide_Subtype));
3545 end Set_Cloned_Subtype;
3547 procedure Set_Component_Bit_Offset (Id : E; V : U) is
3549 pragma Assert (Ekind_In (Id, E_Component, E_Discriminant));
3551 end Set_Component_Bit_Offset;
3553 procedure Set_Component_Clause (Id : E; V : N) is
3555 pragma Assert (Ekind_In (Id, E_Component, E_Discriminant));
3557 end Set_Component_Clause;
3559 procedure Set_Component_Size (Id : E; V : U) is
3561 pragma Assert (Is_Array_Type (Id) and then Is_Base_Type (Id));
3563 end Set_Component_Size;
3565 procedure Set_Component_Type (Id : E; V : E) is
3567 pragma Assert (Is_Array_Type (Id) and then Is_Base_Type (Id));
3569 end Set_Component_Type;
3571 procedure Set_Contract (Id : E; V : N) is
3574 (Ekind_In (Id, E_Entry,
3582 or else Is_Generic_Subprogram (Id)
3583 or else Is_Subprogram (Id));
3587 procedure Set_Corresponding_Concurrent_Type (Id : E; V : E) is
3590 (Ekind (Id) = E_Record_Type and then Is_Concurrent_Type (V));
3592 end Set_Corresponding_Concurrent_Type;
3594 procedure Set_Corresponding_Discriminant (Id : E; V : E) is
3596 pragma Assert (Ekind (Id) = E_Discriminant);
3598 end Set_Corresponding_Discriminant;
3600 procedure Set_Corresponding_Equality (Id : E; V : E) is
3603 (Ekind (Id) = E_Function
3604 and then not Comes_From_Source (Id)
3605 and then Chars (Id) = Name_Op_Ne);
3607 end Set_Corresponding_Equality;
3609 procedure Set_Corresponding_Protected_Entry (Id : E; V : E) is
3611 pragma Assert (Ekind_In (Id, E_Void, E_Subprogram_Body));
3613 end Set_Corresponding_Protected_Entry;
3615 procedure Set_Corresponding_Record_Type (Id : E; V : E) is
3617 pragma Assert (Is_Concurrent_Type (Id));
3619 end Set_Corresponding_Record_Type;
3621 procedure Set_Corresponding_Remote_Type (Id : E; V : E) is
3624 end Set_Corresponding_Remote_Type;
3626 procedure Set_Current_Use_Clause (Id : E; V : E) is
3628 pragma Assert (Ekind (Id) = E_Package or else Is_Type (Id));
3630 end Set_Current_Use_Clause;
3632 procedure Set_Current_Value (Id : E; V : N) is
3634 pragma Assert (Ekind (Id) in Object_Kind or else Ekind (Id) = E_Void);
3636 end Set_Current_Value;
3638 procedure Set_CR_Discriminant (Id : E; V : E) is
3641 end Set_CR_Discriminant;
3643 procedure Set_Debug_Info_Off (Id : E; V : B := True) is
3645 Set_Flag166 (Id, V);
3646 end Set_Debug_Info_Off;
3648 procedure Set_Debug_Renaming_Link (Id : E; V : E) is
3651 end Set_Debug_Renaming_Link;
3653 procedure Set_Default_Aspect_Component_Value (Id : E; V : E) is
3655 pragma Assert (Is_Array_Type (Id) and then Is_Base_Type (Id));
3657 end Set_Default_Aspect_Component_Value;
3659 procedure Set_Default_Aspect_Value (Id : E; V : E) is
3661 pragma Assert (Is_Scalar_Type (Id) and then Is_Base_Type (Id));
3663 end Set_Default_Aspect_Value;
3665 procedure Set_Default_Expr_Function (Id : E; V : E) is
3667 pragma Assert (Is_Formal (Id));
3669 end Set_Default_Expr_Function;
3671 procedure Set_Default_Expressions_Processed (Id : E; V : B := True) is
3673 Set_Flag108 (Id, V);
3674 end Set_Default_Expressions_Processed;
3676 procedure Set_Default_Value (Id : E; V : N) is
3678 pragma Assert (Is_Formal (Id));
3680 end Set_Default_Value;
3682 procedure Set_Delay_Cleanups (Id : E; V : B := True) is
3686 or else Is_Task_Type (Id)
3687 or else Ekind (Id) = E_Block);
3688 Set_Flag114 (Id, V);
3689 end Set_Delay_Cleanups;
3691 procedure Set_Delay_Subprogram_Descriptors (Id : E; V : B := True) is
3694 (Is_Subprogram (Id) or else Ekind_In (Id, E_Package, E_Package_Body));
3697 end Set_Delay_Subprogram_Descriptors;
3699 procedure Set_Delta_Value (Id : E; V : R) is
3701 pragma Assert (Is_Fixed_Point_Type (Id));
3702 Set_Ureal18 (Id, V);
3703 end Set_Delta_Value;
3705 procedure Set_Dependent_Instances (Id : E; V : L) is
3707 pragma Assert (Is_Generic_Instance (Id));
3709 end Set_Dependent_Instances;
3711 procedure Set_Depends_On_Private (Id : E; V : B := True) is
3713 pragma Assert (Nkind (Id) in N_Entity);
3715 end Set_Depends_On_Private;
3717 procedure Set_Derived_Type_Link (Id : E; V : E) is
3719 pragma Assert (Is_Type (Id) and then Is_Base_Type (Id));
3721 end Set_Derived_Type_Link;
3723 procedure Set_Digits_Value (Id : E; V : U) is
3726 (Is_Floating_Point_Type (Id)
3727 or else Is_Decimal_Fixed_Point_Type (Id));
3729 end Set_Digits_Value;
3731 procedure Set_Directly_Designated_Type (Id : E; V : E) is
3734 end Set_Directly_Designated_Type;
3736 procedure Set_Discard_Names (Id : E; V : B := True) is
3739 end Set_Discard_Names;
3741 procedure Set_Discriminal (Id : E; V : E) is
3743 pragma Assert (Ekind (Id) = E_Discriminant);
3745 end Set_Discriminal;
3747 procedure Set_Discriminal_Link (Id : E; V : E) is
3750 end Set_Discriminal_Link;
3752 procedure Set_Discriminant_Checking_Func (Id : E; V : E) is
3754 pragma Assert (Ekind (Id) = E_Component);
3756 end Set_Discriminant_Checking_Func;
3758 procedure Set_Discriminant_Constraint (Id : E; V : L) is
3760 pragma Assert (Nkind (Id) in N_Entity);
3761 Set_Elist21 (Id, V);
3762 end Set_Discriminant_Constraint;
3764 procedure Set_Discriminant_Default_Value (Id : E; V : N) is
3767 end Set_Discriminant_Default_Value;
3769 procedure Set_Discriminant_Number (Id : E; V : U) is
3772 end Set_Discriminant_Number;
3774 procedure Set_Dispatch_Table_Wrappers (Id : E; V : L) is
3776 pragma Assert (Ekind (Id) = E_Record_Type
3777 and then Id = Implementation_Base_Type (Id));
3778 pragma Assert (V = No_Elist or else Is_Tagged_Type (Id));
3779 Set_Elist26 (Id, V);
3780 end Set_Dispatch_Table_Wrappers;
3782 procedure Set_DT_Entry_Count (Id : E; V : U) is
3784 pragma Assert (Ekind (Id) = E_Component);
3786 end Set_DT_Entry_Count;
3788 procedure Set_DT_Offset_To_Top_Func (Id : E; V : E) is
3790 pragma Assert (Ekind (Id) = E_Component and then Is_Tag (Id));
3792 end Set_DT_Offset_To_Top_Func;
3794 procedure Set_DT_Position (Id : E; V : U) is
3796 pragma Assert (Ekind_In (Id, E_Function, E_Procedure));
3798 end Set_DT_Position;
3800 procedure Set_DTC_Entity (Id : E; V : E) is
3802 pragma Assert (Ekind_In (Id, E_Function, E_Procedure));
3806 procedure Set_Elaborate_Body_Desirable (Id : E; V : B := True) is
3808 pragma Assert (Ekind (Id) = E_Package);
3809 Set_Flag210 (Id, V);
3810 end Set_Elaborate_Body_Desirable;
3812 procedure Set_Elaboration_Entity (Id : E; V : E) is
3817 Ekind (Id) = E_Package
3819 Is_Generic_Unit (Id));
3821 end Set_Elaboration_Entity;
3823 procedure Set_Elaboration_Entity_Required (Id : E; V : B := True) is
3828 Ekind (Id) = E_Package
3830 Is_Generic_Unit (Id));
3831 Set_Flag174 (Id, V);
3832 end Set_Elaboration_Entity_Required;
3834 procedure Set_Encapsulating_State (Id : E; V : E) is
3836 pragma Assert (Ekind_In (Id, E_Abstract_State, E_Variable));
3838 end Set_Encapsulating_State;
3840 procedure Set_Enclosing_Scope (Id : E; V : E) is
3843 end Set_Enclosing_Scope;
3845 procedure Set_Entry_Accepted (Id : E; V : B := True) is
3847 pragma Assert (Is_Entry (Id));
3848 Set_Flag152 (Id, V);
3849 end Set_Entry_Accepted;
3851 procedure Set_Entry_Bodies_Array (Id : E; V : E) is
3854 end Set_Entry_Bodies_Array;
3856 procedure Set_Entry_Cancel_Parameter (Id : E; V : E) is
3859 end Set_Entry_Cancel_Parameter;
3861 procedure Set_Entry_Component (Id : E; V : E) is
3864 end Set_Entry_Component;
3866 procedure Set_Entry_Formal (Id : E; V : E) is
3869 end Set_Entry_Formal;
3871 procedure Set_Entry_Index_Constant (Id : E; V : E) is
3873 pragma Assert (Ekind (Id) = E_Entry_Index_Parameter);
3875 end Set_Entry_Index_Constant;
3877 procedure Set_Entry_Parameters_Type (Id : E; V : E) is
3880 end Set_Entry_Parameters_Type;
3882 procedure Set_Enum_Pos_To_Rep (Id : E; V : E) is
3884 pragma Assert (Ekind (Id) = E_Enumeration_Type);
3886 end Set_Enum_Pos_To_Rep;
3888 procedure Set_Enumeration_Pos (Id : E; V : U) is
3890 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
3892 end Set_Enumeration_Pos;
3894 procedure Set_Enumeration_Rep (Id : E; V : U) is
3896 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
3898 end Set_Enumeration_Rep;
3900 procedure Set_Enumeration_Rep_Expr (Id : E; V : N) is
3902 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
3904 end Set_Enumeration_Rep_Expr;
3906 procedure Set_Equivalent_Type (Id : E; V : E) is
3909 (Ekind_In (Id, E_Class_Wide_Type,
3910 E_Class_Wide_Subtype,
3911 E_Access_Protected_Subprogram_Type,
3912 E_Anonymous_Access_Protected_Subprogram_Type,
3913 E_Access_Subprogram_Type,
3916 end Set_Equivalent_Type;
3918 procedure Set_Esize (Id : E; V : U) is
3923 procedure Set_Extra_Accessibility (Id : E; V : E) is
3926 (Is_Formal (Id) or else Ekind_In (Id, E_Variable, E_Constant));
3928 end Set_Extra_Accessibility;
3930 procedure Set_Extra_Accessibility_Of_Result (Id : E; V : E) is
3932 pragma Assert (Ekind_In (Id, E_Function, E_Operator, E_Subprogram_Type));
3934 end Set_Extra_Accessibility_Of_Result;
3936 procedure Set_Extra_Constrained (Id : E; V : E) is
3938 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
3940 end Set_Extra_Constrained;
3942 procedure Set_Extra_Formal (Id : E; V : E) is
3945 end Set_Extra_Formal;
3947 procedure Set_Extra_Formals (Id : E; V : E) is
3950 (Is_Overloadable (Id)
3951 or else Ekind_In (Id, E_Entry_Family,
3953 E_Subprogram_Type));
3955 end Set_Extra_Formals;
3957 procedure Set_Finalization_Master (Id : E; V : E) is
3959 pragma Assert (Is_Access_Type (Id) and then Is_Base_Type (Id));
3961 end Set_Finalization_Master;
3963 procedure Set_Finalize_Storage_Only (Id : E; V : B := True) is
3965 pragma Assert (Is_Type (Id) and then Is_Base_Type (Id));
3966 Set_Flag158 (Id, V);
3967 end Set_Finalize_Storage_Only;
3969 procedure Set_Finalizer (Id : E; V : E) is
3971 pragma Assert (Ekind_In (Id, E_Package, E_Package_Body));
3975 procedure Set_First_Entity (Id : E; V : E) is
3978 end Set_First_Entity;
3980 procedure Set_First_Exit_Statement (Id : E; V : N) is
3982 pragma Assert (Ekind (Id) = E_Loop);
3984 end Set_First_Exit_Statement;
3986 procedure Set_First_Index (Id : E; V : N) is
3988 pragma Assert (Is_Array_Type (Id) or else Is_String_Type (Id));
3990 end Set_First_Index;
3992 procedure Set_First_Literal (Id : E; V : E) is
3994 pragma Assert (Is_Enumeration_Type (Id));
3996 end Set_First_Literal;
3998 procedure Set_First_Private_Entity (Id : E; V : E) is
4000 pragma Assert (Ekind_In (Id, E_Package, E_Generic_Package)
4001 or else Ekind (Id) in Concurrent_Kind);
4003 end Set_First_Private_Entity;
4005 procedure Set_First_Rep_Item (Id : E; V : N) is
4008 end Set_First_Rep_Item;
4010 procedure Set_Float_Rep (Id : E; V : F) is
4011 pragma Assert (Ekind (Id) = E_Floating_Point_Type);
4013 Set_Uint10 (Id, UI_From_Int (F'Pos (V)));
4016 procedure Set_Freeze_Node (Id : E; V : N) is
4019 end Set_Freeze_Node;
4021 procedure Set_From_Limited_With (Id : E; V : B := True) is
4024 (Is_Type (Id) or else Ekind_In (Id, E_Abstract_State, E_Package));
4025 Set_Flag159 (Id, V);
4026 end Set_From_Limited_With;
4028 procedure Set_Full_View (Id : E; V : E) is
4030 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Constant);
4034 procedure Set_Generic_Homonym (Id : E; V : E) is
4037 end Set_Generic_Homonym;
4039 procedure Set_Generic_Renamings (Id : E; V : L) is
4041 Set_Elist23 (Id, V);
4042 end Set_Generic_Renamings;
4044 procedure Set_Handler_Records (Id : E; V : S) is
4047 end Set_Handler_Records;
4049 procedure Set_Has_Aliased_Components (Id : E; V : B := True) is
4051 pragma Assert (Id = Base_Type (Id));
4052 Set_Flag135 (Id, V);
4053 end Set_Has_Aliased_Components;
4055 procedure Set_Has_Alignment_Clause (Id : E; V : B := True) is
4058 end Set_Has_Alignment_Clause;
4060 procedure Set_Has_All_Calls_Remote (Id : E; V : B := True) is
4063 end Set_Has_All_Calls_Remote;
4065 procedure Set_Has_Anonymous_Master (Id : E; V : B := True) is
4068 (Ekind_In (Id, E_Function, E_Package, E_Package_Body, E_Procedure));
4069 Set_Flag253 (Id, V);
4070 end Set_Has_Anonymous_Master;
4072 procedure Set_Has_Atomic_Components (Id : E; V : B := True) is
4074 pragma Assert (not Is_Type (Id) or else Is_Base_Type (Id));
4076 end Set_Has_Atomic_Components;
4078 procedure Set_Has_Biased_Representation (Id : E; V : B := True) is
4081 ((V = False) or else (Is_Discrete_Type (Id) or else Is_Object (Id)));
4082 Set_Flag139 (Id, V);
4083 end Set_Has_Biased_Representation;
4085 procedure Set_Has_Completion (Id : E; V : B := True) is
4088 end Set_Has_Completion;
4090 procedure Set_Has_Completion_In_Body (Id : E; V : B := True) is
4092 pragma Assert (Is_Type (Id));
4094 end Set_Has_Completion_In_Body;
4096 procedure Set_Has_Complex_Representation (Id : E; V : B := True) is
4098 pragma Assert (Ekind (Id) = E_Record_Type);
4099 Set_Flag140 (Id, V);
4100 end Set_Has_Complex_Representation;
4102 procedure Set_Has_Component_Size_Clause (Id : E; V : B := True) is
4104 pragma Assert (Ekind (Id) = E_Array_Type);
4106 end Set_Has_Component_Size_Clause;
4108 procedure Set_Has_Constrained_Partial_View (Id : E; V : B := True) is
4110 pragma Assert (Is_Type (Id));
4111 Set_Flag187 (Id, V);
4112 end Set_Has_Constrained_Partial_View;
4114 procedure Set_Has_Contiguous_Rep (Id : E; V : B := True) is
4116 Set_Flag181 (Id, V);
4117 end Set_Has_Contiguous_Rep;
4119 procedure Set_Has_Controlled_Component (Id : E; V : B := True) is
4121 pragma Assert (Id = Base_Type (Id));
4123 end Set_Has_Controlled_Component;
4125 procedure Set_Has_Controlling_Result (Id : E; V : B := True) is
4128 end Set_Has_Controlling_Result;
4130 procedure Set_Has_Convention_Pragma (Id : E; V : B := True) is
4132 Set_Flag119 (Id, V);
4133 end Set_Has_Convention_Pragma;
4135 procedure Set_Has_Default_Aspect (Id : E; V : B := True) is
4138 ((Is_Scalar_Type (Id) or else Is_Array_Type (Id))
4139 and then Is_Base_Type (Id));
4141 end Set_Has_Default_Aspect;
4143 procedure Set_Has_Delayed_Aspects (Id : E; V : B := True) is
4145 pragma Assert (Nkind (Id) in N_Entity);
4146 Set_Flag200 (Id, V);
4147 end Set_Has_Delayed_Aspects;
4149 procedure Set_Has_Delayed_Freeze (Id : E; V : B := True) is
4151 pragma Assert (Nkind (Id) in N_Entity);
4153 end Set_Has_Delayed_Freeze;
4155 procedure Set_Has_Delayed_Rep_Aspects (Id : E; V : B := True) is
4157 pragma Assert (Nkind (Id) in N_Entity);
4158 Set_Flag261 (Id, V);
4159 end Set_Has_Delayed_Rep_Aspects;
4161 procedure Set_Has_Discriminants (Id : E; V : B := True) is
4163 pragma Assert (Nkind (Id) in N_Entity);
4165 end Set_Has_Discriminants;
4167 procedure Set_Has_Dispatch_Table (Id : E; V : B := True) is
4169 pragma Assert (Ekind (Id) = E_Record_Type
4170 and then Is_Tagged_Type (Id));
4171 Set_Flag220 (Id, V);
4172 end Set_Has_Dispatch_Table;
4174 procedure Set_Has_Dynamic_Predicate_Aspect (Id : E; V : B := True) is
4176 pragma Assert (Is_Type (Id));
4177 Set_Flag258 (Id, V);
4178 end Set_Has_Dynamic_Predicate_Aspect;
4180 procedure Set_Has_Enumeration_Rep_Clause (Id : E; V : B := True) is
4182 pragma Assert (Is_Enumeration_Type (Id));
4184 end Set_Has_Enumeration_Rep_Clause;
4186 procedure Set_Has_Exit (Id : E; V : B := True) is
4191 procedure Set_Has_Forward_Instantiation (Id : E; V : B := True) is
4193 Set_Flag175 (Id, V);
4194 end Set_Has_Forward_Instantiation;
4196 procedure Set_Has_Fully_Qualified_Name (Id : E; V : B := True) is
4198 Set_Flag173 (Id, V);
4199 end Set_Has_Fully_Qualified_Name;
4201 procedure Set_Has_Gigi_Rep_Item (Id : E; V : B := True) is
4204 end Set_Has_Gigi_Rep_Item;
4206 procedure Set_Has_Homonym (Id : E; V : B := True) is
4209 end Set_Has_Homonym;
4211 procedure Set_Has_Implicit_Dereference (Id : E; V : B := True) is
4213 Set_Flag251 (Id, V);
4214 end Set_Has_Implicit_Dereference;
4216 procedure Set_Has_Independent_Components (Id : E; V : B := True) is
4218 pragma Assert ((Is_Array_Type (Id) or else Is_Record_Type (Id))
4219 and then Is_Base_Type (Id));
4221 end Set_Has_Independent_Components;
4223 procedure Set_Has_Inheritable_Invariants (Id : E; V : B := True) is
4225 pragma Assert (Is_Type (Id));
4226 Set_Flag248 (Id, V);
4227 end Set_Has_Inheritable_Invariants;
4229 procedure Set_Has_Initial_Value (Id : E; V : B := True) is
4231 pragma Assert (Ekind_In (Id, E_Variable, E_Out_Parameter));
4232 Set_Flag219 (Id, V);
4233 end Set_Has_Initial_Value;
4235 procedure Set_Has_Invariants (Id : E; V : B := True) is
4237 pragma Assert (Is_Type (Id));
4238 Set_Flag232 (Id, V);
4239 end Set_Has_Invariants;
4241 procedure Set_Has_Loop_Entry_Attributes (Id : E; V : B := True) is
4243 pragma Assert (Ekind (Id) = E_Loop);
4244 Set_Flag260 (Id, V);
4245 end Set_Has_Loop_Entry_Attributes;
4247 procedure Set_Has_Machine_Radix_Clause (Id : E; V : B := True) is
4249 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
4251 end Set_Has_Machine_Radix_Clause;
4253 procedure Set_Has_Master_Entity (Id : E; V : B := True) is
4256 end Set_Has_Master_Entity;
4258 procedure Set_Has_Missing_Return (Id : E; V : B := True) is
4260 pragma Assert (Ekind_In (Id, E_Function, E_Generic_Function));
4261 Set_Flag142 (Id, V);
4262 end Set_Has_Missing_Return;
4264 procedure Set_Has_Nested_Block_With_Handler (Id : E; V : B := True) is
4266 Set_Flag101 (Id, V);
4267 end Set_Has_Nested_Block_With_Handler;
4269 procedure Set_Has_Up_Level_Access (Id : E; V : B := True) is
4271 pragma Assert (Ekind_In (Id, E_Variable, E_Constant, E_Loop_Parameter));
4272 Set_Flag215 (Id, V);
4273 end Set_Has_Up_Level_Access;
4275 procedure Set_Has_Non_Standard_Rep (Id : E; V : B := True) is
4277 pragma Assert (Id = Base_Type (Id));
4279 end Set_Has_Non_Standard_Rep;
4281 procedure Set_Has_Object_Size_Clause (Id : E; V : B := True) is
4283 pragma Assert (Is_Type (Id));
4284 Set_Flag172 (Id, V);
4285 end Set_Has_Object_Size_Clause;
4287 procedure Set_Has_Out_Or_In_Out_Parameter (Id : E; V : B := True) is
4289 pragma Assert (Ekind_In (Id, E_Function, E_Generic_Function));
4290 Set_Flag110 (Id, V);
4291 end Set_Has_Out_Or_In_Out_Parameter;
4293 procedure Set_Has_Per_Object_Constraint (Id : E; V : B := True) is
4295 Set_Flag154 (Id, V);
4296 end Set_Has_Per_Object_Constraint;
4298 procedure Set_Has_Postconditions (Id : E; V : B := True) is
4300 pragma Assert (Is_Subprogram (Id));
4301 Set_Flag240 (Id, V);
4302 end Set_Has_Postconditions;
4304 procedure Set_Has_Pragma_Controlled (Id : E; V : B := True) is
4306 pragma Assert (Is_Access_Type (Id));
4307 Set_Flag27 (Base_Type (Id), V);
4308 end Set_Has_Pragma_Controlled;
4310 procedure Set_Has_Pragma_Elaborate_Body (Id : E; V : B := True) is
4312 Set_Flag150 (Id, V);
4313 end Set_Has_Pragma_Elaborate_Body;
4315 procedure Set_Has_Pragma_Inline (Id : E; V : B := True) is
4317 Set_Flag157 (Id, V);
4318 end Set_Has_Pragma_Inline;
4320 procedure Set_Has_Pragma_Inline_Always (Id : E; V : B := True) is
4322 Set_Flag230 (Id, V);
4323 end Set_Has_Pragma_Inline_Always;
4325 procedure Set_Has_Pragma_No_Inline (Id : E; V : B := True) is
4327 Set_Flag201 (Id, V);
4328 end Set_Has_Pragma_No_Inline;
4330 procedure Set_Has_Pragma_Ordered (Id : E; V : B := True) is
4332 pragma Assert (Is_Enumeration_Type (Id));
4333 pragma Assert (Id = Base_Type (Id));
4334 Set_Flag198 (Id, V);
4335 end Set_Has_Pragma_Ordered;
4337 procedure Set_Has_Pragma_Pack (Id : E; V : B := True) is
4339 pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id));
4340 pragma Assert (Id = Base_Type (Id));
4341 Set_Flag121 (Id, V);
4342 end Set_Has_Pragma_Pack;
4344 procedure Set_Has_Pragma_Preelab_Init (Id : E; V : B := True) is
4346 Set_Flag221 (Id, V);
4347 end Set_Has_Pragma_Preelab_Init;
4349 procedure Set_Has_Pragma_Pure (Id : E; V : B := True) is
4351 Set_Flag203 (Id, V);
4352 end Set_Has_Pragma_Pure;
4354 procedure Set_Has_Pragma_Pure_Function (Id : E; V : B := True) is
4356 Set_Flag179 (Id, V);
4357 end Set_Has_Pragma_Pure_Function;
4359 procedure Set_Has_Pragma_Thread_Local_Storage (Id : E; V : B := True) is
4361 Set_Flag169 (Id, V);
4362 end Set_Has_Pragma_Thread_Local_Storage;
4364 procedure Set_Has_Pragma_Unmodified (Id : E; V : B := True) is
4366 Set_Flag233 (Id, V);
4367 end Set_Has_Pragma_Unmodified;
4369 procedure Set_Has_Pragma_Unreferenced (Id : E; V : B := True) is
4371 Set_Flag180 (Id, V);
4372 end Set_Has_Pragma_Unreferenced;
4374 procedure Set_Has_Pragma_Unreferenced_Objects (Id : E; V : B := True) is
4376 pragma Assert (Is_Type (Id));
4377 Set_Flag212 (Id, V);
4378 end Set_Has_Pragma_Unreferenced_Objects;
4380 procedure Set_Has_Predicates (Id : E; V : B := True) is
4382 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Void);
4383 Set_Flag250 (Id, V);
4384 end Set_Has_Predicates;
4386 procedure Set_Has_Primitive_Operations (Id : E; V : B := True) is
4388 pragma Assert (Id = Base_Type (Id));
4389 Set_Flag120 (Id, V);
4390 end Set_Has_Primitive_Operations;
4392 procedure Set_Has_Private_Ancestor (Id : E; V : B := True) is
4394 pragma Assert (Is_Type (Id));
4395 Set_Flag151 (Id, V);
4396 end Set_Has_Private_Ancestor;
4398 procedure Set_Has_Private_Declaration (Id : E; V : B := True) is
4400 Set_Flag155 (Id, V);
4401 end Set_Has_Private_Declaration;
4403 procedure Set_Has_Protected (Id : E; V : B := True) is
4405 Set_Flag271 (Id, V);
4406 end Set_Has_Protected;
4408 procedure Set_Has_Qualified_Name (Id : E; V : B := True) is
4410 Set_Flag161 (Id, V);
4411 end Set_Has_Qualified_Name;
4413 procedure Set_Has_RACW (Id : E; V : B := True) is
4415 pragma Assert (Ekind (Id) = E_Package);
4416 Set_Flag214 (Id, V);
4419 procedure Set_Has_Record_Rep_Clause (Id : E; V : B := True) is
4421 pragma Assert (Id = Base_Type (Id));
4423 end Set_Has_Record_Rep_Clause;
4425 procedure Set_Has_Recursive_Call (Id : E; V : B := True) is
4427 pragma Assert (Is_Subprogram (Id));
4428 Set_Flag143 (Id, V);
4429 end Set_Has_Recursive_Call;
4431 procedure Set_Has_Shift_Operator (Id : E; V : B := True) is
4433 pragma Assert (Is_Integer_Type (Id) and then Is_Base_Type (Id));
4434 Set_Flag267 (Id, V);
4435 end Set_Has_Shift_Operator;
4437 procedure Set_Has_Size_Clause (Id : E; V : B := True) is
4440 end Set_Has_Size_Clause;
4442 procedure Set_Has_Small_Clause (Id : E; V : B := True) is
4445 end Set_Has_Small_Clause;
4447 procedure Set_Has_Specified_Layout (Id : E; V : B := True) is
4449 pragma Assert (Id = Base_Type (Id));
4450 Set_Flag100 (Id, V);
4451 end Set_Has_Specified_Layout;
4453 procedure Set_Has_Specified_Stream_Input (Id : E; V : B := True) is
4455 pragma Assert (Is_Type (Id));
4456 Set_Flag190 (Id, V);
4457 end Set_Has_Specified_Stream_Input;
4459 procedure Set_Has_Specified_Stream_Output (Id : E; V : B := True) is
4461 pragma Assert (Is_Type (Id));
4462 Set_Flag191 (Id, V);
4463 end Set_Has_Specified_Stream_Output;
4465 procedure Set_Has_Specified_Stream_Read (Id : E; V : B := True) is
4467 pragma Assert (Is_Type (Id));
4468 Set_Flag192 (Id, V);
4469 end Set_Has_Specified_Stream_Read;
4471 procedure Set_Has_Specified_Stream_Write (Id : E; V : B := True) is
4473 pragma Assert (Is_Type (Id));
4474 Set_Flag193 (Id, V);
4475 end Set_Has_Specified_Stream_Write;
4477 procedure Set_Has_Static_Discriminants (Id : E; V : B := True) is
4479 Set_Flag211 (Id, V);
4480 end Set_Has_Static_Discriminants;
4482 procedure Set_Has_Static_Predicate (Id : E; V : B := True) is
4484 pragma Assert (Is_Type (Id));
4485 Set_Flag269 (Id, V);
4486 end Set_Has_Static_Predicate;
4488 procedure Set_Has_Static_Predicate_Aspect (Id : E; V : B := True) is
4490 pragma Assert (Is_Type (Id));
4491 Set_Flag259 (Id, V);
4492 end Set_Has_Static_Predicate_Aspect;
4494 procedure Set_Has_Storage_Size_Clause (Id : E; V : B := True) is
4496 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
4497 pragma Assert (Id = Base_Type (Id));
4499 end Set_Has_Storage_Size_Clause;
4501 procedure Set_Has_Stream_Size_Clause (Id : E; V : B := True) is
4503 pragma Assert (Is_Elementary_Type (Id));
4504 Set_Flag184 (Id, V);
4505 end Set_Has_Stream_Size_Clause;
4507 procedure Set_Has_Task (Id : E; V : B := True) is
4509 pragma Assert (Id = Base_Type (Id));
4513 procedure Set_Has_Thunks (Id : E; V : B := True) is
4515 pragma Assert (Is_Tag (Id));
4516 Set_Flag228 (Id, V);
4519 procedure Set_Has_Unchecked_Union (Id : E; V : B := True) is
4521 pragma Assert (Id = Base_Type (Id));
4522 Set_Flag123 (Id, V);
4523 end Set_Has_Unchecked_Union;
4525 procedure Set_Has_Unknown_Discriminants (Id : E; V : B := True) is
4527 pragma Assert (Is_Type (Id));
4529 end Set_Has_Unknown_Discriminants;
4531 procedure Set_Has_Visible_Refinement (Id : E; V : B := True) is
4533 pragma Assert (Ekind (Id) = E_Abstract_State);
4534 Set_Flag263 (Id, V);
4535 end Set_Has_Visible_Refinement;
4537 procedure Set_Has_Volatile_Components (Id : E; V : B := True) is
4539 pragma Assert (not Is_Type (Id) or else Is_Base_Type (Id));
4541 end Set_Has_Volatile_Components;
4543 procedure Set_Has_Xref_Entry (Id : E; V : B := True) is
4545 Set_Flag182 (Id, V);
4546 end Set_Has_Xref_Entry;
4548 procedure Set_Hiding_Loop_Variable (Id : E; V : E) is
4550 pragma Assert (Ekind (Id) = E_Variable);
4552 end Set_Hiding_Loop_Variable;
4554 procedure Set_Homonym (Id : E; V : E) is
4556 pragma Assert (Id /= V);
4560 procedure Set_Import_Pragma (Id : E; V : E) is
4562 pragma Assert (Is_Subprogram (Id));
4564 end Set_Import_Pragma;
4566 procedure Set_Interface_Alias (Id : E; V : E) is
4570 and then Is_Hidden (Id)
4571 and then (Ekind_In (Id, E_Procedure, E_Function)));
4573 end Set_Interface_Alias;
4575 procedure Set_Interfaces (Id : E; V : L) is
4577 pragma Assert (Is_Record_Type (Id));
4578 Set_Elist25 (Id, V);
4581 procedure Set_In_Package_Body (Id : E; V : B := True) is
4584 end Set_In_Package_Body;
4586 procedure Set_In_Private_Part (Id : E; V : B := True) is
4589 end Set_In_Private_Part;
4591 procedure Set_In_Use (Id : E; V : B := True) is
4593 pragma Assert (Nkind (Id) in N_Entity);
4597 procedure Set_Initialization_Statements (Id : E; V : N) is
4599 -- Tolerate an E_Void entity since this can be called while resolving
4600 -- an aggregate used as the initialization expression for an object
4601 -- declaration, and this occurs before the Ekind for the object is set.
4603 pragma Assert (Ekind_In (Id, E_Void, E_Constant, E_Variable));
4605 end Set_Initialization_Statements;
4607 procedure Set_Inner_Instances (Id : E; V : L) is
4609 Set_Elist23 (Id, V);
4610 end Set_Inner_Instances;
4612 procedure Set_Interface_Name (Id : E; V : N) is
4615 end Set_Interface_Name;
4617 procedure Set_Is_Abstract_Subprogram (Id : E; V : B := True) is
4619 pragma Assert (Is_Overloadable (Id));
4621 end Set_Is_Abstract_Subprogram;
4623 procedure Set_Is_Abstract_Type (Id : E; V : B := True) is
4625 pragma Assert (Is_Type (Id));
4626 Set_Flag146 (Id, V);
4627 end Set_Is_Abstract_Type;
4629 procedure Set_Is_Local_Anonymous_Access (Id : E; V : B := True) is
4631 pragma Assert (Is_Access_Type (Id));
4632 Set_Flag194 (Id, V);
4633 end Set_Is_Local_Anonymous_Access;
4635 procedure Set_Is_Access_Constant (Id : E; V : B := True) is
4637 pragma Assert (Is_Access_Type (Id));
4639 end Set_Is_Access_Constant;
4641 procedure Set_Is_Ada_2005_Only (Id : E; V : B := True) is
4643 Set_Flag185 (Id, V);
4644 end Set_Is_Ada_2005_Only;
4646 procedure Set_Is_Ada_2012_Only (Id : E; V : B := True) is
4648 Set_Flag199 (Id, V);
4649 end Set_Is_Ada_2012_Only;
4651 procedure Set_Is_Aliased (Id : E; V : B := True) is
4653 pragma Assert (Nkind (Id) in N_Entity);
4657 procedure Set_Is_Asynchronous (Id : E; V : B := True) is
4660 (Ekind (Id) = E_Procedure or else Is_Type (Id));
4662 end Set_Is_Asynchronous;
4664 procedure Set_Is_Atomic (Id : E; V : B := True) is
4669 procedure Set_Is_Bit_Packed_Array (Id : E; V : B := True) is
4671 pragma Assert ((not V)
4672 or else (Is_Array_Type (Id) and then Is_Base_Type (Id)));
4673 Set_Flag122 (Id, V);
4674 end Set_Is_Bit_Packed_Array;
4676 procedure Set_Is_Called (Id : E; V : B := True) is
4678 pragma Assert (Ekind_In (Id, E_Procedure, E_Function));
4679 Set_Flag102 (Id, V);
4682 procedure Set_Is_Character_Type (Id : E; V : B := True) is
4685 end Set_Is_Character_Type;
4687 procedure Set_Is_Child_Unit (Id : E; V : B := True) is
4690 end Set_Is_Child_Unit;
4692 procedure Set_Is_Class_Wide_Equivalent_Type (Id : E; V : B := True) is
4695 end Set_Is_Class_Wide_Equivalent_Type;
4697 procedure Set_Is_Compilation_Unit (Id : E; V : B := True) is
4699 Set_Flag149 (Id, V);
4700 end Set_Is_Compilation_Unit;
4702 procedure Set_Is_Completely_Hidden (Id : E; V : B := True) is
4704 pragma Assert (Ekind (Id) = E_Discriminant);
4705 Set_Flag103 (Id, V);
4706 end Set_Is_Completely_Hidden;
4708 procedure Set_Is_Concurrent_Record_Type (Id : E; V : B := True) is
4711 end Set_Is_Concurrent_Record_Type;
4713 procedure Set_Is_Constr_Subt_For_U_Nominal (Id : E; V : B := True) is
4716 end Set_Is_Constr_Subt_For_U_Nominal;
4718 procedure Set_Is_Constr_Subt_For_UN_Aliased (Id : E; V : B := True) is
4720 Set_Flag141 (Id, V);
4721 end Set_Is_Constr_Subt_For_UN_Aliased;
4723 procedure Set_Is_Constrained (Id : E; V : B := True) is
4725 pragma Assert (Nkind (Id) in N_Entity);
4727 end Set_Is_Constrained;
4729 procedure Set_Is_Constructor (Id : E; V : B := True) is
4732 end Set_Is_Constructor;
4734 procedure Set_Is_Controlled (Id : E; V : B := True) is
4736 pragma Assert (Id = Base_Type (Id));
4738 end Set_Is_Controlled;
4740 procedure Set_Is_Controlling_Formal (Id : E; V : B := True) is
4742 pragma Assert (Is_Formal (Id));
4744 end Set_Is_Controlling_Formal;
4746 procedure Set_Is_CPP_Class (Id : E; V : B := True) is
4749 end Set_Is_CPP_Class;
4751 procedure Set_Is_Descendent_Of_Address (Id : E; V : B := True) is
4753 pragma Assert (Is_Type (Id));
4754 Set_Flag223 (Id, V);
4755 end Set_Is_Descendent_Of_Address;
4757 procedure Set_Is_Discrim_SO_Function (Id : E; V : B := True) is
4759 Set_Flag176 (Id, V);
4760 end Set_Is_Discrim_SO_Function;
4762 procedure Set_Is_Discriminant_Check_Function (Id : E; V : B := True) is
4764 Set_Flag264 (Id, V);
4765 end Set_Is_Discriminant_Check_Function;
4767 procedure Set_Is_Dispatch_Table_Entity (Id : E; V : B := True) is
4769 Set_Flag234 (Id, V);
4770 end Set_Is_Dispatch_Table_Entity;
4772 procedure Set_Is_Dispatching_Operation (Id : E; V : B := True) is
4777 Is_Overloadable (Id)
4779 Ekind (Id) = E_Subprogram_Type);
4782 end Set_Is_Dispatching_Operation;
4784 procedure Set_Is_Eliminated (Id : E; V : B := True) is
4786 Set_Flag124 (Id, V);
4787 end Set_Is_Eliminated;
4789 procedure Set_Is_Entry_Formal (Id : E; V : B := True) is
4792 end Set_Is_Entry_Formal;
4794 procedure Set_Is_Exported (Id : E; V : B := True) is
4797 end Set_Is_Exported;
4799 procedure Set_Is_First_Subtype (Id : E; V : B := True) is
4802 end Set_Is_First_Subtype;
4804 procedure Set_Is_For_Access_Subtype (Id : E; V : B := True) is
4806 pragma Assert (Ekind_In (Id, E_Record_Subtype, E_Private_Subtype));
4807 Set_Flag118 (Id, V);
4808 end Set_Is_For_Access_Subtype;
4810 procedure Set_Is_Formal_Subprogram (Id : E; V : B := True) is
4812 Set_Flag111 (Id, V);
4813 end Set_Is_Formal_Subprogram;
4815 procedure Set_Is_Frozen (Id : E; V : B := True) is
4817 pragma Assert (Nkind (Id) in N_Entity);
4821 procedure Set_Is_Generic_Actual_Subprogram (Id : E; V : B := True) is
4823 pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
4824 Set_Flag274 (Id, V);
4825 end Set_Is_Generic_Actual_Subprogram;
4827 procedure Set_Is_Generic_Actual_Type (Id : E; V : B := True) is
4829 pragma Assert (Is_Type (Id));
4831 end Set_Is_Generic_Actual_Type;
4833 procedure Set_Is_Generic_Instance (Id : E; V : B := True) is
4835 Set_Flag130 (Id, V);
4836 end Set_Is_Generic_Instance;
4838 procedure Set_Is_Generic_Type (Id : E; V : B := True) is
4840 pragma Assert (Nkind (Id) in N_Entity);
4842 end Set_Is_Generic_Type;
4844 procedure Set_Is_Hidden (Id : E; V : B := True) is
4849 procedure Set_Is_Hidden_Non_Overridden_Subpgm (Id : E; V : B := True) is
4851 pragma Assert (Ekind_In (Id, E_Function, E_Procedure));
4853 end Set_Is_Hidden_Non_Overridden_Subpgm;
4855 procedure Set_Is_Hidden_Open_Scope (Id : E; V : B := True) is
4857 Set_Flag171 (Id, V);
4858 end Set_Is_Hidden_Open_Scope;
4860 procedure Set_Is_Immediately_Visible (Id : E; V : B := True) is
4862 pragma Assert (Nkind (Id) in N_Entity);
4864 end Set_Is_Immediately_Visible;
4866 procedure Set_Is_Implementation_Defined (Id : E; V : B := True) is
4868 Set_Flag254 (Id, V);
4869 end Set_Is_Implementation_Defined;
4871 procedure Set_Is_Imported (Id : E; V : B := True) is
4874 end Set_Is_Imported;
4876 procedure Set_Is_Independent (Id : E; V : B := True) is
4878 pragma Assert (Ekind_In (Id, E_Component, E_Void));
4879 Set_Flag268 (Id, V);
4880 end Set_Is_Independent;
4882 procedure Set_Is_Inlined (Id : E; V : B := True) is
4887 procedure Set_Is_Inlined_Always (Id : E; V : B := True) is
4889 pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
4891 end Set_Is_Inlined_Always;
4893 procedure Set_Is_Interface (Id : E; V : B := True) is
4895 pragma Assert (Is_Record_Type (Id));
4896 Set_Flag186 (Id, V);
4897 end Set_Is_Interface;
4899 procedure Set_Is_Instantiated (Id : E; V : B := True) is
4901 Set_Flag126 (Id, V);
4902 end Set_Is_Instantiated;
4904 procedure Set_Is_Internal (Id : E; V : B := True) is
4906 pragma Assert (Nkind (Id) in N_Entity);
4908 end Set_Is_Internal;
4910 procedure Set_Is_Interrupt_Handler (Id : E; V : B := True) is
4912 pragma Assert (Nkind (Id) in N_Entity);
4914 end Set_Is_Interrupt_Handler;
4916 procedure Set_Is_Intrinsic_Subprogram (Id : E; V : B := True) is
4919 end Set_Is_Intrinsic_Subprogram;
4921 procedure Set_Is_Invariant_Procedure (Id : E; V : B := True) is
4923 pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
4924 Set_Flag257 (Id, V);
4925 end Set_Is_Invariant_Procedure;
4927 procedure Set_Is_Itype (Id : E; V : B := True) is
4932 procedure Set_Is_Known_Non_Null (Id : E; V : B := True) is
4935 end Set_Is_Known_Non_Null;
4937 procedure Set_Is_Known_Null (Id : E; V : B := True) is
4939 Set_Flag204 (Id, V);
4940 end Set_Is_Known_Null;
4942 procedure Set_Is_Known_Valid (Id : E; V : B := True) is
4944 Set_Flag170 (Id, V);
4945 end Set_Is_Known_Valid;
4947 procedure Set_Is_Limited_Composite (Id : E; V : B := True) is
4949 pragma Assert (Is_Type (Id));
4950 Set_Flag106 (Id, V);
4951 end Set_Is_Limited_Composite;
4953 procedure Set_Is_Limited_Interface (Id : E; V : B := True) is
4955 pragma Assert (Is_Interface (Id));
4956 Set_Flag197 (Id, V);
4957 end Set_Is_Limited_Interface;
4959 procedure Set_Is_Limited_Record (Id : E; V : B := True) is
4962 end Set_Is_Limited_Record;
4964 procedure Set_Is_Machine_Code_Subprogram (Id : E; V : B := True) is
4966 pragma Assert (Is_Subprogram (Id));
4967 Set_Flag137 (Id, V);
4968 end Set_Is_Machine_Code_Subprogram;
4970 procedure Set_Is_Non_Static_Subtype (Id : E; V : B := True) is
4972 pragma Assert (Is_Type (Id));
4973 Set_Flag109 (Id, V);
4974 end Set_Is_Non_Static_Subtype;
4976 procedure Set_Is_Null_Init_Proc (Id : E; V : B := True) is
4978 pragma Assert (Ekind (Id) = E_Procedure);
4979 Set_Flag178 (Id, V);
4980 end Set_Is_Null_Init_Proc;
4982 procedure Set_Is_Obsolescent (Id : E; V : B := True) is
4984 Set_Flag153 (Id, V);
4985 end Set_Is_Obsolescent;
4987 procedure Set_Is_Only_Out_Parameter (Id : E; V : B := True) is
4989 pragma Assert (Ekind (Id) = E_Out_Parameter);
4990 Set_Flag226 (Id, V);
4991 end Set_Is_Only_Out_Parameter;
4993 procedure Set_Is_Package_Body_Entity (Id : E; V : B := True) is
4995 Set_Flag160 (Id, V);
4996 end Set_Is_Package_Body_Entity;
4998 procedure Set_Is_Packed (Id : E; V : B := True) is
5000 pragma Assert (Id = Base_Type (Id));
5004 procedure Set_Is_Packed_Array_Impl_Type (Id : E; V : B := True) is
5006 Set_Flag138 (Id, V);
5007 end Set_Is_Packed_Array_Impl_Type;
5009 procedure Set_Is_Potentially_Use_Visible (Id : E; V : B := True) is
5011 pragma Assert (Nkind (Id) in N_Entity);
5013 end Set_Is_Potentially_Use_Visible;
5015 procedure Set_Is_Predicate_Function (Id : E; V : B := True) is
5017 pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
5018 Set_Flag255 (Id, V);
5019 end Set_Is_Predicate_Function;
5021 procedure Set_Is_Predicate_Function_M (Id : E; V : B := True) is
5023 pragma Assert (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure);
5024 Set_Flag256 (Id, V);
5025 end Set_Is_Predicate_Function_M;
5027 procedure Set_Is_Preelaborated (Id : E; V : B := True) is
5030 end Set_Is_Preelaborated;
5032 procedure Set_Is_Primitive (Id : E; V : B := True) is
5035 (Is_Overloadable (Id)
5036 or else Ekind_In (Id, E_Generic_Function, E_Generic_Procedure));
5037 Set_Flag218 (Id, V);
5038 end Set_Is_Primitive;
5040 procedure Set_Is_Primitive_Wrapper (Id : E; V : B := True) is
5042 pragma Assert (Ekind_In (Id, E_Function, E_Procedure));
5043 Set_Flag195 (Id, V);
5044 end Set_Is_Primitive_Wrapper;
5046 procedure Set_Is_Private_Composite (Id : E; V : B := True) is
5048 pragma Assert (Is_Type (Id));
5049 Set_Flag107 (Id, V);
5050 end Set_Is_Private_Composite;
5052 procedure Set_Is_Private_Descendant (Id : E; V : B := True) is
5055 end Set_Is_Private_Descendant;
5057 procedure Set_Is_Private_Primitive (Id : E; V : B := True) is
5059 pragma Assert (Ekind_In (Id, E_Function, E_Procedure));
5060 Set_Flag245 (Id, V);
5061 end Set_Is_Private_Primitive;
5063 procedure Set_Is_Processed_Transient (Id : E; V : B := True) is
5065 pragma Assert (Ekind_In (Id, E_Constant, E_Variable));
5066 Set_Flag252 (Id, V);
5067 end Set_Is_Processed_Transient;
5069 procedure Set_Is_Public (Id : E; V : B := True) is
5071 pragma Assert (Nkind (Id) in N_Entity);
5075 procedure Set_Is_Pure (Id : E; V : B := True) is
5080 procedure Set_Is_Pure_Unit_Access_Type (Id : E; V : B := True) is
5082 pragma Assert (Is_Access_Type (Id));
5083 Set_Flag189 (Id, V);
5084 end Set_Is_Pure_Unit_Access_Type;
5086 procedure Set_Is_RACW_Stub_Type (Id : E; V : B := True) is
5088 pragma Assert (Is_Type (Id));
5089 Set_Flag244 (Id, V);
5090 end Set_Is_RACW_Stub_Type;
5092 procedure Set_Is_Raised (Id : E; V : B := True) is
5094 pragma Assert (Ekind (Id) = E_Exception);
5095 Set_Flag224 (Id, V);
5098 procedure Set_Is_Remote_Call_Interface (Id : E; V : B := True) is
5101 end Set_Is_Remote_Call_Interface;
5103 procedure Set_Is_Remote_Types (Id : E; V : B := True) is
5106 end Set_Is_Remote_Types;
5108 procedure Set_Is_Renaming_Of_Object (Id : E; V : B := True) is
5110 Set_Flag112 (Id, V);
5111 end Set_Is_Renaming_Of_Object;
5113 procedure Set_Is_Return_Object (Id : E; V : B := True) is
5115 Set_Flag209 (Id, V);
5116 end Set_Is_Return_Object;
5118 procedure Set_Is_Safe_To_Reevaluate (Id : E; V : B := True) is
5120 pragma Assert (Ekind (Id) = E_Variable);
5121 Set_Flag249 (Id, V);
5122 end Set_Is_Safe_To_Reevaluate;
5124 procedure Set_Is_Shared_Passive (Id : E; V : B := True) is
5127 end Set_Is_Shared_Passive;
5129 procedure Set_Is_Statically_Allocated (Id : E; V : B := True) is
5133 or else Ekind_In (Id, E_Exception,
5138 end Set_Is_Statically_Allocated;
5140 procedure Set_Is_Tag (Id : E; V : B := True) is
5142 pragma Assert (Ekind_In (Id, E_Component, E_Constant, E_Variable));
5146 procedure Set_Is_Tagged_Type (Id : E; V : B := True) is
5149 end Set_Is_Tagged_Type;
5151 procedure Set_Is_Thunk (Id : E; V : B := True) is
5153 pragma Assert (Is_Subprogram (Id));
5154 Set_Flag225 (Id, V);
5157 procedure Set_Is_Trivial_Subprogram (Id : E; V : B := True) is
5159 Set_Flag235 (Id, V);
5160 end Set_Is_Trivial_Subprogram;
5162 procedure Set_Is_True_Constant (Id : E; V : B := True) is
5164 Set_Flag163 (Id, V);
5165 end Set_Is_True_Constant;
5167 procedure Set_Is_Unchecked_Union (Id : E; V : B := True) is
5169 pragma Assert (Id = Base_Type (Id));
5170 Set_Flag117 (Id, V);
5171 end Set_Is_Unchecked_Union;
5173 procedure Set_Is_Underlying_Record_View (Id : E; V : B := True) is
5175 pragma Assert (Ekind (Id) = E_Record_Type);
5176 Set_Flag246 (Id, V);
5177 end Set_Is_Underlying_Record_View;
5179 procedure Set_Is_Unsigned_Type (Id : E; V : B := True) is
5181 pragma Assert (Is_Discrete_Or_Fixed_Point_Type (Id));
5182 Set_Flag144 (Id, V);
5183 end Set_Is_Unsigned_Type;
5185 procedure Set_Is_Valued_Procedure (Id : E; V : B := True) is
5187 pragma Assert (Ekind (Id) = E_Procedure);
5188 Set_Flag127 (Id, V);
5189 end Set_Is_Valued_Procedure;
5191 procedure Set_Is_Visible_Formal (Id : E; V : B := True) is
5193 Set_Flag206 (Id, V);
5194 end Set_Is_Visible_Formal;
5196 procedure Set_Is_Visible_Lib_Unit (Id : E; V : B := True) is
5198 Set_Flag116 (Id, V);
5199 end Set_Is_Visible_Lib_Unit;
5201 procedure Set_Is_Volatile (Id : E; V : B := True) is
5203 pragma Assert (Nkind (Id) in N_Entity);
5205 end Set_Is_Volatile;
5207 procedure Set_Itype_Printed (Id : E; V : B := True) is
5209 pragma Assert (Is_Itype (Id));
5210 Set_Flag202 (Id, V);
5211 end Set_Itype_Printed;
5213 procedure Set_Kill_Elaboration_Checks (Id : E; V : B := True) is
5216 end Set_Kill_Elaboration_Checks;
5218 procedure Set_Kill_Range_Checks (Id : E; V : B := True) is
5221 end Set_Kill_Range_Checks;
5223 procedure Set_Known_To_Have_Preelab_Init (Id : E; V : B := True) is
5225 pragma Assert (Is_Type (Id));
5226 Set_Flag207 (Id, V);
5227 end Set_Known_To_Have_Preelab_Init;
5229 procedure Set_Last_Aggregate_Assignment (Id : E; V : N) is
5231 pragma Assert (Ekind_In (Id, E_Constant, E_Variable));
5233 end Set_Last_Aggregate_Assignment;
5235 procedure Set_Last_Assignment (Id : E; V : N) is
5237 pragma Assert (Is_Assignable (Id));
5239 end Set_Last_Assignment;
5241 procedure Set_Last_Entity (Id : E; V : E) is
5244 end Set_Last_Entity;
5246 procedure Set_Limited_View (Id : E; V : E) is
5248 pragma Assert (Ekind (Id) = E_Package);
5250 end Set_Limited_View;
5252 procedure Set_Linker_Section_Pragma (Id : E; V : N) is
5254 pragma Assert (Is_Type (Id)
5255 or else Ekind_In (Id, E_Constant, E_Variable)
5256 or else Is_Subprogram (Id));
5258 end Set_Linker_Section_Pragma;
5260 procedure Set_Lit_Indexes (Id : E; V : E) is
5262 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
5264 end Set_Lit_Indexes;
5266 procedure Set_Lit_Strings (Id : E; V : E) is
5268 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
5270 end Set_Lit_Strings;
5272 procedure Set_Low_Bound_Tested (Id : E; V : B := True) is
5274 pragma Assert (Is_Formal (Id));
5275 Set_Flag205 (Id, V);
5276 end Set_Low_Bound_Tested;
5278 procedure Set_Machine_Radix_10 (Id : E; V : B := True) is
5280 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
5282 end Set_Machine_Radix_10;
5284 procedure Set_Master_Id (Id : E; V : E) is
5286 pragma Assert (Is_Access_Type (Id));
5290 procedure Set_Materialize_Entity (Id : E; V : B := True) is
5292 Set_Flag168 (Id, V);
5293 end Set_Materialize_Entity;
5295 procedure Set_May_Inherit_Delayed_Rep_Aspects (Id : E; V : B := True) is
5297 Set_Flag262 (Id, V);
5298 end Set_May_Inherit_Delayed_Rep_Aspects;
5300 procedure Set_Mechanism (Id : E; V : M) is
5302 pragma Assert (Ekind (Id) = E_Function or else Is_Formal (Id));
5303 Set_Uint8 (Id, UI_From_Int (V));
5306 procedure Set_Modulus (Id : E; V : U) is
5308 pragma Assert (Ekind (Id) = E_Modular_Integer_Type);
5312 procedure Set_Must_Be_On_Byte_Boundary (Id : E; V : B := True) is
5314 pragma Assert (Is_Type (Id));
5315 Set_Flag183 (Id, V);
5316 end Set_Must_Be_On_Byte_Boundary;
5318 procedure Set_Must_Have_Preelab_Init (Id : E; V : B := True) is
5320 pragma Assert (Is_Type (Id));
5321 Set_Flag208 (Id, V);
5322 end Set_Must_Have_Preelab_Init;
5324 procedure Set_Needs_Debug_Info (Id : E; V : B := True) is
5326 Set_Flag147 (Id, V);
5327 end Set_Needs_Debug_Info;
5329 procedure Set_Needs_No_Actuals (Id : E; V : B := True) is
5332 (Is_Overloadable (Id)
5333 or else Ekind_In (Id, E_Subprogram_Type, E_Entry_Family));
5335 end Set_Needs_No_Actuals;
5337 procedure Set_Never_Set_In_Source (Id : E; V : B := True) is
5339 Set_Flag115 (Id, V);
5340 end Set_Never_Set_In_Source;
5342 procedure Set_Next_Inlined_Subprogram (Id : E; V : E) is
5345 end Set_Next_Inlined_Subprogram;
5347 procedure Set_No_Dynamic_Predicate_On_Actual (Id : E; V : B := True) is
5349 pragma Assert (Is_Discrete_Type (Id));
5350 Set_Flag276 (Id, V);
5351 end Set_No_Dynamic_Predicate_On_Actual;
5353 procedure Set_No_Pool_Assigned (Id : E; V : B := True) is
5355 pragma Assert (Is_Access_Type (Id) and then Is_Base_Type (Id));
5356 Set_Flag131 (Id, V);
5357 end Set_No_Pool_Assigned;
5359 procedure Set_No_Predicate_On_Actual (Id : E; V : B := True) is
5361 pragma Assert (Is_Discrete_Type (Id));
5362 Set_Flag275 (Id, V);
5363 end Set_No_Predicate_On_Actual;
5365 procedure Set_No_Return (Id : E; V : B := True) is
5368 (V = False or else Ekind_In (Id, E_Procedure, E_Generic_Procedure));
5369 Set_Flag113 (Id, V);
5372 procedure Set_No_Strict_Aliasing (Id : E; V : B := True) is
5374 pragma Assert (Is_Access_Type (Id) and then Is_Base_Type (Id));
5375 Set_Flag136 (Id, V);
5376 end Set_No_Strict_Aliasing;
5378 procedure Set_Non_Binary_Modulus (Id : E; V : B := True) is
5380 pragma Assert (Is_Type (Id) and then Is_Base_Type (Id));
5382 end Set_Non_Binary_Modulus;
5384 procedure Set_Non_Limited_View (Id : E; V : E) is
5387 (Ekind (Id) in Incomplete_Kind or else Ekind (Id) = E_Abstract_State);
5389 end Set_Non_Limited_View;
5391 procedure Set_Nonzero_Is_True (Id : E; V : B := True) is
5394 (Root_Type (Id) = Standard_Boolean
5395 and then Ekind (Id) = E_Enumeration_Type);
5396 Set_Flag162 (Id, V);
5397 end Set_Nonzero_Is_True;
5399 procedure Set_Normalized_First_Bit (Id : E; V : U) is
5401 pragma Assert (Ekind_In (Id, E_Component, E_Discriminant));
5403 end Set_Normalized_First_Bit;
5405 procedure Set_Normalized_Position (Id : E; V : U) is
5407 pragma Assert (Ekind_In (Id, E_Component, E_Discriminant));
5409 end Set_Normalized_Position;
5411 procedure Set_Normalized_Position_Max (Id : E; V : U) is
5413 pragma Assert (Ekind_In (Id, E_Component, E_Discriminant));
5415 end Set_Normalized_Position_Max;
5417 procedure Set_OK_To_Rename (Id : E; V : B := True) is
5419 pragma Assert (Ekind (Id) = E_Variable);
5420 Set_Flag247 (Id, V);
5421 end Set_OK_To_Rename;
5423 procedure Set_OK_To_Reorder_Components (Id : E; V : B := True) is
5426 (Is_Record_Type (Id) and then Is_Base_Type (Id));
5427 Set_Flag239 (Id, V);
5428 end Set_OK_To_Reorder_Components;
5430 procedure Set_Optimize_Alignment_Space (Id : E; V : B := True) is
5433 (Is_Type (Id) or else Ekind_In (Id, E_Constant, E_Variable));
5434 Set_Flag241 (Id, V);
5435 end Set_Optimize_Alignment_Space;
5437 procedure Set_Optimize_Alignment_Time (Id : E; V : B := True) is
5440 (Is_Type (Id) or else Ekind_In (Id, E_Constant, E_Variable));
5441 Set_Flag242 (Id, V);
5442 end Set_Optimize_Alignment_Time;
5444 procedure Set_Original_Access_Type (Id : E; V : E) is
5446 pragma Assert (Ekind (Id) = E_Access_Subprogram_Type);
5448 end Set_Original_Access_Type;
5450 procedure Set_Original_Array_Type (Id : E; V : E) is
5452 pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id));
5454 end Set_Original_Array_Type;
5456 procedure Set_Original_Record_Component (Id : E; V : E) is
5458 pragma Assert (Ekind_In (Id, E_Void, E_Component, E_Discriminant));
5460 end Set_Original_Record_Component;
5462 procedure Set_Overlays_Constant (Id : E; V : B := True) is
5464 Set_Flag243 (Id, V);
5465 end Set_Overlays_Constant;
5467 procedure Set_Overridden_Operation (Id : E; V : E) is
5470 end Set_Overridden_Operation;
5472 procedure Set_Package_Instantiation (Id : E; V : N) is
5474 pragma Assert (Ekind_In (Id, E_Void, E_Generic_Package, E_Package));
5476 end Set_Package_Instantiation;
5478 procedure Set_Packed_Array_Impl_Type (Id : E; V : E) is
5480 pragma Assert (Is_Array_Type (Id));
5482 end Set_Packed_Array_Impl_Type;
5484 procedure Set_Parent_Subtype (Id : E; V : E) is
5486 pragma Assert (Ekind (Id) = E_Record_Type);
5488 end Set_Parent_Subtype;
5490 procedure Set_Part_Of_Constituents (Id : E; V : L) is
5492 pragma Assert (Ekind (Id) = E_Abstract_State);
5494 end Set_Part_Of_Constituents;
5496 procedure Set_Postcondition_Proc (Id : E; V : E) is
5498 pragma Assert (Ekind (Id) = E_Procedure);
5500 end Set_Postcondition_Proc;
5502 procedure Set_PPC_Wrapper (Id : E; V : E) is
5504 pragma Assert (Ekind_In (Id, E_Entry, E_Entry_Family));
5506 end Set_PPC_Wrapper;
5508 procedure Set_Direct_Primitive_Operations (Id : E; V : L) is
5510 pragma Assert (Is_Tagged_Type (Id));
5511 Set_Elist10 (Id, V);
5512 end Set_Direct_Primitive_Operations;
5514 procedure Set_Prival (Id : E; V : E) is
5516 pragma Assert (Is_Protected_Component (Id));
5520 procedure Set_Prival_Link (Id : E; V : E) is
5522 pragma Assert (Ekind_In (Id, E_Constant, E_Variable));
5524 end Set_Prival_Link;
5526 procedure Set_Private_Dependents (Id : E; V : L) is
5528 pragma Assert (Is_Incomplete_Or_Private_Type (Id));
5529 Set_Elist18 (Id, V);
5530 end Set_Private_Dependents;
5532 procedure Set_Private_View (Id : E; V : N) is
5534 pragma Assert (Is_Private_Type (Id));
5536 end Set_Private_View;
5538 procedure Set_Protected_Body_Subprogram (Id : E; V : E) is
5540 pragma Assert (Is_Subprogram (Id) or else Is_Entry (Id));
5542 end Set_Protected_Body_Subprogram;
5544 procedure Set_Protected_Formal (Id : E; V : E) is
5546 pragma Assert (Is_Formal (Id));
5548 end Set_Protected_Formal;
5550 procedure Set_Protection_Object (Id : E; V : E) is
5552 pragma Assert (Ekind_In (Id, E_Entry,
5557 end Set_Protection_Object;
5559 procedure Set_Reachable (Id : E; V : B := True) is
5564 procedure Set_Referenced (Id : E; V : B := True) is
5566 Set_Flag156 (Id, V);
5569 procedure Set_Referenced_As_LHS (Id : E; V : B := True) is
5572 end Set_Referenced_As_LHS;
5574 procedure Set_Referenced_As_Out_Parameter (Id : E; V : B := True) is
5576 Set_Flag227 (Id, V);
5577 end Set_Referenced_As_Out_Parameter;
5579 procedure Set_Refinement_Constituents (Id : E; V : L) is
5581 pragma Assert (Ekind (Id) = E_Abstract_State);
5583 end Set_Refinement_Constituents;
5585 procedure Set_Register_Exception_Call (Id : E; V : N) is
5587 pragma Assert (Ekind (Id) = E_Exception);
5589 end Set_Register_Exception_Call;
5591 procedure Set_Related_Array_Object (Id : E; V : E) is
5593 pragma Assert (Is_Array_Type (Id));
5595 end Set_Related_Array_Object;
5597 procedure Set_Related_Expression (Id : E; V : N) is
5599 pragma Assert (Ekind (Id) in Type_Kind
5600 or else Ekind_In (Id, E_Constant, E_Variable, E_Void));
5602 end Set_Related_Expression;
5604 procedure Set_Related_Instance (Id : E; V : E) is
5606 pragma Assert (Ekind_In (Id, E_Package, E_Package_Body));
5608 end Set_Related_Instance;
5610 procedure Set_Related_Type (Id : E; V : E) is
5612 pragma Assert (Ekind_In (Id, E_Component, E_Constant, E_Variable));
5614 end Set_Related_Type;
5616 procedure Set_Relative_Deadline_Variable (Id : E; V : E) is
5618 pragma Assert (Is_Task_Type (Id) and then Is_Base_Type (Id));
5620 end Set_Relative_Deadline_Variable;
5622 procedure Set_Renamed_Entity (Id : E; V : N) is
5625 end Set_Renamed_Entity;
5627 procedure Set_Renamed_In_Spec (Id : E; V : B := True) is
5629 pragma Assert (Ekind (Id) = E_Package);
5630 Set_Flag231 (Id, V);
5631 end Set_Renamed_In_Spec;
5633 procedure Set_Renamed_Object (Id : E; V : N) is
5636 end Set_Renamed_Object;
5638 procedure Set_Renaming_Map (Id : E; V : U) is
5641 end Set_Renaming_Map;
5643 procedure Set_Requires_Overriding (Id : E; V : B := True) is
5645 pragma Assert (Is_Overloadable (Id));
5646 Set_Flag213 (Id, V);
5647 end Set_Requires_Overriding;
5649 procedure Set_Return_Present (Id : E; V : B := True) is
5652 end Set_Return_Present;
5654 procedure Set_Return_Applies_To (Id : E; V : N) is
5657 end Set_Return_Applies_To;
5659 procedure Set_Returns_By_Ref (Id : E; V : B := True) is
5662 end Set_Returns_By_Ref;
5664 procedure Set_Reverse_Bit_Order (Id : E; V : B := True) is
5667 (Is_Record_Type (Id) and then Is_Base_Type (Id));
5668 Set_Flag164 (Id, V);
5669 end Set_Reverse_Bit_Order;
5671 procedure Set_Reverse_Storage_Order (Id : E; V : B := True) is
5675 and then (Is_Record_Type (Id) or else Is_Array_Type (Id)));
5677 end Set_Reverse_Storage_Order;
5679 procedure Set_RM_Size (Id : E; V : U) is
5681 pragma Assert (Is_Type (Id));
5685 procedure Set_Scalar_Range (Id : E; V : N) is
5688 end Set_Scalar_Range;
5690 procedure Set_Scale_Value (Id : E; V : U) is
5693 end Set_Scale_Value;
5695 procedure Set_Scope_Depth_Value (Id : E; V : U) is
5697 pragma Assert (not Is_Record_Type (Id));
5699 end Set_Scope_Depth_Value;
5701 procedure Set_Sec_Stack_Needed_For_Return (Id : E; V : B := True) is
5703 Set_Flag167 (Id, V);
5704 end Set_Sec_Stack_Needed_For_Return;
5706 procedure Set_Shadow_Entities (Id : E; V : S) is
5708 pragma Assert (Ekind_In (Id, E_Package, E_Generic_Package));
5710 end Set_Shadow_Entities;
5712 procedure Set_Shared_Var_Procs_Instance (Id : E; V : E) is
5714 pragma Assert (Ekind (Id) = E_Variable);
5716 end Set_Shared_Var_Procs_Instance;
5718 procedure Set_Size_Check_Code (Id : E; V : N) is
5720 pragma Assert (Ekind_In (Id, E_Constant, E_Variable));
5722 end Set_Size_Check_Code;
5724 procedure Set_Size_Depends_On_Discriminant (Id : E; V : B := True) is
5726 Set_Flag177 (Id, V);
5727 end Set_Size_Depends_On_Discriminant;
5729 procedure Set_Size_Known_At_Compile_Time (Id : E; V : B := True) is
5732 end Set_Size_Known_At_Compile_Time;
5734 procedure Set_Small_Value (Id : E; V : R) is
5736 pragma Assert (Is_Fixed_Point_Type (Id));
5737 Set_Ureal21 (Id, V);
5738 end Set_Small_Value;
5740 procedure Set_SPARK_Aux_Pragma (Id : E; V : N) is
5743 (Ekind_In (Id, E_Generic_Package, -- package variants
5748 end Set_SPARK_Aux_Pragma;
5750 procedure Set_SPARK_Aux_Pragma_Inherited (Id : E; V : B := True) is
5753 (Ekind_In (Id, E_Generic_Package, -- package variants
5757 Set_Flag266 (Id, V);
5758 end Set_SPARK_Aux_Pragma_Inherited;
5760 procedure Set_SPARK_Pragma (Id : E; V : N) is
5763 (Ekind_In (Id, E_Function, -- subprogram variants
5765 E_Generic_Procedure,
5769 Ekind_In (Id, E_Generic_Package, -- package variants
5774 end Set_SPARK_Pragma;
5776 procedure Set_SPARK_Pragma_Inherited (Id : E; V : B := True) is
5779 (Ekind_In (Id, E_Function, -- subprogram variants
5781 E_Generic_Procedure,
5785 Ekind_In (Id, E_Generic_Package, -- package variants
5789 Set_Flag265 (Id, V);
5790 end Set_SPARK_Pragma_Inherited;
5792 procedure Set_Spec_Entity (Id : E; V : E) is
5794 pragma Assert (Ekind (Id) = E_Package_Body or else Is_Formal (Id));
5796 end Set_Spec_Entity;
5798 procedure Set_SSO_Set_High_By_Default (Id : E; V : B := True) is
5802 and then (Is_Record_Type (Id) or else Is_Array_Type (Id)));
5803 Set_Flag273 (Id, V);
5804 end Set_SSO_Set_High_By_Default;
5806 procedure Set_SSO_Set_Low_By_Default (Id : E; V : B := True) is
5810 and then (Is_Record_Type (Id) or else Is_Array_Type (Id)));
5811 Set_Flag272 (Id, V);
5812 end Set_SSO_Set_Low_By_Default;
5814 procedure Set_Static_Discrete_Predicate (Id : E; V : S) is
5816 pragma Assert (Is_Discrete_Type (Id) and then Has_Predicates (Id));
5818 end Set_Static_Discrete_Predicate;
5820 procedure Set_Static_Real_Or_String_Predicate (Id : E; V : N) is
5822 pragma Assert ((Is_Real_Type (Id) or else Is_String_Type (Id))
5823 and then Has_Predicates (Id));
5825 end Set_Static_Real_Or_String_Predicate;
5827 procedure Set_Status_Flag_Or_Transient_Decl (Id : E; V : E) is
5829 pragma Assert (Ekind_In (Id, E_Constant, E_Variable));
5831 end Set_Status_Flag_Or_Transient_Decl;
5833 procedure Set_Storage_Size_Variable (Id : E; V : E) is
5835 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
5836 pragma Assert (Id = Base_Type (Id));
5838 end Set_Storage_Size_Variable;
5840 procedure Set_Static_Elaboration_Desired (Id : E; V : B) is
5842 pragma Assert (Ekind (Id) = E_Package);
5844 end Set_Static_Elaboration_Desired;
5846 procedure Set_Static_Initialization (Id : E; V : N) is
5849 (Ekind (Id) = E_Procedure and then not Is_Dispatching_Operation (Id));
5851 end Set_Static_Initialization;
5853 procedure Set_Stored_Constraint (Id : E; V : L) is
5855 pragma Assert (Nkind (Id) in N_Entity);
5856 Set_Elist23 (Id, V);
5857 end Set_Stored_Constraint;
5859 procedure Set_Stores_Attribute_Old_Prefix (Id : E; V : B := True) is
5861 pragma Assert (Ekind (Id) = E_Constant);
5862 Set_Flag270 (Id, V);
5863 end Set_Stores_Attribute_Old_Prefix;
5865 procedure Set_Strict_Alignment (Id : E; V : B := True) is
5867 pragma Assert (Id = Base_Type (Id));
5868 Set_Flag145 (Id, V);
5869 end Set_Strict_Alignment;
5871 procedure Set_String_Literal_Length (Id : E; V : U) is
5873 pragma Assert (Ekind (Id) = E_String_Literal_Subtype);
5875 end Set_String_Literal_Length;
5877 procedure Set_String_Literal_Low_Bound (Id : E; V : N) is
5879 pragma Assert (Ekind (Id) = E_String_Literal_Subtype);
5881 end Set_String_Literal_Low_Bound;
5883 procedure Set_Subprograms_For_Type (Id : E; V : E) is
5885 pragma Assert (Is_Type (Id) or else Is_Subprogram (Id));
5887 end Set_Subprograms_For_Type;
5889 procedure Set_Suppress_Elaboration_Warnings (Id : E; V : B := True) is
5891 Set_Flag148 (Id, V);
5892 end Set_Suppress_Elaboration_Warnings;
5894 procedure Set_Suppress_Initialization (Id : E; V : B := True) is
5896 pragma Assert (Is_Type (Id));
5897 Set_Flag105 (Id, V);
5898 end Set_Suppress_Initialization;
5900 procedure Set_Suppress_Style_Checks (Id : E; V : B := True) is
5902 Set_Flag165 (Id, V);
5903 end Set_Suppress_Style_Checks;
5905 procedure Set_Suppress_Value_Tracking_On_Call (Id : E; V : B := True) is
5907 Set_Flag217 (Id, V);
5908 end Set_Suppress_Value_Tracking_On_Call;
5910 procedure Set_Task_Body_Procedure (Id : E; V : N) is
5912 pragma Assert (Ekind (Id) in Task_Kind);
5914 end Set_Task_Body_Procedure;
5916 procedure Set_Thunk_Entity (Id : E; V : E) is
5918 pragma Assert (Ekind_In (Id, E_Function, E_Procedure)
5919 and then Is_Thunk (Id));
5921 end Set_Thunk_Entity;
5923 procedure Set_Treat_As_Volatile (Id : E; V : B := True) is
5926 end Set_Treat_As_Volatile;
5928 procedure Set_Underlying_Full_View (Id : E; V : E) is
5930 pragma Assert (Ekind (Id) in Private_Kind);
5932 end Set_Underlying_Full_View;
5934 procedure Set_Underlying_Record_View (Id : E; V : E) is
5936 pragma Assert (Ekind (Id) = E_Record_Type);
5938 end Set_Underlying_Record_View;
5940 procedure Set_Universal_Aliasing (Id : E; V : B := True) is
5942 pragma Assert (Is_Type (Id) and then Is_Base_Type (Id));
5943 Set_Flag216 (Id, V);
5944 end Set_Universal_Aliasing;
5946 procedure Set_Unset_Reference (Id : E; V : N) is
5949 end Set_Unset_Reference;
5951 procedure Set_Used_As_Generic_Actual (Id : E; V : B := True) is
5953 Set_Flag222 (Id, V);
5954 end Set_Used_As_Generic_Actual;
5956 procedure Set_Uses_Lock_Free (Id : E; V : B := True) is
5958 pragma Assert (Ekind (Id) = E_Protected_Type);
5959 Set_Flag188 (Id, V);
5960 end Set_Uses_Lock_Free;
5962 procedure Set_Uses_Sec_Stack (Id : E; V : B := True) is
5965 end Set_Uses_Sec_Stack;
5967 procedure Set_Warnings_Off (Id : E; V : B := True) is
5970 end Set_Warnings_Off;
5972 procedure Set_Warnings_Off_Used (Id : E; V : B := True) is
5974 Set_Flag236 (Id, V);
5975 end Set_Warnings_Off_Used;
5977 procedure Set_Warnings_Off_Used_Unmodified (Id : E; V : B := True) is
5979 Set_Flag237 (Id, V);
5980 end Set_Warnings_Off_Used_Unmodified;
5982 procedure Set_Warnings_Off_Used_Unreferenced (Id : E; V : B := True) is
5984 Set_Flag238 (Id, V);
5985 end Set_Warnings_Off_Used_Unreferenced;
5987 procedure Set_Was_Hidden (Id : E; V : B := True) is
5989 Set_Flag196 (Id, V);
5992 procedure Set_Wrapped_Entity (Id : E; V : E) is
5994 pragma Assert (Ekind_In (Id, E_Function, E_Procedure)
5995 and then Is_Primitive_Wrapper (Id));
5997 end Set_Wrapped_Entity;
5999 -----------------------------------
6000 -- Field Initialization Routines --
6001 -----------------------------------
6003 procedure Init_Alignment (Id : E) is
6005 Set_Uint14 (Id, Uint_0);
6008 procedure Init_Alignment (Id : E; V : Int) is
6010 Set_Uint14 (Id, UI_From_Int (V));
6013 procedure Init_Component_Bit_Offset (Id : E) is
6015 Set_Uint11 (Id, No_Uint);
6016 end Init_Component_Bit_Offset;
6018 procedure Init_Component_Bit_Offset (Id : E; V : Int) is
6020 Set_Uint11 (Id, UI_From_Int (V));
6021 end Init_Component_Bit_Offset;
6023 procedure Init_Component_Size (Id : E) is
6025 Set_Uint22 (Id, Uint_0);
6026 end Init_Component_Size;
6028 procedure Init_Component_Size (Id : E; V : Int) is
6030 Set_Uint22 (Id, UI_From_Int (V));
6031 end Init_Component_Size;
6033 procedure Init_Digits_Value (Id : E) is
6035 Set_Uint17 (Id, Uint_0);
6036 end Init_Digits_Value;
6038 procedure Init_Digits_Value (Id : E; V : Int) is
6040 Set_Uint17 (Id, UI_From_Int (V));
6041 end Init_Digits_Value;
6043 procedure Init_Esize (Id : E) is
6045 Set_Uint12 (Id, Uint_0);
6048 procedure Init_Esize (Id : E; V : Int) is
6050 Set_Uint12 (Id, UI_From_Int (V));
6053 procedure Init_Normalized_First_Bit (Id : E) is
6055 Set_Uint8 (Id, No_Uint);
6056 end Init_Normalized_First_Bit;
6058 procedure Init_Normalized_First_Bit (Id : E; V : Int) is
6060 Set_Uint8 (Id, UI_From_Int (V));
6061 end Init_Normalized_First_Bit;
6063 procedure Init_Normalized_Position (Id : E) is
6065 Set_Uint14 (Id, No_Uint);
6066 end Init_Normalized_Position;
6068 procedure Init_Normalized_Position (Id : E; V : Int) is
6070 Set_Uint14 (Id, UI_From_Int (V));
6071 end Init_Normalized_Position;
6073 procedure Init_Normalized_Position_Max (Id : E) is
6075 Set_Uint10 (Id, No_Uint);
6076 end Init_Normalized_Position_Max;
6078 procedure Init_Normalized_Position_Max (Id : E; V : Int) is
6080 Set_Uint10 (Id, UI_From_Int (V));
6081 end Init_Normalized_Position_Max;
6083 procedure Init_RM_Size (Id : E) is
6085 Set_Uint13 (Id, Uint_0);
6088 procedure Init_RM_Size (Id : E; V : Int) is
6090 Set_Uint13 (Id, UI_From_Int (V));
6093 -----------------------------
6094 -- Init_Component_Location --
6095 -----------------------------
6097 procedure Init_Component_Location (Id : E) is
6099 Set_Uint8 (Id, No_Uint); -- Normalized_First_Bit
6100 Set_Uint10 (Id, No_Uint); -- Normalized_Position_Max
6101 Set_Uint11 (Id, No_Uint); -- Component_Bit_Offset
6102 Set_Uint12 (Id, Uint_0); -- Esize
6103 Set_Uint14 (Id, No_Uint); -- Normalized_Position
6104 end Init_Component_Location;
6106 ----------------------------
6107 -- Init_Object_Size_Align --
6108 ----------------------------
6110 procedure Init_Object_Size_Align (Id : E) is
6112 Set_Uint12 (Id, Uint_0); -- Esize
6113 Set_Uint14 (Id, Uint_0); -- Alignment
6114 end Init_Object_Size_Align;
6120 procedure Init_Size (Id : E; V : Int) is
6122 pragma Assert (not Is_Object (Id));
6123 Set_Uint12 (Id, UI_From_Int (V)); -- Esize
6124 Set_Uint13 (Id, UI_From_Int (V)); -- RM_Size
6127 ---------------------
6128 -- Init_Size_Align --
6129 ---------------------
6131 procedure Init_Size_Align (Id : E) is
6133 pragma Assert (not Is_Object (Id));
6134 Set_Uint12 (Id, Uint_0); -- Esize
6135 Set_Uint13 (Id, Uint_0); -- RM_Size
6136 Set_Uint14 (Id, Uint_0); -- Alignment
6137 end Init_Size_Align;
6139 ----------------------------------------------
6140 -- Type Representation Attribute Predicates --
6141 ----------------------------------------------
6143 function Known_Alignment (E : Entity_Id) return B is
6145 return Uint14 (E) /= Uint_0
6146 and then Uint14 (E) /= No_Uint;
6147 end Known_Alignment;
6149 function Known_Component_Bit_Offset (E : Entity_Id) return B is
6151 return Uint11 (E) /= No_Uint;
6152 end Known_Component_Bit_Offset;
6154 function Known_Component_Size (E : Entity_Id) return B is
6156 return Uint22 (Base_Type (E)) /= Uint_0
6157 and then Uint22 (Base_Type (E)) /= No_Uint;
6158 end Known_Component_Size;
6160 function Known_Esize (E : Entity_Id) return B is
6162 return Uint12 (E) /= Uint_0
6163 and then Uint12 (E) /= No_Uint;
6166 function Known_Normalized_First_Bit (E : Entity_Id) return B is
6168 return Uint8 (E) /= No_Uint;
6169 end Known_Normalized_First_Bit;
6171 function Known_Normalized_Position (E : Entity_Id) return B is
6173 return Uint14 (E) /= No_Uint;
6174 end Known_Normalized_Position;
6176 function Known_Normalized_Position_Max (E : Entity_Id) return B is
6178 return Uint10 (E) /= No_Uint;
6179 end Known_Normalized_Position_Max;
6181 function Known_RM_Size (E : Entity_Id) return B is
6183 return Uint13 (E) /= No_Uint
6184 and then (Uint13 (E) /= Uint_0
6185 or else Is_Discrete_Type (E)
6186 or else Is_Fixed_Point_Type (E));
6189 function Known_Static_Component_Bit_Offset (E : Entity_Id) return B is
6191 return Uint11 (E) /= No_Uint
6192 and then Uint11 (E) >= Uint_0;
6193 end Known_Static_Component_Bit_Offset;
6195 function Known_Static_Component_Size (E : Entity_Id) return B is
6197 return Uint22 (Base_Type (E)) > Uint_0;
6198 end Known_Static_Component_Size;
6200 function Known_Static_Esize (E : Entity_Id) return B is
6202 return Uint12 (E) > Uint_0
6203 and then not Is_Generic_Type (E);
6204 end Known_Static_Esize;
6206 function Known_Static_Normalized_First_Bit (E : Entity_Id) return B is
6208 return Uint8 (E) /= No_Uint
6209 and then Uint8 (E) >= Uint_0;
6210 end Known_Static_Normalized_First_Bit;
6212 function Known_Static_Normalized_Position (E : Entity_Id) return B is
6214 return Uint14 (E) /= No_Uint
6215 and then Uint14 (E) >= Uint_0;
6216 end Known_Static_Normalized_Position;
6218 function Known_Static_Normalized_Position_Max (E : Entity_Id) return B is
6220 return Uint10 (E) /= No_Uint
6221 and then Uint10 (E) >= Uint_0;
6222 end Known_Static_Normalized_Position_Max;
6224 function Known_Static_RM_Size (E : Entity_Id) return B is
6226 return (Uint13 (E) > Uint_0
6227 or else Is_Discrete_Type (E)
6228 or else Is_Fixed_Point_Type (E))
6229 and then not Is_Generic_Type (E);
6230 end Known_Static_RM_Size;
6232 function Unknown_Alignment (E : Entity_Id) return B is
6234 return Uint14 (E) = Uint_0
6235 or else Uint14 (E) = No_Uint;
6236 end Unknown_Alignment;
6238 function Unknown_Component_Bit_Offset (E : Entity_Id) return B is
6240 return Uint11 (E) = No_Uint;
6241 end Unknown_Component_Bit_Offset;
6243 function Unknown_Component_Size (E : Entity_Id) return B is
6245 return Uint22 (Base_Type (E)) = Uint_0
6247 Uint22 (Base_Type (E)) = No_Uint;
6248 end Unknown_Component_Size;
6250 function Unknown_Esize (E : Entity_Id) return B is
6252 return Uint12 (E) = No_Uint
6254 Uint12 (E) = Uint_0;
6257 function Unknown_Normalized_First_Bit (E : Entity_Id) return B is
6259 return Uint8 (E) = No_Uint;
6260 end Unknown_Normalized_First_Bit;
6262 function Unknown_Normalized_Position (E : Entity_Id) return B is
6264 return Uint14 (E) = No_Uint;
6265 end Unknown_Normalized_Position;
6267 function Unknown_Normalized_Position_Max (E : Entity_Id) return B is
6269 return Uint10 (E) = No_Uint;
6270 end Unknown_Normalized_Position_Max;
6272 function Unknown_RM_Size (E : Entity_Id) return B is
6274 return (Uint13 (E) = Uint_0
6275 and then not Is_Discrete_Type (E)
6276 and then not Is_Fixed_Point_Type (E))
6277 or else Uint13 (E) = No_Uint;
6278 end Unknown_RM_Size;
6280 --------------------
6281 -- Address_Clause --
6282 --------------------
6284 function Address_Clause (Id : E) return N is
6286 return Get_Attribute_Definition_Clause (Id, Attribute_Address);
6293 function Aft_Value (Id : E) return U is
6295 Delta_Val : Ureal := Delta_Value (Id);
6297 while Delta_Val < Ureal_Tenth loop
6298 Delta_Val := Delta_Val * Ureal_10;
6299 Result := Result + 1;
6302 return UI_From_Int (Result);
6305 ----------------------
6306 -- Alignment_Clause --
6307 ----------------------
6309 function Alignment_Clause (Id : E) return N is
6311 return Get_Attribute_Definition_Clause (Id, Attribute_Alignment);
6312 end Alignment_Clause;
6318 procedure Append_Entity (Id : Entity_Id; V : Entity_Id) is
6320 if Last_Entity (V) = Empty then
6321 Set_First_Entity (Id => V, V => Id);
6323 Set_Next_Entity (Last_Entity (V), Id);
6326 Set_Next_Entity (Id, Empty);
6328 Set_Last_Entity (Id => V, V => Id);
6335 function Base_Type (Id : E) return E is
6337 if Is_Base_Type (Id) then
6340 pragma Assert (Is_Type (Id));
6345 -------------------------
6346 -- Component_Alignment --
6347 -------------------------
6349 -- Component Alignment is encoded using two flags, Flag128/129 as
6350 -- follows. Note that both flags False = Align_Default, so that the
6351 -- default initialization of flags to False initializes component
6352 -- alignment to the default value as required.
6354 -- Flag128 Flag129 Value
6355 -- ------- ------- -----
6356 -- False False Calign_Default
6357 -- False True Calign_Component_Size
6358 -- True False Calign_Component_Size_4
6359 -- True True Calign_Storage_Unit
6361 function Component_Alignment (Id : E) return C is
6362 BT : constant Node_Id := Base_Type (Id);
6365 pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id));
6367 if Flag128 (BT) then
6368 if Flag129 (BT) then
6369 return Calign_Storage_Unit;
6371 return Calign_Component_Size_4;
6375 if Flag129 (BT) then
6376 return Calign_Component_Size;
6378 return Calign_Default;
6381 end Component_Alignment;
6383 ----------------------
6384 -- Declaration_Node --
6385 ----------------------
6387 function Declaration_Node (Id : E) return N is
6391 if Ekind (Id) = E_Incomplete_Type
6392 and then Present (Full_View (Id))
6394 P := Parent (Full_View (Id));
6400 if Nkind (P) /= N_Selected_Component
6401 and then Nkind (P) /= N_Expanded_Name
6403 not (Nkind (P) = N_Defining_Program_Unit_Name
6404 and then Is_Child_Unit (Id))
6411 end Declaration_Node;
6413 ---------------------
6414 -- Designated_Type --
6415 ---------------------
6417 function Designated_Type (Id : E) return E is
6421 Desig_Type := Directly_Designated_Type (Id);
6423 if Ekind (Desig_Type) = E_Incomplete_Type
6424 and then Present (Full_View (Desig_Type))
6426 return Full_View (Desig_Type);
6428 elsif Is_Class_Wide_Type (Desig_Type)
6429 and then Ekind (Etype (Desig_Type)) = E_Incomplete_Type
6430 and then Present (Full_View (Etype (Desig_Type)))
6431 and then Present (Class_Wide_Type (Full_View (Etype (Desig_Type))))
6433 return Class_Wide_Type (Full_View (Etype (Desig_Type)));
6438 end Designated_Type;
6440 ----------------------
6441 -- Entry_Index_Type --
6442 ----------------------
6444 function Entry_Index_Type (Id : E) return N is
6446 pragma Assert (Ekind (Id) = E_Entry_Family);
6447 return Etype (Discrete_Subtype_Definition (Parent (Id)));
6448 end Entry_Index_Type;
6450 ---------------------
6451 -- First_Component --
6452 ---------------------
6454 function First_Component (Id : E) return E is
6459 (Is_Record_Type (Id) or else Is_Incomplete_Or_Private_Type (Id));
6461 Comp_Id := First_Entity (Id);
6462 while Present (Comp_Id) loop
6463 exit when Ekind (Comp_Id) = E_Component;
6464 Comp_Id := Next_Entity (Comp_Id);
6468 end First_Component;
6470 -------------------------------------
6471 -- First_Component_Or_Discriminant --
6472 -------------------------------------
6474 function First_Component_Or_Discriminant (Id : E) return E is
6479 (Is_Record_Type (Id)
6480 or else Is_Incomplete_Or_Private_Type (Id)
6481 or else Has_Discriminants (Id));
6483 Comp_Id := First_Entity (Id);
6484 while Present (Comp_Id) loop
6485 exit when Ekind_In (Comp_Id, E_Component, E_Discriminant);
6486 Comp_Id := Next_Entity (Comp_Id);
6490 end First_Component_Or_Discriminant;
6496 function First_Formal (Id : E) return E is
6501 (Is_Overloadable (Id)
6502 or else Ekind_In (Id, E_Entry_Family,
6504 E_Subprogram_Type));
6506 if Ekind (Id) = E_Enumeration_Literal then
6510 Formal := First_Entity (Id);
6512 if Present (Formal) and then Is_Formal (Formal) then
6520 ------------------------------
6521 -- First_Formal_With_Extras --
6522 ------------------------------
6524 function First_Formal_With_Extras (Id : E) return E is
6529 (Is_Overloadable (Id)
6530 or else Ekind_In (Id, E_Entry_Family,
6532 E_Subprogram_Type));
6534 if Ekind (Id) = E_Enumeration_Literal then
6538 Formal := First_Entity (Id);
6540 if Present (Formal) and then Is_Formal (Formal) then
6543 return Extra_Formals (Id); -- Empty if no extra formals
6546 end First_Formal_With_Extras;
6548 -------------------------------------
6549 -- Get_Attribute_Definition_Clause --
6550 -------------------------------------
6552 function Get_Attribute_Definition_Clause
6554 Id : Attribute_Id) return Node_Id
6559 N := First_Rep_Item (E);
6560 while Present (N) loop
6561 if Nkind (N) = N_Attribute_Definition_Clause
6562 and then Get_Attribute_Id (Chars (N)) = Id
6571 end Get_Attribute_Definition_Clause;
6577 function Get_Full_View (T : Entity_Id) return Entity_Id is
6579 if Ekind (T) = E_Incomplete_Type and then Present (Full_View (T)) then
6580 return Full_View (T);
6582 elsif Is_Class_Wide_Type (T)
6583 and then Ekind (Root_Type (T)) = E_Incomplete_Type
6584 and then Present (Full_View (Root_Type (T)))
6586 return Class_Wide_Type (Full_View (Root_Type (T)));
6597 function Get_Pragma (E : Entity_Id; Id : Pragma_Id) return Node_Id is
6598 Is_CDG : constant Boolean :=
6599 Id = Pragma_Abstract_State or else
6600 Id = Pragma_Async_Readers or else
6601 Id = Pragma_Async_Writers or else
6602 Id = Pragma_Depends or else
6603 Id = Pragma_Effective_Reads or else
6604 Id = Pragma_Effective_Writes or else
6605 Id = Pragma_Global or else
6606 Id = Pragma_Initial_Condition or else
6607 Id = Pragma_Initializes or else
6608 Id = Pragma_Part_Of or else
6609 Id = Pragma_Refined_Depends or else
6610 Id = Pragma_Refined_Global or else
6611 Id = Pragma_Refined_State;
6612 Is_CTC : constant Boolean :=
6613 Id = Pragma_Contract_Cases or else
6614 Id = Pragma_Test_Case;
6615 Is_PPC : constant Boolean :=
6616 Id = Pragma_Precondition or else
6617 Id = Pragma_Postcondition or else
6618 Id = Pragma_Refined_Post;
6620 In_Contract : constant Boolean := Is_CDG or Is_CTC or Is_PPC;
6626 -- Handle pragmas that appear in N_Contract nodes. Those have to be
6627 -- extracted from their specialized list.
6630 Items := Contract (E);
6636 Item := Classifications (Items);
6639 Item := Contract_Test_Cases (Items);
6642 Item := Pre_Post_Conditions (Items);
6648 Item := First_Rep_Item (E);
6651 while Present (Item) loop
6652 if Nkind (Item) = N_Pragma
6653 and then Get_Pragma_Id (Pragma_Name (Item)) = Id
6657 -- All nodes in N_Contract are chained using Next_Pragma
6659 elsif In_Contract then
6660 Item := Next_Pragma (Item);
6665 Next_Rep_Item (Item);
6672 --------------------------------------
6673 -- Get_Record_Representation_Clause --
6674 --------------------------------------
6676 function Get_Record_Representation_Clause (E : Entity_Id) return Node_Id is
6680 N := First_Rep_Item (E);
6681 while Present (N) loop
6682 if Nkind (N) = N_Record_Representation_Clause then
6690 end Get_Record_Representation_Clause;
6692 ------------------------
6693 -- Has_Attach_Handler --
6694 ------------------------
6696 function Has_Attach_Handler (Id : E) return B is
6700 pragma Assert (Is_Protected_Type (Id));
6702 Ritem := First_Rep_Item (Id);
6703 while Present (Ritem) loop
6704 if Nkind (Ritem) = N_Pragma
6705 and then Pragma_Name (Ritem) = Name_Attach_Handler
6709 Next_Rep_Item (Ritem);
6714 end Has_Attach_Handler;
6720 function Has_Entries (Id : E) return B is
6724 pragma Assert (Is_Concurrent_Type (Id));
6726 Ent := First_Entity (Id);
6727 while Present (Ent) loop
6728 if Is_Entry (Ent) then
6732 Ent := Next_Entity (Ent);
6738 ----------------------------
6739 -- Has_Foreign_Convention --
6740 ----------------------------
6742 function Has_Foreign_Convention (Id : E) return B is
6744 -- While regular Intrinsics such as the Standard operators fit in the
6745 -- "Ada" convention, those with an Interface_Name materialize GCC
6746 -- builtin imports for which Ada special treatments shouldn't apply.
6748 return Convention (Id) in Foreign_Convention
6749 or else (Convention (Id) = Convention_Intrinsic
6750 and then Present (Interface_Name (Id)));
6751 end Has_Foreign_Convention;
6753 ---------------------------
6754 -- Has_Interrupt_Handler --
6755 ---------------------------
6757 function Has_Interrupt_Handler (Id : E) return B is
6761 pragma Assert (Is_Protected_Type (Id));
6763 Ritem := First_Rep_Item (Id);
6764 while Present (Ritem) loop
6765 if Nkind (Ritem) = N_Pragma
6766 and then Pragma_Name (Ritem) = Name_Interrupt_Handler
6770 Next_Rep_Item (Ritem);
6775 end Has_Interrupt_Handler;
6777 -----------------------------
6778 -- Has_Non_Null_Refinement --
6779 -----------------------------
6781 function Has_Non_Null_Refinement (Id : E) return B is
6783 -- "Refinement" is a concept applicable only to abstract states
6785 pragma Assert (Ekind (Id) = E_Abstract_State);
6787 if Has_Visible_Refinement (Id) then
6788 pragma Assert (Present (Refinement_Constituents (Id)));
6790 -- For a refinement to be non-null, the first constituent must be
6791 -- anything other than null.
6794 Nkind (Node (First_Elmt (Refinement_Constituents (Id)))) /= N_Null;
6798 end Has_Non_Null_Refinement;
6800 -----------------------------
6801 -- Has_Null_Abstract_State --
6802 -----------------------------
6804 function Has_Null_Abstract_State (Id : E) return B is
6806 pragma Assert (Ekind_In (Id, E_Generic_Package, E_Package));
6809 Present (Abstract_States (Id))
6810 and then Is_Null_State (Node (First_Elmt (Abstract_States (Id))));
6811 end Has_Null_Abstract_State;
6813 -------------------------
6814 -- Has_Null_Refinement --
6815 -------------------------
6817 function Has_Null_Refinement (Id : E) return B is
6819 -- "Refinement" is a concept applicable only to abstract states
6821 pragma Assert (Ekind (Id) = E_Abstract_State);
6823 if Has_Visible_Refinement (Id) then
6824 pragma Assert (Present (Refinement_Constituents (Id)));
6826 -- For a refinement to be null, the state's sole constituent must be
6830 Nkind (Node (First_Elmt (Refinement_Constituents (Id)))) = N_Null;
6834 end Has_Null_Refinement;
6836 --------------------
6837 -- Has_Unmodified --
6838 --------------------
6840 function Has_Unmodified (E : Entity_Id) return Boolean is
6842 if Has_Pragma_Unmodified (E) then
6844 elsif Warnings_Off (E) then
6845 Set_Warnings_Off_Used_Unmodified (E);
6852 ---------------------
6853 -- Has_Unreferenced --
6854 ---------------------
6856 function Has_Unreferenced (E : Entity_Id) return Boolean is
6858 if Has_Pragma_Unreferenced (E) then
6860 elsif Warnings_Off (E) then
6861 Set_Warnings_Off_Used_Unreferenced (E);
6866 end Has_Unreferenced;
6868 ----------------------
6869 -- Has_Warnings_Off --
6870 ----------------------
6872 function Has_Warnings_Off (E : Entity_Id) return Boolean is
6874 if Warnings_Off (E) then
6875 Set_Warnings_Off_Used (E);
6880 end Has_Warnings_Off;
6882 ------------------------------
6883 -- Implementation_Base_Type --
6884 ------------------------------
6886 function Implementation_Base_Type (Id : E) return E is
6891 Bastyp := Base_Type (Id);
6893 if Is_Incomplete_Or_Private_Type (Bastyp) then
6894 Imptyp := Underlying_Type (Bastyp);
6896 -- If we have an implementation type, then just return it,
6897 -- otherwise we return the Base_Type anyway. This can only
6898 -- happen in error situations and should avoid some error bombs.
6900 if Present (Imptyp) then
6901 return Base_Type (Imptyp);
6909 end Implementation_Base_Type;
6911 -------------------------
6912 -- Invariant_Procedure --
6913 -------------------------
6915 function Invariant_Procedure (Id : E) return E is
6919 pragma Assert (Is_Type (Id) and then Has_Invariants (Id));
6921 if No (Subprograms_For_Type (Id)) then
6925 S := Subprograms_For_Type (Id);
6926 while Present (S) loop
6927 if Is_Invariant_Procedure (S) then
6930 S := Subprograms_For_Type (S);
6936 end Invariant_Procedure;
6942 -- Global flag table allowing rapid computation of this function
6944 Entity_Is_Base_Type : constant array (Entity_Kind) of Boolean :=
6945 (E_Enumeration_Subtype |
6947 E_Signed_Integer_Subtype |
6948 E_Modular_Integer_Subtype |
6949 E_Floating_Point_Subtype |
6950 E_Ordinary_Fixed_Point_Subtype |
6951 E_Decimal_Fixed_Point_Subtype |
6956 E_Record_Subtype_With_Private |
6957 E_Limited_Private_Subtype |
6959 E_Protected_Subtype |
6961 E_String_Literal_Subtype |
6962 E_Class_Wide_Subtype => False,
6965 function Is_Base_Type (Id : E) return Boolean is
6967 return Entity_Is_Base_Type (Ekind (Id));
6970 ---------------------
6971 -- Is_Boolean_Type --
6972 ---------------------
6974 function Is_Boolean_Type (Id : E) return B is
6976 return Root_Type (Id) = Standard_Boolean;
6977 end Is_Boolean_Type;
6979 ------------------------
6980 -- Is_Constant_Object --
6981 ------------------------
6983 function Is_Constant_Object (Id : E) return B is
6984 K : constant Entity_Kind := Ekind (Id);
6987 K = E_Constant or else K = E_In_Parameter or else K = E_Loop_Parameter;
6988 end Is_Constant_Object;
6990 --------------------
6991 -- Is_Discriminal --
6992 --------------------
6994 function Is_Discriminal (Id : E) return B is
6996 return (Ekind_In (Id, E_Constant, E_In_Parameter)
6997 and then Present (Discriminal_Link (Id)));
7000 ----------------------
7001 -- Is_Dynamic_Scope --
7002 ----------------------
7004 function Is_Dynamic_Scope (Id : E) return B is
7007 Ekind (Id) = E_Block
7009 Ekind (Id) = E_Function
7011 Ekind (Id) = E_Procedure
7013 Ekind (Id) = E_Subprogram_Body
7015 Ekind (Id) = E_Task_Type
7017 (Ekind (Id) = E_Limited_Private_Type
7018 and then Present (Full_View (Id))
7019 and then Ekind (Full_View (Id)) = E_Task_Type)
7021 Ekind (Id) = E_Entry
7023 Ekind (Id) = E_Entry_Family
7025 Ekind (Id) = E_Return_Statement;
7026 end Is_Dynamic_Scope;
7028 --------------------
7029 -- Is_Entity_Name --
7030 --------------------
7032 function Is_Entity_Name (N : Node_Id) return Boolean is
7033 Kind : constant Node_Kind := Nkind (N);
7036 -- Identifiers, operator symbols, expanded names are entity names
7038 return Kind = N_Identifier
7039 or else Kind = N_Operator_Symbol
7040 or else Kind = N_Expanded_Name
7042 -- Attribute references are entity names if they refer to an entity.
7043 -- Note that we don't do this by testing for the presence of the
7044 -- Entity field in the N_Attribute_Reference node, since it may not
7045 -- have been set yet.
7047 or else (Kind = N_Attribute_Reference
7048 and then Is_Entity_Attribute_Name (Attribute_Name (N)));
7051 -----------------------
7052 -- Is_External_State --
7053 -----------------------
7055 function Is_External_State (Id : E) return B is
7058 Ekind (Id) = E_Abstract_State and then Has_Option (Id, Name_External);
7059 end Is_External_State;
7065 function Is_Finalizer (Id : E) return B is
7067 return Ekind (Id) = E_Procedure and then Chars (Id) = Name_uFinalizer;
7070 ---------------------
7071 -- Is_Ghost_Entity --
7072 ---------------------
7074 -- Note: coding below allows for ghost variables. They are not currently
7075 -- implemented, so we will always get False for variables, but that is
7076 -- expected to change in the future.
7078 function Is_Ghost_Entity (Id : E) return B is
7080 if Present (Id) and then Ekind (Id) = E_Variable then
7081 return Convention (Id) = Convention_Ghost;
7083 return Is_Ghost_Subprogram (Id);
7085 end Is_Ghost_Entity;
7087 -------------------------
7088 -- Is_Ghost_Subprogram --
7089 -------------------------
7091 function Is_Ghost_Subprogram (Id : E) return B is
7093 if Present (Id) and then Ekind_In (Id, E_Function, E_Procedure) then
7094 return Convention (Id) = Convention_Ghost;
7098 end Is_Ghost_Subprogram;
7104 function Is_Null_State (Id : E) return B is
7107 Ekind (Id) = E_Abstract_State and then Nkind (Parent (Id)) = N_Null;
7110 ---------------------
7111 -- Is_Packed_Array --
7112 ---------------------
7114 function Is_Packed_Array (Id : E) return B is
7116 return Is_Array_Type (Id) and then Is_Packed (Id);
7117 end Is_Packed_Array;
7119 -----------------------------------
7120 -- Is_Package_Or_Generic_Package --
7121 -----------------------------------
7123 function Is_Package_Or_Generic_Package (Id : E) return B is
7125 return Ekind_In (Id, E_Generic_Package, E_Package);
7126 end Is_Package_Or_Generic_Package;
7132 function Is_Prival (Id : E) return B is
7134 return (Ekind_In (Id, E_Constant, E_Variable)
7135 and then Present (Prival_Link (Id)));
7138 ----------------------------
7139 -- Is_Protected_Component --
7140 ----------------------------
7142 function Is_Protected_Component (Id : E) return B is
7144 return Ekind (Id) = E_Component and then Is_Protected_Type (Scope (Id));
7145 end Is_Protected_Component;
7147 ----------------------------
7148 -- Is_Protected_Interface --
7149 ----------------------------
7151 function Is_Protected_Interface (Id : E) return B is
7152 Typ : constant Entity_Id := Base_Type (Id);
7154 if not Is_Interface (Typ) then
7156 elsif Is_Class_Wide_Type (Typ) then
7157 return Is_Protected_Interface (Etype (Typ));
7159 return Protected_Present (Type_Definition (Parent (Typ)));
7161 end Is_Protected_Interface;
7163 ------------------------------
7164 -- Is_Protected_Record_Type --
7165 ------------------------------
7167 function Is_Protected_Record_Type (Id : E) return B is
7170 Is_Concurrent_Record_Type (Id)
7171 and then Is_Protected_Type (Corresponding_Concurrent_Type (Id));
7172 end Is_Protected_Record_Type;
7174 --------------------------------
7175 -- Is_Standard_Character_Type --
7176 --------------------------------
7178 function Is_Standard_Character_Type (Id : E) return B is
7180 if Is_Type (Id) then
7182 R : constant Entity_Id := Root_Type (Id);
7185 R = Standard_Character
7187 R = Standard_Wide_Character
7189 R = Standard_Wide_Wide_Character;
7195 end Is_Standard_Character_Type;
7197 --------------------
7198 -- Is_String_Type --
7199 --------------------
7201 function Is_String_Type (Id : E) return B is
7203 return Is_Array_Type (Id)
7204 and then Id /= Any_Composite
7205 and then Number_Dimensions (Id) = 1
7206 and then Is_Character_Type (Component_Type (Id));
7209 -------------------------------
7210 -- Is_Synchronized_Interface --
7211 -------------------------------
7213 function Is_Synchronized_Interface (Id : E) return B is
7214 Typ : constant Entity_Id := Base_Type (Id);
7217 if not Is_Interface (Typ) then
7220 elsif Is_Class_Wide_Type (Typ) then
7221 return Is_Synchronized_Interface (Etype (Typ));
7224 return Protected_Present (Type_Definition (Parent (Typ)))
7225 or else Synchronized_Present (Type_Definition (Parent (Typ)))
7226 or else Task_Present (Type_Definition (Parent (Typ)));
7228 end Is_Synchronized_Interface;
7230 -----------------------
7231 -- Is_Task_Interface --
7232 -----------------------
7234 function Is_Task_Interface (Id : E) return B is
7235 Typ : constant Entity_Id := Base_Type (Id);
7237 if not Is_Interface (Typ) then
7239 elsif Is_Class_Wide_Type (Typ) then
7240 return Is_Task_Interface (Etype (Typ));
7242 return Task_Present (Type_Definition (Parent (Typ)));
7244 end Is_Task_Interface;
7246 -------------------------
7247 -- Is_Task_Record_Type --
7248 -------------------------
7250 function Is_Task_Record_Type (Id : E) return B is
7253 Is_Concurrent_Record_Type (Id)
7254 and then Is_Task_Type (Corresponding_Concurrent_Type (Id));
7255 end Is_Task_Record_Type;
7257 ------------------------
7258 -- Is_Wrapper_Package --
7259 ------------------------
7261 function Is_Wrapper_Package (Id : E) return B is
7263 return (Ekind (Id) = E_Package and then Present (Related_Instance (Id)));
7264 end Is_Wrapper_Package;
7270 function Last_Formal (Id : E) return E is
7275 (Is_Overloadable (Id)
7276 or else Ekind_In (Id, E_Entry_Family,
7278 E_Subprogram_Type));
7280 if Ekind (Id) = E_Enumeration_Literal then
7284 Formal := First_Formal (Id);
7286 if Present (Formal) then
7287 while Present (Next_Formal (Formal)) loop
7288 Formal := Next_Formal (Formal);
7296 function Model_Emin_Value (Id : E) return Uint is
7298 return Machine_Emin_Value (Id);
7299 end Model_Emin_Value;
7301 -------------------------
7302 -- Model_Epsilon_Value --
7303 -------------------------
7305 function Model_Epsilon_Value (Id : E) return Ureal is
7306 Radix : constant Ureal := UR_From_Uint (Machine_Radix_Value (Id));
7308 return Radix ** (1 - Model_Mantissa_Value (Id));
7309 end Model_Epsilon_Value;
7311 --------------------------
7312 -- Model_Mantissa_Value --
7313 --------------------------
7315 function Model_Mantissa_Value (Id : E) return Uint is
7317 return Machine_Mantissa_Value (Id);
7318 end Model_Mantissa_Value;
7320 -----------------------
7321 -- Model_Small_Value --
7322 -----------------------
7324 function Model_Small_Value (Id : E) return Ureal is
7325 Radix : constant Ureal := UR_From_Uint (Machine_Radix_Value (Id));
7327 return Radix ** (Model_Emin_Value (Id) - 1);
7328 end Model_Small_Value;
7330 ------------------------
7331 -- Machine_Emax_Value --
7332 ------------------------
7334 function Machine_Emax_Value (Id : E) return Uint is
7335 Digs : constant Pos := UI_To_Int (Digits_Value (Base_Type (Id)));
7338 case Float_Rep (Id) is
7341 when 1 .. 6 => return Uint_128;
7342 when 7 .. 15 => return 2**10;
7343 when 16 .. 33 => return 2**14;
7344 when others => return No_Uint;
7348 return Uint_2 ** Uint_7 - Uint_1;
7350 end Machine_Emax_Value;
7352 ------------------------
7353 -- Machine_Emin_Value --
7354 ------------------------
7356 function Machine_Emin_Value (Id : E) return Uint is
7358 case Float_Rep (Id) is
7359 when IEEE_Binary => return Uint_3 - Machine_Emax_Value (Id);
7360 when AAMP => return -Machine_Emax_Value (Id);
7362 end Machine_Emin_Value;
7364 ----------------------------
7365 -- Machine_Mantissa_Value --
7366 ----------------------------
7368 function Machine_Mantissa_Value (Id : E) return Uint is
7369 Digs : constant Pos := UI_To_Int (Digits_Value (Base_Type (Id)));
7372 case Float_Rep (Id) is
7375 when 1 .. 6 => return Uint_24;
7376 when 7 .. 15 => return UI_From_Int (53);
7377 when 16 .. 18 => return Uint_64;
7378 when 19 .. 33 => return UI_From_Int (113);
7379 when others => return No_Uint;
7384 when 1 .. 6 => return Uint_24;
7385 when 7 .. 9 => return UI_From_Int (40);
7386 when others => return No_Uint;
7389 end Machine_Mantissa_Value;
7391 -------------------------
7392 -- Machine_Radix_Value --
7393 -------------------------
7395 function Machine_Radix_Value (Id : E) return U is
7397 case Float_Rep (Id) is
7398 when IEEE_Binary | AAMP =>
7401 end Machine_Radix_Value;
7403 --------------------
7404 -- Next_Component --
7405 --------------------
7407 function Next_Component (Id : E) return E is
7411 Comp_Id := Next_Entity (Id);
7412 while Present (Comp_Id) loop
7413 exit when Ekind (Comp_Id) = E_Component;
7414 Comp_Id := Next_Entity (Comp_Id);
7420 ------------------------------------
7421 -- Next_Component_Or_Discriminant --
7422 ------------------------------------
7424 function Next_Component_Or_Discriminant (Id : E) return E is
7428 Comp_Id := Next_Entity (Id);
7429 while Present (Comp_Id) loop
7430 exit when Ekind_In (Comp_Id, E_Component, E_Discriminant);
7431 Comp_Id := Next_Entity (Comp_Id);
7435 end Next_Component_Or_Discriminant;
7437 -----------------------
7438 -- Next_Discriminant --
7439 -----------------------
7441 -- This function actually implements both Next_Discriminant and
7442 -- Next_Stored_Discriminant by making sure that the Discriminant
7443 -- returned is of the same variety as Id.
7445 function Next_Discriminant (Id : E) return E is
7447 -- Derived Tagged types with private extensions look like this...
7449 -- E_Discriminant d1
7450 -- E_Discriminant d2
7452 -- E_Discriminant d1
7453 -- E_Discriminant d2
7456 -- so it is critical not to go past the leading discriminants
7461 pragma Assert (Ekind (Id) = E_Discriminant);
7464 D := Next_Entity (D);
7466 or else (Ekind (D) /= E_Discriminant
7467 and then not Is_Itype (D))
7472 exit when Ekind (D) = E_Discriminant
7473 and then (Is_Completely_Hidden (D) = Is_Completely_Hidden (Id));
7477 end Next_Discriminant;
7483 function Next_Formal (Id : E) return E is
7487 -- Follow the chain of declared entities as long as the kind of the
7488 -- entity corresponds to a formal parameter. Skip internal entities
7489 -- that may have been created for implicit subtypes, in the process
7490 -- of analyzing default expressions.
7494 P := Next_Entity (P);
7496 if No (P) or else Is_Formal (P) then
7498 elsif not Is_Internal (P) then
7504 -----------------------------
7505 -- Next_Formal_With_Extras --
7506 -----------------------------
7508 function Next_Formal_With_Extras (Id : E) return E is
7510 if Present (Extra_Formal (Id)) then
7511 return Extra_Formal (Id);
7513 return Next_Formal (Id);
7515 end Next_Formal_With_Extras;
7521 function Next_Index (Id : Node_Id) return Node_Id is
7530 function Next_Literal (Id : E) return E is
7532 pragma Assert (Nkind (Id) in N_Entity);
7536 ------------------------------
7537 -- Next_Stored_Discriminant --
7538 ------------------------------
7540 function Next_Stored_Discriminant (Id : E) return E is
7542 -- See comment in Next_Discriminant
7544 return Next_Discriminant (Id);
7545 end Next_Stored_Discriminant;
7547 -----------------------
7548 -- Number_Dimensions --
7549 -----------------------
7551 function Number_Dimensions (Id : E) return Pos is
7556 if Ekind (Id) = E_String_Literal_Subtype then
7561 T := First_Index (Id);
7562 while Present (T) loop
7569 end Number_Dimensions;
7571 --------------------
7572 -- Number_Entries --
7573 --------------------
7575 function Number_Entries (Id : E) return Nat is
7580 pragma Assert (Is_Concurrent_Type (Id));
7583 Ent := First_Entity (Id);
7584 while Present (Ent) loop
7585 if Is_Entry (Ent) then
7589 Ent := Next_Entity (Ent);
7595 --------------------
7596 -- Number_Formals --
7597 --------------------
7599 function Number_Formals (Id : E) return Pos is
7605 Formal := First_Formal (Id);
7606 while Present (Formal) loop
7608 Formal := Next_Formal (Formal);
7614 --------------------
7615 -- Parameter_Mode --
7616 --------------------
7618 function Parameter_Mode (Id : E) return Formal_Kind is
7623 ------------------------
7624 -- Predicate_Function --
7625 ------------------------
7627 function Predicate_Function (Id : E) return E is
7632 pragma Assert (Is_Type (Id));
7634 -- If type is private and has a completion, predicate may be defined
7635 -- on the full view.
7637 if Is_Private_Type (Id) and then Present (Full_View (Id)) then
7638 T := Full_View (Id);
7643 if No (Subprograms_For_Type (T)) then
7647 S := Subprograms_For_Type (T);
7648 while Present (S) loop
7649 if Is_Predicate_Function (S) then
7652 S := Subprograms_For_Type (S);
7658 end Predicate_Function;
7660 --------------------------
7661 -- Predicate_Function_M --
7662 --------------------------
7664 function Predicate_Function_M (Id : E) return E is
7669 pragma Assert (Is_Type (Id));
7671 -- If type is private and has a completion, predicate may be defined
7672 -- on the full view.
7674 if Is_Private_Type (Id) and then Present (Full_View (Id)) then
7675 T := Full_View (Id);
7680 if No (Subprograms_For_Type (T)) then
7684 S := Subprograms_For_Type (T);
7685 while Present (S) loop
7686 if Is_Predicate_Function_M (S) then
7689 S := Subprograms_For_Type (S);
7695 end Predicate_Function_M;
7697 -------------------------
7698 -- Present_In_Rep_Item --
7699 -------------------------
7701 function Present_In_Rep_Item (E : Entity_Id; N : Node_Id) return Boolean is
7705 Ritem := First_Rep_Item (E);
7707 while Present (Ritem) loop
7712 Next_Rep_Item (Ritem);
7716 end Present_In_Rep_Item;
7718 --------------------------
7719 -- Primitive_Operations --
7720 --------------------------
7722 function Primitive_Operations (Id : E) return L is
7724 if Is_Concurrent_Type (Id) then
7725 if Present (Corresponding_Record_Type (Id)) then
7726 return Direct_Primitive_Operations
7727 (Corresponding_Record_Type (Id));
7729 -- If expansion is disabled the corresponding record type is absent,
7730 -- but if the type has ancestors it may have primitive operations.
7732 elsif Is_Tagged_Type (Id) then
7733 return Direct_Primitive_Operations (Id);
7739 return Direct_Primitive_Operations (Id);
7741 end Primitive_Operations;
7743 ---------------------
7744 -- Record_Rep_Item --
7745 ---------------------
7747 procedure Record_Rep_Item (E : Entity_Id; N : Node_Id) is
7749 Set_Next_Rep_Item (N, First_Rep_Item (E));
7750 Set_First_Rep_Item (E, N);
7751 end Record_Rep_Item;
7757 function Root_Type (Id : E) return E is
7761 pragma Assert (Nkind (Id) in N_Entity);
7763 T := Base_Type (Id);
7765 if Ekind (T) = E_Class_Wide_Type then
7777 -- Following test catches some error cases resulting from
7780 elsif No (Etyp) then
7781 Check_Error_Detected;
7784 elsif Is_Private_Type (T) and then Etyp = Full_View (T) then
7787 elsif Is_Private_Type (Etyp) and then Full_View (Etyp) = T then
7793 -- Return if there is a circularity in the inheritance chain. This
7794 -- happens in some error situations and we do not want to get
7795 -- stuck in this loop.
7797 if T = Base_Type (Id) then
7804 ---------------------
7805 -- Safe_Emax_Value --
7806 ---------------------
7808 function Safe_Emax_Value (Id : E) return Uint is
7810 return Machine_Emax_Value (Id);
7811 end Safe_Emax_Value;
7813 ----------------------
7814 -- Safe_First_Value --
7815 ----------------------
7817 function Safe_First_Value (Id : E) return Ureal is
7819 return -Safe_Last_Value (Id);
7820 end Safe_First_Value;
7822 ---------------------
7823 -- Safe_Last_Value --
7824 ---------------------
7826 function Safe_Last_Value (Id : E) return Ureal is
7827 Radix : constant Uint := Machine_Radix_Value (Id);
7828 Mantissa : constant Uint := Machine_Mantissa_Value (Id);
7829 Emax : constant Uint := Safe_Emax_Value (Id);
7830 Significand : constant Uint := Radix ** Mantissa - 1;
7831 Exponent : constant Uint := Emax - Mantissa;
7837 (Num => Significand * 2 ** (Exponent mod 4),
7838 Den => -Exponent / 4,
7844 (Num => Significand,
7848 end Safe_Last_Value;
7854 function Scope_Depth (Id : E) return Uint is
7859 while Is_Record_Type (Scop) loop
7860 Scop := Scope (Scop);
7863 return Scope_Depth_Value (Scop);
7866 ---------------------
7867 -- Scope_Depth_Set --
7868 ---------------------
7870 function Scope_Depth_Set (Id : E) return B is
7872 return not Is_Record_Type (Id)
7873 and then Field22 (Id) /= Union_Id (Empty);
7874 end Scope_Depth_Set;
7876 -----------------------------
7877 -- Set_Component_Alignment --
7878 -----------------------------
7880 -- Component Alignment is encoded using two flags, Flag128/129 as
7881 -- follows. Note that both flags False = Align_Default, so that the
7882 -- default initialization of flags to False initializes component
7883 -- alignment to the default value as required.
7885 -- Flag128 Flag129 Value
7886 -- ------- ------- -----
7887 -- False False Calign_Default
7888 -- False True Calign_Component_Size
7889 -- True False Calign_Component_Size_4
7890 -- True True Calign_Storage_Unit
7892 procedure Set_Component_Alignment (Id : E; V : C) is
7894 pragma Assert ((Is_Array_Type (Id) or else Is_Record_Type (Id))
7895 and then Is_Base_Type (Id));
7898 when Calign_Default =>
7899 Set_Flag128 (Id, False);
7900 Set_Flag129 (Id, False);
7902 when Calign_Component_Size =>
7903 Set_Flag128 (Id, False);
7904 Set_Flag129 (Id, True);
7906 when Calign_Component_Size_4 =>
7907 Set_Flag128 (Id, True);
7908 Set_Flag129 (Id, False);
7910 when Calign_Storage_Unit =>
7911 Set_Flag128 (Id, True);
7912 Set_Flag129 (Id, True);
7914 end Set_Component_Alignment;
7916 -----------------------------
7917 -- Set_Invariant_Procedure --
7918 -----------------------------
7920 procedure Set_Invariant_Procedure (Id : E; V : E) is
7924 pragma Assert (Is_Type (Id) and then Has_Invariants (Id));
7926 S := Subprograms_For_Type (Id);
7927 Set_Subprograms_For_Type (Id, V);
7928 Set_Subprograms_For_Type (V, S);
7930 -- Check for duplicate entry
7932 while Present (S) loop
7933 if Is_Invariant_Procedure (S) then
7934 raise Program_Error;
7936 S := Subprograms_For_Type (S);
7939 end Set_Invariant_Procedure;
7941 ----------------------------
7942 -- Set_Predicate_Function --
7943 ----------------------------
7945 procedure Set_Predicate_Function (Id : E; V : E) is
7949 pragma Assert (Is_Type (Id) and then Has_Predicates (Id));
7951 S := Subprograms_For_Type (Id);
7952 Set_Subprograms_For_Type (Id, V);
7953 Set_Subprograms_For_Type (V, S);
7955 while Present (S) loop
7956 if Is_Predicate_Function (S) then
7957 raise Program_Error;
7959 S := Subprograms_For_Type (S);
7962 end Set_Predicate_Function;
7964 ------------------------------
7965 -- Set_Predicate_Function_M --
7966 ------------------------------
7968 procedure Set_Predicate_Function_M (Id : E; V : E) is
7972 pragma Assert (Is_Type (Id) and then Has_Predicates (Id));
7974 S := Subprograms_For_Type (Id);
7975 Set_Subprograms_For_Type (Id, V);
7976 Set_Subprograms_For_Type (V, S);
7978 -- Check for duplicates
7980 while Present (S) loop
7981 if Is_Predicate_Function_M (S) then
7982 raise Program_Error;
7984 S := Subprograms_For_Type (S);
7987 end Set_Predicate_Function_M;
7993 function Size_Clause (Id : E) return N is
7995 return Get_Attribute_Definition_Clause (Id, Attribute_Size);
7998 ------------------------
7999 -- Stream_Size_Clause --
8000 ------------------------
8002 function Stream_Size_Clause (Id : E) return N is
8004 return Get_Attribute_Definition_Clause (Id, Attribute_Stream_Size);
8005 end Stream_Size_Clause;
8011 function Subtype_Kind (K : Entity_Kind) return Entity_Kind is
8017 Kind := E_Access_Subtype;
8021 Kind := E_Array_Subtype;
8023 when E_Class_Wide_Type |
8024 E_Class_Wide_Subtype =>
8025 Kind := E_Class_Wide_Subtype;
8027 when E_Decimal_Fixed_Point_Type |
8028 E_Decimal_Fixed_Point_Subtype =>
8029 Kind := E_Decimal_Fixed_Point_Subtype;
8031 when E_Ordinary_Fixed_Point_Type |
8032 E_Ordinary_Fixed_Point_Subtype =>
8033 Kind := E_Ordinary_Fixed_Point_Subtype;
8035 when E_Private_Type |
8036 E_Private_Subtype =>
8037 Kind := E_Private_Subtype;
8039 when E_Limited_Private_Type |
8040 E_Limited_Private_Subtype =>
8041 Kind := E_Limited_Private_Subtype;
8043 when E_Record_Type_With_Private |
8044 E_Record_Subtype_With_Private =>
8045 Kind := E_Record_Subtype_With_Private;
8047 when E_Record_Type |
8049 Kind := E_Record_Subtype;
8051 when Enumeration_Kind =>
8052 Kind := E_Enumeration_Subtype;
8055 Kind := E_Floating_Point_Subtype;
8057 when Signed_Integer_Kind =>
8058 Kind := E_Signed_Integer_Subtype;
8060 when Modular_Integer_Kind =>
8061 Kind := E_Modular_Integer_Subtype;
8063 when Protected_Kind =>
8064 Kind := E_Protected_Subtype;
8067 Kind := E_Task_Subtype;
8071 raise Program_Error;
8077 ---------------------
8078 -- Type_High_Bound --
8079 ---------------------
8081 function Type_High_Bound (Id : E) return Node_Id is
8082 Rng : constant Node_Id := Scalar_Range (Id);
8084 if Nkind (Rng) = N_Subtype_Indication then
8085 return High_Bound (Range_Expression (Constraint (Rng)));
8087 return High_Bound (Rng);
8089 end Type_High_Bound;
8091 --------------------
8092 -- Type_Low_Bound --
8093 --------------------
8095 function Type_Low_Bound (Id : E) return Node_Id is
8096 Rng : constant Node_Id := Scalar_Range (Id);
8098 if Nkind (Rng) = N_Subtype_Indication then
8099 return Low_Bound (Range_Expression (Constraint (Rng)));
8101 return Low_Bound (Rng);
8105 ---------------------
8106 -- Underlying_Type --
8107 ---------------------
8109 function Underlying_Type (Id : E) return E is
8111 -- For record_with_private the underlying type is always the direct
8112 -- full view. Never try to take the full view of the parent it
8113 -- doesn't make sense.
8115 if Ekind (Id) = E_Record_Type_With_Private then
8116 return Full_View (Id);
8118 elsif Ekind (Id) in Incomplete_Or_Private_Kind then
8120 -- If we have an incomplete or private type with a full view,
8121 -- then we return the Underlying_Type of this full view
8123 if Present (Full_View (Id)) then
8124 if Id = Full_View (Id) then
8126 -- Previous error in declaration
8131 return Underlying_Type (Full_View (Id));
8134 -- If we have an incomplete entity that comes from the limited
8135 -- view then we return the Underlying_Type of its non-limited
8138 elsif From_Limited_With (Id)
8139 and then Present (Non_Limited_View (Id))
8141 return Underlying_Type (Non_Limited_View (Id));
8143 -- Otherwise check for the case where we have a derived type or
8144 -- subtype, and if so get the Underlying_Type of the parent type.
8146 elsif Etype (Id) /= Id then
8147 return Underlying_Type (Etype (Id));
8149 -- Otherwise we have an incomplete or private type that has
8150 -- no full view, which means that we have not encountered the
8151 -- completion, so return Empty to indicate the underlying type
8152 -- is not yet known.
8158 -- For non-incomplete, non-private types, return the type itself Also
8159 -- for entities that are not types at all return the entity itself.
8164 end Underlying_Type;
8166 ------------------------
8167 -- Write_Entity_Flags --
8168 ------------------------
8170 procedure Write_Entity_Flags (Id : Entity_Id; Prefix : String) is
8172 procedure W (Flag_Name : String; Flag : Boolean);
8173 -- Write out given flag if it is set
8179 procedure W (Flag_Name : String; Flag : Boolean) is
8183 Write_Str (Flag_Name);
8184 Write_Str (" = True");
8189 -- Start of processing for Write_Entity_Flags
8192 if (Is_Array_Type (Id) or else Is_Record_Type (Id))
8193 and then Is_Base_Type (Id)
8196 Write_Str ("Component_Alignment = ");
8198 case Component_Alignment (Id) is
8199 when Calign_Default =>
8200 Write_Str ("Calign_Default");
8202 when Calign_Component_Size =>
8203 Write_Str ("Calign_Component_Size");
8205 when Calign_Component_Size_4 =>
8206 Write_Str ("Calign_Component_Size_4");
8208 when Calign_Storage_Unit =>
8209 Write_Str ("Calign_Storage_Unit");
8215 W ("Address_Taken", Flag104 (Id));
8216 W ("Body_Needed_For_SAL", Flag40 (Id));
8217 W ("C_Pass_By_Copy", Flag125 (Id));
8218 W ("Can_Never_Be_Null", Flag38 (Id));
8219 W ("Checks_May_Be_Suppressed", Flag31 (Id));
8220 W ("Debug_Info_Off", Flag166 (Id));
8221 W ("Default_Expressions_Processed", Flag108 (Id));
8222 W ("Delay_Cleanups", Flag114 (Id));
8223 W ("Delay_Subprogram_Descriptors", Flag50 (Id));
8224 W ("Depends_On_Private", Flag14 (Id));
8225 W ("Discard_Names", Flag88 (Id));
8226 W ("Elaboration_Entity_Required", Flag174 (Id));
8227 W ("Elaborate_Body_Desirable", Flag210 (Id));
8228 W ("Entry_Accepted", Flag152 (Id));
8229 W ("Can_Use_Internal_Rep", Flag229 (Id));
8230 W ("Finalize_Storage_Only", Flag158 (Id));
8231 W ("From_Limited_With", Flag159 (Id));
8232 W ("Has_Aliased_Components", Flag135 (Id));
8233 W ("Has_Alignment_Clause", Flag46 (Id));
8234 W ("Has_All_Calls_Remote", Flag79 (Id));
8235 W ("Has_Anonymous_Master", Flag253 (Id));
8236 W ("Has_Atomic_Components", Flag86 (Id));
8237 W ("Has_Biased_Representation", Flag139 (Id));
8238 W ("Has_Completion", Flag26 (Id));
8239 W ("Has_Completion_In_Body", Flag71 (Id));
8240 W ("Has_Complex_Representation", Flag140 (Id));
8241 W ("Has_Component_Size_Clause", Flag68 (Id));
8242 W ("Has_Contiguous_Rep", Flag181 (Id));
8243 W ("Has_Controlled_Component", Flag43 (Id));
8244 W ("Has_Controlling_Result", Flag98 (Id));
8245 W ("Has_Convention_Pragma", Flag119 (Id));
8246 W ("Has_Default_Aspect", Flag39 (Id));
8247 W ("Has_Delayed_Aspects", Flag200 (Id));
8248 W ("Has_Delayed_Freeze", Flag18 (Id));
8249 W ("Has_Delayed_Rep_Aspects", Flag261 (Id));
8250 W ("Has_Discriminants", Flag5 (Id));
8251 W ("Has_Dispatch_Table", Flag220 (Id));
8252 W ("Has_Dynamic_Predicate_Aspect", Flag258 (Id));
8253 W ("Has_Enumeration_Rep_Clause", Flag66 (Id));
8254 W ("Has_Exit", Flag47 (Id));
8255 W ("Has_Forward_Instantiation", Flag175 (Id));
8256 W ("Has_Fully_Qualified_Name", Flag173 (Id));
8257 W ("Has_Gigi_Rep_Item", Flag82 (Id));
8258 W ("Has_Homonym", Flag56 (Id));
8259 W ("Has_Implicit_Dereference", Flag251 (Id));
8260 W ("Has_Independent_Components", Flag34 (Id));
8261 W ("Has_Inheritable_Invariants", Flag248 (Id));
8262 W ("Has_Initial_Value", Flag219 (Id));
8263 W ("Has_Invariants", Flag232 (Id));
8264 W ("Has_Loop_Entry_Attributes", Flag260 (Id));
8265 W ("Has_Machine_Radix_Clause", Flag83 (Id));
8266 W ("Has_Master_Entity", Flag21 (Id));
8267 W ("Has_Missing_Return", Flag142 (Id));
8268 W ("Has_Nested_Block_With_Handler", Flag101 (Id));
8269 W ("Has_Non_Standard_Rep", Flag75 (Id));
8270 W ("Has_Out_Or_In_Out_Parameter", Flag110 (Id));
8271 W ("Has_Object_Size_Clause", Flag172 (Id));
8272 W ("Has_Per_Object_Constraint", Flag154 (Id));
8273 W ("Has_Postconditions", Flag240 (Id));
8274 W ("Has_Pragma_Controlled", Flag27 (Id));
8275 W ("Has_Pragma_Elaborate_Body", Flag150 (Id));
8276 W ("Has_Pragma_Inline", Flag157 (Id));
8277 W ("Has_Pragma_Inline_Always", Flag230 (Id));
8278 W ("Has_Pragma_No_Inline", Flag201 (Id));
8279 W ("Has_Pragma_Ordered", Flag198 (Id));
8280 W ("Has_Pragma_Pack", Flag121 (Id));
8281 W ("Has_Pragma_Preelab_Init", Flag221 (Id));
8282 W ("Has_Pragma_Pure", Flag203 (Id));
8283 W ("Has_Pragma_Pure_Function", Flag179 (Id));
8284 W ("Has_Pragma_Thread_Local_Storage", Flag169 (Id));
8285 W ("Has_Pragma_Unmodified", Flag233 (Id));
8286 W ("Has_Pragma_Unreferenced", Flag180 (Id));
8287 W ("Has_Pragma_Unreferenced_Objects", Flag212 (Id));
8288 W ("Has_Predicates", Flag250 (Id));
8289 W ("Has_Primitive_Operations", Flag120 (Id));
8290 W ("Has_Private_Ancestor", Flag151 (Id));
8291 W ("Has_Private_Declaration", Flag155 (Id));
8292 W ("Has_Protected", Flag271 (Id));
8293 W ("Has_Qualified_Name", Flag161 (Id));
8294 W ("Has_RACW", Flag214 (Id));
8295 W ("Has_Record_Rep_Clause", Flag65 (Id));
8296 W ("Has_Recursive_Call", Flag143 (Id));
8297 W ("Has_Shift_Operator", Flag267 (Id));
8298 W ("Has_Size_Clause", Flag29 (Id));
8299 W ("Has_Small_Clause", Flag67 (Id));
8300 W ("Has_Specified_Layout", Flag100 (Id));
8301 W ("Has_Specified_Stream_Input", Flag190 (Id));
8302 W ("Has_Specified_Stream_Output", Flag191 (Id));
8303 W ("Has_Specified_Stream_Read", Flag192 (Id));
8304 W ("Has_Specified_Stream_Write", Flag193 (Id));
8305 W ("Has_Static_Discriminants", Flag211 (Id));
8306 W ("Has_Static_Predicate", Flag269 (Id));
8307 W ("Has_Static_Predicate_Aspect", Flag259 (Id));
8308 W ("Has_Storage_Size_Clause", Flag23 (Id));
8309 W ("Has_Stream_Size_Clause", Flag184 (Id));
8310 W ("Has_Task", Flag30 (Id));
8311 W ("Has_Thunks", Flag228 (Id));
8312 W ("Has_Unchecked_Union", Flag123 (Id));
8313 W ("Has_Unknown_Discriminants", Flag72 (Id));
8314 W ("Has_Up_Level_Access", Flag215 (Id));
8315 W ("Has_Visible_Refinement", Flag263 (Id));
8316 W ("Has_Volatile_Components", Flag87 (Id));
8317 W ("Has_Xref_Entry", Flag182 (Id));
8318 W ("In_Package_Body", Flag48 (Id));
8319 W ("In_Private_Part", Flag45 (Id));
8320 W ("In_Use", Flag8 (Id));
8321 W ("Is_Abstract_Subprogram", Flag19 (Id));
8322 W ("Is_Abstract_Type", Flag146 (Id));
8323 W ("Is_Local_Anonymous_Access", Flag194 (Id));
8324 W ("Is_Access_Constant", Flag69 (Id));
8325 W ("Is_Ada_2005_Only", Flag185 (Id));
8326 W ("Is_Ada_2012_Only", Flag199 (Id));
8327 W ("Is_Aliased", Flag15 (Id));
8328 W ("Is_Asynchronous", Flag81 (Id));
8329 W ("Is_Atomic", Flag85 (Id));
8330 W ("Is_Bit_Packed_Array", Flag122 (Id));
8331 W ("Is_CPP_Class", Flag74 (Id));
8332 W ("Is_Called", Flag102 (Id));
8333 W ("Is_Character_Type", Flag63 (Id));
8334 W ("Is_Child_Unit", Flag73 (Id));
8335 W ("Is_Class_Wide_Equivalent_Type", Flag35 (Id));
8336 W ("Is_Compilation_Unit", Flag149 (Id));
8337 W ("Is_Completely_Hidden", Flag103 (Id));
8338 W ("Is_Concurrent_Record_Type", Flag20 (Id));
8339 W ("Is_Constr_Subt_For_UN_Aliased", Flag141 (Id));
8340 W ("Is_Constr_Subt_For_U_Nominal", Flag80 (Id));
8341 W ("Is_Constrained", Flag12 (Id));
8342 W ("Is_Constructor", Flag76 (Id));
8343 W ("Is_Controlled", Flag42 (Id));
8344 W ("Is_Controlling_Formal", Flag97 (Id));
8345 W ("Is_Descendent_Of_Address", Flag223 (Id));
8346 W ("Is_Discrim_SO_Function", Flag176 (Id));
8347 W ("Is_Discriminant_Check_Function", Flag264 (Id));
8348 W ("Is_Dispatch_Table_Entity", Flag234 (Id));
8349 W ("Is_Dispatching_Operation", Flag6 (Id));
8350 W ("Is_Eliminated", Flag124 (Id));
8351 W ("Is_Entry_Formal", Flag52 (Id));
8352 W ("Is_Exported", Flag99 (Id));
8353 W ("Is_First_Subtype", Flag70 (Id));
8354 W ("Is_For_Access_Subtype", Flag118 (Id));
8355 W ("Is_Formal_Subprogram", Flag111 (Id));
8356 W ("Is_Frozen", Flag4 (Id));
8357 W ("Is_Generic_Actual_Subprogram", Flag274 (Id));
8358 W ("Is_Generic_Actual_Type", Flag94 (Id));
8359 W ("Is_Generic_Instance", Flag130 (Id));
8360 W ("Is_Generic_Type", Flag13 (Id));
8361 W ("Is_Hidden", Flag57 (Id));
8362 W ("Is_Hidden_Non_Overridden_Subpgm", Flag2 (Id));
8363 W ("Is_Hidden_Open_Scope", Flag171 (Id));
8364 W ("Is_Immediately_Visible", Flag7 (Id));
8365 W ("Is_Implementation_Defined", Flag254 (Id));
8366 W ("Is_Imported", Flag24 (Id));
8367 W ("Is_Independent", Flag268 (Id));
8368 W ("Is_Inlined", Flag11 (Id));
8369 W ("Is_Inlined_Always", Flag1 (Id));
8370 W ("Is_Instantiated", Flag126 (Id));
8371 W ("Is_Interface", Flag186 (Id));
8372 W ("Is_Internal", Flag17 (Id));
8373 W ("Is_Interrupt_Handler", Flag89 (Id));
8374 W ("Is_Intrinsic_Subprogram", Flag64 (Id));
8375 W ("Is_Invariant_Procedure", Flag257 (Id));
8376 W ("Is_Itype", Flag91 (Id));
8377 W ("Is_Known_Non_Null", Flag37 (Id));
8378 W ("Is_Known_Null", Flag204 (Id));
8379 W ("Is_Known_Valid", Flag170 (Id));
8380 W ("Is_Limited_Composite", Flag106 (Id));
8381 W ("Is_Limited_Interface", Flag197 (Id));
8382 W ("Is_Limited_Record", Flag25 (Id));
8383 W ("Is_Machine_Code_Subprogram", Flag137 (Id));
8384 W ("Is_Non_Static_Subtype", Flag109 (Id));
8385 W ("Is_Null_Init_Proc", Flag178 (Id));
8386 W ("Is_Obsolescent", Flag153 (Id));
8387 W ("Is_Only_Out_Parameter", Flag226 (Id));
8388 W ("Is_Package_Body_Entity", Flag160 (Id));
8389 W ("Is_Packed", Flag51 (Id));
8390 W ("Is_Packed_Array_Impl_Type", Flag138 (Id));
8391 W ("Is_Potentially_Use_Visible", Flag9 (Id));
8392 W ("Is_Predicate_Function", Flag255 (Id));
8393 W ("Is_Predicate_Function_M", Flag256 (Id));
8394 W ("Is_Preelaborated", Flag59 (Id));
8395 W ("Is_Primitive", Flag218 (Id));
8396 W ("Is_Primitive_Wrapper", Flag195 (Id));
8397 W ("Is_Private_Composite", Flag107 (Id));
8398 W ("Is_Private_Descendant", Flag53 (Id));
8399 W ("Is_Private_Primitive", Flag245 (Id));
8400 W ("Is_Processed_Transient", Flag252 (Id));
8401 W ("Is_Public", Flag10 (Id));
8402 W ("Is_Pure", Flag44 (Id));
8403 W ("Is_Pure_Unit_Access_Type", Flag189 (Id));
8404 W ("Is_RACW_Stub_Type", Flag244 (Id));
8405 W ("Is_Raised", Flag224 (Id));
8406 W ("Is_Remote_Call_Interface", Flag62 (Id));
8407 W ("Is_Remote_Types", Flag61 (Id));
8408 W ("Is_Renaming_Of_Object", Flag112 (Id));
8409 W ("Is_Return_Object", Flag209 (Id));
8410 W ("Is_Safe_To_Reevaluate", Flag249 (Id));
8411 W ("Is_Shared_Passive", Flag60 (Id));
8412 W ("Is_Statically_Allocated", Flag28 (Id));
8413 W ("Is_Tag", Flag78 (Id));
8414 W ("Is_Tagged_Type", Flag55 (Id));
8415 W ("Is_Thunk", Flag225 (Id));
8416 W ("Is_Trivial_Subprogram", Flag235 (Id));
8417 W ("Is_True_Constant", Flag163 (Id));
8418 W ("Is_Unchecked_Union", Flag117 (Id));
8419 W ("Is_Underlying_Record_View", Flag246 (Id));
8420 W ("Is_Unsigned_Type", Flag144 (Id));
8421 W ("Is_Valued_Procedure", Flag127 (Id));
8422 W ("Is_Visible_Formal", Flag206 (Id));
8423 W ("Is_Visible_Lib_Unit", Flag116 (Id));
8424 W ("Is_Volatile", Flag16 (Id));
8425 W ("Itype_Printed", Flag202 (Id));
8426 W ("Kill_Elaboration_Checks", Flag32 (Id));
8427 W ("Kill_Range_Checks", Flag33 (Id));
8428 W ("Known_To_Have_Preelab_Init", Flag207 (Id));
8429 W ("Low_Bound_Tested", Flag205 (Id));
8430 W ("Machine_Radix_10", Flag84 (Id));
8431 W ("Materialize_Entity", Flag168 (Id));
8432 W ("May_Inherit_Delayed_Rep_Aspects", Flag262 (Id));
8433 W ("Must_Be_On_Byte_Boundary", Flag183 (Id));
8434 W ("Must_Have_Preelab_Init", Flag208 (Id));
8435 W ("Needs_Debug_Info", Flag147 (Id));
8436 W ("Needs_No_Actuals", Flag22 (Id));
8437 W ("Never_Set_In_Source", Flag115 (Id));
8438 W ("No_Dynamic_Predicate_On_actual", Flag276 (Id));
8439 W ("No_Pool_Assigned", Flag131 (Id));
8440 W ("No_Predicate_On_actual", Flag275 (Id));
8441 W ("No_Return", Flag113 (Id));
8442 W ("No_Strict_Aliasing", Flag136 (Id));
8443 W ("Non_Binary_Modulus", Flag58 (Id));
8444 W ("Nonzero_Is_True", Flag162 (Id));
8445 W ("OK_To_Rename", Flag247 (Id));
8446 W ("OK_To_Reorder_Components", Flag239 (Id));
8447 W ("Optimize_Alignment_Space", Flag241 (Id));
8448 W ("Optimize_Alignment_Time", Flag242 (Id));
8449 W ("Overlays_Constant", Flag243 (Id));
8450 W ("Reachable", Flag49 (Id));
8451 W ("Referenced", Flag156 (Id));
8452 W ("Referenced_As_LHS", Flag36 (Id));
8453 W ("Referenced_As_Out_Parameter", Flag227 (Id));
8454 W ("Renamed_In_Spec", Flag231 (Id));
8455 W ("Requires_Overriding", Flag213 (Id));
8456 W ("Return_Present", Flag54 (Id));
8457 W ("Returns_By_Ref", Flag90 (Id));
8458 W ("Reverse_Bit_Order", Flag164 (Id));
8459 W ("Reverse_Storage_Order", Flag93 (Id));
8460 W ("Sec_Stack_Needed_For_Return", Flag167 (Id));
8461 W ("Size_Depends_On_Discriminant", Flag177 (Id));
8462 W ("Size_Known_At_Compile_Time", Flag92 (Id));
8463 W ("SPARK_Aux_Pragma_Inherited", Flag266 (Id));
8464 W ("SPARK_Pragma_Inherited", Flag265 (Id));
8465 W ("SSO_Set_High_By_Default", Flag273 (Id));
8466 W ("SSO_Set_Low_By_Default", Flag272 (Id));
8467 W ("Static_Elaboration_Desired", Flag77 (Id));
8468 W ("Stores_Attribute_Old_Prefix", Flag270 (Id));
8469 W ("Strict_Alignment", Flag145 (Id));
8470 W ("Suppress_Elaboration_Warnings", Flag148 (Id));
8471 W ("Suppress_Initialization", Flag105 (Id));
8472 W ("Suppress_Style_Checks", Flag165 (Id));
8473 W ("Suppress_Value_Tracking_On_Call", Flag217 (Id));
8474 W ("Treat_As_Volatile", Flag41 (Id));
8475 W ("Universal_Aliasing", Flag216 (Id));
8476 W ("Used_As_Generic_Actual", Flag222 (Id));
8477 W ("Uses_Sec_Stack", Flag95 (Id));
8478 W ("Warnings_Off", Flag96 (Id));
8479 W ("Warnings_Off_Used", Flag236 (Id));
8480 W ("Warnings_Off_Used_Unmodified", Flag237 (Id));
8481 W ("Warnings_Off_Used_Unreferenced", Flag238 (Id));
8482 W ("Was_Hidden", Flag196 (Id));
8483 end Write_Entity_Flags;
8485 -----------------------
8486 -- Write_Entity_Info --
8487 -----------------------
8489 procedure Write_Entity_Info (Id : Entity_Id; Prefix : String) is
8491 procedure Write_Attribute (Which : String; Nam : E);
8492 -- Write attribute value with given string name
8494 procedure Write_Kind (Id : Entity_Id);
8495 -- Write Ekind field of entity
8497 ---------------------
8498 -- Write_Attribute --
8499 ---------------------
8501 procedure Write_Attribute (Which : String; Nam : E) is
8505 Write_Int (Int (Nam));
8507 Write_Name (Chars (Nam));
8509 end Write_Attribute;
8515 procedure Write_Kind (Id : Entity_Id) is
8516 K : constant String := Entity_Kind'Image (Ekind (Id));
8520 Write_Str (" Kind ");
8522 if Is_Type (Id) and then Is_Tagged_Type (Id) then
8523 Write_Str ("TAGGED ");
8526 Write_Str (K (3 .. K'Length));
8529 if Is_Type (Id) and then Depends_On_Private (Id) then
8530 Write_Str ("Depends_On_Private ");
8534 -- Start of processing for Write_Entity_Info
8538 Write_Attribute ("Name ", Id);
8539 Write_Int (Int (Id));
8543 Write_Attribute (" Type ", Etype (Id));
8545 Write_Attribute (" Scope ", Scope (Id));
8550 when Discrete_Kind =>
8551 Write_Str ("Bounds: Id = ");
8553 if Present (Scalar_Range (Id)) then
8554 Write_Int (Int (Type_Low_Bound (Id)));
8555 Write_Str (" .. Id = ");
8556 Write_Int (Int (Type_High_Bound (Id)));
8558 Write_Str ("Empty");
8569 (" Component Type ", Component_Type (Id));
8572 Write_Str (" Indexes ");
8574 Index := First_Index (Id);
8575 while Present (Index) loop
8576 Write_Attribute (" ", Etype (Index));
8577 Index := Next_Index (Index);
8585 (" Directly Designated Type ",
8586 Directly_Designated_Type (Id));
8589 when Overloadable_Kind =>
8590 if Present (Homonym (Id)) then
8591 Write_Str (" Homonym ");
8592 Write_Name (Chars (Homonym (Id)));
8594 Write_Int (Int (Homonym (Id)));
8601 if Ekind (Scope (Id)) in Record_Kind then
8603 " Original_Record_Component ",
8604 Original_Record_Component (Id));
8605 Write_Int (Int (Original_Record_Component (Id)));
8609 when others => null;
8611 end Write_Entity_Info;
8613 -----------------------
8614 -- Write_Field6_Name --
8615 -----------------------
8617 procedure Write_Field6_Name (Id : Entity_Id) is
8618 pragma Warnings (Off, Id);
8620 Write_Str ("First_Rep_Item");
8621 end Write_Field6_Name;
8623 -----------------------
8624 -- Write_Field7_Name --
8625 -----------------------
8627 procedure Write_Field7_Name (Id : Entity_Id) is
8628 pragma Warnings (Off, Id);
8630 Write_Str ("Freeze_Node");
8631 end Write_Field7_Name;
8633 -----------------------
8634 -- Write_Field8_Name --
8635 -----------------------
8637 procedure Write_Field8_Name (Id : Entity_Id) is
8641 Write_Str ("Associated_Node_For_Itype");
8644 Write_Str ("Dependent_Instances");
8647 Write_Str ("First_Exit_Statement");
8650 Write_Str ("Hiding_Loop_Variable");
8654 E_Subprogram_Body =>
8655 Write_Str ("Mechanism");
8659 Write_Str ("Normalized_First_Bit");
8662 Write_Str ("Postcondition_Proc");
8664 when E_Abstract_State =>
8665 Write_Str ("Refinement_Constituents");
8667 when E_Return_Statement =>
8668 Write_Str ("Return_Applies_To");
8671 Write_Str ("Field8??");
8673 end Write_Field8_Name;
8675 -----------------------
8676 -- Write_Field9_Name --
8677 -----------------------
8679 procedure Write_Field9_Name (Id : Entity_Id) is
8683 Write_Str ("Class_Wide_Type");
8686 Write_Str ("Current_Value");
8688 when E_Abstract_State =>
8689 Write_Str ("Part_Of_Constituents");
8692 E_Generic_Function |
8694 E_Generic_Procedure |
8697 Write_Str ("Renaming_Map");
8700 Write_Str ("Field9??");
8702 end Write_Field9_Name;
8704 ------------------------
8705 -- Write_Field10_Name --
8706 ------------------------
8708 procedure Write_Field10_Name (Id : Entity_Id) is
8711 when E_Abstract_State |
8713 Write_Str ("Encapsulating_State");
8715 when Class_Wide_Kind |
8721 Write_Str ("Direct_Primitive_Operations");
8724 Write_Str ("Float_Rep");
8726 when E_In_Parameter |
8728 Write_Str ("Discriminal_Link");
8734 Write_Str ("Handler_Records");
8738 Write_Str ("Normalized_Position_Max");
8741 Write_Str ("Field10??");
8743 end Write_Field10_Name;
8745 ------------------------
8746 -- Write_Field11_Name --
8747 ------------------------
8749 procedure Write_Field11_Name (Id : Entity_Id) is
8753 Write_Str ("Block_Node");
8757 Write_Str ("Component_Bit_Offset");
8760 Write_Str ("Entry_Component");
8762 when E_Enumeration_Literal =>
8763 Write_Str ("Enumeration_Pos");
8767 Write_Str ("Full_View");
8769 when E_Generic_Package =>
8770 Write_Str ("Generic_Homonym");
8776 Write_Str ("Protected_Body_Subprogram");
8779 Write_Str ("Field11??");
8781 end Write_Field11_Name;
8783 ------------------------
8784 -- Write_Field12_Name --
8785 ------------------------
8787 procedure Write_Field12_Name (Id : Entity_Id) is
8791 Write_Str ("Associated_Formal_Package");
8794 Write_Str ("Barrier_Function");
8796 when E_Enumeration_Literal =>
8797 Write_Str ("Enumeration_Rep");
8805 E_In_Out_Parameter |
8809 Write_Str ("Esize");
8813 Write_Str ("Next_Inlined_Subprogram");
8816 Write_Str ("Field12??");
8818 end Write_Field12_Name;
8820 ------------------------
8821 -- Write_Field13_Name --
8822 ------------------------
8824 procedure Write_Field13_Name (Id : Entity_Id) is
8829 Write_Str ("Component_Clause");
8832 Write_Str ("Elaboration_Entity");
8836 Generic_Unit_Kind =>
8837 Write_Str ("Elaboration_Entity");
8841 Write_Str ("Extra_Accessibility");
8844 Write_Str ("RM_Size");
8847 Write_Str ("Field13??");
8849 end Write_Field13_Name;
8851 -----------------------
8852 -- Write_Field14_Name --
8853 -----------------------
8855 procedure Write_Field14_Name (Id : Entity_Id) is
8864 Write_Str ("Alignment");
8868 Write_Str ("Normalized_Position");
8871 E_Generic_Package =>
8872 Write_Str ("Shadow_Entities");
8875 Write_Str ("Field14??");
8877 end Write_Field14_Name;
8879 ------------------------
8880 -- Write_Field15_Name --
8881 ------------------------
8883 procedure Write_Field15_Name (Id : Entity_Id) is
8886 when E_Discriminant =>
8887 Write_Str ("Discriminant_Number");
8890 Write_Str ("DT_Entry_Count");
8894 Write_Str ("DT_Position");
8896 when E_Protected_Type =>
8897 Write_Str ("Entry_Bodies_Array");
8900 Write_Str ("Entry_Parameters_Type");
8903 Write_Str ("Extra_Formal");
8905 when Enumeration_Kind =>
8906 Write_Str ("Lit_Indexes");
8910 Write_Str ("Related_Instance");
8912 when Decimal_Fixed_Point_Kind =>
8913 Write_Str ("Scale_Value");
8917 Write_Str ("Status_Flag_Or_Transient_Decl");
8921 Write_Str ("Storage_Size_Variable");
8923 when E_String_Literal_Subtype =>
8924 Write_Str ("String_Literal_Low_Bound");
8927 Write_Str ("Field15??");
8929 end Write_Field15_Name;
8931 ------------------------
8932 -- Write_Field16_Name --
8933 ------------------------
8935 procedure Write_Field16_Name (Id : Entity_Id) is
8938 when E_Record_Type |
8939 E_Record_Type_With_Private =>
8940 Write_Str ("Access_Disp_Table");
8942 when E_Abstract_State =>
8943 Write_Str ("Body_References");
8945 when E_Record_Subtype |
8946 E_Class_Wide_Subtype =>
8947 Write_Str ("Cloned_Subtype");
8951 Write_Str ("DTC_Entity");
8954 Write_Str ("Entry_Formal");
8959 Write_Str ("First_Private_Entity");
8961 when Enumeration_Kind =>
8962 Write_Str ("Lit_Strings");
8964 when E_String_Literal_Subtype =>
8965 Write_Str ("String_Literal_Length");
8969 Write_Str ("Unset_Reference");
8972 Write_Str ("Field16??");
8974 end Write_Field16_Name;
8976 ------------------------
8977 -- Write_Field17_Name --
8978 ------------------------
8980 procedure Write_Field17_Name (Id : Entity_Id) is
8985 E_Generic_In_Out_Parameter |
8987 Write_Str ("Actual_Subtype");
8990 Write_Str ("Digits_Value");
8992 when E_Discriminant =>
8993 Write_Str ("Discriminal");
9002 E_Generic_Function |
9004 E_Generic_Procedure |
9012 E_Return_Statement |
9014 E_Subprogram_Type =>
9015 Write_Str ("First_Entity");
9018 Write_Str ("First_Index");
9020 when Enumeration_Kind =>
9021 Write_Str ("First_Literal");
9024 Write_Str ("Master_Id");
9026 when Modular_Integer_Kind =>
9027 Write_Str ("Modulus");
9029 when E_Abstract_State |
9030 E_Incomplete_Type =>
9031 Write_Str ("Non_Limited_View");
9033 when E_Incomplete_Subtype =>
9034 if From_Limited_With (Id) then
9035 Write_Str ("Non_Limited_View");
9039 Write_Str ("Prival");
9042 Write_Str ("Field17??");
9044 end Write_Field17_Name;
9046 ------------------------
9047 -- Write_Field18_Name --
9048 ------------------------
9050 procedure Write_Field18_Name (Id : Entity_Id) is
9053 when E_Enumeration_Literal |
9057 Write_Str ("Alias");
9059 when E_Record_Type =>
9060 Write_Str ("Corresponding_Concurrent_Type");
9062 when E_Subprogram_Body =>
9063 Write_Str ("Corresponding_Protected_Entry");
9065 when Concurrent_Kind =>
9066 Write_Str ("Corresponding_Record_Type");
9071 Write_Str ("Enclosing_Scope");
9073 when E_Entry_Index_Parameter =>
9074 Write_Str ("Entry_Index_Constant");
9076 when E_Class_Wide_Subtype |
9077 E_Access_Protected_Subprogram_Type |
9078 E_Anonymous_Access_Protected_Subprogram_Type |
9079 E_Access_Subprogram_Type |
9081 Write_Str ("Equivalent_Type");
9083 when Fixed_Point_Kind =>
9084 Write_Str ("Delta_Value");
9086 when Incomplete_Or_Private_Kind |
9088 Write_Str ("Private_Dependents");
9091 Write_Str ("Renamed_Object");
9095 E_Generic_Function |
9096 E_Generic_Procedure |
9097 E_Generic_Package =>
9098 Write_Str ("Renamed_Entity");
9101 Write_Str ("Field18??");
9103 end Write_Field18_Name;
9105 -----------------------
9106 -- Write_Field19_Name --
9107 -----------------------
9109 procedure Write_Field19_Name (Id : Entity_Id) is
9113 E_Generic_Package =>
9114 Write_Str ("Body_Entity");
9116 when E_Discriminant =>
9117 Write_Str ("Corresponding_Discriminant");
9120 Write_Str ("Default_Aspect_Value");
9122 when E_Array_Type =>
9123 Write_Str ("Default_Component_Value");
9125 when E_Record_Type =>
9126 Write_Str ("Parent_Subtype");
9130 Write_Str ("Size_Check_Code");
9132 when E_Package_Body |
9134 Write_Str ("Spec_Entity");
9136 when Private_Kind =>
9137 Write_Str ("Underlying_Full_View");
9139 when E_Function | E_Operator | E_Subprogram_Type =>
9140 Write_Str ("Extra_Accessibility_Of_Result");
9143 Write_Str ("Field19??");
9145 end Write_Field19_Name;
9147 -----------------------
9148 -- Write_Field20_Name --
9149 -----------------------
9151 procedure Write_Field20_Name (Id : Entity_Id) is
9155 Write_Str ("Component_Type");
9157 when E_In_Parameter |
9158 E_Generic_In_Parameter =>
9159 Write_Str ("Default_Value");
9162 Write_Str ("Directly_Designated_Type");
9165 Write_Str ("Discriminant_Checking_Func");
9167 when E_Discriminant =>
9168 Write_Str ("Discriminant_Default_Value");
9177 E_Generic_Function |
9179 E_Generic_Procedure |
9187 E_Return_Statement |
9189 E_Subprogram_Type =>
9190 Write_Str ("Last_Entity");
9194 Write_Str ("Prival_Link");
9197 Write_Str ("Scalar_Range");
9200 Write_Str ("Register_Exception_Call");
9203 Write_Str ("Field20??");
9205 end Write_Field20_Name;
9207 -----------------------
9208 -- Write_Field21_Name --
9209 -----------------------
9211 procedure Write_Field21_Name (Id : Entity_Id) is
9215 Write_Str ("Accept_Address");
9217 when E_In_Parameter =>
9218 Write_Str ("Default_Expr_Function");
9220 when Concurrent_Kind |
9221 Incomplete_Or_Private_Kind |
9225 Write_Str ("Discriminant_Constraint");
9230 E_Generic_Function |
9232 E_Generic_Procedure |
9234 Write_Str ("Interface_Name");
9237 Modular_Integer_Kind =>
9238 Write_Str ("Original_Array_Type");
9240 when Fixed_Point_Kind =>
9241 Write_Str ("Small_Value");
9244 Write_Str ("Field21??");
9246 end Write_Field21_Name;
9248 -----------------------
9249 -- Write_Field22_Name --
9250 -----------------------
9252 procedure Write_Field22_Name (Id : Entity_Id) is
9256 Write_Str ("Associated_Storage_Pool");
9259 Write_Str ("Component_Size");
9261 when E_Record_Type =>
9262 Write_Str ("Corresponding_Remote_Type");
9266 Write_Str ("Original_Record_Component");
9268 when E_Enumeration_Literal =>
9269 Write_Str ("Enumeration_Rep_Expr");
9271 when E_Record_Type_With_Private |
9272 E_Record_Subtype_With_Private |
9275 E_Limited_Private_Type |
9276 E_Limited_Private_Subtype =>
9277 Write_Str ("Private_View");
9280 Write_Str ("Protected_Formal");
9290 E_Generic_Function |
9291 E_Generic_Procedure |
9294 E_Return_Statement |
9297 Write_Str ("Scope_Depth_Value");
9300 Write_Str ("Shared_Var_Procs_Instance");
9303 Write_Str ("Field22??");
9305 end Write_Field22_Name;
9307 ------------------------
9308 -- Write_Field23_Name --
9309 ------------------------
9311 procedure Write_Field23_Name (Id : Entity_Id) is
9314 when E_Discriminant =>
9315 Write_Str ("CR_Discriminant");
9318 Write_Str ("Entry_Cancel_Parameter");
9320 when E_Enumeration_Type =>
9321 Write_Str ("Enum_Pos_To_Rep");
9325 Write_Str ("Extra_Constrained");
9328 Write_Str ("Finalization_Master");
9330 when E_Generic_Function |
9332 E_Generic_Procedure =>
9333 Write_Str ("Inner_Instances");
9336 Write_Str ("Packed_Array_Impl_Type");
9339 Write_Str ("Protection_Object");
9341 when Concurrent_Kind |
9342 Incomplete_Or_Private_Kind |
9346 Write_Str ("Stored_Constraint");
9350 if Present (Scope (Id))
9351 and then Is_Protected_Type (Scope (Id))
9353 Write_Str ("Protection_Object");
9355 Write_Str ("Generic_Renamings");
9359 if Is_Generic_Instance (Id) then
9360 Write_Str ("Generic_Renamings");
9362 Write_Str ("Limited_View");
9366 Write_Str ("Field23??");
9368 end Write_Field23_Name;
9370 ------------------------
9371 -- Write_Field24_Name --
9372 ------------------------
9374 procedure Write_Field24_Name (Id : Entity_Id) is
9380 Write_Str ("Related_Expression");
9383 Write_Str ("Field24???");
9385 end Write_Field24_Name;
9387 ------------------------
9388 -- Write_Field25_Name --
9389 ------------------------
9391 procedure Write_Field25_Name (Id : Entity_Id) is
9394 when E_Generic_Package |
9396 Write_Str ("Abstract_States");
9399 Write_Str ("Debug_Renaming_Link");
9402 Write_Str ("DT_Offset_To_Top_Func");
9406 Write_Str ("Interface_Alias");
9408 when E_Record_Type |
9410 E_Record_Type_With_Private |
9411 E_Record_Subtype_With_Private =>
9412 Write_Str ("Interfaces");
9416 Write_Str ("Related_Array_Object");
9419 Write_Str ("Task_Body_Procedure");
9423 Write_Str ("PPC_Wrapper");
9425 when Discrete_Kind =>
9426 Write_Str ("Static_Discrete_Predicate");
9429 Write_Str ("Static_Real_Or_String_Predicate");
9432 Write_Str ("Field25??");
9434 end Write_Field25_Name;
9436 ------------------------
9437 -- Write_Field26_Name --
9438 ------------------------
9440 procedure Write_Field26_Name (Id : Entity_Id) is
9443 when E_Record_Type |
9444 E_Record_Type_With_Private =>
9445 Write_Str ("Dispatch_Table_Wrappers");
9447 when E_In_Out_Parameter |
9450 Write_Str ("Last_Assignment");
9452 when E_Access_Subprogram_Type =>
9453 Write_Str ("Original_Access_Type");
9455 when E_Generic_Package |
9457 Write_Str ("Package_Instantiation");
9461 Write_Str ("Related_Type");
9464 Write_Str ("Relative_Deadline_Variable");
9468 Write_Str ("Overridden_Operation");
9471 Write_Str ("Field26??");
9473 end Write_Field26_Name;
9475 ------------------------
9476 -- Write_Field27_Name --
9477 ------------------------
9479 procedure Write_Field27_Name (Id : Entity_Id) is
9484 Write_Str ("Current_Use_Clause");
9489 Write_Str ("Related_Type");
9493 Write_Str ("Wrapped_Entity");
9496 Write_Str ("Field27??");
9498 end Write_Field27_Name;
9500 ------------------------
9501 -- Write_Field28_Name --
9502 ------------------------
9504 procedure Write_Field28_Name (Id : Entity_Id) is
9512 E_Subprogram_Type =>
9513 Write_Str ("Extra_Formals");
9517 Write_Str ("Finalizer");
9521 Write_Str ("Initialization_Statements");
9523 when E_Record_Type =>
9524 Write_Str ("Underlying_Record_View");
9527 Write_Str ("Field28??");
9529 end Write_Field28_Name;
9531 ------------------------
9532 -- Write_Field29_Name --
9533 ------------------------
9535 procedure Write_Field29_Name (Id : Entity_Id) is
9540 Write_Str ("BIP_Initialization_Call");
9543 Write_Str ("Subprograms_For_Type");
9546 Write_Str ("Field29??");
9548 end Write_Field29_Name;
9550 ------------------------
9551 -- Write_Field30_Name --
9552 ------------------------
9554 procedure Write_Field30_Name (Id : Entity_Id) is
9558 Write_Str ("Corresponding_Equality");
9562 Write_Str ("Last_Aggregate_Assignment");
9565 Write_Str ("Static_Initialization");
9568 Write_Str ("Field30??");
9570 end Write_Field30_Name;
9572 ------------------------
9573 -- Write_Field31_Name --
9574 ------------------------
9576 procedure Write_Field31_Name (Id : Entity_Id) is
9581 Write_Str ("Thunk_Entity");
9584 Write_Str ("Derived_Type_Link");
9587 Write_Str ("Field31??");
9589 end Write_Field31_Name;
9591 ------------------------
9592 -- Write_Field32_Name --
9593 ------------------------
9595 procedure Write_Field32_Name (Id : Entity_Id) is
9599 E_Generic_Function |
9601 E_Generic_Procedure |
9605 E_Subprogram_Body =>
9606 Write_Str ("SPARK_Pragma");
9609 Write_Str ("Field32??");
9611 end Write_Field32_Name;
9613 ------------------------
9614 -- Write_Field33_Name --
9615 ------------------------
9617 procedure Write_Field33_Name (Id : Entity_Id) is
9620 when E_Generic_Package |
9623 Write_Str ("SPARK_Aux_Pragma");
9629 Write_Str ("Linker_Section_Pragma");
9632 Write_Str ("Field33??");
9634 end Write_Field33_Name;
9636 ------------------------
9637 -- Write_Field34_Name --
9638 ------------------------
9640 procedure Write_Field34_Name (Id : Entity_Id) is
9650 Generic_Subprogram_Kind |
9652 Write_Str ("Contract");
9655 Write_Str ("Field34??");
9657 end Write_Field34_Name;
9659 ------------------------
9660 -- Write_Field35_Name --
9661 ------------------------
9663 procedure Write_Field35_Name (Id : Entity_Id) is
9666 when Subprogram_Kind =>
9667 Write_Str ("Import_Pragma");
9669 Write_Str ("Field35??");
9671 end Write_Field35_Name;
9673 -------------------------
9674 -- Iterator Procedures --
9675 -------------------------
9677 procedure Proc_Next_Component (N : in out Node_Id) is
9679 N := Next_Component (N);
9680 end Proc_Next_Component;
9682 procedure Proc_Next_Component_Or_Discriminant (N : in out Node_Id) is
9684 N := Next_Entity (N);
9685 while Present (N) loop
9686 exit when Ekind_In (N, E_Component, E_Discriminant);
9687 N := Next_Entity (N);
9689 end Proc_Next_Component_Or_Discriminant;
9691 procedure Proc_Next_Discriminant (N : in out Node_Id) is
9693 N := Next_Discriminant (N);
9694 end Proc_Next_Discriminant;
9696 procedure Proc_Next_Formal (N : in out Node_Id) is
9698 N := Next_Formal (N);
9699 end Proc_Next_Formal;
9701 procedure Proc_Next_Formal_With_Extras (N : in out Node_Id) is
9703 N := Next_Formal_With_Extras (N);
9704 end Proc_Next_Formal_With_Extras;
9706 procedure Proc_Next_Index (N : in out Node_Id) is
9708 N := Next_Index (N);
9709 end Proc_Next_Index;
9711 procedure Proc_Next_Inlined_Subprogram (N : in out Node_Id) is
9713 N := Next_Inlined_Subprogram (N);
9714 end Proc_Next_Inlined_Subprogram;
9716 procedure Proc_Next_Literal (N : in out Node_Id) is
9718 N := Next_Literal (N);
9719 end Proc_Next_Literal;
9721 procedure Proc_Next_Stored_Discriminant (N : in out Node_Id) is
9723 N := Next_Stored_Discriminant (N);
9724 end Proc_Next_Stored_Discriminant;