]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/ada/einfo.adb
2da6f4465f974e3a45afba8911c4b953e1dd925b
[thirdparty/gcc.git] / gcc / ada / einfo.adb
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- E I N F O --
6 -- --
7 -- B o d y --
8 -- --
9 -- Copyright (C) 1992-2021, Free Software Foundation, Inc. --
10 -- --
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. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
20 -- --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
23 -- --
24 ------------------------------------------------------------------------------
25
26 with Atree; use Atree;
27 with Elists; use Elists;
28 with Namet; use Namet;
29 with Nlists; use Nlists;
30 with Output; use Output;
31 with Sinfo; use Sinfo;
32 with Stand; use Stand;
33
34 package body Einfo is
35
36 use Atree.Unchecked_Access;
37 -- This is one of the packages that is allowed direct untyped access to
38 -- the fields in a node, since it provides the next level abstraction
39 -- which incorporates appropriate checks.
40
41 ----------------------------------------------
42 -- Usage of Fields in Defining Entity Nodes --
43 ----------------------------------------------
44
45 -- Four of these fields are defined in Sinfo, since they in are the base
46 -- part of the node. The access routines for these four fields and the
47 -- corresponding set procedures are defined in Sinfo. These fields are
48 -- present in all entities. Note that Homonym is also in the base part of
49 -- the node, but has access routines that are more properly part of Einfo,
50 -- which is why they are defined here.
51
52 -- Chars Name1
53 -- Next_Entity Node2
54 -- Scope Node3
55 -- Etype Node5
56
57 -- Remaining fields are present only in extended nodes (i.e. entities).
58
59 -- The following fields are present in all entities
60
61 -- Homonym Node4
62 -- First_Rep_Item Node6
63 -- Freeze_Node Node7
64 -- Prev_Entity Node36
65 -- Associated_Entity Node37
66
67 -- The usage of other fields (and the entity kinds to which it applies)
68 -- depends on the particular field (see Einfo spec for details).
69
70 -- Associated_Node_For_Itype Node8
71 -- Dependent_Instances Elist8
72 -- Hiding_Loop_Variable Node8
73 -- Mechanism Uint8 (but returns Mechanism_Type)
74 -- Normalized_First_Bit Uint8
75 -- Refinement_Constituents Elist8
76 -- Return_Applies_To Node8
77 -- First_Exit_Statement Node8
78
79 -- Class_Wide_Type Node9
80 -- Current_Value Node9
81 -- Renaming_Map Uint9
82
83 -- Direct_Primitive_Operations Elist10
84 -- Discriminal_Link Node10
85 -- Float_Rep Uint10 (but returns Float_Rep_Kind)
86 -- Handler_Records List10
87 -- Normalized_Position_Max Uint10
88 -- Part_Of_Constituents Elist10
89
90 -- Block_Node Node11
91 -- Component_Bit_Offset Uint11
92 -- Full_View Node11
93 -- Entry_Component Node11
94 -- Enumeration_Pos Uint11
95 -- Generic_Homonym Node11
96 -- Part_Of_References Elist11
97 -- Protected_Body_Subprogram Node11
98
99 -- Barrier_Function Node12
100 -- Enumeration_Rep Uint12
101 -- Esize Uint12
102 -- Next_Inlined_Subprogram Node12
103
104 -- Component_Clause Node13
105 -- Elaboration_Entity Node13
106 -- Extra_Accessibility Node13
107 -- RM_Size Uint13
108
109 -- Alignment Uint14
110 -- Normalized_Position Uint14
111 -- Postconditions_Proc Node14
112
113 -- Discriminant_Number Uint15
114 -- DT_Position Uint15
115 -- DT_Entry_Count Uint15
116 -- Entry_Parameters_Type Node15
117 -- Extra_Formal Node15
118 -- Pending_Access_Types Elist15
119 -- Related_Instance Node15
120 -- Status_Flag_Or_Transient_Decl Node15
121
122 -- Access_Disp_Table Elist16
123 -- Body_References Elist16
124 -- Cloned_Subtype Node16
125 -- DTC_Entity Node16
126 -- Entry_Formal Node16
127 -- First_Private_Entity Node16
128 -- Lit_Strings Node16
129 -- Scale_Value Uint16
130 -- String_Literal_Length Uint16
131 -- Unset_Reference Node16
132
133 -- Actual_Subtype Node17
134 -- Digits_Value Uint17
135 -- Discriminal Node17
136 -- First_Entity Node17
137 -- First_Index Node17
138 -- First_Literal Node17
139 -- Master_Id Node17
140 -- Modulus Uint17
141 -- Prival Node17
142
143 -- Alias Node18
144 -- Corresponding_Concurrent_Type Node18
145 -- Corresponding_Protected_Entry Node18
146 -- Corresponding_Record_Type Node18
147 -- Delta_Value Ureal18
148 -- Enclosing_Scope Node18
149 -- Equivalent_Type Node18
150 -- Lit_Indexes Node18
151 -- Private_Dependents Elist18
152 -- Renamed_Entity Node18
153 -- Renamed_Object Node18
154 -- String_Literal_Low_Bound Node18
155
156 -- Body_Entity Node19
157 -- Corresponding_Discriminant Node19
158 -- Default_Aspect_Component_Value Node19
159 -- Default_Aspect_Value Node19
160 -- Entry_Bodies_Array Node19
161 -- Extra_Accessibility_Of_Result Node19
162 -- Non_Limited_View Node19
163 -- Parent_Subtype Node19
164 -- Receiving_Entry Node19
165 -- Size_Check_Code Node19
166 -- Spec_Entity Node19
167 -- Underlying_Full_View Node19
168
169 -- Component_Type Node20
170 -- Default_Value Node20
171 -- Directly_Designated_Type Node20
172 -- Discriminant_Checking_Func Node20
173 -- Discriminant_Default_Value Node20
174 -- Last_Entity Node20
175 -- Prival_Link Node20
176 -- Register_Exception_Call Node20
177 -- Scalar_Range Node20
178
179 -- Accept_Address Elist21
180 -- Corresponding_Record_Component Node21
181 -- Default_Expr_Function Node21
182 -- Discriminant_Constraint Elist21
183 -- Lit_Hash Node21
184 -- Interface_Name Node21
185 -- Original_Array_Type Node21
186 -- Small_Value Ureal21
187
188 -- Associated_Storage_Pool Node22
189 -- Component_Size Uint22
190 -- Corresponding_Remote_Type Node22
191 -- Enumeration_Rep_Expr Node22
192 -- Original_Record_Component Node22
193 -- Protected_Formal Node22
194 -- Scope_Depth_Value Uint22
195 -- Shared_Var_Procs_Instance Node22
196
197 -- CR_Discriminant Node23
198 -- Entry_Cancel_Parameter Node23
199 -- Enum_Pos_To_Rep Node23
200 -- Extra_Constrained Node23
201 -- Finalization_Master Node23
202 -- Generic_Renamings Elist23
203 -- Inner_Instances Elist23
204 -- Limited_View Node23
205 -- Packed_Array_Impl_Type Node23
206 -- Protection_Object Node23
207 -- Stored_Constraint Elist23
208
209 -- Incomplete_Actuals Elist24
210 -- Minimum_Accessibility Node24
211 -- Related_Expression Node24
212 -- Subps_Index Uint24
213
214 -- Contract_Wrapper Node25
215 -- Debug_Renaming_Link Node25
216 -- DT_Offset_To_Top_Func Node25
217 -- Interface_Alias Node25
218 -- Interfaces Elist25
219 -- Related_Array_Object Node25
220 -- Static_Discrete_Predicate List25
221 -- Static_Real_Or_String_Predicate Node25
222 -- Task_Body_Procedure Node25
223
224 -- Dispatch_Table_Wrappers Elist26
225 -- Last_Assignment Node26
226 -- Overridden_Operation Node26
227 -- Package_Instantiation Node26
228 -- Storage_Size_Variable Node26
229
230 -- Current_Use_Clause Node27
231 -- Related_Type Node27
232 -- Wrapped_Entity Node27
233
234 -- Extra_Formals Node28
235 -- Finalizer Node28
236 -- Initialization_Statements Node28
237 -- Original_Access_Type Node28
238 -- Relative_Deadline_Variable Node28
239 -- Underlying_Record_View Node28
240
241 -- Anonymous_Masters Elist29
242 -- BIP_Initialization_Call Node29
243 -- Subprograms_For_Type Elist29
244
245 -- Access_Disp_Table_Elab_Flag Node30
246 -- Anonymous_Object Node30
247 -- Corresponding_Equality Node30
248 -- Hidden_In_Formal_Instance Elist30
249 -- Last_Aggregate_Assignment Node30
250 -- Static_Initialization Node30
251
252 -- Activation_Record_Component Node31
253 -- Derived_Type_Link Node31
254 -- Thunk_Entity Node31
255
256 -- Corresponding_Function Node32
257 -- Corresponding_Procedure Node32
258 -- Encapsulating_State Node32
259 -- No_Tagged_Streams_Pragma Node32
260
261 -- Linker_Section_Pragma Node33
262
263 -- Contract Node34
264
265 -- Anonymous_Designated_Type Node35
266 -- Entry_Max_Queue_Lengths_Array Node35
267 -- Import_Pragma Node35
268
269 -- Validated_Object Node38
270 -- Predicated_Parent Node38
271 -- Class_Wide_Clone Node38
272
273 -- Protected_Subprogram Node39
274
275 -- SPARK_Pragma Node40
276
277 -- Access_Subprogram_Wrapper Node41
278 -- Original_Protected_Subprogram Node41
279 -- SPARK_Aux_Pragma Node41
280
281 ---------------------------------------------
282 -- Usage of Flags in Defining Entity Nodes --
283 ---------------------------------------------
284
285 -- All flags are unique, there is no overlaying, so each flag is physically
286 -- present in every entity. However, for many of the flags, it only makes
287 -- sense for them to be set true for certain subsets of entity kinds. See
288 -- the spec of Einfo for further details.
289
290 -- Is_Inlined_Always Flag1
291 -- Is_Hidden_Non_Overridden_Subpgm Flag2
292 -- Has_Own_DIC Flag3
293 -- Is_Frozen Flag4
294 -- Has_Discriminants Flag5
295 -- Is_Dispatching_Operation Flag6
296 -- Is_Immediately_Visible Flag7
297 -- In_Use Flag8
298 -- Is_Potentially_Use_Visible Flag9
299 -- Is_Public Flag10
300
301 -- Is_Inlined Flag11
302 -- Is_Constrained Flag12
303 -- Is_Generic_Type Flag13
304 -- Depends_On_Private Flag14
305 -- Is_Aliased Flag15
306 -- Is_Volatile Flag16
307 -- Is_Internal Flag17
308 -- Has_Delayed_Freeze Flag18
309 -- Is_Abstract_Subprogram Flag19
310 -- Is_Concurrent_Record_Type Flag20
311
312 -- Has_Master_Entity Flag21
313 -- Needs_No_Actuals Flag22
314 -- Has_Storage_Size_Clause Flag23
315 -- Is_Imported Flag24
316 -- Is_Limited_Record Flag25
317 -- Has_Completion Flag26
318 -- Has_Pragma_Controlled Flag27
319 -- Is_Statically_Allocated Flag28
320 -- Has_Size_Clause Flag29
321 -- Has_Task Flag30
322
323 -- Checks_May_Be_Suppressed Flag31
324 -- Kill_Elaboration_Checks Flag32
325 -- Kill_Range_Checks Flag33
326 -- Has_Independent_Components Flag34
327 -- Is_Class_Wide_Equivalent_Type Flag35
328 -- Referenced_As_LHS Flag36
329 -- Is_Known_Non_Null Flag37
330 -- Can_Never_Be_Null Flag38
331 -- Has_Default_Aspect Flag39
332 -- Body_Needed_For_SAL Flag40
333
334 -- Treat_As_Volatile Flag41
335 -- Is_Controlled_Active Flag42
336 -- Has_Controlled_Component Flag43
337 -- Is_Pure Flag44
338 -- In_Private_Part Flag45
339 -- Has_Alignment_Clause Flag46
340 -- Has_Exit Flag47
341 -- In_Package_Body Flag48
342 -- Reachable Flag49
343 -- Delay_Subprogram_Descriptors Flag50
344
345 -- Is_Packed Flag51
346 -- Is_Entry_Formal Flag52
347 -- Is_Private_Descendant Flag53
348 -- Return_Present Flag54
349 -- Is_Tagged_Type Flag55
350 -- Has_Homonym Flag56
351 -- Is_Hidden Flag57
352 -- Non_Binary_Modulus Flag58
353 -- Is_Preelaborated Flag59
354 -- Is_Shared_Passive Flag60
355
356 -- Is_Remote_Types Flag61
357 -- Is_Remote_Call_Interface Flag62
358 -- Is_Character_Type Flag63
359 -- Is_Intrinsic_Subprogram Flag64
360 -- Has_Record_Rep_Clause Flag65
361 -- Has_Enumeration_Rep_Clause Flag66
362 -- Has_Small_Clause Flag67
363 -- Has_Component_Size_Clause Flag68
364 -- Is_Access_Constant Flag69
365 -- Is_First_Subtype Flag70
366
367 -- Has_Completion_In_Body Flag71
368 -- Has_Unknown_Discriminants Flag72
369 -- Is_Child_Unit Flag73
370 -- Is_CPP_Class Flag74
371 -- Has_Non_Standard_Rep Flag75
372 -- Is_Constructor Flag76
373 -- Static_Elaboration_Desired Flag77
374 -- Is_Tag Flag78
375 -- Has_All_Calls_Remote Flag79
376 -- Is_Constr_Subt_For_U_Nominal Flag80
377
378 -- Is_Asynchronous Flag81
379 -- Has_Gigi_Rep_Item Flag82
380 -- Has_Machine_Radix_Clause Flag83
381 -- Machine_Radix_10 Flag84
382 -- Is_Atomic Flag85
383 -- Has_Atomic_Components Flag86
384 -- Has_Volatile_Components Flag87
385 -- Discard_Names Flag88
386 -- Is_Interrupt_Handler Flag89
387 -- Returns_By_Ref Flag90
388
389 -- Is_Itype Flag91
390 -- Size_Known_At_Compile_Time Flag92
391 -- Reverse_Storage_Order Flag93
392 -- Is_Generic_Actual_Type Flag94
393 -- Uses_Sec_Stack Flag95
394 -- Warnings_Off Flag96
395 -- Is_Controlling_Formal Flag97
396 -- Has_Controlling_Result Flag98
397 -- Is_Exported Flag99
398 -- Has_Specified_Layout Flag100
399
400 -- Has_Nested_Block_With_Handler Flag101
401 -- Is_Called Flag102
402 -- Is_Completely_Hidden Flag103
403 -- Address_Taken Flag104
404 -- Suppress_Initialization Flag105
405 -- Is_Limited_Composite Flag106
406 -- Is_Private_Composite Flag107
407 -- Default_Expressions_Processed Flag108
408 -- Is_Non_Static_Subtype Flag109
409 -- Has_Out_Or_In_Out_Parameter Flag110
410
411 -- Is_Formal_Subprogram Flag111
412 -- Is_Renaming_Of_Object Flag112
413 -- No_Return Flag113
414 -- Delay_Cleanups Flag114
415 -- Never_Set_In_Source Flag115
416 -- Is_Visible_Lib_Unit Flag116
417 -- Is_Unchecked_Union Flag117
418 -- Is_CUDA_Kernel Flag118
419 -- Has_Convention_Pragma Flag119
420 -- Has_Primitive_Operations Flag120
421
422 -- Has_Pragma_Pack Flag121
423 -- Is_Bit_Packed_Array Flag122
424 -- Has_Unchecked_Union Flag123
425 -- Is_Eliminated Flag124
426 -- C_Pass_By_Copy Flag125
427 -- Is_Instantiated Flag126
428 -- Is_Valued_Procedure Flag127
429 -- (used for Component_Alignment) Flag128
430 -- (used for Component_Alignment) Flag129
431 -- Is_Generic_Instance Flag130
432
433 -- No_Pool_Assigned Flag131
434 -- Is_DIC_Procedure Flag132
435 -- Has_Inherited_DIC Flag133
436 -- Has_Aliased_Components Flag135
437 -- No_Strict_Aliasing Flag136
438 -- Is_Machine_Code_Subprogram Flag137
439 -- Is_Packed_Array_Impl_Type Flag138
440 -- Has_Biased_Representation Flag139
441 -- Has_Complex_Representation Flag140
442
443 -- Is_Constr_Subt_For_UN_Aliased Flag141
444 -- Has_Missing_Return Flag142
445 -- Has_Recursive_Call Flag143
446 -- Is_Unsigned_Type Flag144
447 -- Strict_Alignment Flag145
448 -- Is_Abstract_Type Flag146
449 -- Needs_Debug_Info Flag147
450 -- Is_Elaboration_Checks_OK_Id Flag148
451 -- Is_Compilation_Unit Flag149
452 -- Has_Pragma_Elaborate_Body Flag150
453
454 -- Has_Private_Ancestor Flag151
455 -- Entry_Accepted Flag152
456 -- Is_Obsolescent Flag153
457 -- Has_Per_Object_Constraint Flag154
458 -- Has_Private_Declaration Flag155
459 -- Referenced Flag156
460 -- Has_Pragma_Inline Flag157
461 -- Finalize_Storage_Only Flag158
462 -- From_Limited_With Flag159
463 -- Is_Package_Body_Entity Flag160
464
465 -- Has_Qualified_Name Flag161
466 -- Nonzero_Is_True Flag162
467 -- Is_True_Constant Flag163
468 -- Reverse_Bit_Order Flag164
469 -- Suppress_Style_Checks Flag165
470 -- Debug_Info_Off Flag166
471 -- Sec_Stack_Needed_For_Return Flag167
472 -- Materialize_Entity Flag168
473 -- Has_Pragma_Thread_Local_Storage Flag169
474 -- Is_Known_Valid Flag170
475
476 -- Is_Hidden_Open_Scope Flag171
477 -- Has_Object_Size_Clause Flag172
478 -- Has_Fully_Qualified_Name Flag173
479 -- Elaboration_Entity_Required Flag174
480 -- Has_Forward_Instantiation Flag175
481 -- Is_Discrim_SO_Function Flag176
482 -- Size_Depends_On_Discriminant Flag177
483 -- Is_Null_Init_Proc Flag178
484 -- Has_Pragma_Pure_Function Flag179
485 -- Has_Pragma_Unreferenced Flag180
486
487 -- Has_Contiguous_Rep Flag181
488 -- Has_Xref_Entry Flag182
489 -- Must_Be_On_Byte_Boundary Flag183
490 -- Has_Stream_Size_Clause Flag184
491 -- Is_Ada_2005_Only Flag185
492 -- Is_Interface Flag186
493 -- Has_Constrained_Partial_View Flag187
494 -- Uses_Lock_Free Flag188
495 -- Is_Pure_Unit_Access_Type Flag189
496 -- Has_Specified_Stream_Input Flag190
497
498 -- Has_Specified_Stream_Output Flag191
499 -- Has_Specified_Stream_Read Flag192
500 -- Has_Specified_Stream_Write Flag193
501 -- Is_Local_Anonymous_Access Flag194
502 -- Is_Primitive_Wrapper Flag195
503 -- Was_Hidden Flag196
504 -- Is_Limited_Interface Flag197
505 -- Has_Pragma_Ordered Flag198
506 -- Is_Ada_2012_Only Flag199
507
508 -- Has_Delayed_Aspects Flag200
509 -- Has_Pragma_No_Inline Flag201
510 -- Itype_Printed Flag202
511 -- Has_Pragma_Pure Flag203
512 -- Is_Known_Null Flag204
513 -- Low_Bound_Tested Flag205
514 -- Is_Visible_Formal Flag206
515 -- Known_To_Have_Preelab_Init Flag207
516 -- Must_Have_Preelab_Init Flag208
517 -- Is_Return_Object Flag209
518
519 -- Elaborate_Body_Desirable Flag210
520 -- Has_Static_Discriminants Flag211
521 -- Has_Pragma_Unreferenced_Objects Flag212
522 -- Requires_Overriding Flag213
523 -- Has_RACW Flag214
524 -- Is_Param_Block_Component_Type Flag215
525 -- Universal_Aliasing Flag216
526 -- Suppress_Value_Tracking_On_Call Flag217
527 -- Is_Primitive Flag218
528 -- Has_Initial_Value Flag219
529
530 -- Has_Dispatch_Table Flag220
531 -- Has_Pragma_Preelab_Init Flag221
532 -- Used_As_Generic_Actual Flag222
533 -- Is_Descendant_Of_Address Flag223
534 -- Is_Raised Flag224
535 -- Is_Thunk Flag225
536 -- Is_Only_Out_Parameter Flag226
537 -- Referenced_As_Out_Parameter Flag227
538 -- Has_Thunks Flag228
539 -- Can_Use_Internal_Rep Flag229
540
541 -- Has_Pragma_Inline_Always Flag230
542 -- Renamed_In_Spec Flag231
543 -- Has_Own_Invariants Flag232
544 -- Has_Pragma_Unmodified Flag233
545 -- Is_Dispatch_Table_Entity Flag234
546 -- Is_Trivial_Subprogram Flag235
547 -- Warnings_Off_Used Flag236
548 -- Warnings_Off_Used_Unmodified Flag237
549 -- Warnings_Off_Used_Unreferenced Flag238
550 -- No_Reordering Flag239
551
552 -- Has_Expanded_Contract Flag240
553 -- Optimize_Alignment_Space Flag241
554 -- Optimize_Alignment_Time Flag242
555 -- Overlays_Constant Flag243
556 -- Is_RACW_Stub_Type Flag244
557 -- Is_Private_Primitive Flag245
558 -- Is_Underlying_Record_View Flag246
559 -- OK_To_Rename Flag247
560 -- Has_Inheritable_Invariants Flag248
561 -- Is_Safe_To_Reevaluate Flag249
562
563 -- Has_Predicates Flag250
564 -- Has_Implicit_Dereference Flag251
565 -- Is_Finalized_Transient Flag252
566 -- Disable_Controlled Flag253
567 -- Is_Implementation_Defined Flag254
568 -- Is_Predicate_Function Flag255
569 -- Is_Predicate_Function_M Flag256
570 -- Is_Invariant_Procedure Flag257
571 -- Has_Dynamic_Predicate_Aspect Flag258
572 -- Has_Static_Predicate_Aspect Flag259
573
574 -- Has_Loop_Entry_Attributes Flag260
575 -- Has_Delayed_Rep_Aspects Flag261
576 -- May_Inherit_Delayed_Rep_Aspects Flag262
577 -- Has_Visible_Refinement Flag263
578 -- Is_Discriminant_Check_Function Flag264
579 -- SPARK_Pragma_Inherited Flag265
580 -- SPARK_Aux_Pragma_Inherited Flag266
581 -- Has_Shift_Operator Flag267
582 -- Is_Independent Flag268
583 -- Has_Static_Predicate Flag269
584
585 -- Stores_Attribute_Old_Prefix Flag270
586 -- Has_Protected Flag271
587 -- SSO_Set_Low_By_Default Flag272
588 -- SSO_Set_High_By_Default Flag273
589 -- Is_Generic_Actual_Subprogram Flag274
590 -- No_Predicate_On_Actual Flag275
591 -- No_Dynamic_Predicate_On_Actual Flag276
592 -- Is_Checked_Ghost_Entity Flag277
593 -- Is_Ignored_Ghost_Entity Flag278
594 -- Contains_Ignored_Ghost_Code Flag279
595
596 -- Partial_View_Has_Unknown_Discr Flag280
597 -- Is_Static_Type Flag281
598 -- Has_Nested_Subprogram Flag282
599 -- Is_Uplevel_Referenced_Entity Flag283
600 -- Is_Unimplemented Flag284
601 -- Is_Volatile_Full_Access Flag285
602 -- Is_Exception_Handler Flag286
603 -- Rewritten_For_C Flag287
604 -- Predicates_Ignored Flag288
605 -- Has_Timing_Event Flag289
606
607 -- Is_Class_Wide_Clone Flag290
608 -- Has_Inherited_Invariants Flag291
609 -- Is_Partial_Invariant_Procedure Flag292
610 -- Is_Actual_Subtype Flag293
611 -- Has_Pragma_Unused Flag294
612 -- Is_Ignored_Transient Flag295
613 -- Has_Partial_Visible_Refinement Flag296
614 -- Is_Entry_Wrapper Flag297
615 -- Is_Underlying_Full_View Flag298
616 -- Body_Needed_For_Inlining Flag299
617
618 -- Has_Private_Extension Flag300
619 -- Ignore_SPARK_Mode_Pragmas Flag301
620 -- Is_Initial_Condition_Procedure Flag302
621 -- Suppress_Elaboration_Warnings Flag303
622 -- Is_Elaboration_Warnings_OK_Id Flag304
623 -- Is_Activation_Record Flag305
624 -- Needs_Activation_Record Flag306
625 -- Is_Loop_Parameter Flag307
626 -- Has_Yield_Aspect Flag308
627
628 -- (unused) Flag309
629
630 -- Note: Flag310-317 are defined in atree.ads/adb, but not yet in atree.h
631
632 -----------------------
633 -- Local subprograms --
634 -----------------------
635
636 function Has_Option
637 (State_Id : Entity_Id;
638 Option_Nam : Name_Id) return Boolean;
639 -- Determine whether abstract state State_Id has particular option denoted
640 -- by the name Option_Nam.
641
642 ---------------
643 -- Float_Rep --
644 ---------------
645
646 function Float_Rep (Id : E) return F is
647 pragma Assert (Is_Floating_Point_Type (Id));
648 begin
649 return F'Val (UI_To_Int (Uint10 (Base_Type (Id))));
650 end Float_Rep;
651
652 ----------------
653 -- Has_Option --
654 ----------------
655
656 function Has_Option
657 (State_Id : Entity_Id;
658 Option_Nam : Name_Id) return Boolean
659 is
660 Decl : constant Node_Id := Parent (State_Id);
661 Opt : Node_Id;
662 Opt_Nam : Node_Id;
663
664 begin
665 pragma Assert (Ekind (State_Id) = E_Abstract_State);
666
667 -- The declaration of abstract states with options appear as an
668 -- extension aggregate. If this is not the case, the option is not
669 -- available.
670
671 if Nkind (Decl) /= N_Extension_Aggregate then
672 return False;
673 end if;
674
675 -- Simple options
676
677 Opt := First (Expressions (Decl));
678 while Present (Opt) loop
679 if Nkind (Opt) = N_Identifier and then Chars (Opt) = Option_Nam then
680 return True;
681 end if;
682
683 Next (Opt);
684 end loop;
685
686 -- Complex options with various specifiers
687
688 Opt := First (Component_Associations (Decl));
689 while Present (Opt) loop
690 Opt_Nam := First (Choices (Opt));
691
692 if Nkind (Opt_Nam) = N_Identifier
693 and then Chars (Opt_Nam) = Option_Nam
694 then
695 return True;
696 end if;
697
698 Next (Opt);
699 end loop;
700
701 return False;
702 end Has_Option;
703
704 --------------------------------
705 -- Attribute Access Functions --
706 --------------------------------
707
708 function Abstract_States (Id : E) return L is
709 begin
710 pragma Assert (Is_Package_Or_Generic_Package (Id));
711 return Elist25 (Id);
712 end Abstract_States;
713
714 function Accept_Address (Id : E) return L is
715 begin
716 return Elist21 (Id);
717 end Accept_Address;
718
719 function Access_Disp_Table (Id : E) return L is
720 begin
721 pragma Assert (Ekind (Id) in E_Record_Subtype
722 | E_Record_Type
723 | E_Record_Type_With_Private);
724 return Elist16 (Implementation_Base_Type (Id));
725 end Access_Disp_Table;
726
727 function Access_Disp_Table_Elab_Flag (Id : E) return E is
728 begin
729 pragma Assert (Ekind (Id) in E_Record_Subtype
730 | E_Record_Type
731 | E_Record_Type_With_Private);
732 return Node30 (Implementation_Base_Type (Id));
733 end Access_Disp_Table_Elab_Flag;
734
735 function Access_Subprogram_Wrapper (Id : E) return E is
736 begin
737 pragma Assert (Ekind (Id) = E_Subprogram_Type);
738 return Node41 (Id);
739 end Access_Subprogram_Wrapper;
740
741 function Activation_Record_Component (Id : E) return E is
742 begin
743 pragma Assert (Ekind (Id) in E_Constant
744 | E_In_Parameter
745 | E_In_Out_Parameter
746 | E_Loop_Parameter
747 | E_Out_Parameter
748 | E_Variable);
749 return Node31 (Id);
750 end Activation_Record_Component;
751
752 function Actual_Subtype (Id : E) return E is
753 begin
754 pragma Assert
755 (Ekind (Id) in E_Constant | E_Variable | E_Generic_In_Out_Parameter
756 or else Is_Formal (Id));
757 return Node17 (Id);
758 end Actual_Subtype;
759
760 function Address_Taken (Id : E) return B is
761 begin
762 return Flag104 (Id);
763 end Address_Taken;
764
765 function Alias (Id : E) return E is
766 begin
767 pragma Assert
768 (Is_Overloadable (Id) or else Ekind (Id) = E_Subprogram_Type);
769 return Node18 (Id);
770 end Alias;
771
772 function Alignment (Id : E) return U is
773 begin
774 pragma Assert (Is_Type (Id)
775 or else Is_Formal (Id)
776 or else Ekind (Id) in E_Loop_Parameter
777 | E_Constant
778 | E_Exception
779 | E_Variable);
780 return Uint14 (Id);
781 end Alignment;
782
783 function Anonymous_Designated_Type (Id : E) return E is
784 begin
785 pragma Assert (Ekind (Id) = E_Variable);
786 return Node35 (Id);
787 end Anonymous_Designated_Type;
788
789 function Anonymous_Masters (Id : E) return L is
790 begin
791 pragma Assert (Ekind (Id) in E_Function
792 | E_Package
793 | E_Procedure
794 | E_Subprogram_Body);
795 return Elist29 (Id);
796 end Anonymous_Masters;
797
798 function Anonymous_Object (Id : E) return E is
799 begin
800 pragma Assert (Ekind (Id) in E_Protected_Type | E_Task_Type);
801 return Node30 (Id);
802 end Anonymous_Object;
803
804 function Associated_Entity (Id : E) return E is
805 begin
806 return Node37 (Id);
807 end Associated_Entity;
808
809 function Associated_Formal_Package (Id : E) return E is
810 begin
811 pragma Assert (Ekind (Id) = E_Package);
812 return Node12 (Id);
813 end Associated_Formal_Package;
814
815 function Associated_Node_For_Itype (Id : E) return N is
816 begin
817 return Node8 (Id);
818 end Associated_Node_For_Itype;
819
820 function Associated_Storage_Pool (Id : E) return E is
821 begin
822 pragma Assert (Is_Access_Type (Id));
823 return Node22 (Root_Type (Id));
824 end Associated_Storage_Pool;
825
826 function Barrier_Function (Id : E) return N is
827 begin
828 pragma Assert (Is_Entry (Id));
829 return Node12 (Id);
830 end Barrier_Function;
831
832 function Block_Node (Id : E) return N is
833 begin
834 pragma Assert (Ekind (Id) = E_Block);
835 return Node11 (Id);
836 end Block_Node;
837
838 function Body_Entity (Id : E) return E is
839 begin
840 pragma Assert (Is_Package_Or_Generic_Package (Id));
841 return Node19 (Id);
842 end Body_Entity;
843
844 function Body_Needed_For_Inlining (Id : E) return B is
845 begin
846 pragma Assert (Ekind (Id) = E_Package);
847 return Flag299 (Id);
848 end Body_Needed_For_Inlining;
849
850 function Body_Needed_For_SAL (Id : E) return B is
851 begin
852 pragma Assert
853 (Ekind (Id) = E_Package
854 or else Is_Subprogram (Id)
855 or else Is_Generic_Unit (Id));
856 return Flag40 (Id);
857 end Body_Needed_For_SAL;
858
859 function Body_References (Id : E) return L is
860 begin
861 pragma Assert (Ekind (Id) = E_Abstract_State);
862 return Elist16 (Id);
863 end Body_References;
864
865 function BIP_Initialization_Call (Id : E) return N is
866 begin
867 pragma Assert (Ekind (Id) in E_Constant | E_Variable);
868 return Node29 (Id);
869 end BIP_Initialization_Call;
870
871 function C_Pass_By_Copy (Id : E) return B is
872 begin
873 pragma Assert (Is_Record_Type (Id));
874 return Flag125 (Implementation_Base_Type (Id));
875 end C_Pass_By_Copy;
876
877 function Can_Never_Be_Null (Id : E) return B is
878 begin
879 return Flag38 (Id);
880 end Can_Never_Be_Null;
881
882 function Checks_May_Be_Suppressed (Id : E) return B is
883 begin
884 return Flag31 (Id);
885 end Checks_May_Be_Suppressed;
886
887 function Class_Wide_Clone (Id : E) return E is
888 begin
889 pragma Assert (Is_Subprogram (Id));
890 return Node38 (Id);
891 end Class_Wide_Clone;
892
893 function Class_Wide_Type (Id : E) return E is
894 begin
895 pragma Assert (Is_Type (Id));
896 return Node9 (Id);
897 end Class_Wide_Type;
898
899 function Cloned_Subtype (Id : E) return E is
900 begin
901 pragma Assert (Ekind (Id) in E_Record_Subtype | E_Class_Wide_Subtype);
902 return Node16 (Id);
903 end Cloned_Subtype;
904
905 function Component_Bit_Offset (Id : E) return U is
906 begin
907 pragma Assert (Ekind (Id) in E_Component | E_Discriminant);
908 return Uint11 (Id);
909 end Component_Bit_Offset;
910
911 function Component_Clause (Id : E) return N is
912 begin
913 pragma Assert (Ekind (Id) in E_Component | E_Discriminant);
914 return Node13 (Id);
915 end Component_Clause;
916
917 function Component_Size (Id : E) return U is
918 begin
919 pragma Assert (Is_Array_Type (Id));
920 return Uint22 (Implementation_Base_Type (Id));
921 end Component_Size;
922
923 function Component_Type (Id : E) return E is
924 begin
925 pragma Assert (Is_Array_Type (Id));
926 return Node20 (Implementation_Base_Type (Id));
927 end Component_Type;
928
929 function Corresponding_Concurrent_Type (Id : E) return E is
930 begin
931 pragma Assert (Ekind (Id) = E_Record_Type);
932 return Node18 (Id);
933 end Corresponding_Concurrent_Type;
934
935 function Corresponding_Discriminant (Id : E) return E is
936 begin
937 pragma Assert (Ekind (Id) = E_Discriminant);
938 return Node19 (Id);
939 end Corresponding_Discriminant;
940
941 function Corresponding_Equality (Id : E) return E is
942 begin
943 pragma Assert
944 (Ekind (Id) = E_Function
945 and then not Comes_From_Source (Id)
946 and then Chars (Id) = Name_Op_Ne);
947 return Node30 (Id);
948 end Corresponding_Equality;
949
950 function Corresponding_Function (Id : E) return E is
951 begin
952 pragma Assert (Ekind (Id) = E_Procedure);
953 return Node32 (Id);
954 end Corresponding_Function;
955
956 function Corresponding_Procedure (Id : E) return E is
957 begin
958 pragma Assert (Ekind (Id) = E_Function);
959 return Node32 (Id);
960 end Corresponding_Procedure;
961
962 function Corresponding_Protected_Entry (Id : E) return E is
963 begin
964 pragma Assert (Ekind (Id) = E_Subprogram_Body);
965 return Node18 (Id);
966 end Corresponding_Protected_Entry;
967
968 function Corresponding_Record_Component (Id : E) return E is
969 begin
970 pragma Assert (Ekind (Id) in E_Component | E_Discriminant);
971 return Node21 (Id);
972 end Corresponding_Record_Component;
973
974 function Corresponding_Record_Type (Id : E) return E is
975 begin
976 pragma Assert (Is_Concurrent_Type (Id));
977 return Node18 (Id);
978 end Corresponding_Record_Type;
979
980 function Corresponding_Remote_Type (Id : E) return E is
981 begin
982 return Node22 (Id);
983 end Corresponding_Remote_Type;
984
985 function Current_Use_Clause (Id : E) return E is
986 begin
987 pragma Assert (Ekind (Id) = E_Package or else Is_Type (Id));
988 return Node27 (Id);
989 end Current_Use_Clause;
990
991 function Current_Value (Id : E) return N is
992 begin
993 pragma Assert (Is_Object (Id));
994 return Node9 (Id);
995 end Current_Value;
996
997 function CR_Discriminant (Id : E) return E is
998 begin
999 return Node23 (Id);
1000 end CR_Discriminant;
1001
1002 function Debug_Info_Off (Id : E) return B is
1003 begin
1004 return Flag166 (Id);
1005 end Debug_Info_Off;
1006
1007 function Debug_Renaming_Link (Id : E) return E is
1008 begin
1009 return Node25 (Id);
1010 end Debug_Renaming_Link;
1011
1012 function Default_Aspect_Component_Value (Id : E) return N is
1013 begin
1014 pragma Assert (Is_Array_Type (Id));
1015 return Node19 (Base_Type (Id));
1016 end Default_Aspect_Component_Value;
1017
1018 function Default_Aspect_Value (Id : E) return N is
1019 begin
1020 pragma Assert (Is_Scalar_Type (Id));
1021 return Node19 (Base_Type (Id));
1022 end Default_Aspect_Value;
1023
1024 function Default_Expr_Function (Id : E) return E is
1025 begin
1026 pragma Assert (Is_Formal (Id));
1027 return Node21 (Id);
1028 end Default_Expr_Function;
1029
1030 function Default_Expressions_Processed (Id : E) return B is
1031 begin
1032 return Flag108 (Id);
1033 end Default_Expressions_Processed;
1034
1035 function Default_Value (Id : E) return N is
1036 begin
1037 pragma Assert (Is_Formal (Id));
1038 return Node20 (Id);
1039 end Default_Value;
1040
1041 function Delay_Cleanups (Id : E) return B is
1042 begin
1043 return Flag114 (Id);
1044 end Delay_Cleanups;
1045
1046 function Delay_Subprogram_Descriptors (Id : E) return B is
1047 begin
1048 return Flag50 (Id);
1049 end Delay_Subprogram_Descriptors;
1050
1051 function Delta_Value (Id : E) return R is
1052 begin
1053 pragma Assert (Is_Fixed_Point_Type (Id));
1054 return Ureal18 (Id);
1055 end Delta_Value;
1056
1057 function Dependent_Instances (Id : E) return L is
1058 begin
1059 pragma Assert (Is_Generic_Instance (Id));
1060 return Elist8 (Id);
1061 end Dependent_Instances;
1062
1063 function Depends_On_Private (Id : E) return B is
1064 begin
1065 pragma Assert (Nkind (Id) in N_Entity);
1066 return Flag14 (Id);
1067 end Depends_On_Private;
1068
1069 function Derived_Type_Link (Id : E) return E is
1070 begin
1071 pragma Assert (Is_Type (Id));
1072 return Node31 (Base_Type (Id));
1073 end Derived_Type_Link;
1074
1075 function Digits_Value (Id : E) return U is
1076 begin
1077 pragma Assert
1078 (Is_Floating_Point_Type (Id)
1079 or else Is_Decimal_Fixed_Point_Type (Id));
1080 return Uint17 (Id);
1081 end Digits_Value;
1082
1083 function Direct_Primitive_Operations (Id : E) return L is
1084 begin
1085 pragma Assert (Is_Tagged_Type (Id));
1086 return Elist10 (Id);
1087 end Direct_Primitive_Operations;
1088
1089 function Directly_Designated_Type (Id : E) return E is
1090 begin
1091 pragma Assert (Is_Access_Type (Id));
1092 return Node20 (Id);
1093 end Directly_Designated_Type;
1094
1095 function Disable_Controlled (Id : E) return B is
1096 begin
1097 return Flag253 (Base_Type (Id));
1098 end Disable_Controlled;
1099
1100 function Discard_Names (Id : E) return B is
1101 begin
1102 return Flag88 (Id);
1103 end Discard_Names;
1104
1105 function Discriminal (Id : E) return E is
1106 begin
1107 pragma Assert (Ekind (Id) = E_Discriminant);
1108 return Node17 (Id);
1109 end Discriminal;
1110
1111 function Discriminal_Link (Id : E) return N is
1112 begin
1113 return Node10 (Id);
1114 end Discriminal_Link;
1115
1116 function Discriminant_Checking_Func (Id : E) return E is
1117 begin
1118 pragma Assert (Ekind (Id) = E_Component);
1119 return Node20 (Id);
1120 end Discriminant_Checking_Func;
1121
1122 function Discriminant_Constraint (Id : E) return L is
1123 begin
1124 pragma Assert
1125 (Is_Composite_Type (Id)
1126 and then (Has_Discriminants (Id) or else Is_Constrained (Id)));
1127 return Elist21 (Id);
1128 end Discriminant_Constraint;
1129
1130 function Discriminant_Default_Value (Id : E) return N is
1131 begin
1132 pragma Assert (Ekind (Id) = E_Discriminant);
1133 return Node20 (Id);
1134 end Discriminant_Default_Value;
1135
1136 function Discriminant_Number (Id : E) return U is
1137 begin
1138 pragma Assert (Ekind (Id) = E_Discriminant);
1139 return Uint15 (Id);
1140 end Discriminant_Number;
1141
1142 function Dispatch_Table_Wrappers (Id : E) return L is
1143 begin
1144 pragma Assert (Ekind (Id) in E_Record_Type | E_Record_Subtype);
1145 return Elist26 (Implementation_Base_Type (Id));
1146 end Dispatch_Table_Wrappers;
1147
1148 function DT_Entry_Count (Id : E) return U is
1149 begin
1150 pragma Assert (Ekind (Id) = E_Component and then Is_Tag (Id));
1151 return Uint15 (Id);
1152 end DT_Entry_Count;
1153
1154 function DT_Offset_To_Top_Func (Id : E) return E is
1155 begin
1156 pragma Assert (Ekind (Id) = E_Component and then Is_Tag (Id));
1157 return Node25 (Id);
1158 end DT_Offset_To_Top_Func;
1159
1160 function DT_Position (Id : E) return U is
1161 begin
1162 pragma Assert (Ekind (Id) in E_Function | E_Procedure
1163 and then Present (DTC_Entity (Id)));
1164 return Uint15 (Id);
1165 end DT_Position;
1166
1167 function DTC_Entity (Id : E) return E is
1168 begin
1169 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
1170 return Node16 (Id);
1171 end DTC_Entity;
1172
1173 function Elaborate_Body_Desirable (Id : E) return B is
1174 begin
1175 pragma Assert (Ekind (Id) = E_Package);
1176 return Flag210 (Id);
1177 end Elaborate_Body_Desirable;
1178
1179 function Elaboration_Entity (Id : E) return E is
1180 begin
1181 pragma Assert
1182 (Is_Subprogram (Id)
1183 or else
1184 Ekind (Id) in E_Entry | E_Entry_Family | E_Package
1185 or else
1186 Is_Generic_Unit (Id));
1187 return Node13 (Id);
1188 end Elaboration_Entity;
1189
1190 function Elaboration_Entity_Required (Id : E) return B is
1191 begin
1192 pragma Assert
1193 (Is_Subprogram (Id)
1194 or else
1195 Ekind (Id) in E_Entry | E_Entry_Family | E_Package
1196 or else
1197 Is_Generic_Unit (Id));
1198 return Flag174 (Id);
1199 end Elaboration_Entity_Required;
1200
1201 function Encapsulating_State (Id : E) return N is
1202 begin
1203 pragma Assert (Ekind (Id) in E_Abstract_State | E_Constant | E_Variable);
1204 return Node32 (Id);
1205 end Encapsulating_State;
1206
1207 function Enclosing_Scope (Id : E) return E is
1208 begin
1209 return Node18 (Id);
1210 end Enclosing_Scope;
1211
1212 function Entry_Accepted (Id : E) return B is
1213 begin
1214 pragma Assert (Is_Entry (Id));
1215 return Flag152 (Id);
1216 end Entry_Accepted;
1217
1218 function Entry_Bodies_Array (Id : E) return E is
1219 begin
1220 return Node19 (Id);
1221 end Entry_Bodies_Array;
1222
1223 function Entry_Cancel_Parameter (Id : E) return E is
1224 begin
1225 return Node23 (Id);
1226 end Entry_Cancel_Parameter;
1227
1228 function Entry_Component (Id : E) return E is
1229 begin
1230 return Node11 (Id);
1231 end Entry_Component;
1232
1233 function Entry_Formal (Id : E) return E is
1234 begin
1235 return Node16 (Id);
1236 end Entry_Formal;
1237
1238 function Entry_Index_Constant (Id : E) return N is
1239 begin
1240 pragma Assert (Ekind (Id) = E_Entry_Index_Parameter);
1241 return Node18 (Id);
1242 end Entry_Index_Constant;
1243
1244 function Entry_Max_Queue_Lengths_Array (Id : E) return N is
1245 begin
1246 pragma Assert (Ekind (Id) = E_Protected_Type);
1247 return Node35 (Id);
1248 end Entry_Max_Queue_Lengths_Array;
1249
1250 function Contains_Ignored_Ghost_Code (Id : E) return B is
1251 begin
1252 pragma Assert
1253 (Ekind (Id) in E_Block
1254 | E_Function
1255 | E_Generic_Function
1256 | E_Generic_Package
1257 | E_Generic_Procedure
1258 | E_Package
1259 | E_Package_Body
1260 | E_Procedure
1261 | E_Subprogram_Body);
1262 return Flag279 (Id);
1263 end Contains_Ignored_Ghost_Code;
1264
1265 function Contract (Id : E) return N is
1266 begin
1267 pragma Assert
1268 (Ekind (Id) in E_Protected_Type -- concurrent types
1269 | E_Task_Body
1270 | E_Task_Type
1271 or else
1272 Ekind (Id) in E_Constant -- objects
1273 | E_Variable
1274 or else
1275 Ekind (Id) in E_Entry -- overloadable
1276 | E_Entry_Family
1277 | E_Function
1278 | E_Generic_Function
1279 | E_Generic_Procedure
1280 | E_Operator
1281 | E_Procedure
1282 | E_Subprogram_Body
1283 or else
1284 Ekind (Id) in E_Generic_Package -- packages
1285 | E_Package
1286 | E_Package_Body
1287 or else
1288 Is_Type (Id) -- types
1289 or else
1290 Ekind (Id) = E_Void); -- special purpose
1291 return Node34 (Id);
1292 end Contract;
1293
1294 function Contract_Wrapper (Id : E) return E is
1295 begin
1296 pragma Assert (Is_Entry (Id));
1297 return Node25 (Id);
1298 end Contract_Wrapper;
1299
1300 function Entry_Parameters_Type (Id : E) return E is
1301 begin
1302 return Node15 (Id);
1303 end Entry_Parameters_Type;
1304
1305 function Enum_Pos_To_Rep (Id : E) return E is
1306 begin
1307 pragma Assert (Ekind (Id) = E_Enumeration_Type);
1308 return Node23 (Id);
1309 end Enum_Pos_To_Rep;
1310
1311 function Enumeration_Pos (Id : E) return Uint is
1312 begin
1313 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
1314 return Uint11 (Id);
1315 end Enumeration_Pos;
1316
1317 function Enumeration_Rep (Id : E) return U is
1318 begin
1319 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
1320 return Uint12 (Id);
1321 end Enumeration_Rep;
1322
1323 function Enumeration_Rep_Expr (Id : E) return N is
1324 begin
1325 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
1326 return Node22 (Id);
1327 end Enumeration_Rep_Expr;
1328
1329 function Equivalent_Type (Id : E) return E is
1330 begin
1331 pragma Assert
1332 (Ekind (Id) in E_Class_Wide_Type
1333 | E_Class_Wide_Subtype
1334 | E_Access_Subprogram_Type
1335 | E_Access_Protected_Subprogram_Type
1336 | E_Anonymous_Access_Protected_Subprogram_Type
1337 | E_Exception_Type);
1338 return Node18 (Id);
1339 end Equivalent_Type;
1340
1341 function Esize (Id : E) return Uint is
1342 begin
1343 return Uint12 (Id);
1344 end Esize;
1345
1346 function Extra_Accessibility (Id : E) return E is
1347 begin
1348 pragma Assert
1349 (Is_Formal (Id) or else Ekind (Id) in E_Variable | E_Constant);
1350 return Node13 (Id);
1351 end Extra_Accessibility;
1352
1353 function Extra_Accessibility_Of_Result (Id : E) return E is
1354 begin
1355 pragma Assert
1356 (Ekind (Id) in E_Function | E_Operator | E_Subprogram_Type);
1357 return Node19 (Id);
1358 end Extra_Accessibility_Of_Result;
1359
1360 function Extra_Constrained (Id : E) return E is
1361 begin
1362 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
1363 return Node23 (Id);
1364 end Extra_Constrained;
1365
1366 function Extra_Formal (Id : E) return E is
1367 begin
1368 return Node15 (Id);
1369 end Extra_Formal;
1370
1371 function Extra_Formals (Id : E) return E is
1372 begin
1373 pragma Assert
1374 (Is_Overloadable (Id)
1375 or else Ekind (Id) in E_Entry_Family
1376 | E_Subprogram_Body
1377 | E_Subprogram_Type);
1378 return Node28 (Id);
1379 end Extra_Formals;
1380
1381 function Can_Use_Internal_Rep (Id : E) return B is
1382 begin
1383 pragma Assert (Is_Access_Subprogram_Type (Base_Type (Id)));
1384 return Flag229 (Base_Type (Id));
1385 end Can_Use_Internal_Rep;
1386
1387 function Finalization_Master (Id : E) return E is
1388 begin
1389 pragma Assert (Is_Access_Type (Id));
1390 return Node23 (Root_Type (Id));
1391 end Finalization_Master;
1392
1393 function Finalize_Storage_Only (Id : E) return B is
1394 begin
1395 pragma Assert (Is_Type (Id));
1396 return Flag158 (Base_Type (Id));
1397 end Finalize_Storage_Only;
1398
1399 function Finalizer (Id : E) return E is
1400 begin
1401 pragma Assert (Ekind (Id) in E_Package | E_Package_Body);
1402 return Node28 (Id);
1403 end Finalizer;
1404
1405 function First_Entity (Id : E) return E is
1406 begin
1407 return Node17 (Id);
1408 end First_Entity;
1409
1410 function First_Exit_Statement (Id : E) return N is
1411 begin
1412 pragma Assert (Ekind (Id) = E_Loop);
1413 return Node8 (Id);
1414 end First_Exit_Statement;
1415
1416 function First_Index (Id : E) return N is
1417 begin
1418 pragma Assert (Is_Array_Type (Id));
1419 return Node17 (Id);
1420 end First_Index;
1421
1422 function First_Literal (Id : E) return E is
1423 begin
1424 pragma Assert (Is_Enumeration_Type (Id));
1425 return Node17 (Id);
1426 end First_Literal;
1427
1428 function First_Private_Entity (Id : E) return E is
1429 begin
1430 pragma Assert (Is_Package_Or_Generic_Package (Id)
1431 or else Is_Concurrent_Type (Id));
1432 return Node16 (Id);
1433 end First_Private_Entity;
1434
1435 function First_Rep_Item (Id : E) return E is
1436 begin
1437 return Node6 (Id);
1438 end First_Rep_Item;
1439
1440 function Freeze_Node (Id : E) return N is
1441 begin
1442 return Node7 (Id);
1443 end Freeze_Node;
1444
1445 function From_Limited_With (Id : E) return B is
1446 begin
1447 return Flag159 (Id);
1448 end From_Limited_With;
1449
1450 function Full_View (Id : E) return E is
1451 begin
1452 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Constant);
1453 return Node11 (Id);
1454 end Full_View;
1455
1456 function Generic_Homonym (Id : E) return E is
1457 begin
1458 pragma Assert (Ekind (Id) = E_Generic_Package);
1459 return Node11 (Id);
1460 end Generic_Homonym;
1461
1462 function Generic_Renamings (Id : E) return L is
1463 begin
1464 return Elist23 (Id);
1465 end Generic_Renamings;
1466
1467 function Handler_Records (Id : E) return S is
1468 begin
1469 return List10 (Id);
1470 end Handler_Records;
1471
1472 function Has_Aliased_Components (Id : E) return B is
1473 begin
1474 return Flag135 (Implementation_Base_Type (Id));
1475 end Has_Aliased_Components;
1476
1477 function Has_Alignment_Clause (Id : E) return B is
1478 begin
1479 return Flag46 (Id);
1480 end Has_Alignment_Clause;
1481
1482 function Has_All_Calls_Remote (Id : E) return B is
1483 begin
1484 return Flag79 (Id);
1485 end Has_All_Calls_Remote;
1486
1487 function Has_Atomic_Components (Id : E) return B is
1488 begin
1489 return Flag86 (Implementation_Base_Type (Id));
1490 end Has_Atomic_Components;
1491
1492 function Has_Biased_Representation (Id : E) return B is
1493 begin
1494 return Flag139 (Id);
1495 end Has_Biased_Representation;
1496
1497 function Has_Completion (Id : E) return B is
1498 begin
1499 return Flag26 (Id);
1500 end Has_Completion;
1501
1502 function Has_Completion_In_Body (Id : E) return B is
1503 begin
1504 pragma Assert (Is_Type (Id));
1505 return Flag71 (Id);
1506 end Has_Completion_In_Body;
1507
1508 function Has_Complex_Representation (Id : E) return B is
1509 begin
1510 pragma Assert (Is_Record_Type (Id));
1511 return Flag140 (Implementation_Base_Type (Id));
1512 end Has_Complex_Representation;
1513
1514 function Has_Component_Size_Clause (Id : E) return B is
1515 begin
1516 pragma Assert (Is_Array_Type (Id));
1517 return Flag68 (Implementation_Base_Type (Id));
1518 end Has_Component_Size_Clause;
1519
1520 function Has_Constrained_Partial_View (Id : E) return B is
1521 begin
1522 pragma Assert (Is_Type (Id));
1523 return Flag187 (Base_Type (Id));
1524 end Has_Constrained_Partial_View;
1525
1526 function Has_Controlled_Component (Id : E) return B is
1527 begin
1528 return Flag43 (Base_Type (Id));
1529 end Has_Controlled_Component;
1530
1531 function Has_Contiguous_Rep (Id : E) return B is
1532 begin
1533 return Flag181 (Id);
1534 end Has_Contiguous_Rep;
1535
1536 function Has_Controlling_Result (Id : E) return B is
1537 begin
1538 return Flag98 (Id);
1539 end Has_Controlling_Result;
1540
1541 function Has_Convention_Pragma (Id : E) return B is
1542 begin
1543 return Flag119 (Id);
1544 end Has_Convention_Pragma;
1545
1546 function Has_Default_Aspect (Id : E) return B is
1547 begin
1548 return Flag39 (Base_Type (Id));
1549 end Has_Default_Aspect;
1550
1551 function Has_Delayed_Aspects (Id : E) return B is
1552 begin
1553 pragma Assert (Nkind (Id) in N_Entity);
1554 return Flag200 (Id);
1555 end Has_Delayed_Aspects;
1556
1557 function Has_Delayed_Freeze (Id : E) return B is
1558 begin
1559 pragma Assert (Nkind (Id) in N_Entity);
1560 return Flag18 (Id);
1561 end Has_Delayed_Freeze;
1562
1563 function Has_Delayed_Rep_Aspects (Id : E) return B is
1564 begin
1565 pragma Assert (Nkind (Id) in N_Entity);
1566 return Flag261 (Id);
1567 end Has_Delayed_Rep_Aspects;
1568
1569 function Has_Discriminants (Id : E) return B is
1570 begin
1571 pragma Assert (Is_Type (Id));
1572 return Flag5 (Id);
1573 end Has_Discriminants;
1574
1575 function Has_Dispatch_Table (Id : E) return B is
1576 begin
1577 pragma Assert (Is_Tagged_Type (Id));
1578 return Flag220 (Id);
1579 end Has_Dispatch_Table;
1580
1581 function Has_Dynamic_Predicate_Aspect (Id : E) return B is
1582 begin
1583 pragma Assert (Is_Type (Id));
1584 return Flag258 (Id);
1585 end Has_Dynamic_Predicate_Aspect;
1586
1587 function Has_Enumeration_Rep_Clause (Id : E) return B is
1588 begin
1589 pragma Assert (Is_Enumeration_Type (Id));
1590 return Flag66 (Id);
1591 end Has_Enumeration_Rep_Clause;
1592
1593 function Has_Exit (Id : E) return B is
1594 begin
1595 return Flag47 (Id);
1596 end Has_Exit;
1597
1598 function Has_Expanded_Contract (Id : E) return B is
1599 begin
1600 pragma Assert (Is_Subprogram (Id));
1601 return Flag240 (Id);
1602 end Has_Expanded_Contract;
1603
1604 function Has_Forward_Instantiation (Id : E) return B is
1605 begin
1606 return Flag175 (Id);
1607 end Has_Forward_Instantiation;
1608
1609 function Has_Fully_Qualified_Name (Id : E) return B is
1610 begin
1611 return Flag173 (Id);
1612 end Has_Fully_Qualified_Name;
1613
1614 function Has_Gigi_Rep_Item (Id : E) return B is
1615 begin
1616 return Flag82 (Id);
1617 end Has_Gigi_Rep_Item;
1618
1619 function Has_Homonym (Id : E) return B is
1620 begin
1621 return Flag56 (Id);
1622 end Has_Homonym;
1623
1624 function Has_Implicit_Dereference (Id : E) return B is
1625 begin
1626 return Flag251 (Id);
1627 end Has_Implicit_Dereference;
1628
1629 function Has_Independent_Components (Id : E) return B is
1630 begin
1631 return Flag34 (Implementation_Base_Type (Id));
1632 end Has_Independent_Components;
1633
1634 function Has_Inheritable_Invariants (Id : E) return B is
1635 begin
1636 pragma Assert (Is_Type (Id));
1637 return Flag248 (Base_Type (Id));
1638 end Has_Inheritable_Invariants;
1639
1640 function Has_Inherited_DIC (Id : E) return B is
1641 begin
1642 pragma Assert (Is_Type (Id));
1643 return Flag133 (Base_Type (Id));
1644 end Has_Inherited_DIC;
1645
1646 function Has_Inherited_Invariants (Id : E) return B is
1647 begin
1648 pragma Assert (Is_Type (Id));
1649 return Flag291 (Base_Type (Id));
1650 end Has_Inherited_Invariants;
1651
1652 function Has_Initial_Value (Id : E) return B is
1653 begin
1654 pragma Assert (Ekind (Id) = E_Variable or else Is_Formal (Id));
1655 return Flag219 (Id);
1656 end Has_Initial_Value;
1657
1658 function Has_Loop_Entry_Attributes (Id : E) return B is
1659 begin
1660 pragma Assert (Ekind (Id) = E_Loop);
1661 return Flag260 (Id);
1662 end Has_Loop_Entry_Attributes;
1663
1664 function Has_Machine_Radix_Clause (Id : E) return B is
1665 begin
1666 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
1667 return Flag83 (Id);
1668 end Has_Machine_Radix_Clause;
1669
1670 function Has_Master_Entity (Id : E) return B is
1671 begin
1672 return Flag21 (Id);
1673 end Has_Master_Entity;
1674
1675 function Has_Missing_Return (Id : E) return B is
1676 begin
1677 pragma Assert (Ekind (Id) in E_Function | E_Generic_Function);
1678 return Flag142 (Id);
1679 end Has_Missing_Return;
1680
1681 function Has_Nested_Block_With_Handler (Id : E) return B is
1682 begin
1683 return Flag101 (Id);
1684 end Has_Nested_Block_With_Handler;
1685
1686 function Has_Nested_Subprogram (Id : E) return B is
1687 begin
1688 pragma Assert (Is_Subprogram (Id));
1689 return Flag282 (Id);
1690 end Has_Nested_Subprogram;
1691
1692 function Has_Non_Standard_Rep (Id : E) return B is
1693 begin
1694 return Flag75 (Implementation_Base_Type (Id));
1695 end Has_Non_Standard_Rep;
1696
1697 function Has_Object_Size_Clause (Id : E) return B is
1698 begin
1699 pragma Assert (Is_Type (Id));
1700 return Flag172 (Id);
1701 end Has_Object_Size_Clause;
1702
1703 function Has_Out_Or_In_Out_Parameter (Id : E) return B is
1704 begin
1705 pragma Assert
1706 (Is_Entry (Id) or else Is_Subprogram_Or_Generic_Subprogram (Id));
1707 return Flag110 (Id);
1708 end Has_Out_Or_In_Out_Parameter;
1709
1710 function Has_Own_DIC (Id : E) return B is
1711 begin
1712 pragma Assert (Is_Type (Id));
1713 return Flag3 (Base_Type (Id));
1714 end Has_Own_DIC;
1715
1716 function Has_Own_Invariants (Id : E) return B is
1717 begin
1718 pragma Assert (Is_Type (Id));
1719 return Flag232 (Base_Type (Id));
1720 end Has_Own_Invariants;
1721
1722 function Has_Partial_Visible_Refinement (Id : E) return B is
1723 begin
1724 pragma Assert (Ekind (Id) = E_Abstract_State);
1725 return Flag296 (Id);
1726 end Has_Partial_Visible_Refinement;
1727
1728 function Has_Per_Object_Constraint (Id : E) return B is
1729 begin
1730 return Flag154 (Id);
1731 end Has_Per_Object_Constraint;
1732
1733 function Has_Pragma_Controlled (Id : E) return B is
1734 begin
1735 pragma Assert (Is_Access_Type (Id));
1736 return Flag27 (Implementation_Base_Type (Id));
1737 end Has_Pragma_Controlled;
1738
1739 function Has_Pragma_Elaborate_Body (Id : E) return B is
1740 begin
1741 return Flag150 (Id);
1742 end Has_Pragma_Elaborate_Body;
1743
1744 function Has_Pragma_Inline (Id : E) return B is
1745 begin
1746 return Flag157 (Id);
1747 end Has_Pragma_Inline;
1748
1749 function Has_Pragma_Inline_Always (Id : E) return B is
1750 begin
1751 return Flag230 (Id);
1752 end Has_Pragma_Inline_Always;
1753
1754 function Has_Pragma_No_Inline (Id : E) return B is
1755 begin
1756 return Flag201 (Id);
1757 end Has_Pragma_No_Inline;
1758
1759 function Has_Pragma_Ordered (Id : E) return B is
1760 begin
1761 pragma Assert (Is_Enumeration_Type (Id));
1762 return Flag198 (Implementation_Base_Type (Id));
1763 end Has_Pragma_Ordered;
1764
1765 function Has_Pragma_Pack (Id : E) return B is
1766 begin
1767 pragma Assert (Is_Record_Type (Id) or else Is_Array_Type (Id));
1768 return Flag121 (Implementation_Base_Type (Id));
1769 end Has_Pragma_Pack;
1770
1771 function Has_Pragma_Preelab_Init (Id : E) return B is
1772 begin
1773 return Flag221 (Id);
1774 end Has_Pragma_Preelab_Init;
1775
1776 function Has_Pragma_Pure (Id : E) return B is
1777 begin
1778 return Flag203 (Id);
1779 end Has_Pragma_Pure;
1780
1781 function Has_Pragma_Pure_Function (Id : E) return B is
1782 begin
1783 return Flag179 (Id);
1784 end Has_Pragma_Pure_Function;
1785
1786 function Has_Pragma_Thread_Local_Storage (Id : E) return B is
1787 begin
1788 return Flag169 (Id);
1789 end Has_Pragma_Thread_Local_Storage;
1790
1791 function Has_Pragma_Unmodified (Id : E) return B is
1792 begin
1793 return Flag233 (Id);
1794 end Has_Pragma_Unmodified;
1795
1796 function Has_Pragma_Unreferenced (Id : E) return B is
1797 begin
1798 return Flag180 (Id);
1799 end Has_Pragma_Unreferenced;
1800
1801 function Has_Pragma_Unreferenced_Objects (Id : E) return B is
1802 begin
1803 pragma Assert (Is_Type (Id));
1804 return Flag212 (Id);
1805 end Has_Pragma_Unreferenced_Objects;
1806
1807 function Has_Pragma_Unused (Id : E) return B is
1808 begin
1809 return Flag294 (Id);
1810 end Has_Pragma_Unused;
1811
1812 function Has_Predicates (Id : E) return B is
1813 begin
1814 pragma Assert (Is_Type (Id));
1815 return Flag250 (Id);
1816 end Has_Predicates;
1817
1818 function Has_Primitive_Operations (Id : E) return B is
1819 begin
1820 pragma Assert (Is_Type (Id));
1821 return Flag120 (Base_Type (Id));
1822 end Has_Primitive_Operations;
1823
1824 function Has_Private_Ancestor (Id : E) return B is
1825 begin
1826 return Flag151 (Id);
1827 end Has_Private_Ancestor;
1828
1829 function Has_Private_Declaration (Id : E) return B is
1830 begin
1831 return Flag155 (Id);
1832 end Has_Private_Declaration;
1833
1834 function Has_Private_Extension (Id : E) return B is
1835 begin
1836 pragma Assert (Is_Tagged_Type (Id));
1837 return Flag300 (Id);
1838 end Has_Private_Extension;
1839
1840 function Has_Protected (Id : E) return B is
1841 begin
1842 return Flag271 (Base_Type (Id));
1843 end Has_Protected;
1844
1845 function Has_Qualified_Name (Id : E) return B is
1846 begin
1847 return Flag161 (Id);
1848 end Has_Qualified_Name;
1849
1850 function Has_RACW (Id : E) return B is
1851 begin
1852 pragma Assert (Ekind (Id) = E_Package);
1853 return Flag214 (Id);
1854 end Has_RACW;
1855
1856 function Has_Record_Rep_Clause (Id : E) return B is
1857 begin
1858 pragma Assert (Is_Record_Type (Id));
1859 return Flag65 (Implementation_Base_Type (Id));
1860 end Has_Record_Rep_Clause;
1861
1862 function Has_Recursive_Call (Id : E) return B is
1863 begin
1864 pragma Assert (Is_Subprogram (Id));
1865 return Flag143 (Id);
1866 end Has_Recursive_Call;
1867
1868 function Has_Shift_Operator (Id : E) return B is
1869 begin
1870 pragma Assert (Is_Integer_Type (Id));
1871 return Flag267 (Base_Type (Id));
1872 end Has_Shift_Operator;
1873
1874 function Has_Size_Clause (Id : E) return B is
1875 begin
1876 return Flag29 (Id);
1877 end Has_Size_Clause;
1878
1879 function Has_Small_Clause (Id : E) return B is
1880 begin
1881 pragma Assert (Is_Ordinary_Fixed_Point_Type (Id));
1882 return Flag67 (Id);
1883 end Has_Small_Clause;
1884
1885 function Has_Specified_Layout (Id : E) return B is
1886 begin
1887 pragma Assert (Is_Type (Id));
1888 return Flag100 (Implementation_Base_Type (Id));
1889 end Has_Specified_Layout;
1890
1891 function Has_Specified_Stream_Input (Id : E) return B is
1892 begin
1893 pragma Assert (Is_Type (Id));
1894 return Flag190 (Id);
1895 end Has_Specified_Stream_Input;
1896
1897 function Has_Specified_Stream_Output (Id : E) return B is
1898 begin
1899 pragma Assert (Is_Type (Id));
1900 return Flag191 (Id);
1901 end Has_Specified_Stream_Output;
1902
1903 function Has_Specified_Stream_Read (Id : E) return B is
1904 begin
1905 pragma Assert (Is_Type (Id));
1906 return Flag192 (Id);
1907 end Has_Specified_Stream_Read;
1908
1909 function Has_Specified_Stream_Write (Id : E) return B is
1910 begin
1911 pragma Assert (Is_Type (Id));
1912 return Flag193 (Id);
1913 end Has_Specified_Stream_Write;
1914
1915 function Has_Static_Discriminants (Id : E) return B is
1916 begin
1917 pragma Assert (Is_Type (Id));
1918 return Flag211 (Id);
1919 end Has_Static_Discriminants;
1920
1921 function Has_Static_Predicate (Id : E) return B is
1922 begin
1923 pragma Assert (Is_Type (Id));
1924 return Flag269 (Id);
1925 end Has_Static_Predicate;
1926
1927 function Has_Static_Predicate_Aspect (Id : E) return B is
1928 begin
1929 pragma Assert (Is_Type (Id));
1930 return Flag259 (Id);
1931 end Has_Static_Predicate_Aspect;
1932
1933 function Has_Storage_Size_Clause (Id : E) return B is
1934 begin
1935 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
1936 return Flag23 (Implementation_Base_Type (Id));
1937 end Has_Storage_Size_Clause;
1938
1939 function Has_Stream_Size_Clause (Id : E) return B is
1940 begin
1941 return Flag184 (Id);
1942 end Has_Stream_Size_Clause;
1943
1944 function Has_Task (Id : E) return B is
1945 begin
1946 return Flag30 (Base_Type (Id));
1947 end Has_Task;
1948
1949 function Has_Thunks (Id : E) return B is
1950 begin
1951 return Flag228 (Id);
1952 end Has_Thunks;
1953
1954 function Has_Timing_Event (Id : E) return B is
1955 begin
1956 return Flag289 (Base_Type (Id));
1957 end Has_Timing_Event;
1958
1959 function Has_Unchecked_Union (Id : E) return B is
1960 begin
1961 return Flag123 (Base_Type (Id));
1962 end Has_Unchecked_Union;
1963
1964 function Has_Unknown_Discriminants (Id : E) return B is
1965 begin
1966 pragma Assert (Is_Type (Id));
1967 return Flag72 (Id);
1968 end Has_Unknown_Discriminants;
1969
1970 function Has_Visible_Refinement (Id : E) return B is
1971 begin
1972 pragma Assert (Ekind (Id) = E_Abstract_State);
1973 return Flag263 (Id);
1974 end Has_Visible_Refinement;
1975
1976 function Has_Volatile_Components (Id : E) return B is
1977 begin
1978 return Flag87 (Implementation_Base_Type (Id));
1979 end Has_Volatile_Components;
1980
1981 function Has_Xref_Entry (Id : E) return B is
1982 begin
1983 return Flag182 (Id);
1984 end Has_Xref_Entry;
1985
1986 function Has_Yield_Aspect (Id : E) return B is
1987 begin
1988 return Flag308 (Id);
1989 end Has_Yield_Aspect;
1990
1991 function Hiding_Loop_Variable (Id : E) return E is
1992 begin
1993 pragma Assert (Ekind (Id) = E_Variable);
1994 return Node8 (Id);
1995 end Hiding_Loop_Variable;
1996
1997 function Hidden_In_Formal_Instance (Id : E) return L is
1998 begin
1999 pragma Assert (Ekind (Id) = E_Package);
2000 return Elist30 (Id);
2001 end Hidden_In_Formal_Instance;
2002
2003 function Homonym (Id : E) return E is
2004 begin
2005 return Node4 (Id);
2006 end Homonym;
2007
2008 function Ignore_SPARK_Mode_Pragmas (Id : E) return B is
2009 begin
2010 pragma Assert
2011 (Ekind (Id) in E_Protected_Body -- concurrent types
2012 | E_Protected_Type
2013 | E_Task_Body
2014 | E_Task_Type
2015 or else
2016 Ekind (Id) in E_Entry -- overloadable
2017 | E_Entry_Family
2018 | E_Function
2019 | E_Generic_Function
2020 | E_Generic_Procedure
2021 | E_Operator
2022 | E_Procedure
2023 | E_Subprogram_Body
2024 or else
2025 Ekind (Id) in E_Generic_Package -- packages
2026 | E_Package
2027 | E_Package_Body);
2028 return Flag301 (Id);
2029 end Ignore_SPARK_Mode_Pragmas;
2030
2031 function Import_Pragma (Id : E) return E is
2032 begin
2033 pragma Assert (Is_Subprogram (Id));
2034 return Node35 (Id);
2035 end Import_Pragma;
2036
2037 function Incomplete_Actuals (Id : E) return L is
2038 begin
2039 pragma Assert (Ekind (Id) = E_Package);
2040 return Elist24 (Id);
2041 end Incomplete_Actuals;
2042
2043 function Interface_Alias (Id : E) return E is
2044 begin
2045 pragma Assert (Is_Subprogram (Id));
2046 return Node25 (Id);
2047 end Interface_Alias;
2048
2049 function Interfaces (Id : E) return L is
2050 begin
2051 pragma Assert (Is_Record_Type (Id));
2052 return Elist25 (Id);
2053 end Interfaces;
2054
2055 function In_Package_Body (Id : E) return B is
2056 begin
2057 return Flag48 (Id);
2058 end In_Package_Body;
2059
2060 function In_Private_Part (Id : E) return B is
2061 begin
2062 return Flag45 (Id);
2063 end In_Private_Part;
2064
2065 function In_Use (Id : E) return B is
2066 begin
2067 pragma Assert (Nkind (Id) in N_Entity);
2068 return Flag8 (Id);
2069 end In_Use;
2070
2071 function Initialization_Statements (Id : E) return N is
2072 begin
2073 pragma Assert (Ekind (Id) in E_Constant | E_Variable);
2074 return Node28 (Id);
2075 end Initialization_Statements;
2076
2077 function Inner_Instances (Id : E) return L is
2078 begin
2079 return Elist23 (Id);
2080 end Inner_Instances;
2081
2082 function Interface_Name (Id : E) return N is
2083 begin
2084 return Node21 (Id);
2085 end Interface_Name;
2086
2087 function Is_Abstract_Subprogram (Id : E) return B is
2088 begin
2089 pragma Assert (Is_Overloadable (Id));
2090 return Flag19 (Id);
2091 end Is_Abstract_Subprogram;
2092
2093 function Is_Abstract_Type (Id : E) return B is
2094 begin
2095 pragma Assert (Is_Type (Id));
2096 return Flag146 (Id);
2097 end Is_Abstract_Type;
2098
2099 function Is_Access_Constant (Id : E) return B is
2100 begin
2101 pragma Assert (Is_Access_Type (Id));
2102 return Flag69 (Id);
2103 end Is_Access_Constant;
2104
2105 function Is_Activation_Record (Id : E) return B is
2106 begin
2107 pragma Assert (Ekind (Id) = E_In_Parameter);
2108 return Flag305 (Id);
2109 end Is_Activation_Record;
2110
2111 function Is_Actual_Subtype (Id : E) return B is
2112 begin
2113 pragma Assert (Is_Type (Id));
2114 return Flag293 (Id);
2115 end Is_Actual_Subtype;
2116
2117 function Is_Ada_2005_Only (Id : E) return B is
2118 begin
2119 return Flag185 (Id);
2120 end Is_Ada_2005_Only;
2121
2122 function Is_Ada_2012_Only (Id : E) return B is
2123 begin
2124 return Flag199 (Id);
2125 end Is_Ada_2012_Only;
2126
2127 function Is_Aliased (Id : E) return B is
2128 begin
2129 pragma Assert (Nkind (Id) in N_Entity);
2130 return Flag15 (Id);
2131 end Is_Aliased;
2132
2133 function Is_Asynchronous (Id : E) return B is
2134 begin
2135 pragma Assert (Ekind (Id) = E_Procedure or else Is_Type (Id));
2136 return Flag81 (Id);
2137 end Is_Asynchronous;
2138
2139 function Is_Atomic (Id : E) return B is
2140 begin
2141 return Flag85 (Id);
2142 end Is_Atomic;
2143
2144 function Is_Bit_Packed_Array (Id : E) return B is
2145 begin
2146 return Flag122 (Implementation_Base_Type (Id));
2147 end Is_Bit_Packed_Array;
2148
2149 function Is_Called (Id : E) return B is
2150 begin
2151 pragma Assert (Ekind (Id) in E_Procedure | E_Function | E_Package);
2152 return Flag102 (Id);
2153 end Is_Called;
2154
2155 function Is_Character_Type (Id : E) return B is
2156 begin
2157 return Flag63 (Id);
2158 end Is_Character_Type;
2159
2160 function Is_Checked_Ghost_Entity (Id : E) return B is
2161 begin
2162 -- Allow this attribute to appear on unanalyzed entities
2163
2164 pragma Assert (Nkind (Id) in N_Entity
2165 or else Ekind (Id) = E_Void);
2166 return Flag277 (Id);
2167 end Is_Checked_Ghost_Entity;
2168
2169 function Is_Child_Unit (Id : E) return B is
2170 begin
2171 return Flag73 (Id);
2172 end Is_Child_Unit;
2173
2174 function Is_Class_Wide_Clone (Id : E) return B is
2175 begin
2176 return Flag290 (Id);
2177 end Is_Class_Wide_Clone;
2178
2179 function Is_Class_Wide_Equivalent_Type (Id : E) return B is
2180 begin
2181 return Flag35 (Id);
2182 end Is_Class_Wide_Equivalent_Type;
2183
2184 function Is_Compilation_Unit (Id : E) return B is
2185 begin
2186 return Flag149 (Id);
2187 end Is_Compilation_Unit;
2188
2189 function Is_Completely_Hidden (Id : E) return B is
2190 begin
2191 pragma Assert (Ekind (Id) = E_Discriminant);
2192 return Flag103 (Id);
2193 end Is_Completely_Hidden;
2194
2195 function Is_Constr_Subt_For_U_Nominal (Id : E) return B is
2196 begin
2197 return Flag80 (Id);
2198 end Is_Constr_Subt_For_U_Nominal;
2199
2200 function Is_Constr_Subt_For_UN_Aliased (Id : E) return B is
2201 begin
2202 return Flag141 (Id);
2203 end Is_Constr_Subt_For_UN_Aliased;
2204
2205 function Is_Constrained (Id : E) return B is
2206 begin
2207 pragma Assert (Nkind (Id) in N_Entity);
2208 return Flag12 (Id);
2209 end Is_Constrained;
2210
2211 function Is_Constructor (Id : E) return B is
2212 begin
2213 return Flag76 (Id);
2214 end Is_Constructor;
2215
2216 function Is_Controlled_Active (Id : E) return B is
2217 begin
2218 return Flag42 (Base_Type (Id));
2219 end Is_Controlled_Active;
2220
2221 function Is_Controlling_Formal (Id : E) return B is
2222 begin
2223 pragma Assert (Is_Formal (Id));
2224 return Flag97 (Id);
2225 end Is_Controlling_Formal;
2226
2227 function Is_CPP_Class (Id : E) return B is
2228 begin
2229 return Flag74 (Id);
2230 end Is_CPP_Class;
2231
2232 function Is_CUDA_Kernel (Id : E) return B is
2233 begin
2234 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
2235 return Flag118 (Id);
2236 end Is_CUDA_Kernel;
2237
2238 function Is_DIC_Procedure (Id : E) return B is
2239 begin
2240 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
2241 return Flag132 (Id);
2242 end Is_DIC_Procedure;
2243
2244 function Is_Descendant_Of_Address (Id : E) return B is
2245 begin
2246 return Flag223 (Id);
2247 end Is_Descendant_Of_Address;
2248
2249 function Is_Discrim_SO_Function (Id : E) return B is
2250 begin
2251 return Flag176 (Id);
2252 end Is_Discrim_SO_Function;
2253
2254 function Is_Discriminant_Check_Function (Id : E) return B is
2255 begin
2256 return Flag264 (Id);
2257 end Is_Discriminant_Check_Function;
2258
2259 function Is_Dispatch_Table_Entity (Id : E) return B is
2260 begin
2261 return Flag234 (Id);
2262 end Is_Dispatch_Table_Entity;
2263
2264 function Is_Dispatching_Operation (Id : E) return B is
2265 begin
2266 pragma Assert (Nkind (Id) in N_Entity);
2267 return Flag6 (Id);
2268 end Is_Dispatching_Operation;
2269
2270 function Is_Elaboration_Checks_OK_Id (Id : E) return B is
2271 begin
2272 pragma Assert (Is_Elaboration_Target (Id));
2273 return Flag148 (Id);
2274 end Is_Elaboration_Checks_OK_Id;
2275
2276 function Is_Elaboration_Warnings_OK_Id (Id : E) return B is
2277 begin
2278 pragma Assert (Is_Elaboration_Target (Id) or else Ekind (Id) = E_Void);
2279 return Flag304 (Id);
2280 end Is_Elaboration_Warnings_OK_Id;
2281
2282 function Is_Eliminated (Id : E) return B is
2283 begin
2284 return Flag124 (Id);
2285 end Is_Eliminated;
2286
2287 function Is_Entry_Formal (Id : E) return B is
2288 begin
2289 return Flag52 (Id);
2290 end Is_Entry_Formal;
2291
2292 function Is_Entry_Wrapper (Id : E) return B is
2293 begin
2294 return Flag297 (Id);
2295 end Is_Entry_Wrapper;
2296
2297 function Is_Exception_Handler (Id : E) return B is
2298 begin
2299 pragma Assert (Ekind (Id) = E_Block);
2300 return Flag286 (Id);
2301 end Is_Exception_Handler;
2302
2303 function Is_Exported (Id : E) return B is
2304 begin
2305 return Flag99 (Id);
2306 end Is_Exported;
2307
2308 function Is_Finalized_Transient (Id : E) return B is
2309 begin
2310 pragma Assert (Ekind (Id) in E_Constant | E_Loop_Parameter | E_Variable);
2311 return Flag252 (Id);
2312 end Is_Finalized_Transient;
2313
2314 function Is_First_Subtype (Id : E) return B is
2315 begin
2316 return Flag70 (Id);
2317 end Is_First_Subtype;
2318
2319 function Is_Formal_Subprogram (Id : E) return B is
2320 begin
2321 return Flag111 (Id);
2322 end Is_Formal_Subprogram;
2323
2324 function Is_Frozen (Id : E) return B is
2325 begin
2326 return Flag4 (Id);
2327 end Is_Frozen;
2328
2329 function Is_Generic_Actual_Subprogram (Id : E) return B is
2330 begin
2331 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
2332 return Flag274 (Id);
2333 end Is_Generic_Actual_Subprogram;
2334
2335 function Is_Generic_Actual_Type (Id : E) return B is
2336 begin
2337 pragma Assert (Is_Type (Id));
2338 return Flag94 (Id);
2339 end Is_Generic_Actual_Type;
2340
2341 function Is_Generic_Instance (Id : E) return B is
2342 begin
2343 return Flag130 (Id);
2344 end Is_Generic_Instance;
2345
2346 function Is_Generic_Type (Id : E) return B is
2347 begin
2348 pragma Assert (Nkind (Id) in N_Entity);
2349 return Flag13 (Id);
2350 end Is_Generic_Type;
2351
2352 function Is_Hidden (Id : E) return B is
2353 begin
2354 return Flag57 (Id);
2355 end Is_Hidden;
2356
2357 function Is_Hidden_Non_Overridden_Subpgm (Id : E) return B is
2358 begin
2359 return Flag2 (Id);
2360 end Is_Hidden_Non_Overridden_Subpgm;
2361
2362 function Is_Hidden_Open_Scope (Id : E) return B is
2363 begin
2364 return Flag171 (Id);
2365 end Is_Hidden_Open_Scope;
2366
2367 function Is_Ignored_Ghost_Entity (Id : E) return B is
2368 begin
2369 -- Allow this attribute to appear on unanalyzed entities
2370
2371 pragma Assert (Nkind (Id) in N_Entity
2372 or else Ekind (Id) = E_Void);
2373 return Flag278 (Id);
2374 end Is_Ignored_Ghost_Entity;
2375
2376 function Is_Ignored_Transient (Id : E) return B is
2377 begin
2378 pragma Assert (Ekind (Id) in E_Constant | E_Loop_Parameter | E_Variable);
2379 return Flag295 (Id);
2380 end Is_Ignored_Transient;
2381
2382 function Is_Immediately_Visible (Id : E) return B is
2383 begin
2384 pragma Assert (Nkind (Id) in N_Entity);
2385 return Flag7 (Id);
2386 end Is_Immediately_Visible;
2387
2388 function Is_Implementation_Defined (Id : E) return B is
2389 begin
2390 return Flag254 (Id);
2391 end Is_Implementation_Defined;
2392
2393 function Is_Imported (Id : E) return B is
2394 begin
2395 return Flag24 (Id);
2396 end Is_Imported;
2397
2398 function Is_Independent (Id : E) return B is
2399 begin
2400 return Flag268 (Id);
2401 end Is_Independent;
2402
2403 function Is_Initial_Condition_Procedure (Id : E) return B is
2404 begin
2405 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
2406 return Flag302 (Id);
2407 end Is_Initial_Condition_Procedure;
2408
2409 function Is_Inlined (Id : E) return B is
2410 begin
2411 return Flag11 (Id);
2412 end Is_Inlined;
2413
2414 function Is_Inlined_Always (Id : E) return B is
2415 begin
2416 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
2417 return Flag1 (Id);
2418 end Is_Inlined_Always;
2419
2420 function Is_Interface (Id : E) return B is
2421 begin
2422 return Flag186 (Id);
2423 end Is_Interface;
2424
2425 function Is_Instantiated (Id : E) return B is
2426 begin
2427 return Flag126 (Id);
2428 end Is_Instantiated;
2429
2430 function Is_Internal (Id : E) return B is
2431 begin
2432 pragma Assert (Nkind (Id) in N_Entity);
2433 return Flag17 (Id);
2434 end Is_Internal;
2435
2436 function Is_Interrupt_Handler (Id : E) return B is
2437 begin
2438 pragma Assert (Nkind (Id) in N_Entity);
2439 return Flag89 (Id);
2440 end Is_Interrupt_Handler;
2441
2442 function Is_Intrinsic_Subprogram (Id : E) return B is
2443 begin
2444 return Flag64 (Id);
2445 end Is_Intrinsic_Subprogram;
2446
2447 function Is_Invariant_Procedure (Id : E) return B is
2448 begin
2449 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
2450 return Flag257 (Id);
2451 end Is_Invariant_Procedure;
2452
2453 function Is_Itype (Id : E) return B is
2454 begin
2455 return Flag91 (Id);
2456 end Is_Itype;
2457
2458 function Is_Known_Non_Null (Id : E) return B is
2459 begin
2460 return Flag37 (Id);
2461 end Is_Known_Non_Null;
2462
2463 function Is_Known_Null (Id : E) return B is
2464 begin
2465 return Flag204 (Id);
2466 end Is_Known_Null;
2467
2468 function Is_Known_Valid (Id : E) return B is
2469 begin
2470 return Flag170 (Id);
2471 end Is_Known_Valid;
2472
2473 function Is_Limited_Composite (Id : E) return B is
2474 begin
2475 return Flag106 (Id);
2476 end Is_Limited_Composite;
2477
2478 function Is_Limited_Interface (Id : E) return B is
2479 begin
2480 return Flag197 (Id);
2481 end Is_Limited_Interface;
2482
2483 function Is_Limited_Record (Id : E) return B is
2484 begin
2485 return Flag25 (Id);
2486 end Is_Limited_Record;
2487
2488 function Is_Local_Anonymous_Access (Id : E) return B is
2489 begin
2490 pragma Assert (Is_Access_Type (Id));
2491 return Flag194 (Id);
2492 end Is_Local_Anonymous_Access;
2493
2494 function Is_Loop_Parameter (Id : E) return B is
2495 begin
2496 return Flag307 (Id);
2497 end Is_Loop_Parameter;
2498
2499 function Is_Machine_Code_Subprogram (Id : E) return B is
2500 begin
2501 pragma Assert (Is_Subprogram (Id));
2502 return Flag137 (Id);
2503 end Is_Machine_Code_Subprogram;
2504
2505 function Is_Non_Static_Subtype (Id : E) return B is
2506 begin
2507 pragma Assert (Is_Type (Id));
2508 return Flag109 (Id);
2509 end Is_Non_Static_Subtype;
2510
2511 function Is_Null_Init_Proc (Id : E) return B is
2512 begin
2513 pragma Assert (Ekind (Id) = E_Procedure);
2514 return Flag178 (Id);
2515 end Is_Null_Init_Proc;
2516
2517 function Is_Obsolescent (Id : E) return B is
2518 begin
2519 return Flag153 (Id);
2520 end Is_Obsolescent;
2521
2522 function Is_Only_Out_Parameter (Id : E) return B is
2523 begin
2524 pragma Assert (Is_Formal (Id));
2525 return Flag226 (Id);
2526 end Is_Only_Out_Parameter;
2527
2528 function Is_Package_Body_Entity (Id : E) return B is
2529 begin
2530 return Flag160 (Id);
2531 end Is_Package_Body_Entity;
2532
2533 function Is_Packed (Id : E) return B is
2534 begin
2535 return Flag51 (Implementation_Base_Type (Id));
2536 end Is_Packed;
2537
2538 function Is_Packed_Array_Impl_Type (Id : E) return B is
2539 begin
2540 return Flag138 (Id);
2541 end Is_Packed_Array_Impl_Type;
2542
2543 function Is_Param_Block_Component_Type (Id : E) return B is
2544 begin
2545 pragma Assert (Is_Access_Type (Id));
2546 return Flag215 (Base_Type (Id));
2547 end Is_Param_Block_Component_Type;
2548
2549 function Is_Partial_DIC_Procedure (Id : E) return B is
2550 Partial_DIC_Suffix : constant String := "Partial_DIC";
2551 DIC_Nam : constant String := Get_Name_String (Chars (Id));
2552
2553 begin
2554 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
2555
2556 -- Instead of adding a new Entity_Id flag (which are in short supply),
2557 -- we test the form of the subprogram name. When the node field and flag
2558 -- situation is eased, this should be replaced with a flag. ???
2559
2560 if DIC_Nam'Length > Partial_DIC_Suffix'Length
2561 and then
2562 DIC_Nam
2563 (DIC_Nam'Last - Partial_DIC_Suffix'Length + 1 .. DIC_Nam'Last) =
2564 Partial_DIC_Suffix
2565 then
2566 return True;
2567 else
2568 return False;
2569 end if;
2570 end Is_Partial_DIC_Procedure;
2571
2572 function Is_Partial_Invariant_Procedure (Id : E) return B is
2573 begin
2574 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
2575 return Flag292 (Id);
2576 end Is_Partial_Invariant_Procedure;
2577
2578 function Is_Potentially_Use_Visible (Id : E) return B is
2579 begin
2580 pragma Assert (Nkind (Id) in N_Entity);
2581 return Flag9 (Id);
2582 end Is_Potentially_Use_Visible;
2583
2584 function Is_Predicate_Function (Id : E) return B is
2585 begin
2586 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
2587 return Flag255 (Id);
2588 end Is_Predicate_Function;
2589
2590 function Is_Predicate_Function_M (Id : E) return B is
2591 begin
2592 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
2593 return Flag256 (Id);
2594 end Is_Predicate_Function_M;
2595
2596 function Is_Preelaborated (Id : E) return B is
2597 begin
2598 return Flag59 (Id);
2599 end Is_Preelaborated;
2600
2601 function Is_Primitive (Id : E) return B is
2602 begin
2603 pragma Assert (Is_Overloadable (Id) or else Is_Generic_Subprogram (Id));
2604 return Flag218 (Id);
2605 end Is_Primitive;
2606
2607 function Is_Primitive_Wrapper (Id : E) return B is
2608 begin
2609 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
2610 return Flag195 (Id);
2611 end Is_Primitive_Wrapper;
2612
2613 function Is_Private_Composite (Id : E) return B is
2614 begin
2615 pragma Assert (Is_Type (Id));
2616 return Flag107 (Id);
2617 end Is_Private_Composite;
2618
2619 function Is_Private_Descendant (Id : E) return B is
2620 begin
2621 return Flag53 (Id);
2622 end Is_Private_Descendant;
2623
2624 function Is_Private_Primitive (Id : E) return B is
2625 begin
2626 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
2627 return Flag245 (Id);
2628 end Is_Private_Primitive;
2629
2630 function Is_Public (Id : E) return B is
2631 begin
2632 pragma Assert (Nkind (Id) in N_Entity);
2633 return Flag10 (Id);
2634 end Is_Public;
2635
2636 function Is_Pure (Id : E) return B is
2637 begin
2638 return Flag44 (Id);
2639 end Is_Pure;
2640
2641 function Is_Pure_Unit_Access_Type (Id : E) return B is
2642 begin
2643 pragma Assert (Is_Access_Type (Id));
2644 return Flag189 (Id);
2645 end Is_Pure_Unit_Access_Type;
2646
2647 function Is_RACW_Stub_Type (Id : E) return B is
2648 begin
2649 pragma Assert (Is_Type (Id));
2650 return Flag244 (Id);
2651 end Is_RACW_Stub_Type;
2652
2653 function Is_Raised (Id : E) return B is
2654 begin
2655 pragma Assert (Ekind (Id) = E_Exception);
2656 return Flag224 (Id);
2657 end Is_Raised;
2658
2659 function Is_Remote_Call_Interface (Id : E) return B is
2660 begin
2661 return Flag62 (Id);
2662 end Is_Remote_Call_Interface;
2663
2664 function Is_Remote_Types (Id : E) return B is
2665 begin
2666 return Flag61 (Id);
2667 end Is_Remote_Types;
2668
2669 function Is_Renaming_Of_Object (Id : E) return B is
2670 begin
2671 return Flag112 (Id);
2672 end Is_Renaming_Of_Object;
2673
2674 function Is_Return_Object (Id : E) return B is
2675 begin
2676 return Flag209 (Id);
2677 end Is_Return_Object;
2678
2679 function Is_Safe_To_Reevaluate (Id : E) return B is
2680 begin
2681 return Flag249 (Id);
2682 end Is_Safe_To_Reevaluate;
2683
2684 function Is_Shared_Passive (Id : E) return B is
2685 begin
2686 return Flag60 (Id);
2687 end Is_Shared_Passive;
2688
2689 function Is_Static_Type (Id : E) return B is
2690 begin
2691 return Flag281 (Id);
2692 end Is_Static_Type;
2693
2694 function Is_Statically_Allocated (Id : E) return B is
2695 begin
2696 return Flag28 (Id);
2697 end Is_Statically_Allocated;
2698
2699 function Is_Tag (Id : E) return B is
2700 begin
2701 pragma Assert (Nkind (Id) in N_Entity);
2702 return Flag78 (Id);
2703 end Is_Tag;
2704
2705 function Is_Tagged_Type (Id : E) return B is
2706 begin
2707 return Flag55 (Id);
2708 end Is_Tagged_Type;
2709
2710 function Is_Thunk (Id : E) return B is
2711 begin
2712 return Flag225 (Id);
2713 end Is_Thunk;
2714
2715 function Is_Trivial_Subprogram (Id : E) return B is
2716 begin
2717 return Flag235 (Id);
2718 end Is_Trivial_Subprogram;
2719
2720 function Is_True_Constant (Id : E) return B is
2721 begin
2722 return Flag163 (Id);
2723 end Is_True_Constant;
2724
2725 function Is_Unchecked_Union (Id : E) return B is
2726 begin
2727 return Flag117 (Implementation_Base_Type (Id));
2728 end Is_Unchecked_Union;
2729
2730 function Is_Underlying_Full_View (Id : E) return B is
2731 begin
2732 return Flag298 (Id);
2733 end Is_Underlying_Full_View;
2734
2735 function Is_Underlying_Record_View (Id : E) return B is
2736 begin
2737 return Flag246 (Id);
2738 end Is_Underlying_Record_View;
2739
2740 function Is_Unimplemented (Id : E) return B is
2741 begin
2742 return Flag284 (Id);
2743 end Is_Unimplemented;
2744
2745 function Is_Unsigned_Type (Id : E) return B is
2746 begin
2747 pragma Assert (Is_Type (Id));
2748 return Flag144 (Id);
2749 end Is_Unsigned_Type;
2750
2751 function Is_Uplevel_Referenced_Entity (Id : E) return B is
2752 begin
2753 return Flag283 (Id);
2754 end Is_Uplevel_Referenced_Entity;
2755
2756 function Is_Valued_Procedure (Id : E) return B is
2757 begin
2758 pragma Assert (Ekind (Id) = E_Procedure);
2759 return Flag127 (Id);
2760 end Is_Valued_Procedure;
2761
2762 function Is_Visible_Formal (Id : E) return B is
2763 begin
2764 return Flag206 (Id);
2765 end Is_Visible_Formal;
2766
2767 function Is_Visible_Lib_Unit (Id : E) return B is
2768 begin
2769 return Flag116 (Id);
2770 end Is_Visible_Lib_Unit;
2771
2772 function Is_Volatile (Id : E) return B is
2773 begin
2774 pragma Assert (Nkind (Id) in N_Entity);
2775
2776 if Is_Type (Id) then
2777 return Flag16 (Base_Type (Id));
2778 else
2779 return Flag16 (Id);
2780 end if;
2781 end Is_Volatile;
2782
2783 function Is_Volatile_Full_Access (Id : E) return B is
2784 begin
2785 return Flag285 (Id);
2786 end Is_Volatile_Full_Access;
2787
2788 function Itype_Printed (Id : E) return B is
2789 begin
2790 pragma Assert (Is_Itype (Id));
2791 return Flag202 (Id);
2792 end Itype_Printed;
2793
2794 function Kill_Elaboration_Checks (Id : E) return B is
2795 begin
2796 return Flag32 (Id);
2797 end Kill_Elaboration_Checks;
2798
2799 function Kill_Range_Checks (Id : E) return B is
2800 begin
2801 return Flag33 (Id);
2802 end Kill_Range_Checks;
2803
2804 function Known_To_Have_Preelab_Init (Id : E) return B is
2805 begin
2806 pragma Assert (Is_Type (Id));
2807 return Flag207 (Id);
2808 end Known_To_Have_Preelab_Init;
2809
2810 function Last_Aggregate_Assignment (Id : E) return N is
2811 begin
2812 pragma Assert (Ekind (Id) in E_Constant | E_Variable);
2813 return Node30 (Id);
2814 end Last_Aggregate_Assignment;
2815
2816 function Last_Assignment (Id : E) return N is
2817 begin
2818 pragma Assert (Is_Assignable (Id));
2819 return Node26 (Id);
2820 end Last_Assignment;
2821
2822 function Last_Entity (Id : E) return E is
2823 begin
2824 return Node20 (Id);
2825 end Last_Entity;
2826
2827 function Limited_View (Id : E) return E is
2828 begin
2829 pragma Assert (Ekind (Id) = E_Package);
2830 return Node23 (Id);
2831 end Limited_View;
2832
2833 function Linker_Section_Pragma (Id : E) return N is
2834 begin
2835 pragma Assert
2836 (Is_Object (Id) or else Is_Subprogram (Id) or else Is_Type (Id));
2837 return Node33 (Id);
2838 end Linker_Section_Pragma;
2839
2840 function Lit_Hash (Id : E) return E is
2841 begin
2842 pragma Assert (Is_Enumeration_Type (Id));
2843 return Node21 (Id);
2844 end Lit_Hash;
2845
2846 function Lit_Indexes (Id : E) return E is
2847 begin
2848 pragma Assert (Is_Enumeration_Type (Id));
2849 return Node18 (Id);
2850 end Lit_Indexes;
2851
2852 function Lit_Strings (Id : E) return E is
2853 begin
2854 pragma Assert (Is_Enumeration_Type (Id));
2855 return Node16 (Id);
2856 end Lit_Strings;
2857
2858 function Low_Bound_Tested (Id : E) return B is
2859 begin
2860 return Flag205 (Id);
2861 end Low_Bound_Tested;
2862
2863 function Machine_Radix_10 (Id : E) return B is
2864 begin
2865 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
2866 return Flag84 (Id);
2867 end Machine_Radix_10;
2868
2869 function Master_Id (Id : E) return E is
2870 begin
2871 pragma Assert (Is_Access_Type (Id));
2872 return Node17 (Id);
2873 end Master_Id;
2874
2875 function Materialize_Entity (Id : E) return B is
2876 begin
2877 return Flag168 (Id);
2878 end Materialize_Entity;
2879
2880 function May_Inherit_Delayed_Rep_Aspects (Id : E) return B is
2881 begin
2882 return Flag262 (Id);
2883 end May_Inherit_Delayed_Rep_Aspects;
2884
2885 function Mechanism (Id : E) return M is
2886 begin
2887 pragma Assert (Ekind (Id) = E_Function or else Is_Formal (Id));
2888 return UI_To_Int (Uint8 (Id));
2889 end Mechanism;
2890
2891 function Minimum_Accessibility (Id : E) return E is
2892 begin
2893 pragma Assert (Is_Formal (Id));
2894 return Node24 (Id);
2895 end Minimum_Accessibility;
2896
2897 function Modulus (Id : E) return Uint is
2898 begin
2899 pragma Assert (Is_Modular_Integer_Type (Id));
2900 return Uint17 (Base_Type (Id));
2901 end Modulus;
2902
2903 function Must_Be_On_Byte_Boundary (Id : E) return B is
2904 begin
2905 pragma Assert (Is_Type (Id));
2906 return Flag183 (Id);
2907 end Must_Be_On_Byte_Boundary;
2908
2909 function Must_Have_Preelab_Init (Id : E) return B is
2910 begin
2911 pragma Assert (Is_Type (Id));
2912 return Flag208 (Id);
2913 end Must_Have_Preelab_Init;
2914
2915 function Needs_Activation_Record (Id : E) return B is
2916 begin
2917 return Flag306 (Id);
2918 end Needs_Activation_Record;
2919
2920 function Needs_Debug_Info (Id : E) return B is
2921 begin
2922 return Flag147 (Id);
2923 end Needs_Debug_Info;
2924
2925 function Needs_No_Actuals (Id : E) return B is
2926 begin
2927 pragma Assert
2928 (Is_Overloadable (Id)
2929 or else Ekind (Id) in E_Subprogram_Type | E_Entry_Family);
2930 return Flag22 (Id);
2931 end Needs_No_Actuals;
2932
2933 function Never_Set_In_Source (Id : E) return B is
2934 begin
2935 return Flag115 (Id);
2936 end Never_Set_In_Source;
2937
2938 function Next_Inlined_Subprogram (Id : E) return E is
2939 begin
2940 return Node12 (Id);
2941 end Next_Inlined_Subprogram;
2942
2943 function No_Dynamic_Predicate_On_Actual (Id : E) return Boolean is
2944 begin
2945 pragma Assert (Is_Discrete_Type (Id));
2946 return Flag276 (Id);
2947 end No_Dynamic_Predicate_On_Actual;
2948
2949 function No_Pool_Assigned (Id : E) return B is
2950 begin
2951 pragma Assert (Is_Access_Type (Id));
2952 return Flag131 (Root_Type (Id));
2953 end No_Pool_Assigned;
2954
2955 function No_Predicate_On_Actual (Id : E) return Boolean is
2956 begin
2957 pragma Assert (Is_Discrete_Type (Id));
2958 return Flag275 (Id);
2959 end No_Predicate_On_Actual;
2960
2961 function No_Reordering (Id : E) return B is
2962 begin
2963 pragma Assert (Is_Record_Type (Id));
2964 return Flag239 (Implementation_Base_Type (Id));
2965 end No_Reordering;
2966
2967 function No_Return (Id : E) return B is
2968 begin
2969 return Flag113 (Id);
2970 end No_Return;
2971
2972 function No_Strict_Aliasing (Id : E) return B is
2973 begin
2974 pragma Assert (Is_Access_Type (Id));
2975 return Flag136 (Base_Type (Id));
2976 end No_Strict_Aliasing;
2977
2978 function No_Tagged_Streams_Pragma (Id : E) return N is
2979 begin
2980 pragma Assert (Is_Tagged_Type (Id));
2981 return Node32 (Id);
2982 end No_Tagged_Streams_Pragma;
2983
2984 function Non_Binary_Modulus (Id : E) return B is
2985 begin
2986 pragma Assert (Is_Type (Id));
2987 return Flag58 (Base_Type (Id));
2988 end Non_Binary_Modulus;
2989
2990 function Non_Limited_View (Id : E) return E is
2991 begin
2992 pragma Assert
2993 (Ekind (Id) in Incomplete_Kind
2994 or else
2995 Ekind (Id) in Class_Wide_Kind
2996 or else
2997 Ekind (Id) = E_Abstract_State);
2998 return Node19 (Id);
2999 end Non_Limited_View;
3000
3001 function Nonzero_Is_True (Id : E) return B is
3002 begin
3003 pragma Assert (Root_Type (Id) = Standard_Boolean);
3004 return Flag162 (Base_Type (Id));
3005 end Nonzero_Is_True;
3006
3007 function Normalized_First_Bit (Id : E) return U is
3008 begin
3009 pragma Assert (Ekind (Id) in E_Component | E_Discriminant);
3010 return Uint8 (Id);
3011 end Normalized_First_Bit;
3012
3013 function Normalized_Position (Id : E) return U is
3014 begin
3015 pragma Assert (Ekind (Id) in E_Component | E_Discriminant);
3016 return Uint14 (Id);
3017 end Normalized_Position;
3018
3019 function Normalized_Position_Max (Id : E) return U is
3020 begin
3021 pragma Assert (Ekind (Id) in E_Component | E_Discriminant);
3022 return Uint10 (Id);
3023 end Normalized_Position_Max;
3024
3025 function OK_To_Rename (Id : E) return B is
3026 begin
3027 pragma Assert (Ekind (Id) = E_Variable);
3028 return Flag247 (Id);
3029 end OK_To_Rename;
3030
3031 function Optimize_Alignment_Space (Id : E) return B is
3032 begin
3033 pragma Assert
3034 (Is_Type (Id) or else Ekind (Id) in E_Constant | E_Variable);
3035 return Flag241 (Id);
3036 end Optimize_Alignment_Space;
3037
3038 function Optimize_Alignment_Time (Id : E) return B is
3039 begin
3040 pragma Assert
3041 (Is_Type (Id) or else Ekind (Id) in E_Constant | E_Variable);
3042 return Flag242 (Id);
3043 end Optimize_Alignment_Time;
3044
3045 function Original_Access_Type (Id : E) return E is
3046 begin
3047 pragma Assert (Ekind (Id) = E_Access_Subprogram_Type);
3048 return Node28 (Id);
3049 end Original_Access_Type;
3050
3051 function Original_Array_Type (Id : E) return E is
3052 begin
3053 pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id));
3054 return Node21 (Id);
3055 end Original_Array_Type;
3056
3057 function Original_Protected_Subprogram (Id : E) return N is
3058 begin
3059 return Node41 (Id);
3060 end Original_Protected_Subprogram;
3061
3062 function Original_Record_Component (Id : E) return E is
3063 begin
3064 pragma Assert (Ekind (Id) in E_Void | E_Component | E_Discriminant);
3065 return Node22 (Id);
3066 end Original_Record_Component;
3067
3068 function Overlays_Constant (Id : E) return B is
3069 begin
3070 return Flag243 (Id);
3071 end Overlays_Constant;
3072
3073 function Overridden_Operation (Id : E) return E is
3074 begin
3075 pragma Assert (Is_Subprogram_Or_Generic_Subprogram (Id));
3076 return Node26 (Id);
3077 end Overridden_Operation;
3078
3079 function Package_Instantiation (Id : E) return N is
3080 begin
3081 pragma Assert (Is_Package_Or_Generic_Package (Id));
3082 return Node26 (Id);
3083 end Package_Instantiation;
3084
3085 function Packed_Array_Impl_Type (Id : E) return E is
3086 begin
3087 pragma Assert (Is_Array_Type (Id));
3088 return Node23 (Id);
3089 end Packed_Array_Impl_Type;
3090
3091 function Parent_Subtype (Id : E) return E is
3092 begin
3093 pragma Assert (Is_Record_Type (Id));
3094 return Node19 (Base_Type (Id));
3095 end Parent_Subtype;
3096
3097 function Part_Of_Constituents (Id : E) return L is
3098 begin
3099 pragma Assert (Ekind (Id) in E_Abstract_State | E_Variable);
3100 return Elist10 (Id);
3101 end Part_Of_Constituents;
3102
3103 function Part_Of_References (Id : E) return L is
3104 begin
3105 pragma Assert (Ekind (Id) = E_Variable);
3106 return Elist11 (Id);
3107 end Part_Of_References;
3108
3109 function Partial_View_Has_Unknown_Discr (Id : E) return B is
3110 begin
3111 pragma Assert (Is_Type (Id));
3112 return Flag280 (Id);
3113 end Partial_View_Has_Unknown_Discr;
3114
3115 function Pending_Access_Types (Id : E) return L is
3116 begin
3117 pragma Assert (Is_Type (Id));
3118 return Elist15 (Id);
3119 end Pending_Access_Types;
3120
3121 function Postconditions_Proc (Id : E) return E is
3122 begin
3123 pragma Assert
3124 (Ekind (Id) in E_Entry | E_Entry_Family | E_Function | E_Procedure);
3125 return Node14 (Id);
3126 end Postconditions_Proc;
3127
3128 function Predicated_Parent (Id : E) return E is
3129 begin
3130 pragma Assert
3131 (Ekind (Id) in E_Array_Subtype |
3132 E_Record_Subtype |
3133 E_Record_Subtype_With_Private);
3134 return Node38 (Id);
3135 end Predicated_Parent;
3136
3137 function Predicates_Ignored (Id : E) return B is
3138 begin
3139 pragma Assert (Is_Type (Id));
3140 return Flag288 (Id);
3141 end Predicates_Ignored;
3142
3143 function Prev_Entity (Id : E) return E is
3144 begin
3145 return Node36 (Id);
3146 end Prev_Entity;
3147
3148 function Prival (Id : E) return E is
3149 begin
3150 pragma Assert (Is_Protected_Component (Id));
3151 return Node17 (Id);
3152 end Prival;
3153
3154 function Prival_Link (Id : E) return E is
3155 begin
3156 pragma Assert (Ekind (Id) in E_Constant | E_Variable);
3157 return Node20 (Id);
3158 end Prival_Link;
3159
3160 function Private_Dependents (Id : E) return L is
3161 begin
3162 pragma Assert (Is_Incomplete_Or_Private_Type (Id));
3163 return Elist18 (Id);
3164 end Private_Dependents;
3165
3166 function Protected_Body_Subprogram (Id : E) return E is
3167 begin
3168 pragma Assert (Is_Subprogram_Or_Entry (Id));
3169 return Node11 (Id);
3170 end Protected_Body_Subprogram;
3171
3172 function Protected_Formal (Id : E) return E is
3173 begin
3174 pragma Assert (Is_Formal (Id));
3175 return Node22 (Id);
3176 end Protected_Formal;
3177
3178 function Protected_Subprogram (Id : E) return N is
3179 begin
3180 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
3181 return Node39 (Id);
3182 end Protected_Subprogram;
3183
3184 function Protection_Object (Id : E) return E is
3185 begin
3186 pragma Assert
3187 (Ekind (Id) in E_Entry | E_Entry_Family | E_Function | E_Procedure);
3188 return Node23 (Id);
3189 end Protection_Object;
3190
3191 function Reachable (Id : E) return B is
3192 begin
3193 return Flag49 (Id);
3194 end Reachable;
3195
3196 function Receiving_Entry (Id : E) return E is
3197 begin
3198 pragma Assert (Ekind (Id) = E_Procedure);
3199 return Node19 (Id);
3200 end Receiving_Entry;
3201
3202 function Referenced (Id : E) return B is
3203 begin
3204 return Flag156 (Id);
3205 end Referenced;
3206
3207 function Referenced_As_LHS (Id : E) return B is
3208 begin
3209 return Flag36 (Id);
3210 end Referenced_As_LHS;
3211
3212 function Referenced_As_Out_Parameter (Id : E) return B is
3213 begin
3214 return Flag227 (Id);
3215 end Referenced_As_Out_Parameter;
3216
3217 function Refinement_Constituents (Id : E) return L is
3218 begin
3219 pragma Assert (Ekind (Id) = E_Abstract_State);
3220 return Elist8 (Id);
3221 end Refinement_Constituents;
3222
3223 function Register_Exception_Call (Id : E) return N is
3224 begin
3225 pragma Assert (Ekind (Id) = E_Exception);
3226 return Node20 (Id);
3227 end Register_Exception_Call;
3228
3229 function Related_Array_Object (Id : E) return E is
3230 begin
3231 pragma Assert (Is_Array_Type (Id));
3232 return Node25 (Id);
3233 end Related_Array_Object;
3234
3235 function Related_Expression (Id : E) return N is
3236 begin
3237 pragma Assert
3238 (Ekind (Id) in Type_Kind | E_Constant | E_Variable | E_Function);
3239 return Node24 (Id);
3240 end Related_Expression;
3241
3242 function Related_Instance (Id : E) return E is
3243 begin
3244 pragma Assert (Ekind (Id) in E_Package | E_Package_Body);
3245 return Node15 (Id);
3246 end Related_Instance;
3247
3248 function Related_Type (Id : E) return E is
3249 begin
3250 pragma Assert (Ekind (Id) in E_Component | E_Constant | E_Variable);
3251 return Node27 (Id);
3252 end Related_Type;
3253
3254 function Relative_Deadline_Variable (Id : E) return E is
3255 begin
3256 pragma Assert (Is_Task_Type (Id));
3257 return Node28 (Implementation_Base_Type (Id));
3258 end Relative_Deadline_Variable;
3259
3260 function Renamed_Entity (Id : E) return N is
3261 begin
3262 return Node18 (Id);
3263 end Renamed_Entity;
3264
3265 function Renamed_In_Spec (Id : E) return B is
3266 begin
3267 pragma Assert (Ekind (Id) = E_Package);
3268 return Flag231 (Id);
3269 end Renamed_In_Spec;
3270
3271 function Renamed_Object (Id : E) return N is
3272 begin
3273 return Node18 (Id);
3274 end Renamed_Object;
3275
3276 function Renaming_Map (Id : E) return U is
3277 begin
3278 return Uint9 (Id);
3279 end Renaming_Map;
3280
3281 function Requires_Overriding (Id : E) return B is
3282 begin
3283 pragma Assert (Is_Overloadable (Id));
3284 return Flag213 (Id);
3285 end Requires_Overriding;
3286
3287 function Return_Present (Id : E) return B is
3288 begin
3289 return Flag54 (Id);
3290 end Return_Present;
3291
3292 function Return_Applies_To (Id : E) return N is
3293 begin
3294 return Node8 (Id);
3295 end Return_Applies_To;
3296
3297 function Returns_By_Ref (Id : E) return B is
3298 begin
3299 return Flag90 (Id);
3300 end Returns_By_Ref;
3301
3302 function Reverse_Bit_Order (Id : E) return B is
3303 begin
3304 pragma Assert (Is_Record_Type (Id));
3305 return Flag164 (Base_Type (Id));
3306 end Reverse_Bit_Order;
3307
3308 function Reverse_Storage_Order (Id : E) return B is
3309 begin
3310 pragma Assert (Is_Record_Type (Id) or else Is_Array_Type (Id));
3311 return Flag93 (Base_Type (Id));
3312 end Reverse_Storage_Order;
3313
3314 function Rewritten_For_C (Id : E) return B is
3315 begin
3316 pragma Assert (Ekind (Id) = E_Function);
3317 return Flag287 (Id);
3318 end Rewritten_For_C;
3319
3320 function RM_Size (Id : E) return U is
3321 begin
3322 pragma Assert (Is_Type (Id));
3323 return Uint13 (Id);
3324 end RM_Size;
3325
3326 function Scalar_Range (Id : E) return N is
3327 begin
3328 return Node20 (Id);
3329 end Scalar_Range;
3330
3331 function Scale_Value (Id : E) return U is
3332 begin
3333 return Uint16 (Id);
3334 end Scale_Value;
3335
3336 function Scope_Depth_Value (Id : E) return U is
3337 begin
3338 pragma Assert
3339 (Ekind (Id) in
3340 Concurrent_Kind | Entry_Kind | Generic_Unit_Kind |
3341 E_Package | E_Package_Body | Subprogram_Kind |
3342 E_Block | E_Subprogram_Body |
3343 E_Private_Type .. E_Limited_Private_Subtype |
3344 E_Void | E_Loop | E_Return_Statement);
3345 return Uint22 (Id);
3346 end Scope_Depth_Value;
3347
3348 function Sec_Stack_Needed_For_Return (Id : E) return B is
3349 begin
3350 return Flag167 (Id);
3351 end Sec_Stack_Needed_For_Return;
3352
3353 function Shared_Var_Procs_Instance (Id : E) return E is
3354 begin
3355 pragma Assert (Ekind (Id) = E_Variable);
3356 return Node22 (Id);
3357 end Shared_Var_Procs_Instance;
3358
3359 function Size_Check_Code (Id : E) return N is
3360 begin
3361 pragma Assert (Ekind (Id) in E_Constant | E_Variable);
3362 return Node19 (Id);
3363 end Size_Check_Code;
3364
3365 function Size_Depends_On_Discriminant (Id : E) return B is
3366 begin
3367 return Flag177 (Id);
3368 end Size_Depends_On_Discriminant;
3369
3370 function Size_Known_At_Compile_Time (Id : E) return B is
3371 begin
3372 return Flag92 (Id);
3373 end Size_Known_At_Compile_Time;
3374
3375 function Small_Value (Id : E) return R is
3376 begin
3377 pragma Assert (Is_Fixed_Point_Type (Id));
3378 return Ureal21 (Id);
3379 end Small_Value;
3380
3381 function SPARK_Aux_Pragma (Id : E) return N is
3382 begin
3383 pragma Assert
3384 (Ekind (Id) in E_Protected_Type -- concurrent types
3385 | E_Task_Type
3386 or else
3387 Ekind (Id) in E_Generic_Package -- packages
3388 | E_Package
3389 | E_Package_Body);
3390 return Node41 (Id);
3391 end SPARK_Aux_Pragma;
3392
3393 function SPARK_Aux_Pragma_Inherited (Id : E) return B is
3394 begin
3395 pragma Assert
3396 (Ekind (Id) in E_Protected_Type -- concurrent types
3397 | E_Task_Type
3398 or else
3399 Ekind (Id) in E_Generic_Package -- packages
3400 | E_Package
3401 | E_Package_Body);
3402 return Flag266 (Id);
3403 end SPARK_Aux_Pragma_Inherited;
3404
3405 function SPARK_Pragma (Id : E) return N is
3406 begin
3407 pragma Assert
3408 (Ekind (Id) in E_Constant -- objects
3409 | E_Variable
3410 or else
3411 Ekind (Id) in E_Abstract_State -- overloadable
3412 | E_Entry
3413 | E_Entry_Family
3414 | E_Function
3415 | E_Generic_Function
3416 | E_Generic_Procedure
3417 | E_Operator
3418 | E_Procedure
3419 | E_Subprogram_Body
3420 or else
3421 Ekind (Id) in E_Generic_Package -- packages
3422 | E_Package
3423 | E_Package_Body
3424 or else
3425 Ekind (Id) = E_Void -- special purpose
3426 or else
3427 Ekind (Id) in E_Protected_Body -- types
3428 | E_Task_Body
3429 or else
3430 Is_Type (Id));
3431 return Node40 (Id);
3432 end SPARK_Pragma;
3433
3434 function SPARK_Pragma_Inherited (Id : E) return B is
3435 begin
3436 pragma Assert
3437 (Ekind (Id) in E_Constant -- objects
3438 | E_Variable
3439 or else
3440 Ekind (Id) in E_Abstract_State -- overloadable
3441 | E_Entry
3442 | E_Entry_Family
3443 | E_Function
3444 | E_Generic_Function
3445 | E_Generic_Procedure
3446 | E_Operator
3447 | E_Procedure
3448 | E_Subprogram_Body
3449 or else
3450 Ekind (Id) in E_Generic_Package -- packages
3451 | E_Package
3452 | E_Package_Body
3453 or else
3454 Ekind (Id) = E_Void -- special purpose
3455 or else
3456 Ekind (Id) in E_Protected_Body -- types
3457 | E_Task_Body
3458 or else
3459 Is_Type (Id));
3460 return Flag265 (Id);
3461 end SPARK_Pragma_Inherited;
3462
3463 function Spec_Entity (Id : E) return E is
3464 begin
3465 pragma Assert (Ekind (Id) = E_Package_Body or else Is_Formal (Id));
3466 return Node19 (Id);
3467 end Spec_Entity;
3468
3469 function SSO_Set_High_By_Default (Id : E) return B is
3470 begin
3471 pragma Assert (Is_Record_Type (Id) or else Is_Array_Type (Id));
3472 return Flag273 (Base_Type (Id));
3473 end SSO_Set_High_By_Default;
3474
3475 function SSO_Set_Low_By_Default (Id : E) return B is
3476 begin
3477 pragma Assert (Is_Record_Type (Id) or else Is_Array_Type (Id));
3478 return Flag272 (Base_Type (Id));
3479 end SSO_Set_Low_By_Default;
3480
3481 function Static_Discrete_Predicate (Id : E) return S is
3482 begin
3483 pragma Assert (Is_Discrete_Type (Id));
3484 return List25 (Id);
3485 end Static_Discrete_Predicate;
3486
3487 function Static_Real_Or_String_Predicate (Id : E) return N is
3488 begin
3489 pragma Assert (Is_Real_Type (Id) or else Is_String_Type (Id));
3490 return Node25 (Id);
3491 end Static_Real_Or_String_Predicate;
3492
3493 function Status_Flag_Or_Transient_Decl (Id : E) return N is
3494 begin
3495 pragma Assert
3496 (Ekind (Id) in E_Constant | E_Loop_Parameter | E_Variable);
3497 return Node15 (Id);
3498 end Status_Flag_Or_Transient_Decl;
3499
3500 function Storage_Size_Variable (Id : E) return E is
3501 begin
3502 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
3503 return Node26 (Implementation_Base_Type (Id));
3504 end Storage_Size_Variable;
3505
3506 function Static_Elaboration_Desired (Id : E) return B is
3507 begin
3508 pragma Assert (Ekind (Id) = E_Package);
3509 return Flag77 (Id);
3510 end Static_Elaboration_Desired;
3511
3512 function Static_Initialization (Id : E) return N is
3513 begin
3514 pragma Assert
3515 (Ekind (Id) = E_Procedure and then not Is_Dispatching_Operation (Id));
3516 return Node30 (Id);
3517 end Static_Initialization;
3518
3519 function Stored_Constraint (Id : E) return L is
3520 begin
3521 pragma Assert
3522 (Is_Composite_Type (Id) and then not Is_Array_Type (Id));
3523 return Elist23 (Id);
3524 end Stored_Constraint;
3525
3526 function Stores_Attribute_Old_Prefix (Id : E) return B is
3527 begin
3528 return Flag270 (Id);
3529 end Stores_Attribute_Old_Prefix;
3530
3531 function Strict_Alignment (Id : E) return B is
3532 begin
3533 return Flag145 (Implementation_Base_Type (Id));
3534 end Strict_Alignment;
3535
3536 function String_Literal_Length (Id : E) return U is
3537 begin
3538 return Uint16 (Id);
3539 end String_Literal_Length;
3540
3541 function String_Literal_Low_Bound (Id : E) return N is
3542 begin
3543 return Node18 (Id);
3544 end String_Literal_Low_Bound;
3545
3546 function Subprograms_For_Type (Id : E) return L is
3547 begin
3548 pragma Assert (Is_Type (Id));
3549 return Elist29 (Id);
3550 end Subprograms_For_Type;
3551
3552 function Subps_Index (Id : E) return U is
3553 begin
3554 pragma Assert (Is_Subprogram (Id));
3555 return Uint24 (Id);
3556 end Subps_Index;
3557
3558 function Suppress_Elaboration_Warnings (Id : E) return B is
3559 begin
3560 return Flag303 (Id);
3561 end Suppress_Elaboration_Warnings;
3562
3563 function Suppress_Initialization (Id : E) return B is
3564 begin
3565 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Variable);
3566 return Flag105 (Id);
3567 end Suppress_Initialization;
3568
3569 function Suppress_Style_Checks (Id : E) return B is
3570 begin
3571 return Flag165 (Id);
3572 end Suppress_Style_Checks;
3573
3574 function Suppress_Value_Tracking_On_Call (Id : E) return B is
3575 begin
3576 return Flag217 (Id);
3577 end Suppress_Value_Tracking_On_Call;
3578
3579 function Task_Body_Procedure (Id : E) return N is
3580 begin
3581 pragma Assert (Ekind (Id) in Task_Kind);
3582 return Node25 (Id);
3583 end Task_Body_Procedure;
3584
3585 function Thunk_Entity (Id : E) return E is
3586 begin
3587 pragma Assert (Ekind (Id) in E_Function | E_Procedure
3588 and then Is_Thunk (Id));
3589 return Node31 (Id);
3590 end Thunk_Entity;
3591
3592 function Treat_As_Volatile (Id : E) return B is
3593 begin
3594 return Flag41 (Id);
3595 end Treat_As_Volatile;
3596
3597 function Underlying_Full_View (Id : E) return E is
3598 begin
3599 pragma Assert (Ekind (Id) in Private_Kind);
3600 return Node19 (Id);
3601 end Underlying_Full_View;
3602
3603 function Underlying_Record_View (Id : E) return E is
3604 begin
3605 return Node28 (Id);
3606 end Underlying_Record_View;
3607
3608 function Universal_Aliasing (Id : E) return B is
3609 begin
3610 pragma Assert (Is_Type (Id));
3611 return Flag216 (Implementation_Base_Type (Id));
3612 end Universal_Aliasing;
3613
3614 function Unset_Reference (Id : E) return N is
3615 begin
3616 return Node16 (Id);
3617 end Unset_Reference;
3618
3619 function Used_As_Generic_Actual (Id : E) return B is
3620 begin
3621 return Flag222 (Id);
3622 end Used_As_Generic_Actual;
3623
3624 function Uses_Lock_Free (Id : E) return B is
3625 begin
3626 pragma Assert (Is_Protected_Type (Id));
3627 return Flag188 (Id);
3628 end Uses_Lock_Free;
3629
3630 function Uses_Sec_Stack (Id : E) return B is
3631 begin
3632 return Flag95 (Id);
3633 end Uses_Sec_Stack;
3634
3635 function Validated_Object (Id : E) return N is
3636 begin
3637 pragma Assert (Ekind (Id) = E_Variable);
3638 return Node38 (Id);
3639 end Validated_Object;
3640
3641 function Warnings_Off (Id : E) return B is
3642 begin
3643 return Flag96 (Id);
3644 end Warnings_Off;
3645
3646 function Warnings_Off_Used (Id : E) return B is
3647 begin
3648 return Flag236 (Id);
3649 end Warnings_Off_Used;
3650
3651 function Warnings_Off_Used_Unmodified (Id : E) return B is
3652 begin
3653 return Flag237 (Id);
3654 end Warnings_Off_Used_Unmodified;
3655
3656 function Warnings_Off_Used_Unreferenced (Id : E) return B is
3657 begin
3658 return Flag238 (Id);
3659 end Warnings_Off_Used_Unreferenced;
3660
3661 function Was_Hidden (Id : E) return B is
3662 begin
3663 return Flag196 (Id);
3664 end Was_Hidden;
3665
3666 function Wrapped_Entity (Id : E) return E is
3667 begin
3668 pragma Assert (Ekind (Id) in E_Function | E_Procedure
3669 and then Is_Primitive_Wrapper (Id));
3670 return Node27 (Id);
3671 end Wrapped_Entity;
3672
3673 ------------------------------
3674 -- Classification Functions --
3675 ------------------------------
3676
3677 function Is_Access_Object_Type (Id : E) return B is
3678 begin
3679 return Is_Access_Type (Id) and then not Is_Access_Subprogram_Type (Id);
3680 end Is_Access_Object_Type;
3681
3682 function Is_Access_Type (Id : E) return B is
3683 begin
3684 return Ekind (Id) in Access_Kind;
3685 end Is_Access_Type;
3686
3687 function Is_Access_Protected_Subprogram_Type (Id : E) return B is
3688 begin
3689 return Ekind (Id) in Access_Protected_Kind;
3690 end Is_Access_Protected_Subprogram_Type;
3691
3692 function Is_Access_Subprogram_Type (Id : E) return B is
3693 begin
3694 return Ekind (Id) in Access_Subprogram_Kind;
3695 end Is_Access_Subprogram_Type;
3696
3697 function Is_Aggregate_Type (Id : E) return B is
3698 begin
3699 return Ekind (Id) in Aggregate_Kind;
3700 end Is_Aggregate_Type;
3701
3702 function Is_Anonymous_Access_Type (Id : E) return B is
3703 begin
3704 return Ekind (Id) in Anonymous_Access_Kind;
3705 end Is_Anonymous_Access_Type;
3706
3707 function Is_Array_Type (Id : E) return B is
3708 begin
3709 return Ekind (Id) in Array_Kind;
3710 end Is_Array_Type;
3711
3712 function Is_Assignable (Id : E) return B is
3713 begin
3714 return Ekind (Id) in Assignable_Kind;
3715 end Is_Assignable;
3716
3717 function Is_Class_Wide_Type (Id : E) return B is
3718 begin
3719 return Ekind (Id) in Class_Wide_Kind;
3720 end Is_Class_Wide_Type;
3721
3722 function Is_Composite_Type (Id : E) return B is
3723 begin
3724 return Ekind (Id) in Composite_Kind;
3725 end Is_Composite_Type;
3726
3727 function Is_Concurrent_Body (Id : E) return B is
3728 begin
3729 return Ekind (Id) in Concurrent_Body_Kind;
3730 end Is_Concurrent_Body;
3731
3732 function Is_Concurrent_Record_Type (Id : E) return B is
3733 begin
3734 return Flag20 (Id);
3735 end Is_Concurrent_Record_Type;
3736
3737 function Is_Concurrent_Type (Id : E) return B is
3738 begin
3739 return Ekind (Id) in Concurrent_Kind;
3740 end Is_Concurrent_Type;
3741
3742 function Is_Decimal_Fixed_Point_Type (Id : E) return B is
3743 begin
3744 return Ekind (Id) in Decimal_Fixed_Point_Kind;
3745 end Is_Decimal_Fixed_Point_Type;
3746
3747 function Is_Digits_Type (Id : E) return B is
3748 begin
3749 return Ekind (Id) in Digits_Kind;
3750 end Is_Digits_Type;
3751
3752 function Is_Discrete_Or_Fixed_Point_Type (Id : E) return B is
3753 begin
3754 return Ekind (Id) in Discrete_Or_Fixed_Point_Kind;
3755 end Is_Discrete_Or_Fixed_Point_Type;
3756
3757 function Is_Discrete_Type (Id : E) return B is
3758 begin
3759 return Ekind (Id) in Discrete_Kind;
3760 end Is_Discrete_Type;
3761
3762 function Is_Elementary_Type (Id : E) return B is
3763 begin
3764 return Ekind (Id) in Elementary_Kind;
3765 end Is_Elementary_Type;
3766
3767 function Is_Entry (Id : E) return B is
3768 begin
3769 return Ekind (Id) in Entry_Kind;
3770 end Is_Entry;
3771
3772 function Is_Enumeration_Type (Id : E) return B is
3773 begin
3774 return Ekind (Id) in Enumeration_Kind;
3775 end Is_Enumeration_Type;
3776
3777 function Is_Fixed_Point_Type (Id : E) return B is
3778 begin
3779 return Ekind (Id) in Fixed_Point_Kind;
3780 end Is_Fixed_Point_Type;
3781
3782 function Is_Floating_Point_Type (Id : E) return B is
3783 begin
3784 return Ekind (Id) in Float_Kind;
3785 end Is_Floating_Point_Type;
3786
3787 function Is_Formal (Id : E) return B is
3788 begin
3789 return Ekind (Id) in Formal_Kind;
3790 end Is_Formal;
3791
3792 function Is_Formal_Object (Id : E) return B is
3793 begin
3794 return Ekind (Id) in Formal_Object_Kind;
3795 end Is_Formal_Object;
3796
3797 function Is_Generic_Subprogram (Id : E) return B is
3798 begin
3799 return Ekind (Id) in Generic_Subprogram_Kind;
3800 end Is_Generic_Subprogram;
3801
3802 function Is_Generic_Unit (Id : E) return B is
3803 begin
3804 return Ekind (Id) in Generic_Unit_Kind;
3805 end Is_Generic_Unit;
3806
3807 function Is_Ghost_Entity (Id : Entity_Id) return Boolean is
3808 begin
3809 return Is_Checked_Ghost_Entity (Id) or else Is_Ignored_Ghost_Entity (Id);
3810 end Is_Ghost_Entity;
3811
3812 function Is_Incomplete_Or_Private_Type (Id : E) return B is
3813 begin
3814 return Ekind (Id) in Incomplete_Or_Private_Kind;
3815 end Is_Incomplete_Or_Private_Type;
3816
3817 function Is_Incomplete_Type (Id : E) return B is
3818 begin
3819 return Ekind (Id) in Incomplete_Kind;
3820 end Is_Incomplete_Type;
3821
3822 function Is_Integer_Type (Id : E) return B is
3823 begin
3824 return Ekind (Id) in Integer_Kind;
3825 end Is_Integer_Type;
3826
3827 function Is_Modular_Integer_Type (Id : E) return B is
3828 begin
3829 return Ekind (Id) in Modular_Integer_Kind;
3830 end Is_Modular_Integer_Type;
3831
3832 function Is_Named_Access_Type (Id : E) return B is
3833 begin
3834 return Ekind (Id) in E_Access_Type ..
3835 E_Access_Protected_Subprogram_Type;
3836 end Is_Named_Access_Type;
3837
3838 function Is_Named_Number (Id : E) return B is
3839 begin
3840 return Ekind (Id) in Named_Kind;
3841 end Is_Named_Number;
3842
3843 function Is_Numeric_Type (Id : E) return B is
3844 begin
3845 return Ekind (Id) in Numeric_Kind;
3846 end Is_Numeric_Type;
3847
3848 function Is_Object (Id : E) return B is
3849 begin
3850 return Ekind (Id) in Object_Kind;
3851 end Is_Object;
3852
3853 function Is_Ordinary_Fixed_Point_Type (Id : E) return B is
3854 begin
3855 return Ekind (Id) in Ordinary_Fixed_Point_Kind;
3856 end Is_Ordinary_Fixed_Point_Type;
3857
3858 function Is_Overloadable (Id : E) return B is
3859 begin
3860 return Ekind (Id) in Overloadable_Kind;
3861 end Is_Overloadable;
3862
3863 function Is_Private_Type (Id : E) return B is
3864 begin
3865 return Ekind (Id) in Private_Kind;
3866 end Is_Private_Type;
3867
3868 function Is_Protected_Type (Id : E) return B is
3869 begin
3870 return Ekind (Id) in Protected_Kind;
3871 end Is_Protected_Type;
3872
3873 function Is_Real_Type (Id : E) return B is
3874 begin
3875 return Ekind (Id) in Real_Kind;
3876 end Is_Real_Type;
3877
3878 function Is_Record_Type (Id : E) return B is
3879 begin
3880 return Ekind (Id) in Record_Kind;
3881 end Is_Record_Type;
3882
3883 function Is_Scalar_Type (Id : E) return B is
3884 begin
3885 return Ekind (Id) in Scalar_Kind;
3886 end Is_Scalar_Type;
3887
3888 function Is_Signed_Integer_Type (Id : E) return B is
3889 begin
3890 return Ekind (Id) in Signed_Integer_Kind;
3891 end Is_Signed_Integer_Type;
3892
3893 function Is_Subprogram (Id : E) return B is
3894 begin
3895 return Ekind (Id) in Subprogram_Kind;
3896 end Is_Subprogram;
3897
3898 function Is_Subprogram_Or_Entry (Id : E) return B is
3899 begin
3900 return Ekind (Id) in Subprogram_Kind
3901 or else
3902 Ekind (Id) in Entry_Kind;
3903 end Is_Subprogram_Or_Entry;
3904
3905 function Is_Subprogram_Or_Generic_Subprogram (Id : E) return B is
3906 begin
3907 return Ekind (Id) in Subprogram_Kind
3908 or else
3909 Ekind (Id) in Generic_Subprogram_Kind;
3910 end Is_Subprogram_Or_Generic_Subprogram;
3911
3912 function Is_Task_Type (Id : E) return B is
3913 begin
3914 return Ekind (Id) in Task_Kind;
3915 end Is_Task_Type;
3916
3917 function Is_Type (Id : E) return B is
3918 begin
3919 return Ekind (Id) in Type_Kind;
3920 end Is_Type;
3921
3922 ------------------------------
3923 -- Attribute Set Procedures --
3924 ------------------------------
3925
3926 -- Note: in many of these set procedures an "obvious" assertion is missing.
3927 -- The reason for this is that in many cases, a field is set before the
3928 -- Ekind field is set, so that the field is set when Ekind = E_Void. It
3929 -- it is possible to add assertions that specifically include the E_Void
3930 -- possibility, but in some cases, we just omit the assertions.
3931
3932 procedure Set_Abstract_States (Id : E; V : L) is
3933 begin
3934 pragma Assert (Is_Package_Or_Generic_Package (Id));
3935 Set_Elist25 (Id, V);
3936 end Set_Abstract_States;
3937
3938 procedure Set_Accept_Address (Id : E; V : L) is
3939 begin
3940 Set_Elist21 (Id, V);
3941 end Set_Accept_Address;
3942
3943 procedure Set_Access_Disp_Table (Id : E; V : L) is
3944 begin
3945 pragma Assert (Ekind (Id) = E_Record_Type
3946 and then Id = Implementation_Base_Type (Id));
3947 pragma Assert (V = No_Elist or else Is_Tagged_Type (Id));
3948 Set_Elist16 (Id, V);
3949 end Set_Access_Disp_Table;
3950
3951 procedure Set_Access_Disp_Table_Elab_Flag (Id : E; V : E) is
3952 begin
3953 pragma Assert (Ekind (Id) = E_Record_Type
3954 and then Id = Implementation_Base_Type (Id));
3955 pragma Assert (Is_Tagged_Type (Id));
3956 Set_Node30 (Id, V);
3957 end Set_Access_Disp_Table_Elab_Flag;
3958
3959 procedure Set_Access_Subprogram_Wrapper (Id : E; V : E) is
3960 begin
3961 pragma Assert (Ekind (Id) = E_Subprogram_Type);
3962 Set_Node41 (Id, V);
3963 end Set_Access_Subprogram_Wrapper;
3964
3965 procedure Set_Anonymous_Designated_Type (Id : E; V : E) is
3966 begin
3967 pragma Assert (Ekind (Id) = E_Variable);
3968 Set_Node35 (Id, V);
3969 end Set_Anonymous_Designated_Type;
3970
3971 procedure Set_Anonymous_Masters (Id : E; V : L) is
3972 begin
3973 pragma Assert
3974 (Ekind (Id)
3975 in E_Function | E_Package | E_Procedure | E_Subprogram_Body);
3976 Set_Elist29 (Id, V);
3977 end Set_Anonymous_Masters;
3978
3979 procedure Set_Anonymous_Object (Id : E; V : E) is
3980 begin
3981 pragma Assert (Ekind (Id) in E_Protected_Type | E_Task_Type);
3982 Set_Node30 (Id, V);
3983 end Set_Anonymous_Object;
3984
3985 procedure Set_Associated_Entity (Id : E; V : E) is
3986 begin
3987 Set_Node37 (Id, V);
3988 end Set_Associated_Entity;
3989
3990 procedure Set_Associated_Formal_Package (Id : E; V : E) is
3991 begin
3992 Set_Node12 (Id, V);
3993 end Set_Associated_Formal_Package;
3994
3995 procedure Set_Associated_Node_For_Itype (Id : E; V : E) is
3996 begin
3997 Set_Node8 (Id, V);
3998 end Set_Associated_Node_For_Itype;
3999
4000 procedure Set_Associated_Storage_Pool (Id : E; V : E) is
4001 begin
4002 pragma Assert (Is_Access_Type (Id) and then Is_Base_Type (Id));
4003 Set_Node22 (Id, V);
4004 end Set_Associated_Storage_Pool;
4005
4006 procedure Set_Activation_Record_Component (Id : E; V : E) is
4007 begin
4008 pragma Assert
4009 (Ekind (Id) in E_Constant
4010 | E_In_Parameter
4011 | E_In_Out_Parameter
4012 | E_Loop_Parameter
4013 | E_Out_Parameter
4014 | E_Variable);
4015 Set_Node31 (Id, V);
4016 end Set_Activation_Record_Component;
4017
4018 procedure Set_Actual_Subtype (Id : E; V : E) is
4019 begin
4020 pragma Assert
4021 (Ekind (Id) in E_Constant | E_Variable | E_Generic_In_Out_Parameter
4022 or else Is_Formal (Id));
4023 Set_Node17 (Id, V);
4024 end Set_Actual_Subtype;
4025
4026 procedure Set_Address_Taken (Id : E; V : B := True) is
4027 begin
4028 Set_Flag104 (Id, V);
4029 end Set_Address_Taken;
4030
4031 procedure Set_Alias (Id : E; V : E) is
4032 begin
4033 pragma Assert
4034 (Is_Overloadable (Id) or else Ekind (Id) = E_Subprogram_Type);
4035 Set_Node18 (Id, V);
4036 end Set_Alias;
4037
4038 procedure Set_Alignment (Id : E; V : U) is
4039 begin
4040 pragma Assert (Is_Type (Id)
4041 or else Is_Formal (Id)
4042 or else Ekind (Id) in E_Loop_Parameter
4043 | E_Constant
4044 | E_Exception
4045 | E_Variable);
4046 Set_Uint14 (Id, V);
4047 end Set_Alignment;
4048
4049 procedure Set_Barrier_Function (Id : E; V : N) is
4050 begin
4051 pragma Assert (Is_Entry (Id));
4052 Set_Node12 (Id, V);
4053 end Set_Barrier_Function;
4054
4055 procedure Set_Block_Node (Id : E; V : N) is
4056 begin
4057 pragma Assert (Ekind (Id) = E_Block);
4058 Set_Node11 (Id, V);
4059 end Set_Block_Node;
4060
4061 procedure Set_Body_Entity (Id : E; V : E) is
4062 begin
4063 pragma Assert (Is_Package_Or_Generic_Package (Id));
4064 Set_Node19 (Id, V);
4065 end Set_Body_Entity;
4066
4067 procedure Set_Body_Needed_For_Inlining (Id : E; V : B := True) is
4068 begin
4069 pragma Assert (Ekind (Id) = E_Package);
4070 Set_Flag299 (Id, V);
4071 end Set_Body_Needed_For_Inlining;
4072
4073 procedure Set_Body_Needed_For_SAL (Id : E; V : B := True) is
4074 begin
4075 pragma Assert
4076 (Ekind (Id) = E_Package
4077 or else Is_Subprogram (Id)
4078 or else Is_Generic_Unit (Id));
4079 Set_Flag40 (Id, V);
4080 end Set_Body_Needed_For_SAL;
4081
4082 procedure Set_Body_References (Id : E; V : L) is
4083 begin
4084 pragma Assert (Ekind (Id) = E_Abstract_State);
4085 Set_Elist16 (Id, V);
4086 end Set_Body_References;
4087
4088 procedure Set_BIP_Initialization_Call (Id : E; V : N) is
4089 begin
4090 pragma Assert (Ekind (Id) in E_Constant | E_Variable);
4091 Set_Node29 (Id, V);
4092 end Set_BIP_Initialization_Call;
4093
4094 procedure Set_C_Pass_By_Copy (Id : E; V : B := True) is
4095 begin
4096 pragma Assert (Is_Record_Type (Id) and then Is_Base_Type (Id));
4097 Set_Flag125 (Id, V);
4098 end Set_C_Pass_By_Copy;
4099
4100 procedure Set_Can_Never_Be_Null (Id : E; V : B := True) is
4101 begin
4102 Set_Flag38 (Id, V);
4103 end Set_Can_Never_Be_Null;
4104
4105 procedure Set_Can_Use_Internal_Rep (Id : E; V : B := True) is
4106 begin
4107 pragma Assert
4108 (Is_Access_Subprogram_Type (Id) and then Is_Base_Type (Id));
4109 Set_Flag229 (Id, V);
4110 end Set_Can_Use_Internal_Rep;
4111
4112 procedure Set_Checks_May_Be_Suppressed (Id : E; V : B := True) is
4113 begin
4114 Set_Flag31 (Id, V);
4115 end Set_Checks_May_Be_Suppressed;
4116
4117 procedure Set_Class_Wide_Clone (Id : E; V : E) is
4118 begin
4119 pragma Assert (Is_Subprogram (Id));
4120 Set_Node38 (Id, V);
4121 end Set_Class_Wide_Clone;
4122
4123 procedure Set_Class_Wide_Type (Id : E; V : E) is
4124 begin
4125 pragma Assert (Is_Type (Id));
4126 Set_Node9 (Id, V);
4127 end Set_Class_Wide_Type;
4128
4129 procedure Set_Cloned_Subtype (Id : E; V : E) is
4130 begin
4131 pragma Assert (Ekind (Id) in E_Record_Subtype | E_Class_Wide_Subtype);
4132 Set_Node16 (Id, V);
4133 end Set_Cloned_Subtype;
4134
4135 procedure Set_Component_Bit_Offset (Id : E; V : U) is
4136 begin
4137 pragma Assert (Ekind (Id) in E_Component | E_Discriminant);
4138 Set_Uint11 (Id, V);
4139 end Set_Component_Bit_Offset;
4140
4141 procedure Set_Component_Clause (Id : E; V : N) is
4142 begin
4143 pragma Assert (Ekind (Id) in E_Component | E_Discriminant);
4144 Set_Node13 (Id, V);
4145 end Set_Component_Clause;
4146
4147 procedure Set_Component_Size (Id : E; V : U) is
4148 begin
4149 pragma Assert (Is_Array_Type (Id) and then Is_Base_Type (Id));
4150 Set_Uint22 (Id, V);
4151 end Set_Component_Size;
4152
4153 procedure Set_Component_Type (Id : E; V : E) is
4154 begin
4155 pragma Assert (Is_Array_Type (Id) and then Is_Base_Type (Id));
4156 Set_Node20 (Id, V);
4157 end Set_Component_Type;
4158
4159 procedure Set_Contains_Ignored_Ghost_Code (Id : E; V : B := True) is
4160 begin
4161 pragma Assert
4162 (Ekind (Id) in E_Block
4163 | E_Function
4164 | E_Generic_Function
4165 | E_Generic_Package
4166 | E_Generic_Procedure
4167 | E_Package
4168 | E_Package_Body
4169 | E_Procedure
4170 | E_Subprogram_Body);
4171 Set_Flag279 (Id, V);
4172 end Set_Contains_Ignored_Ghost_Code;
4173
4174 procedure Set_Contract (Id : E; V : N) is
4175 begin
4176 pragma Assert
4177 (Ekind (Id) in E_Protected_Type -- concurrent types
4178 | E_Task_Body
4179 | E_Task_Type
4180 or else
4181 Ekind (Id) in E_Constant -- objects
4182 | E_Variable
4183 or else
4184 Ekind (Id) in E_Entry -- overloadable
4185 | E_Entry_Family
4186 | E_Function
4187 | E_Generic_Function
4188 | E_Generic_Procedure
4189 | E_Operator
4190 | E_Procedure
4191 | E_Subprogram_Body
4192 or else
4193 Ekind (Id) in E_Generic_Package -- packages
4194 | E_Package
4195 | E_Package_Body
4196
4197 or else
4198 Is_Type (Id) -- types
4199
4200 or else
4201 Ekind (Id) = E_Void); -- special purpose
4202 Set_Node34 (Id, V);
4203 end Set_Contract;
4204
4205 procedure Set_Contract_Wrapper (Id : E; V : E) is
4206 begin
4207 pragma Assert (Is_Entry (Id));
4208 Set_Node25 (Id, V);
4209 end Set_Contract_Wrapper;
4210
4211 procedure Set_Corresponding_Concurrent_Type (Id : E; V : E) is
4212 begin
4213 pragma Assert
4214 (Ekind (Id) = E_Record_Type and then Is_Concurrent_Type (V));
4215 Set_Node18 (Id, V);
4216 end Set_Corresponding_Concurrent_Type;
4217
4218 procedure Set_Corresponding_Discriminant (Id : E; V : E) is
4219 begin
4220 pragma Assert (Ekind (Id) = E_Discriminant);
4221 Set_Node19 (Id, V);
4222 end Set_Corresponding_Discriminant;
4223
4224 procedure Set_Corresponding_Equality (Id : E; V : E) is
4225 begin
4226 pragma Assert
4227 (Ekind (Id) = E_Function
4228 and then not Comes_From_Source (Id)
4229 and then Chars (Id) = Name_Op_Ne);
4230 Set_Node30 (Id, V);
4231 end Set_Corresponding_Equality;
4232
4233 procedure Set_Corresponding_Function (Id : E; V : E) is
4234 begin
4235 pragma Assert (Ekind (Id) = E_Procedure and then Rewritten_For_C (V));
4236 Set_Node32 (Id, V);
4237 end Set_Corresponding_Function;
4238
4239 procedure Set_Corresponding_Procedure (Id : E; V : E) is
4240 begin
4241 pragma Assert (Ekind (Id) = E_Function and then Rewritten_For_C (Id));
4242 Set_Node32 (Id, V);
4243 end Set_Corresponding_Procedure;
4244
4245 procedure Set_Corresponding_Protected_Entry (Id : E; V : E) is
4246 begin
4247 pragma Assert (Ekind (Id) in E_Void | E_Subprogram_Body);
4248 Set_Node18 (Id, V);
4249 end Set_Corresponding_Protected_Entry;
4250
4251 procedure Set_Corresponding_Record_Component (Id : E; V : E) is
4252 begin
4253 pragma Assert (Ekind (Id) in E_Component | E_Discriminant);
4254 Set_Node21 (Id, V);
4255 end Set_Corresponding_Record_Component;
4256
4257 procedure Set_Corresponding_Record_Type (Id : E; V : E) is
4258 begin
4259 pragma Assert (Is_Concurrent_Type (Id));
4260 Set_Node18 (Id, V);
4261 end Set_Corresponding_Record_Type;
4262
4263 procedure Set_Corresponding_Remote_Type (Id : E; V : E) is
4264 begin
4265 Set_Node22 (Id, V);
4266 end Set_Corresponding_Remote_Type;
4267
4268 procedure Set_Current_Use_Clause (Id : E; V : E) is
4269 begin
4270 pragma Assert (Ekind (Id) = E_Package or else Is_Type (Id));
4271 Set_Node27 (Id, V);
4272 end Set_Current_Use_Clause;
4273
4274 procedure Set_Current_Value (Id : E; V : N) is
4275 begin
4276 pragma Assert (Ekind (Id) in Object_Kind or else Ekind (Id) = E_Void);
4277 Set_Node9 (Id, V);
4278 end Set_Current_Value;
4279
4280 procedure Set_CR_Discriminant (Id : E; V : E) is
4281 begin
4282 Set_Node23 (Id, V);
4283 end Set_CR_Discriminant;
4284
4285 procedure Set_Debug_Info_Off (Id : E; V : B := True) is
4286 begin
4287 Set_Flag166 (Id, V);
4288 end Set_Debug_Info_Off;
4289
4290 procedure Set_Debug_Renaming_Link (Id : E; V : E) is
4291 begin
4292 Set_Node25 (Id, V);
4293 end Set_Debug_Renaming_Link;
4294
4295 procedure Set_Default_Aspect_Component_Value (Id : E; V : E) is
4296 begin
4297 pragma Assert (Is_Array_Type (Id) and then Is_Base_Type (Id));
4298 Set_Node19 (Id, V);
4299 end Set_Default_Aspect_Component_Value;
4300
4301 procedure Set_Default_Aspect_Value (Id : E; V : E) is
4302 begin
4303 pragma Assert (Is_Scalar_Type (Id) and then Is_Base_Type (Id));
4304 Set_Node19 (Id, V);
4305 end Set_Default_Aspect_Value;
4306
4307 procedure Set_Default_Expr_Function (Id : E; V : E) is
4308 begin
4309 pragma Assert (Is_Formal (Id));
4310 Set_Node21 (Id, V);
4311 end Set_Default_Expr_Function;
4312
4313 procedure Set_Default_Expressions_Processed (Id : E; V : B := True) is
4314 begin
4315 Set_Flag108 (Id, V);
4316 end Set_Default_Expressions_Processed;
4317
4318 procedure Set_Default_Value (Id : E; V : N) is
4319 begin
4320 pragma Assert (Is_Formal (Id));
4321 Set_Node20 (Id, V);
4322 end Set_Default_Value;
4323
4324 procedure Set_Delay_Cleanups (Id : E; V : B := True) is
4325 begin
4326 pragma Assert
4327 (Is_Subprogram (Id)
4328 or else Is_Task_Type (Id)
4329 or else Ekind (Id) = E_Block);
4330 Set_Flag114 (Id, V);
4331 end Set_Delay_Cleanups;
4332
4333 procedure Set_Delay_Subprogram_Descriptors (Id : E; V : B := True) is
4334 begin
4335 pragma Assert
4336 (Is_Subprogram (Id) or else Ekind (Id) in E_Package | E_Package_Body);
4337
4338 Set_Flag50 (Id, V);
4339 end Set_Delay_Subprogram_Descriptors;
4340
4341 procedure Set_Delta_Value (Id : E; V : R) is
4342 begin
4343 pragma Assert (Is_Fixed_Point_Type (Id));
4344 Set_Ureal18 (Id, V);
4345 end Set_Delta_Value;
4346
4347 procedure Set_Dependent_Instances (Id : E; V : L) is
4348 begin
4349 pragma Assert (Is_Generic_Instance (Id));
4350 Set_Elist8 (Id, V);
4351 end Set_Dependent_Instances;
4352
4353 procedure Set_Depends_On_Private (Id : E; V : B := True) is
4354 begin
4355 pragma Assert (Nkind (Id) in N_Entity);
4356 Set_Flag14 (Id, V);
4357 end Set_Depends_On_Private;
4358
4359 procedure Set_Derived_Type_Link (Id : E; V : E) is
4360 begin
4361 pragma Assert (Is_Type (Id) and then Is_Base_Type (Id));
4362 Set_Node31 (Id, V);
4363 end Set_Derived_Type_Link;
4364
4365 procedure Set_Digits_Value (Id : E; V : U) is
4366 begin
4367 pragma Assert
4368 (Is_Floating_Point_Type (Id)
4369 or else Is_Decimal_Fixed_Point_Type (Id));
4370 Set_Uint17 (Id, V);
4371 end Set_Digits_Value;
4372
4373 procedure Set_Directly_Designated_Type (Id : E; V : E) is
4374 begin
4375 Set_Node20 (Id, V);
4376 end Set_Directly_Designated_Type;
4377
4378 procedure Set_Disable_Controlled (Id : E; V : B := True) is
4379 begin
4380 pragma Assert (Is_Type (Id) and then Is_Base_Type (Id));
4381 Set_Flag253 (Id, V);
4382 end Set_Disable_Controlled;
4383
4384 procedure Set_Discard_Names (Id : E; V : B := True) is
4385 begin
4386 Set_Flag88 (Id, V);
4387 end Set_Discard_Names;
4388
4389 procedure Set_Discriminal (Id : E; V : E) is
4390 begin
4391 pragma Assert (Ekind (Id) = E_Discriminant);
4392 Set_Node17 (Id, V);
4393 end Set_Discriminal;
4394
4395 procedure Set_Discriminal_Link (Id : E; V : E) is
4396 begin
4397 Set_Node10 (Id, V);
4398 end Set_Discriminal_Link;
4399
4400 procedure Set_Discriminant_Checking_Func (Id : E; V : E) is
4401 begin
4402 pragma Assert (Ekind (Id) = E_Component);
4403 Set_Node20 (Id, V);
4404 end Set_Discriminant_Checking_Func;
4405
4406 procedure Set_Discriminant_Constraint (Id : E; V : L) is
4407 begin
4408 pragma Assert (Nkind (Id) in N_Entity);
4409 Set_Elist21 (Id, V);
4410 end Set_Discriminant_Constraint;
4411
4412 procedure Set_Discriminant_Default_Value (Id : E; V : N) is
4413 begin
4414 Set_Node20 (Id, V);
4415 end Set_Discriminant_Default_Value;
4416
4417 procedure Set_Discriminant_Number (Id : E; V : U) is
4418 begin
4419 Set_Uint15 (Id, V);
4420 end Set_Discriminant_Number;
4421
4422 procedure Set_Dispatch_Table_Wrappers (Id : E; V : L) is
4423 begin
4424 pragma Assert (Ekind (Id) = E_Record_Type
4425 and then Id = Implementation_Base_Type (Id));
4426 pragma Assert (V = No_Elist or else Is_Tagged_Type (Id));
4427 Set_Elist26 (Id, V);
4428 end Set_Dispatch_Table_Wrappers;
4429
4430 procedure Set_DT_Entry_Count (Id : E; V : U) is
4431 begin
4432 pragma Assert (Ekind (Id) = E_Component);
4433 Set_Uint15 (Id, V);
4434 end Set_DT_Entry_Count;
4435
4436 procedure Set_DT_Offset_To_Top_Func (Id : E; V : E) is
4437 begin
4438 pragma Assert (Ekind (Id) = E_Component and then Is_Tag (Id));
4439 Set_Node25 (Id, V);
4440 end Set_DT_Offset_To_Top_Func;
4441
4442 procedure Set_DT_Position (Id : E; V : U) is
4443 begin
4444 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
4445 Set_Uint15 (Id, V);
4446 end Set_DT_Position;
4447
4448 procedure Set_DTC_Entity (Id : E; V : E) is
4449 begin
4450 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
4451 Set_Node16 (Id, V);
4452 end Set_DTC_Entity;
4453
4454 procedure Set_Elaborate_Body_Desirable (Id : E; V : B := True) is
4455 begin
4456 pragma Assert (Ekind (Id) = E_Package);
4457 Set_Flag210 (Id, V);
4458 end Set_Elaborate_Body_Desirable;
4459
4460 procedure Set_Elaboration_Entity (Id : E; V : E) is
4461 begin
4462 pragma Assert
4463 (Is_Subprogram (Id)
4464 or else
4465 Ekind (Id) in E_Entry | E_Entry_Family | E_Package
4466 or else
4467 Is_Generic_Unit (Id));
4468 Set_Node13 (Id, V);
4469 end Set_Elaboration_Entity;
4470
4471 procedure Set_Elaboration_Entity_Required (Id : E; V : B := True) is
4472 begin
4473 pragma Assert
4474 (Is_Subprogram (Id)
4475 or else
4476 Ekind (Id) in E_Entry | E_Entry_Family | E_Package
4477 or else
4478 Is_Generic_Unit (Id));
4479 Set_Flag174 (Id, V);
4480 end Set_Elaboration_Entity_Required;
4481
4482 procedure Set_Encapsulating_State (Id : E; V : E) is
4483 begin
4484 pragma Assert (Ekind (Id) in E_Abstract_State | E_Constant | E_Variable);
4485 Set_Node32 (Id, V);
4486 end Set_Encapsulating_State;
4487
4488 procedure Set_Enclosing_Scope (Id : E; V : E) is
4489 begin
4490 Set_Node18 (Id, V);
4491 end Set_Enclosing_Scope;
4492
4493 procedure Set_Entry_Accepted (Id : E; V : B := True) is
4494 begin
4495 pragma Assert (Is_Entry (Id));
4496 Set_Flag152 (Id, V);
4497 end Set_Entry_Accepted;
4498
4499 procedure Set_Entry_Bodies_Array (Id : E; V : E) is
4500 begin
4501 Set_Node19 (Id, V);
4502 end Set_Entry_Bodies_Array;
4503
4504 procedure Set_Entry_Cancel_Parameter (Id : E; V : E) is
4505 begin
4506 Set_Node23 (Id, V);
4507 end Set_Entry_Cancel_Parameter;
4508
4509 procedure Set_Entry_Component (Id : E; V : E) is
4510 begin
4511 Set_Node11 (Id, V);
4512 end Set_Entry_Component;
4513
4514 procedure Set_Entry_Formal (Id : E; V : E) is
4515 begin
4516 Set_Node16 (Id, V);
4517 end Set_Entry_Formal;
4518
4519 procedure Set_Entry_Index_Constant (Id : E; V : E) is
4520 begin
4521 pragma Assert (Ekind (Id) = E_Entry_Index_Parameter);
4522 Set_Node18 (Id, V);
4523 end Set_Entry_Index_Constant;
4524
4525 procedure Set_Entry_Max_Queue_Lengths_Array (Id : E; V : E) is
4526 begin
4527 pragma Assert (Ekind (Id) = E_Protected_Type);
4528 Set_Node35 (Id, V);
4529 end Set_Entry_Max_Queue_Lengths_Array;
4530
4531 procedure Set_Entry_Parameters_Type (Id : E; V : E) is
4532 begin
4533 Set_Node15 (Id, V);
4534 end Set_Entry_Parameters_Type;
4535
4536 procedure Set_Enum_Pos_To_Rep (Id : E; V : E) is
4537 begin
4538 pragma Assert (Ekind (Id) = E_Enumeration_Type);
4539 Set_Node23 (Id, V);
4540 end Set_Enum_Pos_To_Rep;
4541
4542 procedure Set_Enumeration_Pos (Id : E; V : U) is
4543 begin
4544 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
4545 Set_Uint11 (Id, V);
4546 end Set_Enumeration_Pos;
4547
4548 procedure Set_Enumeration_Rep (Id : E; V : U) is
4549 begin
4550 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
4551 Set_Uint12 (Id, V);
4552 end Set_Enumeration_Rep;
4553
4554 procedure Set_Enumeration_Rep_Expr (Id : E; V : N) is
4555 begin
4556 pragma Assert (Ekind (Id) = E_Enumeration_Literal);
4557 Set_Node22 (Id, V);
4558 end Set_Enumeration_Rep_Expr;
4559
4560 procedure Set_Equivalent_Type (Id : E; V : E) is
4561 begin
4562 pragma Assert
4563 (Ekind (Id) in E_Class_Wide_Type
4564 | E_Class_Wide_Subtype
4565 | E_Access_Protected_Subprogram_Type
4566 | E_Anonymous_Access_Protected_Subprogram_Type
4567 | E_Access_Subprogram_Type
4568 | E_Exception_Type);
4569 Set_Node18 (Id, V);
4570 end Set_Equivalent_Type;
4571
4572 procedure Set_Esize (Id : E; V : U) is
4573 begin
4574 Set_Uint12 (Id, V);
4575 end Set_Esize;
4576
4577 procedure Set_Extra_Accessibility (Id : E; V : E) is
4578 begin
4579 pragma Assert
4580 (Is_Formal (Id) or else Ekind (Id) in E_Variable | E_Constant);
4581 Set_Node13 (Id, V);
4582 end Set_Extra_Accessibility;
4583
4584 procedure Set_Extra_Accessibility_Of_Result (Id : E; V : E) is
4585 begin
4586 pragma Assert
4587 (Ekind (Id) in E_Function | E_Operator | E_Subprogram_Type);
4588 Set_Node19 (Id, V);
4589 end Set_Extra_Accessibility_Of_Result;
4590
4591 procedure Set_Extra_Constrained (Id : E; V : E) is
4592 begin
4593 pragma Assert (Is_Formal (Id) or else Ekind (Id) = E_Variable);
4594 Set_Node23 (Id, V);
4595 end Set_Extra_Constrained;
4596
4597 procedure Set_Extra_Formal (Id : E; V : E) is
4598 begin
4599 Set_Node15 (Id, V);
4600 end Set_Extra_Formal;
4601
4602 procedure Set_Extra_Formals (Id : E; V : E) is
4603 begin
4604 pragma Assert
4605 (Is_Overloadable (Id)
4606 or else Ekind (Id) in E_Entry_Family
4607 | E_Subprogram_Body
4608 | E_Subprogram_Type);
4609 Set_Node28 (Id, V);
4610 end Set_Extra_Formals;
4611
4612 procedure Set_Finalization_Master (Id : E; V : E) is
4613 begin
4614 pragma Assert (Is_Access_Type (Id) and then Is_Base_Type (Id));
4615 Set_Node23 (Id, V);
4616 end Set_Finalization_Master;
4617
4618 procedure Set_Finalize_Storage_Only (Id : E; V : B := True) is
4619 begin
4620 pragma Assert (Is_Type (Id) and then Is_Base_Type (Id));
4621 Set_Flag158 (Id, V);
4622 end Set_Finalize_Storage_Only;
4623
4624 procedure Set_Finalizer (Id : E; V : E) is
4625 begin
4626 pragma Assert (Ekind (Id) in E_Package | E_Package_Body);
4627 Set_Node28 (Id, V);
4628 end Set_Finalizer;
4629
4630 procedure Set_First_Entity (Id : E; V : E) is
4631 begin
4632 Set_Node17 (Id, V);
4633 end Set_First_Entity;
4634
4635 procedure Set_First_Exit_Statement (Id : E; V : N) is
4636 begin
4637 pragma Assert (Ekind (Id) = E_Loop);
4638 Set_Node8 (Id, V);
4639 end Set_First_Exit_Statement;
4640
4641 procedure Set_First_Index (Id : E; V : N) is
4642 begin
4643 pragma Assert (Is_Array_Type (Id));
4644 Set_Node17 (Id, V);
4645 end Set_First_Index;
4646
4647 procedure Set_First_Literal (Id : E; V : E) is
4648 begin
4649 pragma Assert (Is_Enumeration_Type (Id));
4650 Set_Node17 (Id, V);
4651 end Set_First_Literal;
4652
4653 procedure Set_First_Private_Entity (Id : E; V : E) is
4654 begin
4655 pragma Assert (Is_Package_Or_Generic_Package (Id)
4656 or else Is_Concurrent_Type (Id));
4657 Set_Node16 (Id, V);
4658 end Set_First_Private_Entity;
4659
4660 procedure Set_First_Rep_Item (Id : E; V : N) is
4661 begin
4662 Set_Node6 (Id, V);
4663 end Set_First_Rep_Item;
4664
4665 procedure Set_Float_Rep (Id : E; V : F) is
4666 pragma Assert (Ekind (Id) = E_Floating_Point_Type);
4667 begin
4668 Set_Uint10 (Id, UI_From_Int (F'Pos (V)));
4669 end Set_Float_Rep;
4670
4671 procedure Set_Freeze_Node (Id : E; V : N) is
4672 begin
4673 Set_Node7 (Id, V);
4674 end Set_Freeze_Node;
4675
4676 procedure Set_From_Limited_With (Id : E; V : B := True) is
4677 begin
4678 pragma Assert
4679 (Is_Type (Id) or else Ekind (Id) in E_Abstract_State | E_Package);
4680 Set_Flag159 (Id, V);
4681 end Set_From_Limited_With;
4682
4683 procedure Set_Full_View (Id : E; V : E) is
4684 begin
4685 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Constant);
4686 Set_Node11 (Id, V);
4687 end Set_Full_View;
4688
4689 procedure Set_Generic_Homonym (Id : E; V : E) is
4690 begin
4691 Set_Node11 (Id, V);
4692 end Set_Generic_Homonym;
4693
4694 procedure Set_Generic_Renamings (Id : E; V : L) is
4695 begin
4696 Set_Elist23 (Id, V);
4697 end Set_Generic_Renamings;
4698
4699 procedure Set_Handler_Records (Id : E; V : S) is
4700 begin
4701 Set_List10 (Id, V);
4702 end Set_Handler_Records;
4703
4704 procedure Set_Has_Aliased_Components (Id : E; V : B := True) is
4705 begin
4706 pragma Assert (Id = Base_Type (Id));
4707 Set_Flag135 (Id, V);
4708 end Set_Has_Aliased_Components;
4709
4710 procedure Set_Has_Alignment_Clause (Id : E; V : B := True) is
4711 begin
4712 Set_Flag46 (Id, V);
4713 end Set_Has_Alignment_Clause;
4714
4715 procedure Set_Has_All_Calls_Remote (Id : E; V : B := True) is
4716 begin
4717 Set_Flag79 (Id, V);
4718 end Set_Has_All_Calls_Remote;
4719
4720 procedure Set_Has_Atomic_Components (Id : E; V : B := True) is
4721 begin
4722 pragma Assert (not Is_Type (Id) or else Is_Base_Type (Id));
4723 Set_Flag86 (Id, V);
4724 end Set_Has_Atomic_Components;
4725
4726 procedure Set_Has_Biased_Representation (Id : E; V : B := True) is
4727 begin
4728 pragma Assert
4729 ((V = False) or else (Is_Discrete_Type (Id) or else Is_Object (Id)));
4730 Set_Flag139 (Id, V);
4731 end Set_Has_Biased_Representation;
4732
4733 procedure Set_Has_Completion (Id : E; V : B := True) is
4734 begin
4735 Set_Flag26 (Id, V);
4736 end Set_Has_Completion;
4737
4738 procedure Set_Has_Completion_In_Body (Id : E; V : B := True) is
4739 begin
4740 pragma Assert (Is_Type (Id));
4741 Set_Flag71 (Id, V);
4742 end Set_Has_Completion_In_Body;
4743
4744 procedure Set_Has_Complex_Representation (Id : E; V : B := True) is
4745 begin
4746 pragma Assert (Is_Record_Type (Id) and then Is_Base_Type (Id));
4747 Set_Flag140 (Id, V);
4748 end Set_Has_Complex_Representation;
4749
4750 procedure Set_Has_Component_Size_Clause (Id : E; V : B := True) is
4751 begin
4752 pragma Assert (Ekind (Id) = E_Array_Type);
4753 Set_Flag68 (Id, V);
4754 end Set_Has_Component_Size_Clause;
4755
4756 procedure Set_Has_Constrained_Partial_View (Id : E; V : B := True) is
4757 begin
4758 pragma Assert (Is_Type (Id));
4759 Set_Flag187 (Id, V);
4760 end Set_Has_Constrained_Partial_View;
4761
4762 procedure Set_Has_Contiguous_Rep (Id : E; V : B := True) is
4763 begin
4764 Set_Flag181 (Id, V);
4765 end Set_Has_Contiguous_Rep;
4766
4767 procedure Set_Has_Controlled_Component (Id : E; V : B := True) is
4768 begin
4769 pragma Assert (Id = Base_Type (Id));
4770 Set_Flag43 (Id, V);
4771 end Set_Has_Controlled_Component;
4772
4773 procedure Set_Has_Controlling_Result (Id : E; V : B := True) is
4774 begin
4775 Set_Flag98 (Id, V);
4776 end Set_Has_Controlling_Result;
4777
4778 procedure Set_Has_Convention_Pragma (Id : E; V : B := True) is
4779 begin
4780 Set_Flag119 (Id, V);
4781 end Set_Has_Convention_Pragma;
4782
4783 procedure Set_Has_Default_Aspect (Id : E; V : B := True) is
4784 begin
4785 pragma Assert
4786 ((Is_Scalar_Type (Id) or else Is_Array_Type (Id))
4787 and then Is_Base_Type (Id));
4788 Set_Flag39 (Id, V);
4789 end Set_Has_Default_Aspect;
4790
4791 procedure Set_Has_Delayed_Aspects (Id : E; V : B := True) is
4792 begin
4793 pragma Assert (Nkind (Id) in N_Entity);
4794 Set_Flag200 (Id, V);
4795 end Set_Has_Delayed_Aspects;
4796
4797 procedure Set_Has_Delayed_Freeze (Id : E; V : B := True) is
4798 begin
4799 pragma Assert (Nkind (Id) in N_Entity);
4800 Set_Flag18 (Id, V);
4801 end Set_Has_Delayed_Freeze;
4802
4803 procedure Set_Has_Delayed_Rep_Aspects (Id : E; V : B := True) is
4804 begin
4805 pragma Assert (Nkind (Id) in N_Entity);
4806 Set_Flag261 (Id, V);
4807 end Set_Has_Delayed_Rep_Aspects;
4808
4809 procedure Set_Has_Discriminants (Id : E; V : B := True) is
4810 begin
4811 pragma Assert (Is_Type (Id));
4812 Set_Flag5 (Id, V);
4813 end Set_Has_Discriminants;
4814
4815 procedure Set_Has_Dispatch_Table (Id : E; V : B := True) is
4816 begin
4817 pragma Assert (Ekind (Id) = E_Record_Type
4818 and then Is_Tagged_Type (Id));
4819 Set_Flag220 (Id, V);
4820 end Set_Has_Dispatch_Table;
4821
4822 procedure Set_Has_Dynamic_Predicate_Aspect (Id : E; V : B := True) is
4823 begin
4824 pragma Assert (Is_Type (Id));
4825 Set_Flag258 (Id, V);
4826 end Set_Has_Dynamic_Predicate_Aspect;
4827
4828 procedure Set_Has_Enumeration_Rep_Clause (Id : E; V : B := True) is
4829 begin
4830 pragma Assert (Is_Enumeration_Type (Id));
4831 Set_Flag66 (Id, V);
4832 end Set_Has_Enumeration_Rep_Clause;
4833
4834 procedure Set_Has_Exit (Id : E; V : B := True) is
4835 begin
4836 Set_Flag47 (Id, V);
4837 end Set_Has_Exit;
4838
4839 procedure Set_Has_Expanded_Contract (Id : E; V : B := True) is
4840 begin
4841 pragma Assert
4842 (Ekind (Id) in E_Entry | E_Entry_Family | E_Function | E_Procedure);
4843 Set_Flag240 (Id, V);
4844 end Set_Has_Expanded_Contract;
4845
4846 procedure Set_Has_Forward_Instantiation (Id : E; V : B := True) is
4847 begin
4848 Set_Flag175 (Id, V);
4849 end Set_Has_Forward_Instantiation;
4850
4851 procedure Set_Has_Fully_Qualified_Name (Id : E; V : B := True) is
4852 begin
4853 Set_Flag173 (Id, V);
4854 end Set_Has_Fully_Qualified_Name;
4855
4856 procedure Set_Has_Gigi_Rep_Item (Id : E; V : B := True) is
4857 begin
4858 Set_Flag82 (Id, V);
4859 end Set_Has_Gigi_Rep_Item;
4860
4861 procedure Set_Has_Homonym (Id : E; V : B := True) is
4862 begin
4863 Set_Flag56 (Id, V);
4864 end Set_Has_Homonym;
4865
4866 procedure Set_Has_Implicit_Dereference (Id : E; V : B := True) is
4867 begin
4868 Set_Flag251 (Id, V);
4869 end Set_Has_Implicit_Dereference;
4870
4871 procedure Set_Has_Independent_Components (Id : E; V : B := True) is
4872 begin
4873 pragma Assert (not Is_Type (Id) or else Is_Base_Type (Id));
4874 Set_Flag34 (Id, V);
4875 end Set_Has_Independent_Components;
4876
4877 procedure Set_Has_Inheritable_Invariants (Id : E; V : B := True) is
4878 begin
4879 pragma Assert (Is_Type (Id));
4880 Set_Flag248 (Base_Type (Id), V);
4881 end Set_Has_Inheritable_Invariants;
4882
4883 procedure Set_Has_Inherited_DIC (Id : E; V : B := True) is
4884 begin
4885 pragma Assert (Is_Type (Id));
4886 Set_Flag133 (Base_Type (Id), V);
4887 end Set_Has_Inherited_DIC;
4888
4889 procedure Set_Has_Inherited_Invariants (Id : E; V : B := True) is
4890 begin
4891 pragma Assert (Is_Type (Id));
4892 Set_Flag291 (Base_Type (Id), V);
4893 end Set_Has_Inherited_Invariants;
4894
4895 procedure Set_Has_Initial_Value (Id : E; V : B := True) is
4896 begin
4897 pragma Assert (Ekind (Id) in E_Variable | E_Out_Parameter);
4898 Set_Flag219 (Id, V);
4899 end Set_Has_Initial_Value;
4900
4901 procedure Set_Has_Loop_Entry_Attributes (Id : E; V : B := True) is
4902 begin
4903 pragma Assert (Ekind (Id) = E_Loop);
4904 Set_Flag260 (Id, V);
4905 end Set_Has_Loop_Entry_Attributes;
4906
4907 procedure Set_Has_Machine_Radix_Clause (Id : E; V : B := True) is
4908 begin
4909 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
4910 Set_Flag83 (Id, V);
4911 end Set_Has_Machine_Radix_Clause;
4912
4913 procedure Set_Has_Master_Entity (Id : E; V : B := True) is
4914 begin
4915 Set_Flag21 (Id, V);
4916 end Set_Has_Master_Entity;
4917
4918 procedure Set_Has_Missing_Return (Id : E; V : B := True) is
4919 begin
4920 pragma Assert (Ekind (Id) in E_Function | E_Generic_Function);
4921 Set_Flag142 (Id, V);
4922 end Set_Has_Missing_Return;
4923
4924 procedure Set_Has_Nested_Block_With_Handler (Id : E; V : B := True) is
4925 begin
4926 Set_Flag101 (Id, V);
4927 end Set_Has_Nested_Block_With_Handler;
4928
4929 procedure Set_Has_Nested_Subprogram (Id : E; V : B := True) is
4930 begin
4931 pragma Assert (Is_Subprogram (Id));
4932 Set_Flag282 (Id, V);
4933 end Set_Has_Nested_Subprogram;
4934
4935 procedure Set_Has_Non_Standard_Rep (Id : E; V : B := True) is
4936 begin
4937 pragma Assert (Id = Base_Type (Id));
4938 Set_Flag75 (Id, V);
4939 end Set_Has_Non_Standard_Rep;
4940
4941 procedure Set_Has_Object_Size_Clause (Id : E; V : B := True) is
4942 begin
4943 pragma Assert (Is_Type (Id));
4944 Set_Flag172 (Id, V);
4945 end Set_Has_Object_Size_Clause;
4946
4947 procedure Set_Has_Out_Or_In_Out_Parameter (Id : E; V : B := True) is
4948 begin
4949 pragma Assert
4950 (Is_Entry (Id)
4951 or else Is_Subprogram_Or_Generic_Subprogram (Id));
4952 Set_Flag110 (Id, V);
4953 end Set_Has_Out_Or_In_Out_Parameter;
4954
4955 procedure Set_Has_Own_DIC (Id : E; V : B := True) is
4956 begin
4957 pragma Assert (Is_Type (Id));
4958 Set_Flag3 (Base_Type (Id), V);
4959 end Set_Has_Own_DIC;
4960
4961 procedure Set_Has_Own_Invariants (Id : E; V : B := True) is
4962 begin
4963 pragma Assert (Is_Type (Id));
4964 Set_Flag232 (Base_Type (Id), V);
4965 end Set_Has_Own_Invariants;
4966
4967 procedure Set_Has_Partial_Visible_Refinement (Id : E; V : B := True) is
4968 begin
4969 pragma Assert (Ekind (Id) = E_Abstract_State);
4970 Set_Flag296 (Id, V);
4971 end Set_Has_Partial_Visible_Refinement;
4972
4973 procedure Set_Has_Per_Object_Constraint (Id : E; V : B := True) is
4974 begin
4975 Set_Flag154 (Id, V);
4976 end Set_Has_Per_Object_Constraint;
4977
4978 procedure Set_Has_Pragma_Controlled (Id : E; V : B := True) is
4979 begin
4980 pragma Assert (Is_Access_Type (Id));
4981 Set_Flag27 (Base_Type (Id), V);
4982 end Set_Has_Pragma_Controlled;
4983
4984 procedure Set_Has_Pragma_Elaborate_Body (Id : E; V : B := True) is
4985 begin
4986 Set_Flag150 (Id, V);
4987 end Set_Has_Pragma_Elaborate_Body;
4988
4989 procedure Set_Has_Pragma_Inline (Id : E; V : B := True) is
4990 begin
4991 Set_Flag157 (Id, V);
4992 end Set_Has_Pragma_Inline;
4993
4994 procedure Set_Has_Pragma_Inline_Always (Id : E; V : B := True) is
4995 begin
4996 Set_Flag230 (Id, V);
4997 end Set_Has_Pragma_Inline_Always;
4998
4999 procedure Set_Has_Pragma_No_Inline (Id : E; V : B := True) is
5000 begin
5001 Set_Flag201 (Id, V);
5002 end Set_Has_Pragma_No_Inline;
5003
5004 procedure Set_Has_Pragma_Ordered (Id : E; V : B := True) is
5005 begin
5006 pragma Assert (Is_Enumeration_Type (Id));
5007 pragma Assert (Id = Base_Type (Id));
5008 Set_Flag198 (Id, V);
5009 end Set_Has_Pragma_Ordered;
5010
5011 procedure Set_Has_Pragma_Pack (Id : E; V : B := True) is
5012 begin
5013 pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id));
5014 pragma Assert (Id = Base_Type (Id));
5015 Set_Flag121 (Id, V);
5016 end Set_Has_Pragma_Pack;
5017
5018 procedure Set_Has_Pragma_Preelab_Init (Id : E; V : B := True) is
5019 begin
5020 Set_Flag221 (Id, V);
5021 end Set_Has_Pragma_Preelab_Init;
5022
5023 procedure Set_Has_Pragma_Pure (Id : E; V : B := True) is
5024 begin
5025 Set_Flag203 (Id, V);
5026 end Set_Has_Pragma_Pure;
5027
5028 procedure Set_Has_Pragma_Pure_Function (Id : E; V : B := True) is
5029 begin
5030 Set_Flag179 (Id, V);
5031 end Set_Has_Pragma_Pure_Function;
5032
5033 procedure Set_Has_Pragma_Thread_Local_Storage (Id : E; V : B := True) is
5034 begin
5035 Set_Flag169 (Id, V);
5036 end Set_Has_Pragma_Thread_Local_Storage;
5037
5038 procedure Set_Has_Pragma_Unmodified (Id : E; V : B := True) is
5039 begin
5040 Set_Flag233 (Id, V);
5041 end Set_Has_Pragma_Unmodified;
5042
5043 procedure Set_Has_Pragma_Unreferenced (Id : E; V : B := True) is
5044 begin
5045 Set_Flag180 (Id, V);
5046 end Set_Has_Pragma_Unreferenced;
5047
5048 procedure Set_Has_Pragma_Unreferenced_Objects (Id : E; V : B := True) is
5049 begin
5050 pragma Assert (Is_Type (Id));
5051 Set_Flag212 (Id, V);
5052 end Set_Has_Pragma_Unreferenced_Objects;
5053
5054 procedure Set_Has_Pragma_Unused (Id : E; V : B := True) is
5055 begin
5056 Set_Flag294 (Id, V);
5057 end Set_Has_Pragma_Unused;
5058
5059 procedure Set_Has_Predicates (Id : E; V : B := True) is
5060 begin
5061 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Void);
5062 Set_Flag250 (Id, V);
5063 end Set_Has_Predicates;
5064
5065 procedure Set_Has_Primitive_Operations (Id : E; V : B := True) is
5066 begin
5067 pragma Assert (Id = Base_Type (Id));
5068 Set_Flag120 (Id, V);
5069 end Set_Has_Primitive_Operations;
5070
5071 procedure Set_Has_Private_Ancestor (Id : E; V : B := True) is
5072 begin
5073 pragma Assert (Is_Type (Id));
5074 Set_Flag151 (Id, V);
5075 end Set_Has_Private_Ancestor;
5076
5077 procedure Set_Has_Private_Declaration (Id : E; V : B := True) is
5078 begin
5079 Set_Flag155 (Id, V);
5080 end Set_Has_Private_Declaration;
5081
5082 procedure Set_Has_Private_Extension (Id : E; V : B := True) is
5083 begin
5084 pragma Assert (Is_Tagged_Type (Id));
5085 Set_Flag300 (Id, V);
5086 end Set_Has_Private_Extension;
5087
5088 procedure Set_Has_Protected (Id : E; V : B := True) is
5089 begin
5090 Set_Flag271 (Id, V);
5091 end Set_Has_Protected;
5092
5093 procedure Set_Has_Qualified_Name (Id : E; V : B := True) is
5094 begin
5095 Set_Flag161 (Id, V);
5096 end Set_Has_Qualified_Name;
5097
5098 procedure Set_Has_RACW (Id : E; V : B := True) is
5099 begin
5100 pragma Assert (Ekind (Id) = E_Package);
5101 Set_Flag214 (Id, V);
5102 end Set_Has_RACW;
5103
5104 procedure Set_Has_Record_Rep_Clause (Id : E; V : B := True) is
5105 begin
5106 pragma Assert (Id = Base_Type (Id));
5107 Set_Flag65 (Id, V);
5108 end Set_Has_Record_Rep_Clause;
5109
5110 procedure Set_Has_Recursive_Call (Id : E; V : B := True) is
5111 begin
5112 pragma Assert (Is_Subprogram (Id));
5113 Set_Flag143 (Id, V);
5114 end Set_Has_Recursive_Call;
5115
5116 procedure Set_Has_Shift_Operator (Id : E; V : B := True) is
5117 begin
5118 pragma Assert (Is_Integer_Type (Id) and then Is_Base_Type (Id));
5119 Set_Flag267 (Id, V);
5120 end Set_Has_Shift_Operator;
5121
5122 procedure Set_Has_Size_Clause (Id : E; V : B := True) is
5123 begin
5124 Set_Flag29 (Id, V);
5125 end Set_Has_Size_Clause;
5126
5127 procedure Set_Has_Small_Clause (Id : E; V : B := True) is
5128 begin
5129 pragma Assert (Is_Ordinary_Fixed_Point_Type (Id));
5130 Set_Flag67 (Id, V);
5131 end Set_Has_Small_Clause;
5132
5133 procedure Set_Has_Specified_Layout (Id : E; V : B := True) is
5134 begin
5135 pragma Assert (Id = Base_Type (Id));
5136 Set_Flag100 (Id, V);
5137 end Set_Has_Specified_Layout;
5138
5139 procedure Set_Has_Specified_Stream_Input (Id : E; V : B := True) is
5140 begin
5141 pragma Assert (Is_Type (Id));
5142 Set_Flag190 (Id, V);
5143 end Set_Has_Specified_Stream_Input;
5144
5145 procedure Set_Has_Specified_Stream_Output (Id : E; V : B := True) is
5146 begin
5147 pragma Assert (Is_Type (Id));
5148 Set_Flag191 (Id, V);
5149 end Set_Has_Specified_Stream_Output;
5150
5151 procedure Set_Has_Specified_Stream_Read (Id : E; V : B := True) is
5152 begin
5153 pragma Assert (Is_Type (Id));
5154 Set_Flag192 (Id, V);
5155 end Set_Has_Specified_Stream_Read;
5156
5157 procedure Set_Has_Specified_Stream_Write (Id : E; V : B := True) is
5158 begin
5159 pragma Assert (Is_Type (Id));
5160 Set_Flag193 (Id, V);
5161 end Set_Has_Specified_Stream_Write;
5162
5163 procedure Set_Has_Static_Discriminants (Id : E; V : B := True) is
5164 begin
5165 Set_Flag211 (Id, V);
5166 end Set_Has_Static_Discriminants;
5167
5168 procedure Set_Has_Static_Predicate (Id : E; V : B := True) is
5169 begin
5170 pragma Assert (Is_Type (Id));
5171 Set_Flag269 (Id, V);
5172 end Set_Has_Static_Predicate;
5173
5174 procedure Set_Has_Static_Predicate_Aspect (Id : E; V : B := True) is
5175 begin
5176 pragma Assert (Is_Type (Id));
5177 Set_Flag259 (Id, V);
5178 end Set_Has_Static_Predicate_Aspect;
5179
5180 procedure Set_Has_Storage_Size_Clause (Id : E; V : B := True) is
5181 begin
5182 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
5183 pragma Assert (Id = Base_Type (Id));
5184 Set_Flag23 (Id, V);
5185 end Set_Has_Storage_Size_Clause;
5186
5187 procedure Set_Has_Stream_Size_Clause (Id : E; V : B := True) is
5188 begin
5189 pragma Assert (Is_Elementary_Type (Id));
5190 Set_Flag184 (Id, V);
5191 end Set_Has_Stream_Size_Clause;
5192
5193 procedure Set_Has_Task (Id : E; V : B := True) is
5194 begin
5195 pragma Assert (Id = Base_Type (Id));
5196 Set_Flag30 (Id, V);
5197 end Set_Has_Task;
5198
5199 procedure Set_Has_Thunks (Id : E; V : B := True) is
5200 begin
5201 pragma Assert (Is_Tag (Id));
5202 Set_Flag228 (Id, V);
5203 end Set_Has_Thunks;
5204
5205 procedure Set_Has_Timing_Event (Id : E; V : B := True) is
5206 begin
5207 pragma Assert (Id = Base_Type (Id));
5208 Set_Flag289 (Id, V);
5209 end Set_Has_Timing_Event;
5210
5211 procedure Set_Has_Unchecked_Union (Id : E; V : B := True) is
5212 begin
5213 pragma Assert (Id = Base_Type (Id));
5214 Set_Flag123 (Id, V);
5215 end Set_Has_Unchecked_Union;
5216
5217 procedure Set_Has_Unknown_Discriminants (Id : E; V : B := True) is
5218 begin
5219 pragma Assert (Is_Type (Id));
5220 Set_Flag72 (Id, V);
5221 end Set_Has_Unknown_Discriminants;
5222
5223 procedure Set_Has_Visible_Refinement (Id : E; V : B := True) is
5224 begin
5225 pragma Assert (Ekind (Id) = E_Abstract_State);
5226 Set_Flag263 (Id, V);
5227 end Set_Has_Visible_Refinement;
5228
5229 procedure Set_Has_Volatile_Components (Id : E; V : B := True) is
5230 begin
5231 pragma Assert (not Is_Type (Id) or else Is_Base_Type (Id));
5232 Set_Flag87 (Id, V);
5233 end Set_Has_Volatile_Components;
5234
5235 procedure Set_Has_Xref_Entry (Id : E; V : B := True) is
5236 begin
5237 Set_Flag182 (Id, V);
5238 end Set_Has_Xref_Entry;
5239
5240 procedure Set_Has_Yield_Aspect (Id : E; V : B := True) is
5241 begin
5242 pragma Assert
5243 (Is_Entry (Id) or else Is_Subprogram_Or_Generic_Subprogram (Id));
5244 Set_Flag308 (Id, V);
5245 end Set_Has_Yield_Aspect;
5246
5247 procedure Set_Hiding_Loop_Variable (Id : E; V : E) is
5248 begin
5249 pragma Assert (Ekind (Id) = E_Variable);
5250 Set_Node8 (Id, V);
5251 end Set_Hiding_Loop_Variable;
5252
5253 procedure Set_Hidden_In_Formal_Instance (Id : E; V : L) is
5254 begin
5255 pragma Assert (Ekind (Id) = E_Package);
5256 Set_Elist30 (Id, V);
5257 end Set_Hidden_In_Formal_Instance;
5258
5259 procedure Set_Homonym (Id : E; V : E) is
5260 begin
5261 pragma Assert (Id /= V);
5262 Set_Node4 (Id, V);
5263 end Set_Homonym;
5264
5265 procedure Set_Incomplete_Actuals (Id : E; V : L) is
5266 begin
5267 pragma Assert (Ekind (Id) = E_Package);
5268 Set_Elist24 (Id, V);
5269 end Set_Incomplete_Actuals;
5270
5271 procedure Set_Ignore_SPARK_Mode_Pragmas (Id : E; V : B := True) is
5272 begin
5273 pragma Assert
5274 (Ekind (Id) in E_Protected_Body -- concurrent types
5275 | E_Protected_Type
5276 | E_Task_Body
5277 | E_Task_Type
5278 or else
5279 Ekind (Id) in E_Entry -- overloadable
5280 | E_Entry_Family
5281 | E_Function
5282 | E_Generic_Function
5283 | E_Generic_Procedure
5284 | E_Operator
5285 | E_Procedure
5286 | E_Subprogram_Body
5287 or else
5288 Ekind (Id) in E_Generic_Package -- packages
5289 | E_Package
5290 | E_Package_Body);
5291 Set_Flag301 (Id, V);
5292 end Set_Ignore_SPARK_Mode_Pragmas;
5293
5294 procedure Set_Import_Pragma (Id : E; V : E) is
5295 begin
5296 pragma Assert (Is_Subprogram (Id));
5297 Set_Node35 (Id, V);
5298 end Set_Import_Pragma;
5299
5300 procedure Set_Interface_Alias (Id : E; V : E) is
5301 begin
5302 pragma Assert
5303 (Is_Internal (Id)
5304 and then Is_Hidden (Id)
5305 and then (Ekind (Id) in E_Procedure | E_Function));
5306 Set_Node25 (Id, V);
5307 end Set_Interface_Alias;
5308
5309 procedure Set_Interfaces (Id : E; V : L) is
5310 begin
5311 pragma Assert (Is_Record_Type (Id));
5312 Set_Elist25 (Id, V);
5313 end Set_Interfaces;
5314
5315 procedure Set_In_Package_Body (Id : E; V : B := True) is
5316 begin
5317 Set_Flag48 (Id, V);
5318 end Set_In_Package_Body;
5319
5320 procedure Set_In_Private_Part (Id : E; V : B := True) is
5321 begin
5322 Set_Flag45 (Id, V);
5323 end Set_In_Private_Part;
5324
5325 procedure Set_In_Use (Id : E; V : B := True) is
5326 begin
5327 pragma Assert (Nkind (Id) in N_Entity);
5328 Set_Flag8 (Id, V);
5329 end Set_In_Use;
5330
5331 procedure Set_Initialization_Statements (Id : E; V : N) is
5332 begin
5333 -- Tolerate an E_Void entity since this can be called while resolving
5334 -- an aggregate used as the initialization expression for an object
5335 -- declaration, and this occurs before the Ekind for the object is set.
5336
5337 pragma Assert (Ekind (Id) in E_Void | E_Constant | E_Variable);
5338 Set_Node28 (Id, V);
5339 end Set_Initialization_Statements;
5340
5341 procedure Set_Inner_Instances (Id : E; V : L) is
5342 begin
5343 Set_Elist23 (Id, V);
5344 end Set_Inner_Instances;
5345
5346 procedure Set_Interface_Name (Id : E; V : N) is
5347 begin
5348 Set_Node21 (Id, V);
5349 end Set_Interface_Name;
5350
5351 procedure Set_Is_Abstract_Subprogram (Id : E; V : B := True) is
5352 begin
5353 pragma Assert (Is_Overloadable (Id));
5354 Set_Flag19 (Id, V);
5355 end Set_Is_Abstract_Subprogram;
5356
5357 procedure Set_Is_Abstract_Type (Id : E; V : B := True) is
5358 begin
5359 pragma Assert (Is_Type (Id));
5360 Set_Flag146 (Id, V);
5361 end Set_Is_Abstract_Type;
5362
5363 procedure Set_Is_Local_Anonymous_Access (Id : E; V : B := True) is
5364 begin
5365 pragma Assert (Is_Access_Type (Id));
5366 Set_Flag194 (Id, V);
5367 end Set_Is_Local_Anonymous_Access;
5368
5369 procedure Set_Is_Access_Constant (Id : E; V : B := True) is
5370 begin
5371 pragma Assert (Is_Access_Type (Id));
5372 Set_Flag69 (Id, V);
5373 end Set_Is_Access_Constant;
5374
5375 procedure Set_Is_Activation_Record (Id : E; V : B := True) is
5376 begin
5377 pragma Assert (Ekind (Id) = E_In_Parameter);
5378 Set_Flag305 (Id, V);
5379 end Set_Is_Activation_Record;
5380
5381 procedure Set_Is_Actual_Subtype (Id : E; V : B := True) is
5382 begin
5383 pragma Assert (Is_Type (Id));
5384 Set_Flag293 (Id, V);
5385 end Set_Is_Actual_Subtype;
5386
5387 procedure Set_Is_Ada_2005_Only (Id : E; V : B := True) is
5388 begin
5389 Set_Flag185 (Id, V);
5390 end Set_Is_Ada_2005_Only;
5391
5392 procedure Set_Is_Ada_2012_Only (Id : E; V : B := True) is
5393 begin
5394 Set_Flag199 (Id, V);
5395 end Set_Is_Ada_2012_Only;
5396
5397 procedure Set_Is_Aliased (Id : E; V : B := True) is
5398 begin
5399 pragma Assert (Nkind (Id) in N_Entity);
5400 Set_Flag15 (Id, V);
5401 end Set_Is_Aliased;
5402
5403 procedure Set_Is_Asynchronous (Id : E; V : B := True) is
5404 begin
5405 pragma Assert
5406 (Ekind (Id) = E_Procedure or else Is_Type (Id));
5407 Set_Flag81 (Id, V);
5408 end Set_Is_Asynchronous;
5409
5410 procedure Set_Is_Atomic (Id : E; V : B := True) is
5411 begin
5412 Set_Flag85 (Id, V);
5413 end Set_Is_Atomic;
5414
5415 procedure Set_Is_Bit_Packed_Array (Id : E; V : B := True) is
5416 begin
5417 pragma Assert ((not V)
5418 or else (Is_Array_Type (Id) and then Is_Base_Type (Id)));
5419 Set_Flag122 (Id, V);
5420 end Set_Is_Bit_Packed_Array;
5421
5422 procedure Set_Is_Called (Id : E; V : B := True) is
5423 begin
5424 pragma Assert (Ekind (Id) in E_Procedure | E_Function | E_Package);
5425 Set_Flag102 (Id, V);
5426 end Set_Is_Called;
5427
5428 procedure Set_Is_Character_Type (Id : E; V : B := True) is
5429 begin
5430 Set_Flag63 (Id, V);
5431 end Set_Is_Character_Type;
5432
5433 procedure Set_Is_Checked_Ghost_Entity (Id : E; V : B := True) is
5434 begin
5435 -- Allow this attribute to appear on unanalyzed entities
5436
5437 pragma Assert (Nkind (Id) in N_Entity
5438 or else Ekind (Id) = E_Void);
5439 Set_Flag277 (Id, V);
5440 end Set_Is_Checked_Ghost_Entity;
5441
5442 procedure Set_Is_Child_Unit (Id : E; V : B := True) is
5443 begin
5444 Set_Flag73 (Id, V);
5445 end Set_Is_Child_Unit;
5446
5447 procedure Set_Is_Class_Wide_Clone (Id : E; V : B := True) is
5448 begin
5449 Set_Flag290 (Id, V);
5450 end Set_Is_Class_Wide_Clone;
5451
5452 procedure Set_Is_Class_Wide_Equivalent_Type (Id : E; V : B := True) is
5453 begin
5454 Set_Flag35 (Id, V);
5455 end Set_Is_Class_Wide_Equivalent_Type;
5456
5457 procedure Set_Is_Compilation_Unit (Id : E; V : B := True) is
5458 begin
5459 Set_Flag149 (Id, V);
5460 end Set_Is_Compilation_Unit;
5461
5462 procedure Set_Is_Completely_Hidden (Id : E; V : B := True) is
5463 begin
5464 pragma Assert (Ekind (Id) = E_Discriminant);
5465 Set_Flag103 (Id, V);
5466 end Set_Is_Completely_Hidden;
5467
5468 procedure Set_Is_Concurrent_Record_Type (Id : E; V : B := True) is
5469 begin
5470 Set_Flag20 (Id, V);
5471 end Set_Is_Concurrent_Record_Type;
5472
5473 procedure Set_Is_Constr_Subt_For_U_Nominal (Id : E; V : B := True) is
5474 begin
5475 Set_Flag80 (Id, V);
5476 end Set_Is_Constr_Subt_For_U_Nominal;
5477
5478 procedure Set_Is_Constr_Subt_For_UN_Aliased (Id : E; V : B := True) is
5479 begin
5480 Set_Flag141 (Id, V);
5481 end Set_Is_Constr_Subt_For_UN_Aliased;
5482
5483 procedure Set_Is_Constrained (Id : E; V : B := True) is
5484 begin
5485 pragma Assert (Nkind (Id) in N_Entity);
5486 Set_Flag12 (Id, V);
5487 end Set_Is_Constrained;
5488
5489 procedure Set_Is_Constructor (Id : E; V : B := True) is
5490 begin
5491 Set_Flag76 (Id, V);
5492 end Set_Is_Constructor;
5493
5494 procedure Set_Is_Controlled_Active (Id : E; V : B := True) is
5495 begin
5496 pragma Assert (Id = Base_Type (Id));
5497 Set_Flag42 (Id, V);
5498 end Set_Is_Controlled_Active;
5499
5500 procedure Set_Is_Controlling_Formal (Id : E; V : B := True) is
5501 begin
5502 pragma Assert (Is_Formal (Id));
5503 Set_Flag97 (Id, V);
5504 end Set_Is_Controlling_Formal;
5505
5506 procedure Set_Is_CPP_Class (Id : E; V : B := True) is
5507 begin
5508 Set_Flag74 (Id, V);
5509 end Set_Is_CPP_Class;
5510
5511 procedure Set_Is_CUDA_Kernel (Id : E; V : B := True) is
5512 begin
5513 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
5514 Set_Flag118 (Id, V);
5515 end Set_Is_CUDA_Kernel;
5516
5517 procedure Set_Is_DIC_Procedure (Id : E; V : B := True) is
5518 begin
5519 pragma Assert (Ekind (Id) = E_Procedure);
5520 Set_Flag132 (Id, V);
5521 end Set_Is_DIC_Procedure;
5522
5523 procedure Set_Is_Descendant_Of_Address (Id : E; V : B := True) is
5524 begin
5525 pragma Assert (Is_Type (Id));
5526 Set_Flag223 (Id, V);
5527 end Set_Is_Descendant_Of_Address;
5528
5529 procedure Set_Is_Discrim_SO_Function (Id : E; V : B := True) is
5530 begin
5531 Set_Flag176 (Id, V);
5532 end Set_Is_Discrim_SO_Function;
5533
5534 procedure Set_Is_Discriminant_Check_Function (Id : E; V : B := True) is
5535 begin
5536 Set_Flag264 (Id, V);
5537 end Set_Is_Discriminant_Check_Function;
5538
5539 procedure Set_Is_Dispatch_Table_Entity (Id : E; V : B := True) is
5540 begin
5541 Set_Flag234 (Id, V);
5542 end Set_Is_Dispatch_Table_Entity;
5543
5544 procedure Set_Is_Dispatching_Operation (Id : E; V : B := True) is
5545 begin
5546 pragma Assert
5547 (V = False
5548 or else
5549 Is_Overloadable (Id)
5550 or else
5551 Ekind (Id) = E_Subprogram_Type);
5552
5553 Set_Flag6 (Id, V);
5554 end Set_Is_Dispatching_Operation;
5555
5556 procedure Set_Is_Elaboration_Checks_OK_Id (Id : E; V : B := True) is
5557 begin
5558 pragma Assert (Is_Elaboration_Target (Id));
5559 Set_Flag148 (Id, V);
5560 end Set_Is_Elaboration_Checks_OK_Id;
5561
5562 procedure Set_Is_Elaboration_Warnings_OK_Id (Id : E; V : B := True) is
5563 begin
5564 pragma Assert (Is_Elaboration_Target (Id));
5565 Set_Flag304 (Id, V);
5566 end Set_Is_Elaboration_Warnings_OK_Id;
5567
5568 procedure Set_Is_Eliminated (Id : E; V : B := True) is
5569 begin
5570 Set_Flag124 (Id, V);
5571 end Set_Is_Eliminated;
5572
5573 procedure Set_Is_Entry_Formal (Id : E; V : B := True) is
5574 begin
5575 Set_Flag52 (Id, V);
5576 end Set_Is_Entry_Formal;
5577
5578 procedure Set_Is_Entry_Wrapper (Id : E; V : B := True) is
5579 begin
5580 Set_Flag297 (Id, V);
5581 end Set_Is_Entry_Wrapper;
5582
5583 procedure Set_Is_Exception_Handler (Id : E; V : B := True) is
5584 begin
5585 pragma Assert (Ekind (Id) = E_Block);
5586 Set_Flag286 (Id, V);
5587 end Set_Is_Exception_Handler;
5588
5589 procedure Set_Is_Exported (Id : E; V : B := True) is
5590 begin
5591 Set_Flag99 (Id, V);
5592 end Set_Is_Exported;
5593
5594 procedure Set_Is_Finalized_Transient (Id : E; V : B := True) is
5595 begin
5596 pragma Assert (Ekind (Id) in E_Constant | E_Loop_Parameter | E_Variable);
5597 Set_Flag252 (Id, V);
5598 end Set_Is_Finalized_Transient;
5599
5600 procedure Set_Is_First_Subtype (Id : E; V : B := True) is
5601 begin
5602 Set_Flag70 (Id, V);
5603 end Set_Is_First_Subtype;
5604
5605 procedure Set_Is_Formal_Subprogram (Id : E; V : B := True) is
5606 begin
5607 Set_Flag111 (Id, V);
5608 end Set_Is_Formal_Subprogram;
5609
5610 procedure Set_Is_Frozen (Id : E; V : B := True) is
5611 begin
5612 pragma Assert (Nkind (Id) in N_Entity);
5613 Set_Flag4 (Id, V);
5614 end Set_Is_Frozen;
5615
5616 procedure Set_Is_Generic_Actual_Subprogram (Id : E; V : B := True) is
5617 begin
5618 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
5619 Set_Flag274 (Id, V);
5620 end Set_Is_Generic_Actual_Subprogram;
5621
5622 procedure Set_Is_Generic_Actual_Type (Id : E; V : B := True) is
5623 begin
5624 pragma Assert (Is_Type (Id));
5625 Set_Flag94 (Id, V);
5626 end Set_Is_Generic_Actual_Type;
5627
5628 procedure Set_Is_Generic_Instance (Id : E; V : B := True) is
5629 begin
5630 Set_Flag130 (Id, V);
5631 end Set_Is_Generic_Instance;
5632
5633 procedure Set_Is_Generic_Type (Id : E; V : B := True) is
5634 begin
5635 pragma Assert (Nkind (Id) in N_Entity);
5636 Set_Flag13 (Id, V);
5637 end Set_Is_Generic_Type;
5638
5639 procedure Set_Is_Hidden (Id : E; V : B := True) is
5640 begin
5641 Set_Flag57 (Id, V);
5642 end Set_Is_Hidden;
5643
5644 procedure Set_Is_Hidden_Non_Overridden_Subpgm (Id : E; V : B := True) is
5645 begin
5646 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
5647 Set_Flag2 (Id, V);
5648 end Set_Is_Hidden_Non_Overridden_Subpgm;
5649
5650 procedure Set_Is_Hidden_Open_Scope (Id : E; V : B := True) is
5651 begin
5652 Set_Flag171 (Id, V);
5653 end Set_Is_Hidden_Open_Scope;
5654
5655 procedure Set_Is_Ignored_Ghost_Entity (Id : E; V : B := True) is
5656 begin
5657 -- Allow this attribute to appear on unanalyzed entities
5658
5659 pragma Assert (Nkind (Id) in N_Entity
5660 or else Ekind (Id) = E_Void);
5661 Set_Flag278 (Id, V);
5662 end Set_Is_Ignored_Ghost_Entity;
5663
5664 procedure Set_Is_Ignored_Transient (Id : E; V : B := True) is
5665 begin
5666 pragma Assert (Ekind (Id) in E_Constant | E_Loop_Parameter | E_Variable);
5667 Set_Flag295 (Id, V);
5668 end Set_Is_Ignored_Transient;
5669
5670 procedure Set_Is_Immediately_Visible (Id : E; V : B := True) is
5671 begin
5672 pragma Assert (Nkind (Id) in N_Entity);
5673 Set_Flag7 (Id, V);
5674 end Set_Is_Immediately_Visible;
5675
5676 procedure Set_Is_Implementation_Defined (Id : E; V : B := True) is
5677 begin
5678 Set_Flag254 (Id, V);
5679 end Set_Is_Implementation_Defined;
5680
5681 procedure Set_Is_Imported (Id : E; V : B := True) is
5682 begin
5683 Set_Flag24 (Id, V);
5684 end Set_Is_Imported;
5685
5686 procedure Set_Is_Independent (Id : E; V : B := True) is
5687 begin
5688 Set_Flag268 (Id, V);
5689 end Set_Is_Independent;
5690
5691 procedure Set_Is_Initial_Condition_Procedure (Id : E; V : B := True) is
5692 begin
5693 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
5694 Set_Flag302 (Id, V);
5695 end Set_Is_Initial_Condition_Procedure;
5696
5697 procedure Set_Is_Inlined (Id : E; V : B := True) is
5698 begin
5699 Set_Flag11 (Id, V);
5700 end Set_Is_Inlined;
5701
5702 procedure Set_Is_Inlined_Always (Id : E; V : B := True) is
5703 begin
5704 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
5705 Set_Flag1 (Id, V);
5706 end Set_Is_Inlined_Always;
5707
5708 procedure Set_Is_Interface (Id : E; V : B := True) is
5709 begin
5710 pragma Assert (Is_Record_Type (Id));
5711 Set_Flag186 (Id, V);
5712 end Set_Is_Interface;
5713
5714 procedure Set_Is_Instantiated (Id : E; V : B := True) is
5715 begin
5716 Set_Flag126 (Id, V);
5717 end Set_Is_Instantiated;
5718
5719 procedure Set_Is_Internal (Id : E; V : B := True) is
5720 begin
5721 pragma Assert (Nkind (Id) in N_Entity);
5722 Set_Flag17 (Id, V);
5723 end Set_Is_Internal;
5724
5725 procedure Set_Is_Interrupt_Handler (Id : E; V : B := True) is
5726 begin
5727 pragma Assert (Nkind (Id) in N_Entity);
5728 Set_Flag89 (Id, V);
5729 end Set_Is_Interrupt_Handler;
5730
5731 procedure Set_Is_Intrinsic_Subprogram (Id : E; V : B := True) is
5732 begin
5733 Set_Flag64 (Id, V);
5734 end Set_Is_Intrinsic_Subprogram;
5735
5736 procedure Set_Is_Invariant_Procedure (Id : E; V : B := True) is
5737 begin
5738 pragma Assert (Ekind (Id) = E_Procedure);
5739 Set_Flag257 (Id, V);
5740 end Set_Is_Invariant_Procedure;
5741
5742 procedure Set_Is_Itype (Id : E; V : B := True) is
5743 begin
5744 Set_Flag91 (Id, V);
5745 end Set_Is_Itype;
5746
5747 procedure Set_Is_Known_Non_Null (Id : E; V : B := True) is
5748 begin
5749 Set_Flag37 (Id, V);
5750 end Set_Is_Known_Non_Null;
5751
5752 procedure Set_Is_Known_Null (Id : E; V : B := True) is
5753 begin
5754 Set_Flag204 (Id, V);
5755 end Set_Is_Known_Null;
5756
5757 procedure Set_Is_Known_Valid (Id : E; V : B := True) is
5758 begin
5759 Set_Flag170 (Id, V);
5760 end Set_Is_Known_Valid;
5761
5762 procedure Set_Is_Limited_Composite (Id : E; V : B := True) is
5763 begin
5764 pragma Assert (Is_Type (Id));
5765 Set_Flag106 (Id, V);
5766 end Set_Is_Limited_Composite;
5767
5768 procedure Set_Is_Limited_Interface (Id : E; V : B := True) is
5769 begin
5770 pragma Assert (Is_Interface (Id));
5771 Set_Flag197 (Id, V);
5772 end Set_Is_Limited_Interface;
5773
5774 procedure Set_Is_Limited_Record (Id : E; V : B := True) is
5775 begin
5776 Set_Flag25 (Id, V);
5777 end Set_Is_Limited_Record;
5778
5779 procedure Set_Is_Loop_Parameter (Id : E; V : B := True) is
5780 begin
5781 Set_Flag307 (Id, V);
5782 end Set_Is_Loop_Parameter;
5783
5784 procedure Set_Is_Machine_Code_Subprogram (Id : E; V : B := True) is
5785 begin
5786 pragma Assert (Is_Subprogram (Id));
5787 Set_Flag137 (Id, V);
5788 end Set_Is_Machine_Code_Subprogram;
5789
5790 procedure Set_Is_Non_Static_Subtype (Id : E; V : B := True) is
5791 begin
5792 pragma Assert (Is_Type (Id));
5793 Set_Flag109 (Id, V);
5794 end Set_Is_Non_Static_Subtype;
5795
5796 procedure Set_Is_Null_Init_Proc (Id : E; V : B := True) is
5797 begin
5798 pragma Assert (Ekind (Id) = E_Procedure);
5799 Set_Flag178 (Id, V);
5800 end Set_Is_Null_Init_Proc;
5801
5802 procedure Set_Is_Obsolescent (Id : E; V : B := True) is
5803 begin
5804 Set_Flag153 (Id, V);
5805 end Set_Is_Obsolescent;
5806
5807 procedure Set_Is_Only_Out_Parameter (Id : E; V : B := True) is
5808 begin
5809 pragma Assert (Ekind (Id) = E_Out_Parameter);
5810 Set_Flag226 (Id, V);
5811 end Set_Is_Only_Out_Parameter;
5812
5813 procedure Set_Is_Package_Body_Entity (Id : E; V : B := True) is
5814 begin
5815 Set_Flag160 (Id, V);
5816 end Set_Is_Package_Body_Entity;
5817
5818 procedure Set_Is_Packed (Id : E; V : B := True) is
5819 begin
5820 pragma Assert (Id = Base_Type (Id));
5821 Set_Flag51 (Id, V);
5822 end Set_Is_Packed;
5823
5824 procedure Set_Is_Packed_Array_Impl_Type (Id : E; V : B := True) is
5825 begin
5826 Set_Flag138 (Id, V);
5827 end Set_Is_Packed_Array_Impl_Type;
5828
5829 procedure Set_Is_Param_Block_Component_Type (Id : E; V : B := True) is
5830 begin
5831 pragma Assert (Ekind (Id) in E_Void | E_General_Access_Type);
5832 Set_Flag215 (Id, V);
5833 end Set_Is_Param_Block_Component_Type;
5834
5835 procedure Set_Is_Partial_Invariant_Procedure (Id : E; V : B := True) is
5836 begin
5837 pragma Assert (Ekind (Id) = E_Procedure);
5838 Set_Flag292 (Id, V);
5839 end Set_Is_Partial_Invariant_Procedure;
5840
5841 procedure Set_Is_Potentially_Use_Visible (Id : E; V : B := True) is
5842 begin
5843 pragma Assert (Nkind (Id) in N_Entity);
5844 Set_Flag9 (Id, V);
5845 end Set_Is_Potentially_Use_Visible;
5846
5847 procedure Set_Is_Predicate_Function (Id : E; V : B := True) is
5848 begin
5849 pragma Assert (Ekind (Id) = E_Function);
5850 Set_Flag255 (Id, V);
5851 end Set_Is_Predicate_Function;
5852
5853 procedure Set_Is_Predicate_Function_M (Id : E; V : B := True) is
5854 begin
5855 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
5856 Set_Flag256 (Id, V);
5857 end Set_Is_Predicate_Function_M;
5858
5859 procedure Set_Is_Preelaborated (Id : E; V : B := True) is
5860 begin
5861 Set_Flag59 (Id, V);
5862 end Set_Is_Preelaborated;
5863
5864 procedure Set_Is_Primitive (Id : E; V : B := True) is
5865 begin
5866 pragma Assert (Is_Overloadable (Id) or else Is_Generic_Subprogram (Id));
5867 Set_Flag218 (Id, V);
5868 end Set_Is_Primitive;
5869
5870 procedure Set_Is_Primitive_Wrapper (Id : E; V : B := True) is
5871 begin
5872 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
5873 Set_Flag195 (Id, V);
5874 end Set_Is_Primitive_Wrapper;
5875
5876 procedure Set_Is_Private_Composite (Id : E; V : B := True) is
5877 begin
5878 pragma Assert (Is_Type (Id));
5879 Set_Flag107 (Id, V);
5880 end Set_Is_Private_Composite;
5881
5882 procedure Set_Is_Private_Descendant (Id : E; V : B := True) is
5883 begin
5884 Set_Flag53 (Id, V);
5885 end Set_Is_Private_Descendant;
5886
5887 procedure Set_Is_Private_Primitive (Id : E; V : B := True) is
5888 begin
5889 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
5890 Set_Flag245 (Id, V);
5891 end Set_Is_Private_Primitive;
5892
5893 procedure Set_Is_Public (Id : E; V : B := True) is
5894 begin
5895 pragma Assert (Nkind (Id) in N_Entity);
5896 Set_Flag10 (Id, V);
5897 end Set_Is_Public;
5898
5899 procedure Set_Is_Pure (Id : E; V : B := True) is
5900 begin
5901 Set_Flag44 (Id, V);
5902 end Set_Is_Pure;
5903
5904 procedure Set_Is_Pure_Unit_Access_Type (Id : E; V : B := True) is
5905 begin
5906 pragma Assert (Is_Access_Type (Id));
5907 Set_Flag189 (Id, V);
5908 end Set_Is_Pure_Unit_Access_Type;
5909
5910 procedure Set_Is_RACW_Stub_Type (Id : E; V : B := True) is
5911 begin
5912 pragma Assert (Is_Type (Id));
5913 Set_Flag244 (Id, V);
5914 end Set_Is_RACW_Stub_Type;
5915
5916 procedure Set_Is_Raised (Id : E; V : B := True) is
5917 begin
5918 pragma Assert (Ekind (Id) = E_Exception);
5919 Set_Flag224 (Id, V);
5920 end Set_Is_Raised;
5921
5922 procedure Set_Is_Remote_Call_Interface (Id : E; V : B := True) is
5923 begin
5924 Set_Flag62 (Id, V);
5925 end Set_Is_Remote_Call_Interface;
5926
5927 procedure Set_Is_Remote_Types (Id : E; V : B := True) is
5928 begin
5929 Set_Flag61 (Id, V);
5930 end Set_Is_Remote_Types;
5931
5932 procedure Set_Is_Renaming_Of_Object (Id : E; V : B := True) is
5933 begin
5934 Set_Flag112 (Id, V);
5935 end Set_Is_Renaming_Of_Object;
5936
5937 procedure Set_Is_Return_Object (Id : E; V : B := True) is
5938 begin
5939 Set_Flag209 (Id, V);
5940 end Set_Is_Return_Object;
5941
5942 procedure Set_Is_Safe_To_Reevaluate (Id : E; V : B := True) is
5943 begin
5944 pragma Assert (Ekind (Id) = E_Variable);
5945 Set_Flag249 (Id, V);
5946 end Set_Is_Safe_To_Reevaluate;
5947
5948 procedure Set_Is_Shared_Passive (Id : E; V : B := True) is
5949 begin
5950 Set_Flag60 (Id, V);
5951 end Set_Is_Shared_Passive;
5952
5953 procedure Set_Is_Static_Type (Id : E; V : B := True) is
5954 begin
5955 pragma Assert (Is_Type (Id));
5956 Set_Flag281 (Id, V);
5957 end Set_Is_Static_Type;
5958
5959 procedure Set_Is_Statically_Allocated (Id : E; V : B := True) is
5960 begin
5961 pragma Assert
5962 (Is_Type (Id)
5963 or else
5964 Ekind (Id) in E_Exception | E_Variable | E_Constant | E_Void);
5965 Set_Flag28 (Id, V);
5966 end Set_Is_Statically_Allocated;
5967
5968 procedure Set_Is_Tag (Id : E; V : B := True) is
5969 begin
5970 pragma Assert (Ekind (Id) in E_Component | E_Constant | E_Variable);
5971 Set_Flag78 (Id, V);
5972 end Set_Is_Tag;
5973
5974 procedure Set_Is_Tagged_Type (Id : E; V : B := True) is
5975 begin
5976 Set_Flag55 (Id, V);
5977 end Set_Is_Tagged_Type;
5978
5979 procedure Set_Is_Thunk (Id : E; V : B := True) is
5980 begin
5981 pragma Assert (Is_Subprogram (Id));
5982 Set_Flag225 (Id, V);
5983 end Set_Is_Thunk;
5984
5985 procedure Set_Is_Trivial_Subprogram (Id : E; V : B := True) is
5986 begin
5987 Set_Flag235 (Id, V);
5988 end Set_Is_Trivial_Subprogram;
5989
5990 procedure Set_Is_True_Constant (Id : E; V : B := True) is
5991 begin
5992 Set_Flag163 (Id, V);
5993 end Set_Is_True_Constant;
5994
5995 procedure Set_Is_Unchecked_Union (Id : E; V : B := True) is
5996 begin
5997 pragma Assert (Id = Base_Type (Id));
5998 Set_Flag117 (Id, V);
5999 end Set_Is_Unchecked_Union;
6000
6001 procedure Set_Is_Underlying_Full_View (Id : E; V : B := True) is
6002 begin
6003 pragma Assert (Is_Type (Id));
6004 Set_Flag298 (Id, V);
6005 end Set_Is_Underlying_Full_View;
6006
6007 procedure Set_Is_Underlying_Record_View (Id : E; V : B := True) is
6008 begin
6009 pragma Assert (Ekind (Id) = E_Record_Type);
6010 Set_Flag246 (Id, V);
6011 end Set_Is_Underlying_Record_View;
6012
6013 procedure Set_Is_Unimplemented (Id : E; V : B := True) is
6014 begin
6015 Set_Flag284 (Id, V);
6016 end Set_Is_Unimplemented;
6017
6018 procedure Set_Is_Unsigned_Type (Id : E; V : B := True) is
6019 begin
6020 pragma Assert (Is_Discrete_Or_Fixed_Point_Type (Id));
6021 Set_Flag144 (Id, V);
6022 end Set_Is_Unsigned_Type;
6023
6024 procedure Set_Is_Uplevel_Referenced_Entity (Id : E; V : B := True) is
6025 begin
6026 pragma Assert
6027 (Ekind (Id) in E_Constant | E_Loop_Parameter | E_Variable
6028 or else Is_Formal (Id)
6029 or else Is_Type (Id));
6030 Set_Flag283 (Id, V);
6031 end Set_Is_Uplevel_Referenced_Entity;
6032
6033 procedure Set_Is_Valued_Procedure (Id : E; V : B := True) is
6034 begin
6035 pragma Assert (Ekind (Id) = E_Procedure);
6036 Set_Flag127 (Id, V);
6037 end Set_Is_Valued_Procedure;
6038
6039 procedure Set_Is_Visible_Formal (Id : E; V : B := True) is
6040 begin
6041 Set_Flag206 (Id, V);
6042 end Set_Is_Visible_Formal;
6043
6044 procedure Set_Is_Visible_Lib_Unit (Id : E; V : B := True) is
6045 begin
6046 Set_Flag116 (Id, V);
6047 end Set_Is_Visible_Lib_Unit;
6048
6049 procedure Set_Is_Volatile (Id : E; V : B := True) is
6050 begin
6051 pragma Assert (Nkind (Id) in N_Entity);
6052 Set_Flag16 (Id, V);
6053 end Set_Is_Volatile;
6054
6055 procedure Set_Is_Volatile_Full_Access (Id : E; V : B := True) is
6056 begin
6057 Set_Flag285 (Id, V);
6058 end Set_Is_Volatile_Full_Access;
6059
6060 procedure Set_Itype_Printed (Id : E; V : B := True) is
6061 begin
6062 pragma Assert (Is_Itype (Id));
6063 Set_Flag202 (Id, V);
6064 end Set_Itype_Printed;
6065
6066 procedure Set_Kill_Elaboration_Checks (Id : E; V : B := True) is
6067 begin
6068 Set_Flag32 (Id, V);
6069 end Set_Kill_Elaboration_Checks;
6070
6071 procedure Set_Kill_Range_Checks (Id : E; V : B := True) is
6072 begin
6073 Set_Flag33 (Id, V);
6074 end Set_Kill_Range_Checks;
6075
6076 procedure Set_Known_To_Have_Preelab_Init (Id : E; V : B := True) is
6077 begin
6078 pragma Assert (Is_Type (Id));
6079 Set_Flag207 (Id, V);
6080 end Set_Known_To_Have_Preelab_Init;
6081
6082 procedure Set_Last_Aggregate_Assignment (Id : E; V : N) is
6083 begin
6084 pragma Assert (Ekind (Id) in E_Constant | E_Variable);
6085 Set_Node30 (Id, V);
6086 end Set_Last_Aggregate_Assignment;
6087
6088 procedure Set_Last_Assignment (Id : E; V : N) is
6089 begin
6090 pragma Assert (Is_Assignable (Id));
6091 Set_Node26 (Id, V);
6092 end Set_Last_Assignment;
6093
6094 procedure Set_Last_Entity (Id : E; V : E) is
6095 begin
6096 Set_Node20 (Id, V);
6097 end Set_Last_Entity;
6098
6099 procedure Set_Limited_View (Id : E; V : E) is
6100 begin
6101 pragma Assert (Ekind (Id) = E_Package
6102 and then not Is_Generic_Instance (Id));
6103 Set_Node23 (Id, V);
6104 end Set_Limited_View;
6105
6106 procedure Set_Linker_Section_Pragma (Id : E; V : N) is
6107 begin
6108 pragma Assert
6109 (Is_Object (Id) or else Is_Subprogram (Id) or else Is_Type (Id));
6110 Set_Node33 (Id, V);
6111 end Set_Linker_Section_Pragma;
6112
6113 procedure Set_Lit_Hash (Id : E; V : E) is
6114 begin
6115 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
6116 Set_Node21 (Id, V);
6117 end Set_Lit_Hash;
6118
6119 procedure Set_Lit_Indexes (Id : E; V : E) is
6120 begin
6121 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
6122 Set_Node18 (Id, V);
6123 end Set_Lit_Indexes;
6124
6125 procedure Set_Lit_Strings (Id : E; V : E) is
6126 begin
6127 pragma Assert (Is_Enumeration_Type (Id) and then Root_Type (Id) = Id);
6128 Set_Node16 (Id, V);
6129 end Set_Lit_Strings;
6130
6131 procedure Set_Low_Bound_Tested (Id : E; V : B := True) is
6132 begin
6133 pragma Assert (Is_Formal (Id));
6134 Set_Flag205 (Id, V);
6135 end Set_Low_Bound_Tested;
6136
6137 procedure Set_Machine_Radix_10 (Id : E; V : B := True) is
6138 begin
6139 pragma Assert (Is_Decimal_Fixed_Point_Type (Id));
6140 Set_Flag84 (Id, V);
6141 end Set_Machine_Radix_10;
6142
6143 procedure Set_Master_Id (Id : E; V : E) is
6144 begin
6145 pragma Assert (Is_Access_Type (Id));
6146 Set_Node17 (Id, V);
6147 end Set_Master_Id;
6148
6149 procedure Set_Materialize_Entity (Id : E; V : B := True) is
6150 begin
6151 Set_Flag168 (Id, V);
6152 end Set_Materialize_Entity;
6153
6154 procedure Set_May_Inherit_Delayed_Rep_Aspects (Id : E; V : B := True) is
6155 begin
6156 Set_Flag262 (Id, V);
6157 end Set_May_Inherit_Delayed_Rep_Aspects;
6158
6159 procedure Set_Mechanism (Id : E; V : M) is
6160 begin
6161 pragma Assert (Ekind (Id) = E_Function or else Is_Formal (Id));
6162 Set_Uint8 (Id, UI_From_Int (V));
6163 end Set_Mechanism;
6164
6165 procedure Set_Minimum_Accessibility (Id : E; V : E) is
6166 begin
6167 pragma Assert (Is_Formal (Id));
6168 Set_Node24 (Id, V);
6169 end Set_Minimum_Accessibility;
6170
6171 procedure Set_Modulus (Id : E; V : U) is
6172 begin
6173 pragma Assert (Ekind (Id) = E_Modular_Integer_Type);
6174 Set_Uint17 (Id, V);
6175 end Set_Modulus;
6176
6177 procedure Set_Must_Be_On_Byte_Boundary (Id : E; V : B := True) is
6178 begin
6179 pragma Assert (Is_Type (Id));
6180 Set_Flag183 (Id, V);
6181 end Set_Must_Be_On_Byte_Boundary;
6182
6183 procedure Set_Must_Have_Preelab_Init (Id : E; V : B := True) is
6184 begin
6185 pragma Assert (Is_Type (Id));
6186 Set_Flag208 (Id, V);
6187 end Set_Must_Have_Preelab_Init;
6188
6189 procedure Set_Needs_Activation_Record (Id : E; V : B := True) is
6190 begin
6191 Set_Flag306 (Id, V);
6192 end Set_Needs_Activation_Record;
6193
6194 procedure Set_Needs_Debug_Info (Id : E; V : B := True) is
6195 begin
6196 Set_Flag147 (Id, V);
6197 end Set_Needs_Debug_Info;
6198
6199 procedure Set_Needs_No_Actuals (Id : E; V : B := True) is
6200 begin
6201 pragma Assert
6202 (Is_Overloadable (Id)
6203 or else Ekind (Id) in E_Subprogram_Type | E_Entry_Family);
6204 Set_Flag22 (Id, V);
6205 end Set_Needs_No_Actuals;
6206
6207 procedure Set_Never_Set_In_Source (Id : E; V : B := True) is
6208 begin
6209 Set_Flag115 (Id, V);
6210 end Set_Never_Set_In_Source;
6211
6212 procedure Set_Next_Inlined_Subprogram (Id : E; V : E) is
6213 begin
6214 Set_Node12 (Id, V);
6215 end Set_Next_Inlined_Subprogram;
6216
6217 procedure Set_No_Dynamic_Predicate_On_Actual (Id : E; V : B := True) is
6218 begin
6219 pragma Assert (Is_Discrete_Type (Id));
6220 Set_Flag276 (Id, V);
6221 end Set_No_Dynamic_Predicate_On_Actual;
6222
6223 procedure Set_No_Pool_Assigned (Id : E; V : B := True) is
6224 begin
6225 pragma Assert (Is_Access_Type (Id) and then Is_Base_Type (Id));
6226 Set_Flag131 (Id, V);
6227 end Set_No_Pool_Assigned;
6228
6229 procedure Set_No_Predicate_On_Actual (Id : E; V : B := True) is
6230 begin
6231 pragma Assert (Is_Discrete_Type (Id));
6232 Set_Flag275 (Id, V);
6233 end Set_No_Predicate_On_Actual;
6234
6235 procedure Set_No_Reordering (Id : E; V : B := True) is
6236 begin
6237 pragma Assert (Is_Record_Type (Id) and then Is_Base_Type (Id));
6238 Set_Flag239 (Id, V);
6239 end Set_No_Reordering;
6240
6241 procedure Set_No_Return (Id : E; V : B := True) is
6242 begin
6243 pragma Assert (Is_Subprogram_Or_Generic_Subprogram (Id));
6244 Set_Flag113 (Id, V);
6245 end Set_No_Return;
6246
6247 procedure Set_No_Strict_Aliasing (Id : E; V : B := True) is
6248 begin
6249 pragma Assert (Is_Access_Type (Id) and then Is_Base_Type (Id));
6250 Set_Flag136 (Id, V);
6251 end Set_No_Strict_Aliasing;
6252
6253 procedure Set_No_Tagged_Streams_Pragma (Id : E; V : E) is
6254 begin
6255 pragma Assert (Is_Tagged_Type (Id));
6256 Set_Node32 (Id, V);
6257 end Set_No_Tagged_Streams_Pragma;
6258
6259 procedure Set_Non_Binary_Modulus (Id : E; V : B := True) is
6260 begin
6261 pragma Assert (Is_Type (Id) and then Is_Base_Type (Id));
6262 Set_Flag58 (Id, V);
6263 end Set_Non_Binary_Modulus;
6264
6265 procedure Set_Non_Limited_View (Id : E; V : E) is
6266 begin
6267 pragma Assert
6268 (Ekind (Id) in Incomplete_Kind
6269 or else Ekind (Id) in E_Abstract_State | E_Class_Wide_Type);
6270 Set_Node19 (Id, V);
6271 end Set_Non_Limited_View;
6272
6273 procedure Set_Nonzero_Is_True (Id : E; V : B := True) is
6274 begin
6275 pragma Assert
6276 (Root_Type (Id) = Standard_Boolean
6277 and then Ekind (Id) = E_Enumeration_Type);
6278 Set_Flag162 (Id, V);
6279 end Set_Nonzero_Is_True;
6280
6281 procedure Set_Normalized_First_Bit (Id : E; V : U) is
6282 begin
6283 pragma Assert (Ekind (Id) in E_Component | E_Discriminant);
6284 Set_Uint8 (Id, V);
6285 end Set_Normalized_First_Bit;
6286
6287 procedure Set_Normalized_Position (Id : E; V : U) is
6288 begin
6289 pragma Assert (Ekind (Id) in E_Component | E_Discriminant);
6290 Set_Uint14 (Id, V);
6291 end Set_Normalized_Position;
6292
6293 procedure Set_Normalized_Position_Max (Id : E; V : U) is
6294 begin
6295 pragma Assert (Ekind (Id) in E_Component | E_Discriminant);
6296 Set_Uint10 (Id, V);
6297 end Set_Normalized_Position_Max;
6298
6299 procedure Set_OK_To_Rename (Id : E; V : B := True) is
6300 begin
6301 pragma Assert (Ekind (Id) = E_Variable);
6302 Set_Flag247 (Id, V);
6303 end Set_OK_To_Rename;
6304
6305 procedure Set_Optimize_Alignment_Space (Id : E; V : B := True) is
6306 begin
6307 pragma Assert
6308 (Is_Type (Id) or else Ekind (Id) in E_Constant | E_Variable);
6309 Set_Flag241 (Id, V);
6310 end Set_Optimize_Alignment_Space;
6311
6312 procedure Set_Optimize_Alignment_Time (Id : E; V : B := True) is
6313 begin
6314 pragma Assert
6315 (Is_Type (Id) or else Ekind (Id) in E_Constant | E_Variable);
6316 Set_Flag242 (Id, V);
6317 end Set_Optimize_Alignment_Time;
6318
6319 procedure Set_Original_Access_Type (Id : E; V : E) is
6320 begin
6321 pragma Assert (Ekind (Id) = E_Access_Subprogram_Type);
6322 Set_Node28 (Id, V);
6323 end Set_Original_Access_Type;
6324
6325 procedure Set_Original_Array_Type (Id : E; V : E) is
6326 begin
6327 pragma Assert (Is_Array_Type (Id) or else Is_Modular_Integer_Type (Id));
6328 Set_Node21 (Id, V);
6329 end Set_Original_Array_Type;
6330
6331 procedure Set_Original_Protected_Subprogram (Id : E; V : N) is
6332 begin
6333 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
6334 Set_Node41 (Id, V);
6335 end Set_Original_Protected_Subprogram;
6336
6337 procedure Set_Original_Record_Component (Id : E; V : E) is
6338 begin
6339 pragma Assert (Ekind (Id) in E_Void | E_Component | E_Discriminant);
6340 Set_Node22 (Id, V);
6341 end Set_Original_Record_Component;
6342
6343 procedure Set_Overlays_Constant (Id : E; V : B := True) is
6344 begin
6345 Set_Flag243 (Id, V);
6346 end Set_Overlays_Constant;
6347
6348 procedure Set_Overridden_Operation (Id : E; V : E) is
6349 begin
6350 pragma Assert (Is_Subprogram_Or_Generic_Subprogram (Id));
6351 Set_Node26 (Id, V);
6352 end Set_Overridden_Operation;
6353
6354 procedure Set_Package_Instantiation (Id : E; V : N) is
6355 begin
6356 pragma Assert (Ekind (Id) in E_Void | E_Generic_Package | E_Package);
6357 Set_Node26 (Id, V);
6358 end Set_Package_Instantiation;
6359
6360 procedure Set_Packed_Array_Impl_Type (Id : E; V : E) is
6361 begin
6362 pragma Assert (Is_Array_Type (Id));
6363 Set_Node23 (Id, V);
6364 end Set_Packed_Array_Impl_Type;
6365
6366 procedure Set_Parent_Subtype (Id : E; V : E) is
6367 begin
6368 pragma Assert (Ekind (Id) = E_Record_Type);
6369 Set_Node19 (Id, V);
6370 end Set_Parent_Subtype;
6371
6372 procedure Set_Part_Of_Constituents (Id : E; V : L) is
6373 begin
6374 pragma Assert (Ekind (Id) in E_Abstract_State | E_Variable);
6375 Set_Elist10 (Id, V);
6376 end Set_Part_Of_Constituents;
6377
6378 procedure Set_Part_Of_References (Id : E; V : L) is
6379 begin
6380 pragma Assert (Ekind (Id) = E_Variable);
6381 Set_Elist11 (Id, V);
6382 end Set_Part_Of_References;
6383
6384 procedure Set_Partial_View_Has_Unknown_Discr (Id : E; V : B := True) is
6385 begin
6386 pragma Assert (Is_Type (Id));
6387 Set_Flag280 (Id, V);
6388 end Set_Partial_View_Has_Unknown_Discr;
6389
6390 procedure Set_Pending_Access_Types (Id : E; V : L) is
6391 begin
6392 pragma Assert (Is_Type (Id));
6393 Set_Elist15 (Id, V);
6394 end Set_Pending_Access_Types;
6395
6396 procedure Set_Postconditions_Proc (Id : E; V : E) is
6397 begin
6398 pragma Assert
6399 (Ekind (Id) in E_Entry | E_Entry_Family | E_Function | E_Procedure);
6400 Set_Node14 (Id, V);
6401 end Set_Postconditions_Proc;
6402
6403 procedure Set_Predicated_Parent (Id : E; V : E) is
6404 begin
6405 pragma Assert (Ekind (Id) in E_Array_Subtype
6406 | E_Record_Subtype
6407 | E_Record_Subtype_With_Private);
6408 Set_Node38 (Id, V);
6409 end Set_Predicated_Parent;
6410
6411 procedure Set_Predicates_Ignored (Id : E; V : B) is
6412 begin
6413 pragma Assert (Is_Type (Id));
6414 Set_Flag288 (Id, V);
6415 end Set_Predicates_Ignored;
6416
6417 procedure Set_Direct_Primitive_Operations (Id : E; V : L) is
6418 begin
6419 pragma Assert (Is_Tagged_Type (Id));
6420 Set_Elist10 (Id, V);
6421 end Set_Direct_Primitive_Operations;
6422
6423 procedure Set_Prival (Id : E; V : E) is
6424 begin
6425 pragma Assert (Is_Protected_Component (Id));
6426 Set_Node17 (Id, V);
6427 end Set_Prival;
6428
6429 procedure Set_Prival_Link (Id : E; V : E) is
6430 begin
6431 pragma Assert (Ekind (Id) in E_Constant | E_Variable);
6432 Set_Node20 (Id, V);
6433 end Set_Prival_Link;
6434
6435 procedure Set_Private_Dependents (Id : E; V : L) is
6436 begin
6437 pragma Assert (Is_Incomplete_Or_Private_Type (Id));
6438 Set_Elist18 (Id, V);
6439 end Set_Private_Dependents;
6440
6441 procedure Set_Prev_Entity (Id : E; V : E) is
6442 begin
6443 Set_Node36 (Id, V);
6444 end Set_Prev_Entity;
6445
6446 procedure Set_Protected_Body_Subprogram (Id : E; V : E) is
6447 begin
6448 pragma Assert (Is_Subprogram_Or_Entry (Id));
6449 Set_Node11 (Id, V);
6450 end Set_Protected_Body_Subprogram;
6451
6452 procedure Set_Protected_Formal (Id : E; V : E) is
6453 begin
6454 pragma Assert (Is_Formal (Id));
6455 Set_Node22 (Id, V);
6456 end Set_Protected_Formal;
6457
6458 procedure Set_Protected_Subprogram (Id : E; V : E) is
6459 begin
6460 pragma Assert (Ekind (Id) in E_Function | E_Procedure);
6461 Set_Node39 (Id, V);
6462 end Set_Protected_Subprogram;
6463
6464 procedure Set_Protection_Object (Id : E; V : E) is
6465 begin
6466 pragma Assert (Ekind (Id) in E_Entry
6467 | E_Entry_Family
6468 | E_Function
6469 | E_Procedure);
6470 Set_Node23 (Id, V);
6471 end Set_Protection_Object;
6472
6473 procedure Set_Reachable (Id : E; V : B := True) is
6474 begin
6475 Set_Flag49 (Id, V);
6476 end Set_Reachable;
6477
6478 procedure Set_Receiving_Entry (Id : E; V : E) is
6479 begin
6480 pragma Assert (Ekind (Id) = E_Procedure);
6481 Set_Node19 (Id, V);
6482 end Set_Receiving_Entry;
6483
6484 procedure Set_Referenced (Id : E; V : B := True) is
6485 begin
6486 Set_Flag156 (Id, V);
6487 end Set_Referenced;
6488
6489 procedure Set_Referenced_As_LHS (Id : E; V : B := True) is
6490 begin
6491 Set_Flag36 (Id, V);
6492 end Set_Referenced_As_LHS;
6493
6494 procedure Set_Referenced_As_Out_Parameter (Id : E; V : B := True) is
6495 begin
6496 Set_Flag227 (Id, V);
6497 end Set_Referenced_As_Out_Parameter;
6498
6499 procedure Set_Refinement_Constituents (Id : E; V : L) is
6500 begin
6501 pragma Assert (Ekind (Id) = E_Abstract_State);
6502 Set_Elist8 (Id, V);
6503 end Set_Refinement_Constituents;
6504
6505 procedure Set_Register_Exception_Call (Id : E; V : N) is
6506 begin
6507 pragma Assert (Ekind (Id) = E_Exception);
6508 Set_Node20 (Id, V);
6509 end Set_Register_Exception_Call;
6510
6511 procedure Set_Related_Array_Object (Id : E; V : E) is
6512 begin
6513 pragma Assert (Is_Array_Type (Id));
6514 Set_Node25 (Id, V);
6515 end Set_Related_Array_Object;
6516
6517 procedure Set_Related_Expression (Id : E; V : N) is
6518 begin
6519 pragma Assert
6520 (Ekind (Id) in
6521 Type_Kind | E_Constant | E_Variable | E_Function | E_Void);
6522 Set_Node24 (Id, V);
6523 end Set_Related_Expression;
6524
6525 procedure Set_Related_Instance (Id : E; V : E) is
6526 begin
6527 pragma Assert (Ekind (Id) in E_Package | E_Package_Body);
6528 Set_Node15 (Id, V);
6529 end Set_Related_Instance;
6530
6531 procedure Set_Related_Type (Id : E; V : E) is
6532 begin
6533 pragma Assert (Ekind (Id) in E_Component | E_Constant | E_Variable);
6534 Set_Node27 (Id, V);
6535 end Set_Related_Type;
6536
6537 procedure Set_Relative_Deadline_Variable (Id : E; V : E) is
6538 begin
6539 pragma Assert (Is_Task_Type (Id) and then Is_Base_Type (Id));
6540 Set_Node28 (Id, V);
6541 end Set_Relative_Deadline_Variable;
6542
6543 procedure Set_Renamed_Entity (Id : E; V : N) is
6544 begin
6545 Set_Node18 (Id, V);
6546 end Set_Renamed_Entity;
6547
6548 procedure Set_Renamed_In_Spec (Id : E; V : B := True) is
6549 begin
6550 pragma Assert (Ekind (Id) = E_Package);
6551 Set_Flag231 (Id, V);
6552 end Set_Renamed_In_Spec;
6553
6554 procedure Set_Renamed_Object (Id : E; V : N) is
6555 begin
6556 Set_Node18 (Id, V);
6557 end Set_Renamed_Object;
6558
6559 procedure Set_Renaming_Map (Id : E; V : U) is
6560 begin
6561 Set_Uint9 (Id, V);
6562 end Set_Renaming_Map;
6563
6564 procedure Set_Requires_Overriding (Id : E; V : B := True) is
6565 begin
6566 pragma Assert (Is_Overloadable (Id));
6567 Set_Flag213 (Id, V);
6568 end Set_Requires_Overriding;
6569
6570 procedure Set_Return_Present (Id : E; V : B := True) is
6571 begin
6572 Set_Flag54 (Id, V);
6573 end Set_Return_Present;
6574
6575 procedure Set_Return_Applies_To (Id : E; V : N) is
6576 begin
6577 Set_Node8 (Id, V);
6578 end Set_Return_Applies_To;
6579
6580 procedure Set_Returns_By_Ref (Id : E; V : B := True) is
6581 begin
6582 Set_Flag90 (Id, V);
6583 end Set_Returns_By_Ref;
6584
6585 procedure Set_Reverse_Bit_Order (Id : E; V : B := True) is
6586 begin
6587 pragma Assert
6588 (Is_Record_Type (Id) and then Is_Base_Type (Id));
6589 Set_Flag164 (Id, V);
6590 end Set_Reverse_Bit_Order;
6591
6592 procedure Set_Reverse_Storage_Order (Id : E; V : B := True) is
6593 begin
6594 pragma Assert
6595 (Is_Base_Type (Id)
6596 and then (Is_Record_Type (Id) or else Is_Array_Type (Id)));
6597 Set_Flag93 (Id, V);
6598 end Set_Reverse_Storage_Order;
6599
6600 procedure Set_Rewritten_For_C (Id : E; V : B := True) is
6601 begin
6602 pragma Assert (Ekind (Id) = E_Function);
6603 Set_Flag287 (Id, V);
6604 end Set_Rewritten_For_C;
6605
6606 procedure Set_RM_Size (Id : E; V : U) is
6607 begin
6608 pragma Assert (Is_Type (Id));
6609 Set_Uint13 (Id, V);
6610 end Set_RM_Size;
6611
6612 procedure Set_Scalar_Range (Id : E; V : N) is
6613 begin
6614 Set_Node20 (Id, V);
6615 end Set_Scalar_Range;
6616
6617 procedure Set_Scale_Value (Id : E; V : U) is
6618 begin
6619 Set_Uint16 (Id, V);
6620 end Set_Scale_Value;
6621
6622 procedure Set_Scope_Depth_Value (Id : E; V : U) is
6623 begin
6624 pragma Assert
6625 (Ekind (Id) in
6626 Concurrent_Kind | Entry_Kind | Generic_Unit_Kind |
6627 E_Package | E_Package_Body | Subprogram_Kind |
6628 E_Block | E_Subprogram_Body |
6629 E_Private_Type .. E_Limited_Private_Subtype |
6630 E_Void | E_Loop | E_Return_Statement);
6631 Set_Uint22 (Id, V);
6632 end Set_Scope_Depth_Value;
6633
6634 procedure Set_Sec_Stack_Needed_For_Return (Id : E; V : B := True) is
6635 begin
6636 Set_Flag167 (Id, V);
6637 end Set_Sec_Stack_Needed_For_Return;
6638
6639 procedure Set_Shared_Var_Procs_Instance (Id : E; V : E) is
6640 begin
6641 pragma Assert (Ekind (Id) = E_Variable);
6642 Set_Node22 (Id, V);
6643 end Set_Shared_Var_Procs_Instance;
6644
6645 procedure Set_Size_Check_Code (Id : E; V : N) is
6646 begin
6647 pragma Assert (Ekind (Id) in E_Constant | E_Variable);
6648 Set_Node19 (Id, V);
6649 end Set_Size_Check_Code;
6650
6651 procedure Set_Size_Depends_On_Discriminant (Id : E; V : B := True) is
6652 begin
6653 Set_Flag177 (Id, V);
6654 end Set_Size_Depends_On_Discriminant;
6655
6656 procedure Set_Size_Known_At_Compile_Time (Id : E; V : B := True) is
6657 begin
6658 Set_Flag92 (Id, V);
6659 end Set_Size_Known_At_Compile_Time;
6660
6661 procedure Set_Small_Value (Id : E; V : R) is
6662 begin
6663 pragma Assert (Is_Fixed_Point_Type (Id));
6664 Set_Ureal21 (Id, V);
6665 end Set_Small_Value;
6666
6667 procedure Set_SPARK_Aux_Pragma (Id : E; V : N) is
6668 begin
6669 pragma Assert
6670 (Ekind (Id) in E_Protected_Type -- concurrent types
6671 | E_Task_Type
6672 or else
6673 Ekind (Id) in E_Generic_Package -- packages
6674 | E_Package
6675 | E_Package_Body);
6676 Set_Node41 (Id, V);
6677 end Set_SPARK_Aux_Pragma;
6678
6679 procedure Set_SPARK_Aux_Pragma_Inherited (Id : E; V : B := True) is
6680 begin
6681 pragma Assert
6682 (Ekind (Id) in E_Protected_Type -- concurrent types
6683 | E_Task_Type
6684 or else
6685 Ekind (Id) in E_Generic_Package -- packages
6686 | E_Package
6687 | E_Package_Body);
6688 Set_Flag266 (Id, V);
6689 end Set_SPARK_Aux_Pragma_Inherited;
6690
6691 procedure Set_SPARK_Pragma (Id : E; V : N) is
6692 begin
6693 pragma Assert
6694 (Ekind (Id) in E_Constant -- objects
6695 | E_Variable
6696 or else
6697 Ekind (Id) in E_Abstract_State -- overloadable
6698 | E_Entry
6699 | E_Entry_Family
6700 | E_Function
6701 | E_Generic_Function
6702 | E_Generic_Procedure
6703 | E_Operator
6704 | E_Procedure
6705 | E_Subprogram_Body
6706 or else
6707 Ekind (Id) in E_Generic_Package -- packages
6708 | E_Package
6709 | E_Package_Body
6710 or else
6711 Ekind (Id) = E_Void -- special purpose
6712 or else
6713 Ekind (Id) in E_Protected_Body -- types
6714 | E_Task_Body
6715 or else
6716 Is_Type (Id));
6717 Set_Node40 (Id, V);
6718 end Set_SPARK_Pragma;
6719
6720 procedure Set_SPARK_Pragma_Inherited (Id : E; V : B := True) is
6721 begin
6722 pragma Assert
6723 (Ekind (Id) in E_Constant -- objects
6724 | E_Variable
6725 or else
6726 Ekind (Id) in E_Abstract_State -- overloadable
6727 | E_Entry
6728 | E_Entry_Family
6729 | E_Function
6730 | E_Generic_Function
6731 | E_Generic_Procedure
6732 | E_Operator
6733 | E_Procedure
6734 | E_Subprogram_Body
6735 or else
6736 Ekind (Id) in E_Generic_Package -- packages
6737 | E_Package
6738 | E_Package_Body
6739 or else
6740 Ekind (Id) = E_Void -- special purpose
6741 or else
6742 Ekind (Id) in E_Protected_Body -- types
6743 | E_Task_Body
6744 or else
6745 Is_Type (Id));
6746 Set_Flag265 (Id, V);
6747 end Set_SPARK_Pragma_Inherited;
6748
6749 procedure Set_Spec_Entity (Id : E; V : E) is
6750 begin
6751 pragma Assert (Ekind (Id) = E_Package_Body or else Is_Formal (Id));
6752 Set_Node19 (Id, V);
6753 end Set_Spec_Entity;
6754
6755 procedure Set_SSO_Set_High_By_Default (Id : E; V : B := True) is
6756 begin
6757 pragma Assert
6758 (Is_Base_Type (Id)
6759 and then (Is_Record_Type (Id) or else Is_Array_Type (Id)));
6760 Set_Flag273 (Id, V);
6761 end Set_SSO_Set_High_By_Default;
6762
6763 procedure Set_SSO_Set_Low_By_Default (Id : E; V : B := True) is
6764 begin
6765 pragma Assert
6766 (Is_Base_Type (Id)
6767 and then (Is_Record_Type (Id) or else Is_Array_Type (Id)));
6768 Set_Flag272 (Id, V);
6769 end Set_SSO_Set_Low_By_Default;
6770
6771 procedure Set_Static_Discrete_Predicate (Id : E; V : S) is
6772 begin
6773 pragma Assert (Is_Discrete_Type (Id) and then Has_Predicates (Id));
6774 Set_List25 (Id, V);
6775 end Set_Static_Discrete_Predicate;
6776
6777 procedure Set_Static_Real_Or_String_Predicate (Id : E; V : N) is
6778 begin
6779 pragma Assert ((Is_Real_Type (Id) or else Is_String_Type (Id))
6780 and then Has_Predicates (Id));
6781 Set_Node25 (Id, V);
6782 end Set_Static_Real_Or_String_Predicate;
6783
6784 procedure Set_Status_Flag_Or_Transient_Decl (Id : E; V : E) is
6785 begin
6786 pragma Assert (Ekind (Id) in E_Constant
6787 | E_Loop_Parameter
6788 | E_Variable);
6789 Set_Node15 (Id, V);
6790 end Set_Status_Flag_Or_Transient_Decl;
6791
6792 procedure Set_Storage_Size_Variable (Id : E; V : E) is
6793 begin
6794 pragma Assert (Is_Access_Type (Id) or else Is_Task_Type (Id));
6795 pragma Assert (Id = Base_Type (Id));
6796 Set_Node26 (Id, V);
6797 end Set_Storage_Size_Variable;
6798
6799 procedure Set_Static_Elaboration_Desired (Id : E; V : B) is
6800 begin
6801 pragma Assert (Ekind (Id) = E_Package);
6802 Set_Flag77 (Id, V);
6803 end Set_Static_Elaboration_Desired;
6804
6805 procedure Set_Static_Initialization (Id : E; V : N) is
6806 begin
6807 pragma Assert
6808 (Ekind (Id) = E_Procedure and then not Is_Dispatching_Operation (Id));
6809 Set_Node30 (Id, V);
6810 end Set_Static_Initialization;
6811
6812 procedure Set_Stored_Constraint (Id : E; V : L) is
6813 begin
6814 pragma Assert (Nkind (Id) in N_Entity);
6815 Set_Elist23 (Id, V);
6816 end Set_Stored_Constraint;
6817
6818 procedure Set_Stores_Attribute_Old_Prefix (Id : E; V : B := True) is
6819 begin
6820 pragma Assert (Is_Type (Id)
6821 or else (Ekind (Id) in E_Constant
6822 | E_Variable));
6823 Set_Flag270 (Id, V);
6824 end Set_Stores_Attribute_Old_Prefix;
6825
6826 procedure Set_Strict_Alignment (Id : E; V : B := True) is
6827 begin
6828 pragma Assert (Id = Base_Type (Id));
6829 Set_Flag145 (Id, V);
6830 end Set_Strict_Alignment;
6831
6832 procedure Set_String_Literal_Length (Id : E; V : U) is
6833 begin
6834 pragma Assert (Ekind (Id) = E_String_Literal_Subtype);
6835 Set_Uint16 (Id, V);
6836 end Set_String_Literal_Length;
6837
6838 procedure Set_String_Literal_Low_Bound (Id : E; V : N) is
6839 begin
6840 pragma Assert (Ekind (Id) = E_String_Literal_Subtype);
6841 Set_Node18 (Id, V);
6842 end Set_String_Literal_Low_Bound;
6843
6844 procedure Set_Subprograms_For_Type (Id : E; V : L) is
6845 begin
6846 pragma Assert (Is_Type (Id));
6847 Set_Elist29 (Id, V);
6848 end Set_Subprograms_For_Type;
6849
6850 procedure Set_Subps_Index (Id : E; V : U) is
6851 begin
6852 pragma Assert (Is_Subprogram (Id));
6853 Set_Uint24 (Id, V);
6854 end Set_Subps_Index;
6855
6856 procedure Set_Suppress_Elaboration_Warnings (Id : E; V : B := True) is
6857 begin
6858 Set_Flag303 (Id, V);
6859 end Set_Suppress_Elaboration_Warnings;
6860
6861 procedure Set_Suppress_Initialization (Id : E; V : B := True) is
6862 begin
6863 pragma Assert (Is_Type (Id) or else Ekind (Id) = E_Variable);
6864 Set_Flag105 (Id, V);
6865 end Set_Suppress_Initialization;
6866
6867 procedure Set_Suppress_Style_Checks (Id : E; V : B := True) is
6868 begin
6869 Set_Flag165 (Id, V);
6870 end Set_Suppress_Style_Checks;
6871
6872 procedure Set_Suppress_Value_Tracking_On_Call (Id : E; V : B := True) is
6873 begin
6874 Set_Flag217 (Id, V);
6875 end Set_Suppress_Value_Tracking_On_Call;
6876
6877 procedure Set_Task_Body_Procedure (Id : E; V : N) is
6878 begin
6879 pragma Assert (Ekind (Id) in Task_Kind);
6880 Set_Node25 (Id, V);
6881 end Set_Task_Body_Procedure;
6882
6883 procedure Set_Thunk_Entity (Id : E; V : E) is
6884 begin
6885 pragma Assert (Ekind (Id) in E_Function | E_Procedure
6886 and then Is_Thunk (Id));
6887 Set_Node31 (Id, V);
6888 end Set_Thunk_Entity;
6889
6890 procedure Set_Treat_As_Volatile (Id : E; V : B := True) is
6891 begin
6892 Set_Flag41 (Id, V);
6893 end Set_Treat_As_Volatile;
6894
6895 procedure Set_Underlying_Full_View (Id : E; V : E) is
6896 begin
6897 pragma Assert (Ekind (Id) in Private_Kind);
6898 Set_Node19 (Id, V);
6899 end Set_Underlying_Full_View;
6900
6901 procedure Set_Underlying_Record_View (Id : E; V : E) is
6902 begin
6903 pragma Assert (Ekind (Id) = E_Record_Type);
6904 Set_Node28 (Id, V);
6905 end Set_Underlying_Record_View;
6906
6907 procedure Set_Universal_Aliasing (Id : E; V : B := True) is
6908 begin
6909 pragma Assert (Is_Type (Id) and then Is_Base_Type (Id));
6910 Set_Flag216 (Id, V);
6911 end Set_Universal_Aliasing;
6912
6913 procedure Set_Unset_Reference (Id : E; V : N) is
6914 begin
6915 Set_Node16 (Id, V);
6916 end Set_Unset_Reference;
6917
6918 procedure Set_Used_As_Generic_Actual (Id : E; V : B := True) is
6919 begin
6920 Set_Flag222 (Id, V);
6921 end Set_Used_As_Generic_Actual;
6922
6923 procedure Set_Uses_Lock_Free (Id : E; V : B := True) is
6924 begin
6925 pragma Assert (Ekind (Id) = E_Protected_Type);
6926 Set_Flag188 (Id, V);
6927 end Set_Uses_Lock_Free;
6928
6929 procedure Set_Uses_Sec_Stack (Id : E; V : B := True) is
6930 begin
6931 Set_Flag95 (Id, V);
6932 end Set_Uses_Sec_Stack;
6933
6934 procedure Set_Validated_Object (Id : E; V : N) is
6935 begin
6936 pragma Assert (Ekind (Id) = E_Variable);
6937 Set_Node38 (Id, V);
6938 end Set_Validated_Object;
6939
6940 procedure Set_Warnings_Off (Id : E; V : B := True) is
6941 begin
6942 Set_Flag96 (Id, V);
6943 end Set_Warnings_Off;
6944
6945 procedure Set_Warnings_Off_Used (Id : E; V : B := True) is
6946 begin
6947 Set_Flag236 (Id, V);
6948 end Set_Warnings_Off_Used;
6949
6950 procedure Set_Warnings_Off_Used_Unmodified (Id : E; V : B := True) is
6951 begin
6952 Set_Flag237 (Id, V);
6953 end Set_Warnings_Off_Used_Unmodified;
6954
6955 procedure Set_Warnings_Off_Used_Unreferenced (Id : E; V : B := True) is
6956 begin
6957 Set_Flag238 (Id, V);
6958 end Set_Warnings_Off_Used_Unreferenced;
6959
6960 procedure Set_Was_Hidden (Id : E; V : B := True) is
6961 begin
6962 Set_Flag196 (Id, V);
6963 end Set_Was_Hidden;
6964
6965 procedure Set_Wrapped_Entity (Id : E; V : E) is
6966 begin
6967 pragma Assert (Ekind (Id) in E_Function | E_Procedure
6968 and then Is_Primitive_Wrapper (Id));
6969 Set_Node27 (Id, V);
6970 end Set_Wrapped_Entity;
6971
6972 -----------------------------------
6973 -- Field Initialization Routines --
6974 -----------------------------------
6975
6976 procedure Init_Alignment (Id : E) is
6977 begin
6978 Set_Uint14 (Id, Uint_0);
6979 end Init_Alignment;
6980
6981 procedure Init_Alignment (Id : E; V : Int) is
6982 begin
6983 Set_Uint14 (Id, UI_From_Int (V));
6984 end Init_Alignment;
6985
6986 procedure Init_Component_Bit_Offset (Id : E) is
6987 begin
6988 Set_Uint11 (Id, No_Uint);
6989 end Init_Component_Bit_Offset;
6990
6991 procedure Init_Component_Bit_Offset (Id : E; V : Int) is
6992 begin
6993 Set_Uint11 (Id, UI_From_Int (V));
6994 end Init_Component_Bit_Offset;
6995
6996 procedure Init_Component_Size (Id : E) is
6997 begin
6998 Set_Uint22 (Id, Uint_0);
6999 end Init_Component_Size;
7000
7001 procedure Init_Component_Size (Id : E; V : Int) is
7002 begin
7003 Set_Uint22 (Id, UI_From_Int (V));
7004 end Init_Component_Size;
7005
7006 procedure Init_Digits_Value (Id : E) is
7007 begin
7008 Set_Uint17 (Id, Uint_0);
7009 end Init_Digits_Value;
7010
7011 procedure Init_Digits_Value (Id : E; V : Int) is
7012 begin
7013 Set_Uint17 (Id, UI_From_Int (V));
7014 end Init_Digits_Value;
7015
7016 procedure Init_Esize (Id : E) is
7017 begin
7018 Set_Uint12 (Id, Uint_0);
7019 end Init_Esize;
7020
7021 procedure Init_Esize (Id : E; V : Int) is
7022 begin
7023 Set_Uint12 (Id, UI_From_Int (V));
7024 end Init_Esize;
7025
7026 procedure Init_Normalized_First_Bit (Id : E) is
7027 begin
7028 Set_Uint8 (Id, No_Uint);
7029 end Init_Normalized_First_Bit;
7030
7031 procedure Init_Normalized_First_Bit (Id : E; V : Int) is
7032 begin
7033 Set_Uint8 (Id, UI_From_Int (V));
7034 end Init_Normalized_First_Bit;
7035
7036 procedure Init_Normalized_Position (Id : E) is
7037 begin
7038 Set_Uint14 (Id, No_Uint);
7039 end Init_Normalized_Position;
7040
7041 procedure Init_Normalized_Position (Id : E; V : Int) is
7042 begin
7043 Set_Uint14 (Id, UI_From_Int (V));
7044 end Init_Normalized_Position;
7045
7046 procedure Init_Normalized_Position_Max (Id : E) is
7047 begin
7048 Set_Uint10 (Id, No_Uint);
7049 end Init_Normalized_Position_Max;
7050
7051 procedure Init_Normalized_Position_Max (Id : E; V : Int) is
7052 begin
7053 Set_Uint10 (Id, UI_From_Int (V));
7054 end Init_Normalized_Position_Max;
7055
7056 procedure Init_RM_Size (Id : E) is
7057 begin
7058 Set_Uint13 (Id, Uint_0);
7059 end Init_RM_Size;
7060
7061 procedure Init_RM_Size (Id : E; V : Int) is
7062 begin
7063 Set_Uint13 (Id, UI_From_Int (V));
7064 end Init_RM_Size;
7065
7066 -----------------------------
7067 -- Init_Component_Location --
7068 -----------------------------
7069
7070 procedure Init_Component_Location (Id : E) is
7071 begin
7072 Set_Uint8 (Id, No_Uint); -- Normalized_First_Bit
7073 Set_Uint10 (Id, No_Uint); -- Normalized_Position_Max
7074 Set_Uint11 (Id, No_Uint); -- Component_Bit_Offset
7075 Set_Uint12 (Id, Uint_0); -- Esize
7076 Set_Uint14 (Id, No_Uint); -- Normalized_Position
7077 end Init_Component_Location;
7078
7079 ----------------------------
7080 -- Init_Object_Size_Align --
7081 ----------------------------
7082
7083 procedure Init_Object_Size_Align (Id : E) is
7084 begin
7085 Set_Uint12 (Id, Uint_0); -- Esize
7086 Set_Uint14 (Id, Uint_0); -- Alignment
7087 end Init_Object_Size_Align;
7088
7089 ---------------
7090 -- Init_Size --
7091 ---------------
7092
7093 procedure Init_Size (Id : E; V : Int) is
7094 begin
7095 pragma Assert (not Is_Object (Id));
7096 Set_Uint12 (Id, UI_From_Int (V)); -- Esize
7097 Set_Uint13 (Id, UI_From_Int (V)); -- RM_Size
7098 end Init_Size;
7099
7100 ---------------------
7101 -- Init_Size_Align --
7102 ---------------------
7103
7104 procedure Init_Size_Align (Id : E) is
7105 begin
7106 pragma Assert (not Is_Object (Id));
7107 Set_Uint12 (Id, Uint_0); -- Esize
7108 Set_Uint13 (Id, Uint_0); -- RM_Size
7109 Set_Uint14 (Id, Uint_0); -- Alignment
7110 end Init_Size_Align;
7111
7112 ----------------------------------------------
7113 -- Type Representation Attribute Predicates --
7114 ----------------------------------------------
7115
7116 function Known_Alignment (E : Entity_Id) return B is
7117 begin
7118 return Uint14 (E) /= Uint_0
7119 and then Uint14 (E) /= No_Uint;
7120 end Known_Alignment;
7121
7122 function Known_Component_Bit_Offset (E : Entity_Id) return B is
7123 begin
7124 return Uint11 (E) /= No_Uint;
7125 end Known_Component_Bit_Offset;
7126
7127 function Known_Component_Size (E : Entity_Id) return B is
7128 begin
7129 return Uint22 (Base_Type (E)) /= Uint_0
7130 and then Uint22 (Base_Type (E)) /= No_Uint;
7131 end Known_Component_Size;
7132
7133 function Known_Esize (E : Entity_Id) return B is
7134 begin
7135 return Uint12 (E) /= Uint_0
7136 and then Uint12 (E) /= No_Uint;
7137 end Known_Esize;
7138
7139 function Known_Normalized_First_Bit (E : Entity_Id) return B is
7140 begin
7141 return Uint8 (E) /= No_Uint;
7142 end Known_Normalized_First_Bit;
7143
7144 function Known_Normalized_Position (E : Entity_Id) return B is
7145 begin
7146 return Uint14 (E) /= No_Uint;
7147 end Known_Normalized_Position;
7148
7149 function Known_Normalized_Position_Max (E : Entity_Id) return B is
7150 begin
7151 return Uint10 (E) /= No_Uint;
7152 end Known_Normalized_Position_Max;
7153
7154 function Known_RM_Size (E : Entity_Id) return B is
7155 begin
7156 return Uint13 (E) /= No_Uint
7157 and then (Uint13 (E) /= Uint_0
7158 or else Is_Discrete_Type (E)
7159 or else Is_Fixed_Point_Type (E));
7160 end Known_RM_Size;
7161
7162 function Known_Static_Component_Bit_Offset (E : Entity_Id) return B is
7163 begin
7164 return Uint11 (E) /= No_Uint
7165 and then Uint11 (E) >= Uint_0;
7166 end Known_Static_Component_Bit_Offset;
7167
7168 function Known_Static_Component_Size (E : Entity_Id) return B is
7169 begin
7170 return Uint22 (Base_Type (E)) > Uint_0;
7171 end Known_Static_Component_Size;
7172
7173 function Known_Static_Esize (E : Entity_Id) return B is
7174 begin
7175 return Uint12 (E) > Uint_0
7176 and then not Is_Generic_Type (E);
7177 end Known_Static_Esize;
7178
7179 function Known_Static_Normalized_First_Bit (E : Entity_Id) return B is
7180 begin
7181 return Uint8 (E) /= No_Uint
7182 and then Uint8 (E) >= Uint_0;
7183 end Known_Static_Normalized_First_Bit;
7184
7185 function Known_Static_Normalized_Position (E : Entity_Id) return B is
7186 begin
7187 return Uint14 (E) /= No_Uint
7188 and then Uint14 (E) >= Uint_0;
7189 end Known_Static_Normalized_Position;
7190
7191 function Known_Static_Normalized_Position_Max (E : Entity_Id) return B is
7192 begin
7193 return Uint10 (E) /= No_Uint
7194 and then Uint10 (E) >= Uint_0;
7195 end Known_Static_Normalized_Position_Max;
7196
7197 function Known_Static_RM_Size (E : Entity_Id) return B is
7198 begin
7199 return (Uint13 (E) > Uint_0
7200 or else Is_Discrete_Type (E)
7201 or else Is_Fixed_Point_Type (E))
7202 and then not Is_Generic_Type (E);
7203 end Known_Static_RM_Size;
7204
7205 function Unknown_Alignment (E : Entity_Id) return B is
7206 begin
7207 return Uint14 (E) = Uint_0
7208 or else Uint14 (E) = No_Uint;
7209 end Unknown_Alignment;
7210
7211 function Unknown_Component_Bit_Offset (E : Entity_Id) return B is
7212 begin
7213 return Uint11 (E) = No_Uint;
7214 end Unknown_Component_Bit_Offset;
7215
7216 function Unknown_Component_Size (E : Entity_Id) return B is
7217 begin
7218 return Uint22 (Base_Type (E)) = Uint_0
7219 or else
7220 Uint22 (Base_Type (E)) = No_Uint;
7221 end Unknown_Component_Size;
7222
7223 function Unknown_Esize (E : Entity_Id) return B is
7224 begin
7225 return Uint12 (E) = No_Uint
7226 or else
7227 Uint12 (E) = Uint_0;
7228 end Unknown_Esize;
7229
7230 function Unknown_Normalized_First_Bit (E : Entity_Id) return B is
7231 begin
7232 return Uint8 (E) = No_Uint;
7233 end Unknown_Normalized_First_Bit;
7234
7235 function Unknown_Normalized_Position (E : Entity_Id) return B is
7236 begin
7237 return Uint14 (E) = No_Uint;
7238 end Unknown_Normalized_Position;
7239
7240 function Unknown_Normalized_Position_Max (E : Entity_Id) return B is
7241 begin
7242 return Uint10 (E) = No_Uint;
7243 end Unknown_Normalized_Position_Max;
7244
7245 function Unknown_RM_Size (E : Entity_Id) return B is
7246 begin
7247 return (Uint13 (E) = Uint_0
7248 and then not Is_Discrete_Type (E)
7249 and then not Is_Fixed_Point_Type (E))
7250 or else Uint13 (E) = No_Uint;
7251 end Unknown_RM_Size;
7252
7253 --------------------
7254 -- Address_Clause --
7255 --------------------
7256
7257 function Address_Clause (Id : E) return N is
7258 begin
7259 return Get_Attribute_Definition_Clause (Id, Attribute_Address);
7260 end Address_Clause;
7261
7262 ---------------
7263 -- Aft_Value --
7264 ---------------
7265
7266 function Aft_Value (Id : E) return U is
7267 Result : Nat := 1;
7268 Delta_Val : Ureal := Delta_Value (Id);
7269 begin
7270 while Delta_Val < Ureal_Tenth loop
7271 Delta_Val := Delta_Val * Ureal_10;
7272 Result := Result + 1;
7273 end loop;
7274
7275 return UI_From_Int (Result);
7276 end Aft_Value;
7277
7278 ----------------------
7279 -- Alignment_Clause --
7280 ----------------------
7281
7282 function Alignment_Clause (Id : E) return N is
7283 begin
7284 return Get_Attribute_Definition_Clause (Id, Attribute_Alignment);
7285 end Alignment_Clause;
7286
7287 -------------------
7288 -- Append_Entity --
7289 -------------------
7290
7291 procedure Append_Entity (Id : Entity_Id; Scop : Entity_Id) is
7292 Last : constant Entity_Id := Last_Entity (Scop);
7293
7294 begin
7295 Set_Scope (Id, Scop);
7296 Set_Prev_Entity (Id, Empty); -- Empty <-- Id
7297
7298 -- The entity chain is empty
7299
7300 if No (Last) then
7301 Set_First_Entity (Scop, Id);
7302
7303 -- Otherwise the entity chain has at least one element
7304
7305 else
7306 Link_Entities (Last, Id); -- Last <-- Id, Last --> Id
7307 end if;
7308
7309 -- NOTE: The setting of the Next_Entity attribute of Id must happen
7310 -- here as opposed to at the beginning of the routine because doing
7311 -- so causes the binder to hang. It is not clear why ???
7312
7313 Set_Next_Entity (Id, Empty); -- Id --> Empty
7314
7315 Set_Last_Entity (Scop, Id);
7316 end Append_Entity;
7317
7318 ---------------
7319 -- Base_Type --
7320 ---------------
7321
7322 function Base_Type (Id : E) return E is
7323 begin
7324 if Is_Base_Type (Id) then
7325 return Id;
7326 else
7327 pragma Assert (Is_Type (Id));
7328 return Etype (Id);
7329 end if;
7330 end Base_Type;
7331
7332 -------------------------
7333 -- Component_Alignment --
7334 -------------------------
7335
7336 -- Component Alignment is encoded using two flags, Flag128/129 as
7337 -- follows. Note that both flags False = Align_Default, so that the
7338 -- default initialization of flags to False initializes component
7339 -- alignment to the default value as required.
7340
7341 -- Flag128 Flag129 Value
7342 -- ------- ------- -----
7343 -- False False Calign_Default
7344 -- False True Calign_Component_Size
7345 -- True False Calign_Component_Size_4
7346 -- True True Calign_Storage_Unit
7347
7348 function Component_Alignment (Id : E) return C is
7349 BT : constant Node_Id := Base_Type (Id);
7350
7351 begin
7352 pragma Assert (Is_Array_Type (Id) or else Is_Record_Type (Id));
7353
7354 if Flag128 (BT) then
7355 if Flag129 (BT) then
7356 return Calign_Storage_Unit;
7357 else
7358 return Calign_Component_Size_4;
7359 end if;
7360
7361 else
7362 if Flag129 (BT) then
7363 return Calign_Component_Size;
7364 else
7365 return Calign_Default;
7366 end if;
7367 end if;
7368 end Component_Alignment;
7369
7370 ----------------------
7371 -- Declaration_Node --
7372 ----------------------
7373
7374 function Declaration_Node (Id : E) return N is
7375 P : Node_Id;
7376
7377 begin
7378 if Ekind (Id) = E_Incomplete_Type
7379 and then Present (Full_View (Id))
7380 then
7381 P := Parent (Full_View (Id));
7382 else
7383 P := Parent (Id);
7384 end if;
7385
7386 loop
7387 if Nkind (P) in N_Selected_Component | N_Expanded_Name
7388 or else (Nkind (P) = N_Defining_Program_Unit_Name
7389 and then Is_Child_Unit (Id))
7390 then
7391 P := Parent (P);
7392 else
7393 return P;
7394 end if;
7395 end loop;
7396 end Declaration_Node;
7397
7398 ---------------------
7399 -- Designated_Type --
7400 ---------------------
7401
7402 function Designated_Type (Id : E) return E is
7403 Desig_Type : Entity_Id;
7404
7405 begin
7406 Desig_Type := Directly_Designated_Type (Id);
7407
7408 if Is_Incomplete_Type (Desig_Type)
7409 and then Present (Full_View (Desig_Type))
7410 then
7411 return Full_View (Desig_Type);
7412
7413 elsif Is_Class_Wide_Type (Desig_Type)
7414 and then Is_Incomplete_Type (Etype (Desig_Type))
7415 and then Present (Full_View (Etype (Desig_Type)))
7416 and then Present (Class_Wide_Type (Full_View (Etype (Desig_Type))))
7417 then
7418 return Class_Wide_Type (Full_View (Etype (Desig_Type)));
7419
7420 else
7421 return Desig_Type;
7422 end if;
7423 end Designated_Type;
7424
7425 -------------------
7426 -- DIC_Procedure --
7427 -------------------
7428
7429 function DIC_Procedure (Id : E) return E is
7430 Subp_Elmt : Elmt_Id;
7431 Subp_Id : Entity_Id;
7432 Subps : Elist_Id;
7433
7434 begin
7435 pragma Assert (Is_Type (Id));
7436
7437 Subps := Subprograms_For_Type (Base_Type (Id));
7438
7439 if Present (Subps) then
7440 Subp_Elmt := First_Elmt (Subps);
7441 while Present (Subp_Elmt) loop
7442 Subp_Id := Node (Subp_Elmt);
7443
7444 -- Currently the flag Is_DIC_Procedure is set for both normal DIC
7445 -- check procedures as well as for partial DIC check procedures,
7446 -- and we don't have a flag for the partial procedures.
7447
7448 if Is_DIC_Procedure (Subp_Id)
7449 and then not Is_Partial_DIC_Procedure (Subp_Id)
7450 then
7451 return Subp_Id;
7452 end if;
7453
7454 Next_Elmt (Subp_Elmt);
7455 end loop;
7456 end if;
7457
7458 return Empty;
7459 end DIC_Procedure;
7460
7461 ----------------------
7462 -- Entry_Index_Type --
7463 ----------------------
7464
7465 function Entry_Index_Type (Id : E) return N is
7466 begin
7467 pragma Assert (Ekind (Id) = E_Entry_Family);
7468 return Etype (Discrete_Subtype_Definition (Parent (Id)));
7469 end Entry_Index_Type;
7470
7471 ---------------------
7472 -- First_Component --
7473 ---------------------
7474
7475 function First_Component (Id : E) return E is
7476 Comp_Id : Entity_Id;
7477
7478 begin
7479 pragma Assert
7480 (Is_Concurrent_Type (Id)
7481 or else Is_Incomplete_Or_Private_Type (Id)
7482 or else Is_Record_Type (Id));
7483
7484 Comp_Id := First_Entity (Id);
7485 while Present (Comp_Id) loop
7486 exit when Ekind (Comp_Id) = E_Component;
7487 Next_Entity (Comp_Id);
7488 end loop;
7489
7490 return Comp_Id;
7491 end First_Component;
7492
7493 -------------------------------------
7494 -- First_Component_Or_Discriminant --
7495 -------------------------------------
7496
7497 function First_Component_Or_Discriminant (Id : E) return E is
7498 Comp_Id : Entity_Id;
7499
7500 begin
7501 pragma Assert
7502 (Is_Concurrent_Type (Id)
7503 or else Is_Incomplete_Or_Private_Type (Id)
7504 or else Is_Record_Type (Id)
7505 or else Has_Discriminants (Id));
7506
7507 Comp_Id := First_Entity (Id);
7508 while Present (Comp_Id) loop
7509 exit when Ekind (Comp_Id) in E_Component | E_Discriminant;
7510 Next_Entity (Comp_Id);
7511 end loop;
7512
7513 return Comp_Id;
7514 end First_Component_Or_Discriminant;
7515
7516 ------------------
7517 -- First_Formal --
7518 ------------------
7519
7520 function First_Formal (Id : E) return E is
7521 Formal : Entity_Id;
7522
7523 begin
7524 pragma Assert
7525 (Is_Generic_Subprogram (Id)
7526 or else Is_Overloadable (Id)
7527 or else Ekind (Id) in E_Entry_Family
7528 | E_Subprogram_Body
7529 | E_Subprogram_Type);
7530
7531 if Ekind (Id) = E_Enumeration_Literal then
7532 return Empty;
7533
7534 else
7535 Formal := First_Entity (Id);
7536
7537 -- Deal with the common, non-generic case first
7538
7539 if No (Formal) or else Is_Formal (Formal) then
7540 return Formal;
7541 end if;
7542
7543 -- The first/next entity chain of a generic subprogram contains all
7544 -- generic formal parameters, followed by the formal parameters.
7545
7546 if Is_Generic_Subprogram (Id) then
7547 while Present (Formal) and then not Is_Formal (Formal) loop
7548 Next_Entity (Formal);
7549 end loop;
7550 return Formal;
7551 else
7552 return Empty;
7553 end if;
7554 end if;
7555 end First_Formal;
7556
7557 ------------------------------
7558 -- First_Formal_With_Extras --
7559 ------------------------------
7560
7561 function First_Formal_With_Extras (Id : E) return E is
7562 Formal : Entity_Id;
7563
7564 begin
7565 pragma Assert
7566 (Is_Generic_Subprogram (Id)
7567 or else Is_Overloadable (Id)
7568 or else Ekind (Id) in E_Entry_Family
7569 | E_Subprogram_Body
7570 | E_Subprogram_Type);
7571
7572 if Ekind (Id) = E_Enumeration_Literal then
7573 return Empty;
7574
7575 else
7576 Formal := First_Entity (Id);
7577
7578 -- The first/next entity chain of a generic subprogram contains all
7579 -- generic formal parameters, followed by the formal parameters. Go
7580 -- directly to the parameters by skipping the formal part.
7581
7582 if Is_Generic_Subprogram (Id) then
7583 while Present (Formal) and then not Is_Formal (Formal) loop
7584 Next_Entity (Formal);
7585 end loop;
7586 end if;
7587
7588 if Present (Formal) and then Is_Formal (Formal) then
7589 return Formal;
7590 else
7591 return Extra_Formals (Id); -- Empty if no extra formals
7592 end if;
7593 end if;
7594 end First_Formal_With_Extras;
7595
7596 -------------------------------------
7597 -- Get_Attribute_Definition_Clause --
7598 -------------------------------------
7599
7600 function Get_Attribute_Definition_Clause
7601 (E : Entity_Id;
7602 Id : Attribute_Id) return Node_Id
7603 is
7604 N : Node_Id;
7605
7606 begin
7607 N := First_Rep_Item (E);
7608 while Present (N) loop
7609 if Nkind (N) = N_Attribute_Definition_Clause
7610 and then Get_Attribute_Id (Chars (N)) = Id
7611 then
7612 return N;
7613 else
7614 Next_Rep_Item (N);
7615 end if;
7616 end loop;
7617
7618 return Empty;
7619 end Get_Attribute_Definition_Clause;
7620
7621 ---------------------------
7622 -- Get_Class_Wide_Pragma --
7623 ---------------------------
7624
7625 function Get_Class_Wide_Pragma
7626 (E : Entity_Id;
7627 Id : Pragma_Id) return Node_Id
7628 is
7629 Item : Node_Id;
7630 Items : Node_Id;
7631
7632 begin
7633 Items := Contract (E);
7634
7635 if No (Items) then
7636 return Empty;
7637 end if;
7638
7639 Item := Pre_Post_Conditions (Items);
7640 while Present (Item) loop
7641 if Nkind (Item) = N_Pragma
7642 and then Get_Pragma_Id (Pragma_Name_Unmapped (Item)) = Id
7643 and then Class_Present (Item)
7644 then
7645 return Item;
7646 end if;
7647
7648 Item := Next_Pragma (Item);
7649 end loop;
7650
7651 return Empty;
7652 end Get_Class_Wide_Pragma;
7653
7654 -------------------
7655 -- Get_Full_View --
7656 -------------------
7657
7658 function Get_Full_View (T : Entity_Id) return Entity_Id is
7659 begin
7660 if Is_Incomplete_Type (T) and then Present (Full_View (T)) then
7661 return Full_View (T);
7662
7663 elsif Is_Class_Wide_Type (T)
7664 and then Is_Incomplete_Type (Root_Type (T))
7665 and then Present (Full_View (Root_Type (T)))
7666 then
7667 return Class_Wide_Type (Full_View (Root_Type (T)));
7668
7669 else
7670 return T;
7671 end if;
7672 end Get_Full_View;
7673
7674 ----------------
7675 -- Get_Pragma --
7676 ----------------
7677
7678 function Get_Pragma (E : Entity_Id; Id : Pragma_Id) return Node_Id is
7679
7680 -- Classification pragmas
7681
7682 Is_CLS : constant Boolean :=
7683 Id = Pragma_Abstract_State or else
7684 Id = Pragma_Attach_Handler or else
7685 Id = Pragma_Async_Readers or else
7686 Id = Pragma_Async_Writers or else
7687 Id = Pragma_Constant_After_Elaboration or else
7688 Id = Pragma_Depends or else
7689 Id = Pragma_Effective_Reads or else
7690 Id = Pragma_Effective_Writes or else
7691 Id = Pragma_Extensions_Visible or else
7692 Id = Pragma_Global or else
7693 Id = Pragma_Initial_Condition or else
7694 Id = Pragma_Initializes or else
7695 Id = Pragma_Interrupt_Handler or else
7696 Id = Pragma_No_Caching or else
7697 Id = Pragma_Part_Of or else
7698 Id = Pragma_Refined_Depends or else
7699 Id = Pragma_Refined_Global or else
7700 Id = Pragma_Refined_State or else
7701 Id = Pragma_Volatile_Function;
7702
7703 -- Contract / subprogram variant / test case pragmas
7704
7705 Is_CTC : constant Boolean :=
7706 Id = Pragma_Contract_Cases or else
7707 Id = Pragma_Subprogram_Variant or else
7708 Id = Pragma_Test_Case;
7709
7710 -- Pre / postcondition pragmas
7711
7712 Is_PPC : constant Boolean :=
7713 Id = Pragma_Precondition or else
7714 Id = Pragma_Postcondition or else
7715 Id = Pragma_Refined_Post;
7716
7717 In_Contract : constant Boolean := Is_CLS or Is_CTC or Is_PPC;
7718
7719 Item : Node_Id;
7720 Items : Node_Id;
7721
7722 begin
7723 -- Handle pragmas that appear in N_Contract nodes. Those have to be
7724 -- extracted from their specialized list.
7725
7726 if In_Contract then
7727 Items := Contract (E);
7728
7729 if No (Items) then
7730 return Empty;
7731
7732 elsif Is_CLS then
7733 Item := Classifications (Items);
7734
7735 elsif Is_CTC then
7736 Item := Contract_Test_Cases (Items);
7737
7738 else
7739 Item := Pre_Post_Conditions (Items);
7740 end if;
7741
7742 -- Regular pragmas
7743
7744 else
7745 Item := First_Rep_Item (E);
7746 end if;
7747
7748 while Present (Item) loop
7749 if Nkind (Item) = N_Pragma
7750 and then Get_Pragma_Id (Pragma_Name_Unmapped (Item)) = Id
7751 then
7752 return Item;
7753
7754 -- All nodes in N_Contract are chained using Next_Pragma
7755
7756 elsif In_Contract then
7757 Item := Next_Pragma (Item);
7758
7759 -- Regular pragmas
7760
7761 else
7762 Next_Rep_Item (Item);
7763 end if;
7764 end loop;
7765
7766 return Empty;
7767 end Get_Pragma;
7768
7769 --------------------------------------
7770 -- Get_Record_Representation_Clause --
7771 --------------------------------------
7772
7773 function Get_Record_Representation_Clause (E : Entity_Id) return Node_Id is
7774 N : Node_Id;
7775
7776 begin
7777 N := First_Rep_Item (E);
7778 while Present (N) loop
7779 if Nkind (N) = N_Record_Representation_Clause then
7780 return N;
7781 end if;
7782
7783 Next_Rep_Item (N);
7784 end loop;
7785
7786 return Empty;
7787 end Get_Record_Representation_Clause;
7788
7789 ------------------------
7790 -- Has_Attach_Handler --
7791 ------------------------
7792
7793 function Has_Attach_Handler (Id : E) return B is
7794 Ritem : Node_Id;
7795
7796 begin
7797 pragma Assert (Is_Protected_Type (Id));
7798
7799 Ritem := First_Rep_Item (Id);
7800 while Present (Ritem) loop
7801 if Nkind (Ritem) = N_Pragma
7802 and then Pragma_Name (Ritem) = Name_Attach_Handler
7803 then
7804 return True;
7805 else
7806 Next_Rep_Item (Ritem);
7807 end if;
7808 end loop;
7809
7810 return False;
7811 end Has_Attach_Handler;
7812
7813 -------------
7814 -- Has_DIC --
7815 -------------
7816
7817 function Has_DIC (Id : E) return B is
7818 begin
7819 return Has_Own_DIC (Id) or else Has_Inherited_DIC (Id);
7820 end Has_DIC;
7821
7822 -----------------
7823 -- Has_Entries --
7824 -----------------
7825
7826 function Has_Entries (Id : E) return B is
7827 Ent : Entity_Id;
7828
7829 begin
7830 pragma Assert (Is_Concurrent_Type (Id));
7831
7832 Ent := First_Entity (Id);
7833 while Present (Ent) loop
7834 if Is_Entry (Ent) then
7835 return True;
7836 end if;
7837
7838 Next_Entity (Ent);
7839 end loop;
7840
7841 return False;
7842 end Has_Entries;
7843
7844 ----------------------------
7845 -- Has_Foreign_Convention --
7846 ----------------------------
7847
7848 function Has_Foreign_Convention (Id : E) return B is
7849 begin
7850 -- While regular Intrinsics such as the Standard operators fit in the
7851 -- "Ada" convention, those with an Interface_Name materialize GCC
7852 -- builtin imports for which Ada special treatments shouldn't apply.
7853
7854 return Convention (Id) in Foreign_Convention
7855 or else (Convention (Id) = Convention_Intrinsic
7856 and then Present (Interface_Name (Id)));
7857 end Has_Foreign_Convention;
7858
7859 ---------------------------
7860 -- Has_Interrupt_Handler --
7861 ---------------------------
7862
7863 function Has_Interrupt_Handler (Id : E) return B is
7864 Ritem : Node_Id;
7865
7866 begin
7867 pragma Assert (Is_Protected_Type (Id));
7868
7869 Ritem := First_Rep_Item (Id);
7870 while Present (Ritem) loop
7871 if Nkind (Ritem) = N_Pragma
7872 and then Pragma_Name (Ritem) = Name_Interrupt_Handler
7873 then
7874 return True;
7875 else
7876 Next_Rep_Item (Ritem);
7877 end if;
7878 end loop;
7879
7880 return False;
7881 end Has_Interrupt_Handler;
7882
7883 --------------------
7884 -- Has_Invariants --
7885 --------------------
7886
7887 function Has_Invariants (Id : E) return B is
7888 begin
7889 return Has_Own_Invariants (Id) or else Has_Inherited_Invariants (Id);
7890 end Has_Invariants;
7891
7892 --------------------------
7893 -- Has_Limited_View --
7894 --------------------------
7895
7896 function Has_Limited_View (Id : E) return B is
7897 begin
7898 return Ekind (Id) = E_Package
7899 and then not Is_Generic_Instance (Id)
7900 and then Present (Limited_View (Id));
7901 end Has_Limited_View;
7902
7903 --------------------------
7904 -- Has_Non_Limited_View --
7905 --------------------------
7906
7907 function Has_Non_Limited_View (Id : E) return B is
7908 begin
7909 return (Ekind (Id) in Incomplete_Kind
7910 or else Ekind (Id) in Class_Wide_Kind
7911 or else Ekind (Id) = E_Abstract_State)
7912 and then Present (Non_Limited_View (Id));
7913 end Has_Non_Limited_View;
7914
7915 ---------------------------------
7916 -- Has_Non_Null_Abstract_State --
7917 ---------------------------------
7918
7919 function Has_Non_Null_Abstract_State (Id : E) return B is
7920 begin
7921 pragma Assert (Is_Package_Or_Generic_Package (Id));
7922
7923 return
7924 Present (Abstract_States (Id))
7925 and then
7926 not Is_Null_State (Node (First_Elmt (Abstract_States (Id))));
7927 end Has_Non_Null_Abstract_State;
7928
7929 -------------------------------------
7930 -- Has_Non_Null_Visible_Refinement --
7931 -------------------------------------
7932
7933 function Has_Non_Null_Visible_Refinement (Id : E) return B is
7934 Constits : Elist_Id;
7935
7936 begin
7937 -- "Refinement" is a concept applicable only to abstract states
7938
7939 pragma Assert (Ekind (Id) = E_Abstract_State);
7940 Constits := Refinement_Constituents (Id);
7941
7942 -- A partial refinement is always non-null. For a full refinement to be
7943 -- non-null, the first constituent must be anything other than null.
7944
7945 return
7946 Has_Partial_Visible_Refinement (Id)
7947 or else (Has_Visible_Refinement (Id)
7948 and then Present (Constits)
7949 and then Nkind (Node (First_Elmt (Constits))) /= N_Null);
7950 end Has_Non_Null_Visible_Refinement;
7951
7952 -----------------------------
7953 -- Has_Null_Abstract_State --
7954 -----------------------------
7955
7956 function Has_Null_Abstract_State (Id : E) return B is
7957 pragma Assert (Is_Package_Or_Generic_Package (Id));
7958
7959 States : constant Elist_Id := Abstract_States (Id);
7960
7961 begin
7962 -- Check first available state of related package. A null abstract
7963 -- state always appears as the sole element of the state list.
7964
7965 return
7966 Present (States)
7967 and then Is_Null_State (Node (First_Elmt (States)));
7968 end Has_Null_Abstract_State;
7969
7970 ---------------------------------
7971 -- Has_Null_Visible_Refinement --
7972 ---------------------------------
7973
7974 function Has_Null_Visible_Refinement (Id : E) return B is
7975 Constits : Elist_Id;
7976
7977 begin
7978 -- "Refinement" is a concept applicable only to abstract states
7979
7980 pragma Assert (Ekind (Id) = E_Abstract_State);
7981 Constits := Refinement_Constituents (Id);
7982
7983 -- For a refinement to be null, the state's sole constituent must be a
7984 -- null.
7985
7986 return
7987 Has_Visible_Refinement (Id)
7988 and then Present (Constits)
7989 and then Nkind (Node (First_Elmt (Constits))) = N_Null;
7990 end Has_Null_Visible_Refinement;
7991
7992 --------------------
7993 -- Has_Unmodified --
7994 --------------------
7995
7996 function Has_Unmodified (E : Entity_Id) return Boolean is
7997 begin
7998 if Has_Pragma_Unmodified (E) then
7999 return True;
8000 elsif Warnings_Off (E) then
8001 Set_Warnings_Off_Used_Unmodified (E);
8002 return True;
8003 else
8004 return False;
8005 end if;
8006 end Has_Unmodified;
8007
8008 ---------------------
8009 -- Has_Unreferenced --
8010 ---------------------
8011
8012 function Has_Unreferenced (E : Entity_Id) return Boolean is
8013 begin
8014 if Has_Pragma_Unreferenced (E) then
8015 return True;
8016 elsif Warnings_Off (E) then
8017 Set_Warnings_Off_Used_Unreferenced (E);
8018 return True;
8019 else
8020 return False;
8021 end if;
8022 end Has_Unreferenced;
8023
8024 ----------------------
8025 -- Has_Warnings_Off --
8026 ----------------------
8027
8028 function Has_Warnings_Off (E : Entity_Id) return Boolean is
8029 begin
8030 if Warnings_Off (E) then
8031 Set_Warnings_Off_Used (E);
8032 return True;
8033 else
8034 return False;
8035 end if;
8036 end Has_Warnings_Off;
8037
8038 ------------------------------
8039 -- Implementation_Base_Type --
8040 ------------------------------
8041
8042 function Implementation_Base_Type (Id : E) return E is
8043 Bastyp : Entity_Id;
8044 Imptyp : Entity_Id;
8045
8046 begin
8047 Bastyp := Base_Type (Id);
8048
8049 if Is_Incomplete_Or_Private_Type (Bastyp) then
8050 Imptyp := Underlying_Type (Bastyp);
8051
8052 -- If we have an implementation type, then just return it,
8053 -- otherwise we return the Base_Type anyway. This can only
8054 -- happen in error situations and should avoid some error bombs.
8055
8056 if Present (Imptyp) then
8057 return Base_Type (Imptyp);
8058 else
8059 return Bastyp;
8060 end if;
8061
8062 else
8063 return Bastyp;
8064 end if;
8065 end Implementation_Base_Type;
8066
8067 -------------------------
8068 -- Invariant_Procedure --
8069 -------------------------
8070
8071 function Invariant_Procedure (Id : E) return E is
8072 Subp_Elmt : Elmt_Id;
8073 Subp_Id : Entity_Id;
8074 Subps : Elist_Id;
8075
8076 begin
8077 pragma Assert (Is_Type (Id));
8078
8079 Subps := Subprograms_For_Type (Base_Type (Id));
8080
8081 if Present (Subps) then
8082 Subp_Elmt := First_Elmt (Subps);
8083 while Present (Subp_Elmt) loop
8084 Subp_Id := Node (Subp_Elmt);
8085
8086 if Is_Invariant_Procedure (Subp_Id) then
8087 return Subp_Id;
8088 end if;
8089
8090 Next_Elmt (Subp_Elmt);
8091 end loop;
8092 end if;
8093
8094 return Empty;
8095 end Invariant_Procedure;
8096
8097 ------------------
8098 -- Is_Base_Type --
8099 ------------------
8100
8101 -- Global flag table allowing rapid computation of this function
8102
8103 Entity_Is_Base_Type : constant array (Entity_Kind) of Boolean :=
8104 (E_Enumeration_Subtype |
8105 E_Incomplete_Subtype |
8106 E_Signed_Integer_Subtype |
8107 E_Modular_Integer_Subtype |
8108 E_Floating_Point_Subtype |
8109 E_Ordinary_Fixed_Point_Subtype |
8110 E_Decimal_Fixed_Point_Subtype |
8111 E_Array_Subtype |
8112 E_Record_Subtype |
8113 E_Private_Subtype |
8114 E_Record_Subtype_With_Private |
8115 E_Limited_Private_Subtype |
8116 E_Access_Subtype |
8117 E_Protected_Subtype |
8118 E_Task_Subtype |
8119 E_String_Literal_Subtype |
8120 E_Class_Wide_Subtype => False,
8121 others => True);
8122
8123 function Is_Base_Type (Id : E) return Boolean is
8124 begin
8125 return Entity_Is_Base_Type (Ekind (Id));
8126 end Is_Base_Type;
8127
8128 ---------------------
8129 -- Is_Boolean_Type --
8130 ---------------------
8131
8132 function Is_Boolean_Type (Id : E) return B is
8133 begin
8134 return Root_Type (Id) = Standard_Boolean;
8135 end Is_Boolean_Type;
8136
8137 ------------------------
8138 -- Is_Constant_Object --
8139 ------------------------
8140
8141 function Is_Constant_Object (Id : E) return B is
8142 begin
8143 return Ekind (Id) in E_Constant | E_In_Parameter | E_Loop_Parameter;
8144 end Is_Constant_Object;
8145
8146 -------------------
8147 -- Is_Controlled --
8148 -------------------
8149
8150 function Is_Controlled (Id : E) return B is
8151 begin
8152 return Is_Controlled_Active (Id) and then not Disable_Controlled (Id);
8153 end Is_Controlled;
8154
8155 --------------------
8156 -- Is_Discriminal --
8157 --------------------
8158
8159 function Is_Discriminal (Id : E) return B is
8160 begin
8161 return Ekind (Id) in E_Constant | E_In_Parameter
8162 and then Present (Discriminal_Link (Id));
8163 end Is_Discriminal;
8164
8165 ----------------------
8166 -- Is_Dynamic_Scope --
8167 ----------------------
8168
8169 function Is_Dynamic_Scope (Id : E) return B is
8170 begin
8171 return
8172 Ekind (Id) = E_Block
8173 or else
8174 Ekind (Id) = E_Function
8175 or else
8176 Ekind (Id) = E_Procedure
8177 or else
8178 Ekind (Id) = E_Subprogram_Body
8179 or else
8180 Ekind (Id) = E_Task_Type
8181 or else
8182 (Ekind (Id) = E_Limited_Private_Type
8183 and then Present (Full_View (Id))
8184 and then Ekind (Full_View (Id)) = E_Task_Type)
8185 or else
8186 Ekind (Id) = E_Entry
8187 or else
8188 Ekind (Id) = E_Entry_Family
8189 or else
8190 Ekind (Id) = E_Return_Statement;
8191 end Is_Dynamic_Scope;
8192
8193 --------------------
8194 -- Is_Entity_Name --
8195 --------------------
8196
8197 function Is_Entity_Name (N : Node_Id) return Boolean is
8198 Kind : constant Node_Kind := Nkind (N);
8199
8200 begin
8201 -- Identifiers, operator symbols, expanded names are entity names
8202
8203 return Kind in N_Identifier | N_Operator_Symbol | N_Expanded_Name
8204
8205 -- Attribute references are entity names if they refer to an entity.
8206 -- Note that we don't do this by testing for the presence of the
8207 -- Entity field in the N_Attribute_Reference node, since it may not
8208 -- have been set yet.
8209
8210 or else (Kind = N_Attribute_Reference
8211 and then Is_Entity_Attribute_Name (Attribute_Name (N)));
8212 end Is_Entity_Name;
8213
8214 ---------------------------
8215 -- Is_Elaboration_Target --
8216 ---------------------------
8217
8218 function Is_Elaboration_Target (Id : Entity_Id) return Boolean is
8219 begin
8220 return
8221 Ekind (Id) in E_Constant | E_Package | E_Variable
8222 or else Is_Generic_Unit (Id)
8223 or else Is_Subprogram_Or_Entry (Id)
8224 or else Is_Task_Type (Id);
8225 end Is_Elaboration_Target;
8226
8227 -----------------------
8228 -- Is_External_State --
8229 -----------------------
8230
8231 function Is_External_State (Id : E) return B is
8232 begin
8233 -- To qualify, the abstract state must appear with option "external" or
8234 -- "synchronous" (SPARK RM 7.1.4(7) and (9)).
8235
8236 return
8237 Ekind (Id) = E_Abstract_State
8238 and then (Has_Option (Id, Name_External)
8239 or else
8240 Has_Option (Id, Name_Synchronous));
8241 end Is_External_State;
8242
8243 ------------------
8244 -- Is_Finalizer --
8245 ------------------
8246
8247 function Is_Finalizer (Id : E) return B is
8248 begin
8249 return Ekind (Id) = E_Procedure and then Chars (Id) = Name_uFinalizer;
8250 end Is_Finalizer;
8251
8252 ----------------------
8253 -- Is_Full_Access --
8254 ----------------------
8255
8256 function Is_Full_Access (Id : E) return B is
8257 begin
8258 return Is_Atomic (Id) or else Is_Volatile_Full_Access (Id);
8259 end Is_Full_Access;
8260
8261 -------------------
8262 -- Is_Null_State --
8263 -------------------
8264
8265 function Is_Null_State (Id : E) return B is
8266 begin
8267 return
8268 Ekind (Id) = E_Abstract_State and then Nkind (Parent (Id)) = N_Null;
8269 end Is_Null_State;
8270
8271 -----------------------------------
8272 -- Is_Package_Or_Generic_Package --
8273 -----------------------------------
8274
8275 function Is_Package_Or_Generic_Package (Id : E) return B is
8276 begin
8277 return Ekind (Id) in E_Generic_Package | E_Package;
8278 end Is_Package_Or_Generic_Package;
8279
8280 ---------------------
8281 -- Is_Packed_Array --
8282 ---------------------
8283
8284 function Is_Packed_Array (Id : E) return B is
8285 begin
8286 return Is_Array_Type (Id) and then Is_Packed (Id);
8287 end Is_Packed_Array;
8288
8289 ---------------
8290 -- Is_Prival --
8291 ---------------
8292
8293 function Is_Prival (Id : E) return B is
8294 begin
8295 return Ekind (Id) in E_Constant | E_Variable
8296 and then Present (Prival_Link (Id));
8297 end Is_Prival;
8298
8299 ----------------------------
8300 -- Is_Protected_Component --
8301 ----------------------------
8302
8303 function Is_Protected_Component (Id : E) return B is
8304 begin
8305 return Ekind (Id) = E_Component and then Is_Protected_Type (Scope (Id));
8306 end Is_Protected_Component;
8307
8308 ----------------------------
8309 -- Is_Protected_Interface --
8310 ----------------------------
8311
8312 function Is_Protected_Interface (Id : E) return B is
8313 Typ : constant Entity_Id := Base_Type (Id);
8314 begin
8315 if not Is_Interface (Typ) then
8316 return False;
8317 elsif Is_Class_Wide_Type (Typ) then
8318 return Is_Protected_Interface (Etype (Typ));
8319 else
8320 return Protected_Present (Type_Definition (Parent (Typ)));
8321 end if;
8322 end Is_Protected_Interface;
8323
8324 ------------------------------
8325 -- Is_Protected_Record_Type --
8326 ------------------------------
8327
8328 function Is_Protected_Record_Type (Id : E) return B is
8329 begin
8330 return
8331 Is_Concurrent_Record_Type (Id)
8332 and then Is_Protected_Type (Corresponding_Concurrent_Type (Id));
8333 end Is_Protected_Record_Type;
8334
8335 -------------------------------------
8336 -- Is_Relaxed_Initialization_State --
8337 -------------------------------------
8338
8339 function Is_Relaxed_Initialization_State (Id : E) return B is
8340 begin
8341 -- To qualify, the abstract state must appear with simple option
8342 -- "Relaxed_Initialization" (SPARK RM 6.10).
8343
8344 return
8345 Ekind (Id) = E_Abstract_State
8346 and then Has_Option (Id, Name_Relaxed_Initialization);
8347 end Is_Relaxed_Initialization_State;
8348
8349 --------------------------------
8350 -- Is_Standard_Character_Type --
8351 --------------------------------
8352
8353 function Is_Standard_Character_Type (Id : E) return B is
8354 begin
8355 return Is_Type (Id)
8356 and then Root_Type (Id) in Standard_Character
8357 | Standard_Wide_Character
8358 | Standard_Wide_Wide_Character;
8359 end Is_Standard_Character_Type;
8360
8361 -----------------------------
8362 -- Is_Standard_String_Type --
8363 -----------------------------
8364
8365 function Is_Standard_String_Type (Id : E) return B is
8366 begin
8367 return Is_Type (Id)
8368 and then Root_Type (Id) in Standard_String
8369 | Standard_Wide_String
8370 | Standard_Wide_Wide_String;
8371 end Is_Standard_String_Type;
8372
8373 --------------------
8374 -- Is_String_Type --
8375 --------------------
8376
8377 function Is_String_Type (Id : E) return B is
8378 begin
8379 return Is_Array_Type (Id)
8380 and then Id /= Any_Composite
8381 and then Number_Dimensions (Id) = 1
8382 and then Is_Character_Type (Component_Type (Id));
8383 end Is_String_Type;
8384
8385 -------------------------------
8386 -- Is_Synchronized_Interface --
8387 -------------------------------
8388
8389 function Is_Synchronized_Interface (Id : E) return B is
8390 Typ : constant Entity_Id := Base_Type (Id);
8391
8392 begin
8393 if not Is_Interface (Typ) then
8394 return False;
8395
8396 elsif Is_Class_Wide_Type (Typ) then
8397 return Is_Synchronized_Interface (Etype (Typ));
8398
8399 else
8400 return Protected_Present (Type_Definition (Parent (Typ)))
8401 or else Synchronized_Present (Type_Definition (Parent (Typ)))
8402 or else Task_Present (Type_Definition (Parent (Typ)));
8403 end if;
8404 end Is_Synchronized_Interface;
8405
8406 ---------------------------
8407 -- Is_Synchronized_State --
8408 ---------------------------
8409
8410 function Is_Synchronized_State (Id : E) return B is
8411 begin
8412 -- To qualify, the abstract state must appear with simple option
8413 -- "synchronous" (SPARK RM 7.1.4(9)).
8414
8415 return
8416 Ekind (Id) = E_Abstract_State
8417 and then Has_Option (Id, Name_Synchronous);
8418 end Is_Synchronized_State;
8419
8420 -----------------------
8421 -- Is_Task_Interface --
8422 -----------------------
8423
8424 function Is_Task_Interface (Id : E) return B is
8425 Typ : constant Entity_Id := Base_Type (Id);
8426 begin
8427 if not Is_Interface (Typ) then
8428 return False;
8429 elsif Is_Class_Wide_Type (Typ) then
8430 return Is_Task_Interface (Etype (Typ));
8431 else
8432 return Task_Present (Type_Definition (Parent (Typ)));
8433 end if;
8434 end Is_Task_Interface;
8435
8436 -------------------------
8437 -- Is_Task_Record_Type --
8438 -------------------------
8439
8440 function Is_Task_Record_Type (Id : E) return B is
8441 begin
8442 return
8443 Is_Concurrent_Record_Type (Id)
8444 and then Is_Task_Type (Corresponding_Concurrent_Type (Id));
8445 end Is_Task_Record_Type;
8446
8447 ------------------------
8448 -- Is_Wrapper_Package --
8449 ------------------------
8450
8451 function Is_Wrapper_Package (Id : E) return B is
8452 begin
8453 return Ekind (Id) = E_Package and then Present (Related_Instance (Id));
8454 end Is_Wrapper_Package;
8455
8456 -----------------
8457 -- Last_Formal --
8458 -----------------
8459
8460 function Last_Formal (Id : E) return E is
8461 Formal : Entity_Id;
8462
8463 begin
8464 pragma Assert
8465 (Is_Overloadable (Id)
8466 or else Ekind (Id) in E_Entry_Family
8467 | E_Subprogram_Body
8468 | E_Subprogram_Type);
8469
8470 if Ekind (Id) = E_Enumeration_Literal then
8471 return Empty;
8472
8473 else
8474 Formal := First_Formal (Id);
8475
8476 if Present (Formal) then
8477 while Present (Next_Formal (Formal)) loop
8478 Next_Formal (Formal);
8479 end loop;
8480 end if;
8481
8482 return Formal;
8483 end if;
8484 end Last_Formal;
8485
8486 -------------------
8487 -- Link_Entities --
8488 -------------------
8489
8490 procedure Link_Entities (First : Entity_Id; Second : Node_Id) is
8491 begin
8492 if Present (Second) then
8493 Set_Prev_Entity (Second, First); -- First <-- Second
8494 end if;
8495
8496 Set_Next_Entity (First, Second); -- First --> Second
8497 end Link_Entities;
8498
8499 ------------------------
8500 -- Machine_Emax_Value --
8501 ------------------------
8502
8503 function Machine_Emax_Value (Id : E) return Uint is
8504 Digs : constant Pos := UI_To_Int (Digits_Value (Base_Type (Id)));
8505
8506 begin
8507 case Float_Rep (Id) is
8508 when IEEE_Binary =>
8509 case Digs is
8510 when 1 .. 6 => return Uint_128;
8511 when 7 .. 15 => return 2**10;
8512 when 16 .. 33 => return 2**14;
8513 when others => return No_Uint;
8514 end case;
8515
8516 when AAMP =>
8517 return Uint_2 ** Uint_7 - Uint_1;
8518 end case;
8519 end Machine_Emax_Value;
8520
8521 ------------------------
8522 -- Machine_Emin_Value --
8523 ------------------------
8524
8525 function Machine_Emin_Value (Id : E) return Uint is
8526 begin
8527 case Float_Rep (Id) is
8528 when IEEE_Binary => return Uint_3 - Machine_Emax_Value (Id);
8529 when AAMP => return -Machine_Emax_Value (Id);
8530 end case;
8531 end Machine_Emin_Value;
8532
8533 ----------------------------
8534 -- Machine_Mantissa_Value --
8535 ----------------------------
8536
8537 function Machine_Mantissa_Value (Id : E) return Uint is
8538 Digs : constant Pos := UI_To_Int (Digits_Value (Base_Type (Id)));
8539
8540 begin
8541 case Float_Rep (Id) is
8542 when IEEE_Binary =>
8543 case Digs is
8544 when 1 .. 6 => return Uint_24;
8545 when 7 .. 15 => return UI_From_Int (53);
8546 when 16 .. 18 => return Uint_64;
8547 when 19 .. 33 => return UI_From_Int (113);
8548 when others => return No_Uint;
8549 end case;
8550
8551 when AAMP =>
8552 case Digs is
8553 when 1 .. 6 => return Uint_24;
8554 when 7 .. 9 => return UI_From_Int (40);
8555 when others => return No_Uint;
8556 end case;
8557 end case;
8558 end Machine_Mantissa_Value;
8559
8560 -------------------------
8561 -- Machine_Radix_Value --
8562 -------------------------
8563
8564 function Machine_Radix_Value (Id : E) return U is
8565 begin
8566 case Float_Rep (Id) is
8567 when AAMP
8568 | IEEE_Binary
8569 =>
8570 return Uint_2;
8571 end case;
8572 end Machine_Radix_Value;
8573
8574 ----------------------
8575 -- Model_Emin_Value --
8576 ----------------------
8577
8578 function Model_Emin_Value (Id : E) return Uint is
8579 begin
8580 return Machine_Emin_Value (Id);
8581 end Model_Emin_Value;
8582
8583 -------------------------
8584 -- Model_Epsilon_Value --
8585 -------------------------
8586
8587 function Model_Epsilon_Value (Id : E) return Ureal is
8588 Radix : constant Ureal := UR_From_Uint (Machine_Radix_Value (Id));
8589 begin
8590 return Radix ** (1 - Model_Mantissa_Value (Id));
8591 end Model_Epsilon_Value;
8592
8593 --------------------------
8594 -- Model_Mantissa_Value --
8595 --------------------------
8596
8597 function Model_Mantissa_Value (Id : E) return Uint is
8598 begin
8599 return Machine_Mantissa_Value (Id);
8600 end Model_Mantissa_Value;
8601
8602 -----------------------
8603 -- Model_Small_Value --
8604 -----------------------
8605
8606 function Model_Small_Value (Id : E) return Ureal is
8607 Radix : constant Ureal := UR_From_Uint (Machine_Radix_Value (Id));
8608 begin
8609 return Radix ** (Model_Emin_Value (Id) - 1);
8610 end Model_Small_Value;
8611
8612 --------------------
8613 -- Next_Component --
8614 --------------------
8615
8616 function Next_Component (Id : E) return E is
8617 Comp_Id : Entity_Id;
8618
8619 begin
8620 Comp_Id := Next_Entity (Id);
8621 while Present (Comp_Id) loop
8622 exit when Ekind (Comp_Id) = E_Component;
8623 Next_Entity (Comp_Id);
8624 end loop;
8625
8626 return Comp_Id;
8627 end Next_Component;
8628
8629 ------------------------------------
8630 -- Next_Component_Or_Discriminant --
8631 ------------------------------------
8632
8633 function Next_Component_Or_Discriminant (Id : E) return E is
8634 Comp_Id : Entity_Id;
8635
8636 begin
8637 Comp_Id := Next_Entity (Id);
8638 while Present (Comp_Id) loop
8639 exit when Ekind (Comp_Id) in E_Component | E_Discriminant;
8640 Next_Entity (Comp_Id);
8641 end loop;
8642
8643 return Comp_Id;
8644 end Next_Component_Or_Discriminant;
8645
8646 -----------------------
8647 -- Next_Discriminant --
8648 -----------------------
8649
8650 -- This function actually implements both Next_Discriminant and
8651 -- Next_Stored_Discriminant by making sure that the Discriminant
8652 -- returned is of the same variety as Id.
8653
8654 function Next_Discriminant (Id : E) return E is
8655
8656 -- Derived Tagged types with private extensions look like this...
8657
8658 -- E_Discriminant d1
8659 -- E_Discriminant d2
8660 -- E_Component _tag
8661 -- E_Discriminant d1
8662 -- E_Discriminant d2
8663 -- ...
8664
8665 -- so it is critical not to go past the leading discriminants
8666
8667 D : E := Id;
8668
8669 begin
8670 pragma Assert (Ekind (Id) = E_Discriminant);
8671
8672 loop
8673 Next_Entity (D);
8674 if No (D)
8675 or else (Ekind (D) /= E_Discriminant
8676 and then not Is_Itype (D))
8677 then
8678 return Empty;
8679 end if;
8680
8681 exit when Ekind (D) = E_Discriminant
8682 and then (Is_Completely_Hidden (D) = Is_Completely_Hidden (Id));
8683 end loop;
8684
8685 return D;
8686 end Next_Discriminant;
8687
8688 -----------------
8689 -- Next_Formal --
8690 -----------------
8691
8692 function Next_Formal (Id : E) return E is
8693 P : Entity_Id;
8694
8695 begin
8696 -- Follow the chain of declared entities as long as the kind of the
8697 -- entity corresponds to a formal parameter. Skip internal entities
8698 -- that may have been created for implicit subtypes, in the process
8699 -- of analyzing default expressions.
8700
8701 P := Id;
8702 loop
8703 Next_Entity (P);
8704
8705 if No (P) or else Is_Formal (P) then
8706 return P;
8707 elsif not Is_Internal (P) then
8708 return Empty;
8709 end if;
8710 end loop;
8711 end Next_Formal;
8712
8713 -----------------------------
8714 -- Next_Formal_With_Extras --
8715 -----------------------------
8716
8717 function Next_Formal_With_Extras (Id : E) return E is
8718 begin
8719 if Present (Extra_Formal (Id)) then
8720 return Extra_Formal (Id);
8721 else
8722 return Next_Formal (Id);
8723 end if;
8724 end Next_Formal_With_Extras;
8725
8726 ----------------
8727 -- Next_Index --
8728 ----------------
8729
8730 function Next_Index (Id : Node_Id) return Node_Id is
8731 begin
8732 return Next (Id);
8733 end Next_Index;
8734
8735 ------------------
8736 -- Next_Literal --
8737 ------------------
8738
8739 function Next_Literal (Id : E) return E is
8740 begin
8741 pragma Assert (Nkind (Id) in N_Entity);
8742 return Next (Id);
8743 end Next_Literal;
8744
8745 ------------------------------
8746 -- Next_Stored_Discriminant --
8747 ------------------------------
8748
8749 function Next_Stored_Discriminant (Id : E) return E is
8750 begin
8751 -- See comment in Next_Discriminant
8752
8753 return Next_Discriminant (Id);
8754 end Next_Stored_Discriminant;
8755
8756 -----------------------
8757 -- Number_Dimensions --
8758 -----------------------
8759
8760 function Number_Dimensions (Id : E) return Pos is
8761 N : Int;
8762 T : Node_Id;
8763
8764 begin
8765 if Ekind (Id) = E_String_Literal_Subtype then
8766 return 1;
8767
8768 else
8769 N := 0;
8770 T := First_Index (Id);
8771 while Present (T) loop
8772 N := N + 1;
8773 Next_Index (T);
8774 end loop;
8775
8776 return N;
8777 end if;
8778 end Number_Dimensions;
8779
8780 --------------------
8781 -- Number_Entries --
8782 --------------------
8783
8784 function Number_Entries (Id : E) return Nat is
8785 N : Int;
8786 Ent : Entity_Id;
8787
8788 begin
8789 pragma Assert (Is_Concurrent_Type (Id));
8790
8791 N := 0;
8792 Ent := First_Entity (Id);
8793 while Present (Ent) loop
8794 if Is_Entry (Ent) then
8795 N := N + 1;
8796 end if;
8797
8798 Next_Entity (Ent);
8799 end loop;
8800
8801 return N;
8802 end Number_Entries;
8803
8804 --------------------
8805 -- Number_Formals --
8806 --------------------
8807
8808 function Number_Formals (Id : E) return Pos is
8809 N : Int;
8810 Formal : Entity_Id;
8811
8812 begin
8813 N := 0;
8814 Formal := First_Formal (Id);
8815 while Present (Formal) loop
8816 N := N + 1;
8817 Next_Formal (Formal);
8818 end loop;
8819
8820 return N;
8821 end Number_Formals;
8822
8823 ------------------------
8824 -- Object_Size_Clause --
8825 ------------------------
8826
8827 function Object_Size_Clause (Id : E) return N is
8828 begin
8829 return Get_Attribute_Definition_Clause (Id, Attribute_Object_Size);
8830 end Object_Size_Clause;
8831
8832 --------------------
8833 -- Parameter_Mode --
8834 --------------------
8835
8836 function Parameter_Mode (Id : E) return Formal_Kind is
8837 begin
8838 return Ekind (Id);
8839 end Parameter_Mode;
8840
8841 ---------------------------
8842 -- Partial_DIC_Procedure --
8843 ---------------------------
8844
8845 function Partial_DIC_Procedure (Id : E) return E is
8846 Subp_Elmt : Elmt_Id;
8847 Subp_Id : Entity_Id;
8848 Subps : Elist_Id;
8849
8850 begin
8851 pragma Assert (Is_Type (Id));
8852
8853 Subps := Subprograms_For_Type (Base_Type (Id));
8854
8855 if Present (Subps) then
8856 Subp_Elmt := First_Elmt (Subps);
8857 while Present (Subp_Elmt) loop
8858 Subp_Id := Node (Subp_Elmt);
8859
8860 if Is_Partial_DIC_Procedure (Subp_Id) then
8861 return Subp_Id;
8862 end if;
8863
8864 Next_Elmt (Subp_Elmt);
8865 end loop;
8866 end if;
8867
8868 return Empty;
8869 end Partial_DIC_Procedure;
8870
8871 ---------------------------------
8872 -- Partial_Invariant_Procedure --
8873 ---------------------------------
8874
8875 function Partial_Invariant_Procedure (Id : E) return E is
8876 Subp_Elmt : Elmt_Id;
8877 Subp_Id : Entity_Id;
8878 Subps : Elist_Id;
8879
8880 begin
8881 pragma Assert (Is_Type (Id));
8882
8883 Subps := Subprograms_For_Type (Base_Type (Id));
8884
8885 if Present (Subps) then
8886 Subp_Elmt := First_Elmt (Subps);
8887 while Present (Subp_Elmt) loop
8888 Subp_Id := Node (Subp_Elmt);
8889
8890 if Is_Partial_Invariant_Procedure (Subp_Id) then
8891 return Subp_Id;
8892 end if;
8893
8894 Next_Elmt (Subp_Elmt);
8895 end loop;
8896 end if;
8897
8898 return Empty;
8899 end Partial_Invariant_Procedure;
8900
8901 -------------------------------------
8902 -- Partial_Refinement_Constituents --
8903 -------------------------------------
8904
8905 function Partial_Refinement_Constituents (Id : E) return L is
8906 Constits : Elist_Id := No_Elist;
8907
8908 procedure Add_Usable_Constituents (Item : E);
8909 -- Add global item Item and/or its constituents to list Constits when
8910 -- they can be used in a global refinement within the current scope. The
8911 -- criteria are:
8912 -- 1) If Item is an abstract state with full refinement visible, add
8913 -- its constituents.
8914 -- 2) If Item is an abstract state with only partial refinement
8915 -- visible, add both Item and its constituents.
8916 -- 3) If Item is an abstract state without a visible refinement, add
8917 -- it.
8918 -- 4) If Id is not an abstract state, add it.
8919
8920 procedure Add_Usable_Constituents (List : Elist_Id);
8921 -- Apply Add_Usable_Constituents to every constituent in List
8922
8923 -----------------------------
8924 -- Add_Usable_Constituents --
8925 -----------------------------
8926
8927 procedure Add_Usable_Constituents (Item : E) is
8928 begin
8929 if Ekind (Item) = E_Abstract_State then
8930 if Has_Visible_Refinement (Item) then
8931 Add_Usable_Constituents (Refinement_Constituents (Item));
8932
8933 elsif Has_Partial_Visible_Refinement (Item) then
8934 Append_New_Elmt (Item, Constits);
8935 Add_Usable_Constituents (Part_Of_Constituents (Item));
8936
8937 else
8938 Append_New_Elmt (Item, Constits);
8939 end if;
8940
8941 else
8942 Append_New_Elmt (Item, Constits);
8943 end if;
8944 end Add_Usable_Constituents;
8945
8946 procedure Add_Usable_Constituents (List : Elist_Id) is
8947 Constit_Elmt : Elmt_Id;
8948 begin
8949 if Present (List) then
8950 Constit_Elmt := First_Elmt (List);
8951 while Present (Constit_Elmt) loop
8952 Add_Usable_Constituents (Node (Constit_Elmt));
8953 Next_Elmt (Constit_Elmt);
8954 end loop;
8955 end if;
8956 end Add_Usable_Constituents;
8957
8958 -- Start of processing for Partial_Refinement_Constituents
8959
8960 begin
8961 -- "Refinement" is a concept applicable only to abstract states
8962
8963 pragma Assert (Ekind (Id) = E_Abstract_State);
8964
8965 if Has_Visible_Refinement (Id) then
8966 Constits := Refinement_Constituents (Id);
8967
8968 -- A refinement may be partially visible when objects declared in the
8969 -- private part of a package are subject to a Part_Of indicator.
8970
8971 elsif Has_Partial_Visible_Refinement (Id) then
8972 Add_Usable_Constituents (Part_Of_Constituents (Id));
8973
8974 -- Function should only be called when full or partial refinement is
8975 -- visible.
8976
8977 else
8978 raise Program_Error;
8979 end if;
8980
8981 return Constits;
8982 end Partial_Refinement_Constituents;
8983
8984 ------------------------
8985 -- Predicate_Function --
8986 ------------------------
8987
8988 function Predicate_Function (Id : E) return E is
8989 Subp_Elmt : Elmt_Id;
8990 Subp_Id : Entity_Id;
8991 Subps : Elist_Id;
8992 Typ : Entity_Id;
8993
8994 begin
8995 pragma Assert (Is_Type (Id));
8996
8997 -- If type is private and has a completion, predicate may be defined on
8998 -- the full view.
8999
9000 if Is_Private_Type (Id)
9001 and then
9002 (not Has_Predicates (Id) or else No (Subprograms_For_Type (Id)))
9003 and then Present (Full_View (Id))
9004 then
9005 Typ := Full_View (Id);
9006
9007 elsif Ekind (Id) in E_Array_Subtype
9008 | E_Record_Subtype
9009 | E_Record_Subtype_With_Private
9010 and then Present (Predicated_Parent (Id))
9011 then
9012 Typ := Predicated_Parent (Id);
9013
9014 else
9015 Typ := Id;
9016 end if;
9017
9018 Subps := Subprograms_For_Type (Typ);
9019
9020 if Present (Subps) then
9021 Subp_Elmt := First_Elmt (Subps);
9022 while Present (Subp_Elmt) loop
9023 Subp_Id := Node (Subp_Elmt);
9024
9025 if Ekind (Subp_Id) = E_Function
9026 and then Is_Predicate_Function (Subp_Id)
9027 then
9028 return Subp_Id;
9029 end if;
9030
9031 Next_Elmt (Subp_Elmt);
9032 end loop;
9033 end if;
9034
9035 return Empty;
9036 end Predicate_Function;
9037
9038 --------------------------
9039 -- Predicate_Function_M --
9040 --------------------------
9041
9042 function Predicate_Function_M (Id : E) return E is
9043 Subp_Elmt : Elmt_Id;
9044 Subp_Id : Entity_Id;
9045 Subps : Elist_Id;
9046 Typ : Entity_Id;
9047
9048 begin
9049 pragma Assert (Is_Type (Id));
9050
9051 -- If type is private and has a completion, predicate may be defined on
9052 -- the full view.
9053
9054 if Is_Private_Type (Id)
9055 and then
9056 (not Has_Predicates (Id) or else No (Subprograms_For_Type (Id)))
9057 and then Present (Full_View (Id))
9058 then
9059 Typ := Full_View (Id);
9060
9061 else
9062 Typ := Id;
9063 end if;
9064
9065 Subps := Subprograms_For_Type (Typ);
9066
9067 if Present (Subps) then
9068 Subp_Elmt := First_Elmt (Subps);
9069 while Present (Subp_Elmt) loop
9070 Subp_Id := Node (Subp_Elmt);
9071
9072 if Ekind (Subp_Id) = E_Function
9073 and then Is_Predicate_Function_M (Subp_Id)
9074 then
9075 return Subp_Id;
9076 end if;
9077
9078 Next_Elmt (Subp_Elmt);
9079 end loop;
9080 end if;
9081
9082 return Empty;
9083 end Predicate_Function_M;
9084
9085 -------------------------
9086 -- Present_In_Rep_Item --
9087 -------------------------
9088
9089 function Present_In_Rep_Item (E : Entity_Id; N : Node_Id) return Boolean is
9090 Ritem : Node_Id;
9091
9092 begin
9093 Ritem := First_Rep_Item (E);
9094
9095 while Present (Ritem) loop
9096 if Ritem = N then
9097 return True;
9098 end if;
9099
9100 Next_Rep_Item (Ritem);
9101 end loop;
9102
9103 return False;
9104 end Present_In_Rep_Item;
9105
9106 --------------------------
9107 -- Primitive_Operations --
9108 --------------------------
9109
9110 function Primitive_Operations (Id : E) return L is
9111 begin
9112 if Is_Concurrent_Type (Id) then
9113 if Present (Corresponding_Record_Type (Id)) then
9114 return Direct_Primitive_Operations
9115 (Corresponding_Record_Type (Id));
9116
9117 -- If expansion is disabled the corresponding record type is absent,
9118 -- but if the type has ancestors it may have primitive operations.
9119
9120 elsif Is_Tagged_Type (Id) then
9121 return Direct_Primitive_Operations (Id);
9122
9123 else
9124 return No_Elist;
9125 end if;
9126 else
9127 return Direct_Primitive_Operations (Id);
9128 end if;
9129 end Primitive_Operations;
9130
9131 ---------------------
9132 -- Record_Rep_Item --
9133 ---------------------
9134
9135 procedure Record_Rep_Item (E : Entity_Id; N : Node_Id) is
9136 begin
9137 Set_Next_Rep_Item (N, First_Rep_Item (E));
9138 Set_First_Rep_Item (E, N);
9139 end Record_Rep_Item;
9140
9141 -------------------
9142 -- Remove_Entity --
9143 -------------------
9144
9145 procedure Remove_Entity (Id : Entity_Id) is
9146 Next : constant Entity_Id := Next_Entity (Id);
9147 Prev : constant Entity_Id := Prev_Entity (Id);
9148 Scop : constant Entity_Id := Scope (Id);
9149 First : constant Entity_Id := First_Entity (Scop);
9150 Last : constant Entity_Id := Last_Entity (Scop);
9151
9152 begin
9153 -- Eliminate any existing linkages from the entity
9154
9155 Set_Prev_Entity (Id, Empty); -- Empty <-- Id
9156 Set_Next_Entity (Id, Empty); -- Id --> Empty
9157
9158 -- The eliminated entity was the only element in the entity chain
9159
9160 if Id = First and then Id = Last then
9161 Set_First_Entity (Scop, Empty);
9162 Set_Last_Entity (Scop, Empty);
9163
9164 -- The eliminated entity was the head of the entity chain
9165
9166 elsif Id = First then
9167 Set_First_Entity (Scop, Next);
9168
9169 -- The eliminated entity was the tail of the entity chain
9170
9171 elsif Id = Last then
9172 Set_Last_Entity (Scop, Prev);
9173
9174 -- Otherwise the eliminated entity comes from the middle of the entity
9175 -- chain.
9176
9177 else
9178 Link_Entities (Prev, Next); -- Prev <-- Next, Prev --> Next
9179 end if;
9180 end Remove_Entity;
9181
9182 ---------------
9183 -- Root_Type --
9184 ---------------
9185
9186 function Root_Type (Id : E) return E is
9187 T, Etyp : Entity_Id;
9188
9189 begin
9190 pragma Assert (Nkind (Id) in N_Entity);
9191
9192 T := Base_Type (Id);
9193
9194 if Ekind (T) = E_Class_Wide_Type then
9195 return Etype (T);
9196
9197 -- Other cases
9198
9199 else
9200 loop
9201 Etyp := Etype (T);
9202
9203 if T = Etyp then
9204 return T;
9205
9206 -- Following test catches some error cases resulting from
9207 -- previous errors.
9208
9209 elsif No (Etyp) then
9210 Check_Error_Detected;
9211 return T;
9212
9213 elsif Is_Private_Type (T) and then Etyp = Full_View (T) then
9214 return T;
9215
9216 elsif Is_Private_Type (Etyp) and then Full_View (Etyp) = T then
9217 return T;
9218 end if;
9219
9220 T := Etyp;
9221
9222 -- Return if there is a circularity in the inheritance chain. This
9223 -- happens in some error situations and we do not want to get
9224 -- stuck in this loop.
9225
9226 if T = Base_Type (Id) then
9227 return T;
9228 end if;
9229 end loop;
9230 end if;
9231 end Root_Type;
9232
9233 ---------------------
9234 -- Safe_Emax_Value --
9235 ---------------------
9236
9237 function Safe_Emax_Value (Id : E) return Uint is
9238 begin
9239 return Machine_Emax_Value (Id);
9240 end Safe_Emax_Value;
9241
9242 ----------------------
9243 -- Safe_First_Value --
9244 ----------------------
9245
9246 function Safe_First_Value (Id : E) return Ureal is
9247 begin
9248 return -Safe_Last_Value (Id);
9249 end Safe_First_Value;
9250
9251 ---------------------
9252 -- Safe_Last_Value --
9253 ---------------------
9254
9255 function Safe_Last_Value (Id : E) return Ureal is
9256 Radix : constant Uint := Machine_Radix_Value (Id);
9257 Mantissa : constant Uint := Machine_Mantissa_Value (Id);
9258 Emax : constant Uint := Safe_Emax_Value (Id);
9259 Significand : constant Uint := Radix ** Mantissa - 1;
9260 Exponent : constant Uint := Emax - Mantissa;
9261
9262 begin
9263 if Radix = 2 then
9264 return
9265 UR_From_Components
9266 (Num => Significand * 2 ** (Exponent mod 4),
9267 Den => -Exponent / 4,
9268 Rbase => 16);
9269 else
9270 return
9271 UR_From_Components
9272 (Num => Significand,
9273 Den => -Exponent,
9274 Rbase => 16);
9275 end if;
9276 end Safe_Last_Value;
9277
9278 -----------------
9279 -- Scope_Depth --
9280 -----------------
9281
9282 function Scope_Depth (Id : E) return Uint is
9283 Scop : Entity_Id;
9284
9285 begin
9286 Scop := Id;
9287 while Is_Record_Type (Scop) loop
9288 Scop := Scope (Scop);
9289 end loop;
9290
9291 return Scope_Depth_Value (Scop);
9292 end Scope_Depth;
9293
9294 ---------------------
9295 -- Scope_Depth_Set --
9296 ---------------------
9297
9298 function Scope_Depth_Set (Id : E) return B is
9299 begin
9300 return not Is_Record_Type (Id)
9301 and then Field22 (Id) /= Union_Id (Empty);
9302 end Scope_Depth_Set;
9303
9304 -----------------------------
9305 -- Set_Component_Alignment --
9306 -----------------------------
9307
9308 -- Component Alignment is encoded using two flags, Flag128/129 as
9309 -- follows. Note that both flags False = Align_Default, so that the
9310 -- default initialization of flags to False initializes component
9311 -- alignment to the default value as required.
9312
9313 -- Flag128 Flag129 Value
9314 -- ------- ------- -----
9315 -- False False Calign_Default
9316 -- False True Calign_Component_Size
9317 -- True False Calign_Component_Size_4
9318 -- True True Calign_Storage_Unit
9319
9320 procedure Set_Component_Alignment (Id : E; V : C) is
9321 begin
9322 pragma Assert ((Is_Array_Type (Id) or else Is_Record_Type (Id))
9323 and then Is_Base_Type (Id));
9324
9325 case V is
9326 when Calign_Default =>
9327 Set_Flag128 (Id, False);
9328 Set_Flag129 (Id, False);
9329
9330 when Calign_Component_Size =>
9331 Set_Flag128 (Id, False);
9332 Set_Flag129 (Id, True);
9333
9334 when Calign_Component_Size_4 =>
9335 Set_Flag128 (Id, True);
9336 Set_Flag129 (Id, False);
9337
9338 when Calign_Storage_Unit =>
9339 Set_Flag128 (Id, True);
9340 Set_Flag129 (Id, True);
9341 end case;
9342 end Set_Component_Alignment;
9343
9344 -----------------------
9345 -- Set_DIC_Procedure --
9346 -----------------------
9347
9348 procedure Set_DIC_Procedure (Id : E; V : E) is
9349 Base_Typ : Entity_Id;
9350 Subps : Elist_Id;
9351
9352 begin
9353 pragma Assert (Is_Type (Id));
9354
9355 Base_Typ := Base_Type (Id);
9356 Subps := Subprograms_For_Type (Base_Typ);
9357
9358 if No (Subps) then
9359 Subps := New_Elmt_List;
9360 Set_Subprograms_For_Type (Base_Typ, Subps);
9361 end if;
9362
9363 Prepend_Elmt (V, Subps);
9364 end Set_DIC_Procedure;
9365
9366 -------------------------------------
9367 -- Set_Partial_Invariant_Procedure --
9368 -------------------------------------
9369
9370 procedure Set_Partial_DIC_Procedure (Id : E; V : E) is
9371 begin
9372 Set_DIC_Procedure (Id, V);
9373 end Set_Partial_DIC_Procedure;
9374
9375 -----------------------------
9376 -- Set_Invariant_Procedure --
9377 -----------------------------
9378
9379 procedure Set_Invariant_Procedure (Id : E; V : E) is
9380 Base_Typ : Entity_Id;
9381 Subp_Elmt : Elmt_Id;
9382 Subp_Id : Entity_Id;
9383 Subps : Elist_Id;
9384
9385 begin
9386 pragma Assert (Is_Type (Id));
9387
9388 Base_Typ := Base_Type (Id);
9389 Subps := Subprograms_For_Type (Base_Typ);
9390
9391 if No (Subps) then
9392 Subps := New_Elmt_List;
9393 Set_Subprograms_For_Type (Base_Typ, Subps);
9394 end if;
9395
9396 Subp_Elmt := First_Elmt (Subps);
9397 Prepend_Elmt (V, Subps);
9398
9399 -- Check for a duplicate invariant procedure
9400
9401 while Present (Subp_Elmt) loop
9402 Subp_Id := Node (Subp_Elmt);
9403
9404 if Is_Invariant_Procedure (Subp_Id) then
9405 raise Program_Error;
9406 end if;
9407
9408 Next_Elmt (Subp_Elmt);
9409 end loop;
9410 end Set_Invariant_Procedure;
9411
9412 -------------------------------------
9413 -- Set_Partial_Invariant_Procedure --
9414 -------------------------------------
9415
9416 procedure Set_Partial_Invariant_Procedure (Id : E; V : E) is
9417 Base_Typ : Entity_Id;
9418 Subp_Elmt : Elmt_Id;
9419 Subp_Id : Entity_Id;
9420 Subps : Elist_Id;
9421
9422 begin
9423 pragma Assert (Is_Type (Id));
9424
9425 Base_Typ := Base_Type (Id);
9426 Subps := Subprograms_For_Type (Base_Typ);
9427
9428 if No (Subps) then
9429 Subps := New_Elmt_List;
9430 Set_Subprograms_For_Type (Base_Typ, Subps);
9431 end if;
9432
9433 Subp_Elmt := First_Elmt (Subps);
9434 Prepend_Elmt (V, Subps);
9435
9436 -- Check for a duplicate partial invariant procedure
9437
9438 while Present (Subp_Elmt) loop
9439 Subp_Id := Node (Subp_Elmt);
9440
9441 if Is_Partial_Invariant_Procedure (Subp_Id) then
9442 raise Program_Error;
9443 end if;
9444
9445 Next_Elmt (Subp_Elmt);
9446 end loop;
9447 end Set_Partial_Invariant_Procedure;
9448
9449 ----------------------------
9450 -- Set_Predicate_Function --
9451 ----------------------------
9452
9453 procedure Set_Predicate_Function (Id : E; V : E) is
9454 Subp_Elmt : Elmt_Id;
9455 Subp_Id : Entity_Id;
9456 Subps : Elist_Id;
9457
9458 begin
9459 pragma Assert (Is_Type (Id) and then Has_Predicates (Id));
9460
9461 Subps := Subprograms_For_Type (Id);
9462
9463 if No (Subps) then
9464 Subps := New_Elmt_List;
9465 Set_Subprograms_For_Type (Id, Subps);
9466 end if;
9467
9468 Subp_Elmt := First_Elmt (Subps);
9469 Prepend_Elmt (V, Subps);
9470
9471 -- Check for a duplicate predication function
9472
9473 while Present (Subp_Elmt) loop
9474 Subp_Id := Node (Subp_Elmt);
9475
9476 if Ekind (Subp_Id) = E_Function
9477 and then Is_Predicate_Function (Subp_Id)
9478 then
9479 raise Program_Error;
9480 end if;
9481
9482 Next_Elmt (Subp_Elmt);
9483 end loop;
9484 end Set_Predicate_Function;
9485
9486 ------------------------------
9487 -- Set_Predicate_Function_M --
9488 ------------------------------
9489
9490 procedure Set_Predicate_Function_M (Id : E; V : E) is
9491 Subp_Elmt : Elmt_Id;
9492 Subp_Id : Entity_Id;
9493 Subps : Elist_Id;
9494
9495 begin
9496 pragma Assert (Is_Type (Id) and then Has_Predicates (Id));
9497
9498 Subps := Subprograms_For_Type (Id);
9499
9500 if No (Subps) then
9501 Subps := New_Elmt_List;
9502 Set_Subprograms_For_Type (Id, Subps);
9503 end if;
9504
9505 Subp_Elmt := First_Elmt (Subps);
9506 Prepend_Elmt (V, Subps);
9507
9508 -- Check for a duplicate predication function
9509
9510 while Present (Subp_Elmt) loop
9511 Subp_Id := Node (Subp_Elmt);
9512
9513 if Ekind (Subp_Id) = E_Function
9514 and then Is_Predicate_Function_M (Subp_Id)
9515 then
9516 raise Program_Error;
9517 end if;
9518
9519 Next_Elmt (Subp_Elmt);
9520 end loop;
9521 end Set_Predicate_Function_M;
9522
9523 -----------------
9524 -- Size_Clause --
9525 -----------------
9526
9527 function Size_Clause (Id : E) return N is
9528 begin
9529 return Get_Attribute_Definition_Clause (Id, Attribute_Size);
9530 end Size_Clause;
9531
9532 ------------------------
9533 -- Stream_Size_Clause --
9534 ------------------------
9535
9536 function Stream_Size_Clause (Id : E) return N is
9537 begin
9538 return Get_Attribute_Definition_Clause (Id, Attribute_Stream_Size);
9539 end Stream_Size_Clause;
9540
9541 ------------------
9542 -- Subtype_Kind --
9543 ------------------
9544
9545 function Subtype_Kind (K : Entity_Kind) return Entity_Kind is
9546 Kind : Entity_Kind;
9547
9548 begin
9549 case K is
9550 when Access_Kind =>
9551 Kind := E_Access_Subtype;
9552
9553 when E_Array_Subtype
9554 | E_Array_Type
9555 =>
9556 Kind := E_Array_Subtype;
9557
9558 when E_Class_Wide_Subtype
9559 | E_Class_Wide_Type
9560 =>
9561 Kind := E_Class_Wide_Subtype;
9562
9563 when E_Decimal_Fixed_Point_Subtype
9564 | E_Decimal_Fixed_Point_Type
9565 =>
9566 Kind := E_Decimal_Fixed_Point_Subtype;
9567
9568 when E_Ordinary_Fixed_Point_Subtype
9569 | E_Ordinary_Fixed_Point_Type
9570 =>
9571 Kind := E_Ordinary_Fixed_Point_Subtype;
9572
9573 when E_Private_Subtype
9574 | E_Private_Type
9575 =>
9576 Kind := E_Private_Subtype;
9577
9578 when E_Limited_Private_Subtype
9579 | E_Limited_Private_Type
9580 =>
9581 Kind := E_Limited_Private_Subtype;
9582
9583 when E_Record_Subtype_With_Private
9584 | E_Record_Type_With_Private
9585 =>
9586 Kind := E_Record_Subtype_With_Private;
9587
9588 when E_Record_Subtype
9589 | E_Record_Type
9590 =>
9591 Kind := E_Record_Subtype;
9592
9593 when Enumeration_Kind =>
9594 Kind := E_Enumeration_Subtype;
9595
9596 when E_Incomplete_Type =>
9597 Kind := E_Incomplete_Subtype;
9598
9599 when Float_Kind =>
9600 Kind := E_Floating_Point_Subtype;
9601
9602 when Signed_Integer_Kind =>
9603 Kind := E_Signed_Integer_Subtype;
9604
9605 when Modular_Integer_Kind =>
9606 Kind := E_Modular_Integer_Subtype;
9607
9608 when Protected_Kind =>
9609 Kind := E_Protected_Subtype;
9610
9611 when Task_Kind =>
9612 Kind := E_Task_Subtype;
9613
9614 when others =>
9615 Kind := E_Void;
9616 raise Program_Error;
9617 end case;
9618
9619 return Kind;
9620 end Subtype_Kind;
9621
9622 ---------------------
9623 -- Type_High_Bound --
9624 ---------------------
9625
9626 function Type_High_Bound (Id : E) return Node_Id is
9627 Rng : constant Node_Id := Scalar_Range (Id);
9628 begin
9629 if Nkind (Rng) = N_Subtype_Indication then
9630 return High_Bound (Range_Expression (Constraint (Rng)));
9631 else
9632 return High_Bound (Rng);
9633 end if;
9634 end Type_High_Bound;
9635
9636 --------------------
9637 -- Type_Low_Bound --
9638 --------------------
9639
9640 function Type_Low_Bound (Id : E) return Node_Id is
9641 Rng : constant Node_Id := Scalar_Range (Id);
9642 begin
9643 if Nkind (Rng) = N_Subtype_Indication then
9644 return Low_Bound (Range_Expression (Constraint (Rng)));
9645 else
9646 return Low_Bound (Rng);
9647 end if;
9648 end Type_Low_Bound;
9649
9650 ---------------------
9651 -- Underlying_Type --
9652 ---------------------
9653
9654 function Underlying_Type (Id : E) return E is
9655 begin
9656 -- For record_with_private the underlying type is always the direct full
9657 -- view. Never try to take the full view of the parent it does not make
9658 -- sense.
9659
9660 if Ekind (Id) = E_Record_Type_With_Private then
9661 return Full_View (Id);
9662
9663 -- If we have a class-wide type that comes from the limited view then we
9664 -- return the Underlying_Type of its nonlimited view.
9665
9666 elsif Ekind (Id) = E_Class_Wide_Type
9667 and then From_Limited_With (Id)
9668 and then Present (Non_Limited_View (Id))
9669 then
9670 return Underlying_Type (Non_Limited_View (Id));
9671
9672 elsif Ekind (Id) in Incomplete_Or_Private_Kind then
9673
9674 -- If we have an incomplete or private type with a full view, then we
9675 -- return the Underlying_Type of this full view.
9676
9677 if Present (Full_View (Id)) then
9678 if Id = Full_View (Id) then
9679
9680 -- Previous error in declaration
9681
9682 return Empty;
9683
9684 else
9685 return Underlying_Type (Full_View (Id));
9686 end if;
9687
9688 -- If we have a private type with an underlying full view, then we
9689 -- return the Underlying_Type of this underlying full view.
9690
9691 elsif Ekind (Id) in Private_Kind
9692 and then Present (Underlying_Full_View (Id))
9693 then
9694 return Underlying_Type (Underlying_Full_View (Id));
9695
9696 -- If we have an incomplete entity that comes from the limited view
9697 -- then we return the Underlying_Type of its nonlimited view.
9698
9699 elsif From_Limited_With (Id)
9700 and then Present (Non_Limited_View (Id))
9701 then
9702 return Underlying_Type (Non_Limited_View (Id));
9703
9704 -- Otherwise check for the case where we have a derived type or
9705 -- subtype, and if so get the Underlying_Type of the parent type.
9706
9707 elsif Etype (Id) /= Id then
9708 return Underlying_Type (Etype (Id));
9709
9710 -- Otherwise we have an incomplete or private type that has no full
9711 -- view, which means that we have not encountered the completion, so
9712 -- return Empty to indicate the underlying type is not yet known.
9713
9714 else
9715 return Empty;
9716 end if;
9717
9718 -- For non-incomplete, non-private types, return the type itself. Also
9719 -- for entities that are not types at all return the entity itself.
9720
9721 else
9722 return Id;
9723 end if;
9724 end Underlying_Type;
9725
9726 ------------------------
9727 -- Unlink_Next_Entity --
9728 ------------------------
9729
9730 procedure Unlink_Next_Entity (Id : Entity_Id) is
9731 Next : constant Entity_Id := Next_Entity (Id);
9732
9733 begin
9734 if Present (Next) then
9735 Set_Prev_Entity (Next, Empty); -- Empty <-- Next
9736 end if;
9737
9738 Set_Next_Entity (Id, Empty); -- Id --> Empty
9739 end Unlink_Next_Entity;
9740
9741 ------------------------
9742 -- Write_Entity_Flags --
9743 ------------------------
9744
9745 procedure Write_Entity_Flags (Id : Entity_Id; Prefix : String) is
9746
9747 procedure W (Flag_Name : String; Flag : Boolean);
9748 -- Write out given flag if it is set
9749
9750 -------
9751 -- W --
9752 -------
9753
9754 procedure W (Flag_Name : String; Flag : Boolean) is
9755 begin
9756 if Flag then
9757 Write_Str (Prefix);
9758 Write_Str (Flag_Name);
9759 Write_Str (" = True");
9760 Write_Eol;
9761 end if;
9762 end W;
9763
9764 -- Start of processing for Write_Entity_Flags
9765
9766 begin
9767 if (Is_Array_Type (Id) or else Is_Record_Type (Id))
9768 and then Is_Base_Type (Id)
9769 then
9770 Write_Str (Prefix);
9771 Write_Str ("Component_Alignment = ");
9772
9773 case Component_Alignment (Id) is
9774 when Calign_Default =>
9775 Write_Str ("Calign_Default");
9776
9777 when Calign_Component_Size =>
9778 Write_Str ("Calign_Component_Size");
9779
9780 when Calign_Component_Size_4 =>
9781 Write_Str ("Calign_Component_Size_4");
9782
9783 when Calign_Storage_Unit =>
9784 Write_Str ("Calign_Storage_Unit");
9785 end case;
9786
9787 Write_Eol;
9788 end if;
9789
9790 W ("Address_Taken", Flag104 (Id));
9791 W ("Body_Needed_For_Inlining", Flag299 (Id));
9792 W ("Body_Needed_For_SAL", Flag40 (Id));
9793 W ("C_Pass_By_Copy", Flag125 (Id));
9794 W ("Can_Never_Be_Null", Flag38 (Id));
9795 W ("Checks_May_Be_Suppressed", Flag31 (Id));
9796 W ("Contains_Ignored_Ghost_Code", Flag279 (Id));
9797 W ("Debug_Info_Off", Flag166 (Id));
9798 W ("Default_Expressions_Processed", Flag108 (Id));
9799 W ("Delay_Cleanups", Flag114 (Id));
9800 W ("Delay_Subprogram_Descriptors", Flag50 (Id));
9801 W ("Depends_On_Private", Flag14 (Id));
9802 W ("Discard_Names", Flag88 (Id));
9803 W ("Elaboration_Entity_Required", Flag174 (Id));
9804 W ("Elaborate_Body_Desirable", Flag210 (Id));
9805 W ("Entry_Accepted", Flag152 (Id));
9806 W ("Can_Use_Internal_Rep", Flag229 (Id));
9807 W ("Finalize_Storage_Only", Flag158 (Id));
9808 W ("From_Limited_With", Flag159 (Id));
9809 W ("Has_Aliased_Components", Flag135 (Id));
9810 W ("Has_Alignment_Clause", Flag46 (Id));
9811 W ("Has_All_Calls_Remote", Flag79 (Id));
9812 W ("Has_Atomic_Components", Flag86 (Id));
9813 W ("Has_Biased_Representation", Flag139 (Id));
9814 W ("Has_Completion", Flag26 (Id));
9815 W ("Has_Completion_In_Body", Flag71 (Id));
9816 W ("Has_Complex_Representation", Flag140 (Id));
9817 W ("Has_Component_Size_Clause", Flag68 (Id));
9818 W ("Has_Contiguous_Rep", Flag181 (Id));
9819 W ("Has_Controlled_Component", Flag43 (Id));
9820 W ("Has_Controlling_Result", Flag98 (Id));
9821 W ("Has_Convention_Pragma", Flag119 (Id));
9822 W ("Has_Default_Aspect", Flag39 (Id));
9823 W ("Has_Delayed_Aspects", Flag200 (Id));
9824 W ("Has_Delayed_Freeze", Flag18 (Id));
9825 W ("Has_Delayed_Rep_Aspects", Flag261 (Id));
9826 W ("Has_Discriminants", Flag5 (Id));
9827 W ("Has_Dispatch_Table", Flag220 (Id));
9828 W ("Has_Dynamic_Predicate_Aspect", Flag258 (Id));
9829 W ("Has_Enumeration_Rep_Clause", Flag66 (Id));
9830 W ("Has_Exit", Flag47 (Id));
9831 W ("Has_Expanded_Contract", Flag240 (Id));
9832 W ("Has_Forward_Instantiation", Flag175 (Id));
9833 W ("Has_Fully_Qualified_Name", Flag173 (Id));
9834 W ("Has_Gigi_Rep_Item", Flag82 (Id));
9835 W ("Has_Homonym", Flag56 (Id));
9836 W ("Has_Implicit_Dereference", Flag251 (Id));
9837 W ("Has_Independent_Components", Flag34 (Id));
9838 W ("Has_Inheritable_Invariants", Flag248 (Id));
9839 W ("Has_Inherited_DIC", Flag133 (Id));
9840 W ("Has_Inherited_Invariants", Flag291 (Id));
9841 W ("Has_Initial_Value", Flag219 (Id));
9842 W ("Has_Loop_Entry_Attributes", Flag260 (Id));
9843 W ("Has_Machine_Radix_Clause", Flag83 (Id));
9844 W ("Has_Master_Entity", Flag21 (Id));
9845 W ("Has_Missing_Return", Flag142 (Id));
9846 W ("Has_Nested_Block_With_Handler", Flag101 (Id));
9847 W ("Has_Nested_Subprogram", Flag282 (Id));
9848 W ("Has_Non_Standard_Rep", Flag75 (Id));
9849 W ("Has_Out_Or_In_Out_Parameter", Flag110 (Id));
9850 W ("Has_Object_Size_Clause", Flag172 (Id));
9851 W ("Has_Own_DIC", Flag3 (Id));
9852 W ("Has_Own_Invariants", Flag232 (Id));
9853 W ("Has_Per_Object_Constraint", Flag154 (Id));
9854 W ("Has_Pragma_Controlled", Flag27 (Id));
9855 W ("Has_Pragma_Elaborate_Body", Flag150 (Id));
9856 W ("Has_Pragma_Inline", Flag157 (Id));
9857 W ("Has_Pragma_Inline_Always", Flag230 (Id));
9858 W ("Has_Pragma_No_Inline", Flag201 (Id));
9859 W ("Has_Pragma_Ordered", Flag198 (Id));
9860 W ("Has_Pragma_Pack", Flag121 (Id));
9861 W ("Has_Pragma_Preelab_Init", Flag221 (Id));
9862 W ("Has_Pragma_Pure", Flag203 (Id));
9863 W ("Has_Pragma_Pure_Function", Flag179 (Id));
9864 W ("Has_Pragma_Thread_Local_Storage", Flag169 (Id));
9865 W ("Has_Pragma_Unmodified", Flag233 (Id));
9866 W ("Has_Pragma_Unreferenced", Flag180 (Id));
9867 W ("Has_Pragma_Unreferenced_Objects", Flag212 (Id));
9868 W ("Has_Pragma_Unused", Flag294 (Id));
9869 W ("Has_Predicates", Flag250 (Id));
9870 W ("Has_Primitive_Operations", Flag120 (Id));
9871 W ("Has_Private_Ancestor", Flag151 (Id));
9872 W ("Has_Private_Declaration", Flag155 (Id));
9873 W ("Has_Private_Extension", Flag300 (Id));
9874 W ("Has_Protected", Flag271 (Id));
9875 W ("Has_Qualified_Name", Flag161 (Id));
9876 W ("Has_RACW", Flag214 (Id));
9877 W ("Has_Record_Rep_Clause", Flag65 (Id));
9878 W ("Has_Recursive_Call", Flag143 (Id));
9879 W ("Has_Shift_Operator", Flag267 (Id));
9880 W ("Has_Size_Clause", Flag29 (Id));
9881 W ("Has_Small_Clause", Flag67 (Id));
9882 W ("Has_Specified_Layout", Flag100 (Id));
9883 W ("Has_Specified_Stream_Input", Flag190 (Id));
9884 W ("Has_Specified_Stream_Output", Flag191 (Id));
9885 W ("Has_Specified_Stream_Read", Flag192 (Id));
9886 W ("Has_Specified_Stream_Write", Flag193 (Id));
9887 W ("Has_Static_Discriminants", Flag211 (Id));
9888 W ("Has_Static_Predicate", Flag269 (Id));
9889 W ("Has_Static_Predicate_Aspect", Flag259 (Id));
9890 W ("Has_Storage_Size_Clause", Flag23 (Id));
9891 W ("Has_Stream_Size_Clause", Flag184 (Id));
9892 W ("Has_Task", Flag30 (Id));
9893 W ("Has_Timing_Event", Flag289 (Id));
9894 W ("Has_Thunks", Flag228 (Id));
9895 W ("Has_Unchecked_Union", Flag123 (Id));
9896 W ("Has_Unknown_Discriminants", Flag72 (Id));
9897 W ("Has_Visible_Refinement", Flag263 (Id));
9898 W ("Has_Volatile_Components", Flag87 (Id));
9899 W ("Has_Xref_Entry", Flag182 (Id));
9900 W ("Has_Yield_Aspect", Flag308 (Id));
9901 W ("Ignore_SPARK_Mode_Pragmas", Flag301 (Id));
9902 W ("In_Package_Body", Flag48 (Id));
9903 W ("In_Private_Part", Flag45 (Id));
9904 W ("In_Use", Flag8 (Id));
9905 W ("Is_Abstract_Subprogram", Flag19 (Id));
9906 W ("Is_Abstract_Type", Flag146 (Id));
9907 W ("Is_Access_Constant", Flag69 (Id));
9908 W ("Is_Activation_Record", Flag305 (Id));
9909 W ("Is_Actual_Subtype", Flag293 (Id));
9910 W ("Is_Ada_2005_Only", Flag185 (Id));
9911 W ("Is_Ada_2012_Only", Flag199 (Id));
9912 W ("Is_Aliased", Flag15 (Id));
9913 W ("Is_Asynchronous", Flag81 (Id));
9914 W ("Is_Atomic", Flag85 (Id));
9915 W ("Is_Bit_Packed_Array", Flag122 (Id));
9916 W ("Is_CPP_Class", Flag74 (Id));
9917 W ("Is_CUDA_Kernel", Flag118 (Id));
9918 W ("Is_Called", Flag102 (Id));
9919 W ("Is_Character_Type", Flag63 (Id));
9920 W ("Is_Checked_Ghost_Entity", Flag277 (Id));
9921 W ("Is_Child_Unit", Flag73 (Id));
9922 W ("Is_Class_Wide_Equivalent_Type", Flag35 (Id));
9923 W ("Is_Compilation_Unit", Flag149 (Id));
9924 W ("Is_Completely_Hidden", Flag103 (Id));
9925 W ("Is_Concurrent_Record_Type", Flag20 (Id));
9926 W ("Is_Constr_Subt_For_UN_Aliased", Flag141 (Id));
9927 W ("Is_Constr_Subt_For_U_Nominal", Flag80 (Id));
9928 W ("Is_Constrained", Flag12 (Id));
9929 W ("Is_Constructor", Flag76 (Id));
9930 W ("Is_Controlled_Active", Flag42 (Id));
9931 W ("Is_Controlling_Formal", Flag97 (Id));
9932 W ("Is_Descendant_Of_Address", Flag223 (Id));
9933 W ("Is_DIC_Procedure", Flag132 (Id));
9934 W ("Is_Discrim_SO_Function", Flag176 (Id));
9935 W ("Is_Discriminant_Check_Function", Flag264 (Id));
9936 W ("Is_Dispatch_Table_Entity", Flag234 (Id));
9937 W ("Is_Dispatching_Operation", Flag6 (Id));
9938 W ("Is_Elaboration_Checks_OK_Id", Flag148 (Id));
9939 W ("Is_Elaboration_Warnings_OK_Id", Flag304 (Id));
9940 W ("Is_Eliminated", Flag124 (Id));
9941 W ("Is_Entry_Formal", Flag52 (Id));
9942 W ("Is_Exception_Handler", Flag286 (Id));
9943 W ("Is_Exported", Flag99 (Id));
9944 W ("Is_Finalized_Transient", Flag252 (Id));
9945 W ("Is_First_Subtype", Flag70 (Id));
9946 W ("Is_Formal_Subprogram", Flag111 (Id));
9947 W ("Is_Frozen", Flag4 (Id));
9948 W ("Is_Generic_Actual_Subprogram", Flag274 (Id));
9949 W ("Is_Generic_Actual_Type", Flag94 (Id));
9950 W ("Is_Generic_Instance", Flag130 (Id));
9951 W ("Is_Generic_Type", Flag13 (Id));
9952 W ("Is_Hidden", Flag57 (Id));
9953 W ("Is_Hidden_Non_Overridden_Subpgm", Flag2 (Id));
9954 W ("Is_Hidden_Open_Scope", Flag171 (Id));
9955 W ("Is_Ignored_Ghost_Entity", Flag278 (Id));
9956 W ("Is_Ignored_Transient", Flag295 (Id));
9957 W ("Is_Immediately_Visible", Flag7 (Id));
9958 W ("Is_Implementation_Defined", Flag254 (Id));
9959 W ("Is_Imported", Flag24 (Id));
9960 W ("Is_Independent", Flag268 (Id));
9961 W ("Is_Initial_Condition_Procedure", Flag302 (Id));
9962 W ("Is_Inlined", Flag11 (Id));
9963 W ("Is_Inlined_Always", Flag1 (Id));
9964 W ("Is_Instantiated", Flag126 (Id));
9965 W ("Is_Interface", Flag186 (Id));
9966 W ("Is_Internal", Flag17 (Id));
9967 W ("Is_Interrupt_Handler", Flag89 (Id));
9968 W ("Is_Intrinsic_Subprogram", Flag64 (Id));
9969 W ("Is_Invariant_Procedure", Flag257 (Id));
9970 W ("Is_Itype", Flag91 (Id));
9971 W ("Is_Known_Non_Null", Flag37 (Id));
9972 W ("Is_Known_Null", Flag204 (Id));
9973 W ("Is_Known_Valid", Flag170 (Id));
9974 W ("Is_Limited_Composite", Flag106 (Id));
9975 W ("Is_Limited_Interface", Flag197 (Id));
9976 W ("Is_Limited_Record", Flag25 (Id));
9977 W ("Is_Local_Anonymous_Access", Flag194 (Id));
9978 W ("Is_Loop_Parameter", Flag307 (Id));
9979 W ("Is_Machine_Code_Subprogram", Flag137 (Id));
9980 W ("Is_Non_Static_Subtype", Flag109 (Id));
9981 W ("Is_Null_Init_Proc", Flag178 (Id));
9982 W ("Is_Obsolescent", Flag153 (Id));
9983 W ("Is_Only_Out_Parameter", Flag226 (Id));
9984 W ("Is_Package_Body_Entity", Flag160 (Id));
9985 W ("Is_Packed", Flag51 (Id));
9986 W ("Is_Packed_Array_Impl_Type", Flag138 (Id));
9987 W ("Is_Param_Block_Component_Type", Flag215 (Id));
9988 W ("Is_Partial_Invariant_Procedure", Flag292 (Id));
9989 W ("Is_Potentially_Use_Visible", Flag9 (Id));
9990 W ("Is_Predicate_Function", Flag255 (Id));
9991 W ("Is_Predicate_Function_M", Flag256 (Id));
9992 W ("Is_Preelaborated", Flag59 (Id));
9993 W ("Is_Primitive", Flag218 (Id));
9994 W ("Is_Primitive_Wrapper", Flag195 (Id));
9995 W ("Is_Private_Composite", Flag107 (Id));
9996 W ("Is_Private_Descendant", Flag53 (Id));
9997 W ("Is_Private_Primitive", Flag245 (Id));
9998 W ("Is_Public", Flag10 (Id));
9999 W ("Is_Pure", Flag44 (Id));
10000 W ("Is_Pure_Unit_Access_Type", Flag189 (Id));
10001 W ("Is_RACW_Stub_Type", Flag244 (Id));
10002 W ("Is_Raised", Flag224 (Id));
10003 W ("Is_Remote_Call_Interface", Flag62 (Id));
10004 W ("Is_Remote_Types", Flag61 (Id));
10005 W ("Is_Renaming_Of_Object", Flag112 (Id));
10006 W ("Is_Return_Object", Flag209 (Id));
10007 W ("Is_Safe_To_Reevaluate", Flag249 (Id));
10008 W ("Is_Shared_Passive", Flag60 (Id));
10009 W ("Is_Static_Type", Flag281 (Id));
10010 W ("Is_Statically_Allocated", Flag28 (Id));
10011 W ("Is_Tag", Flag78 (Id));
10012 W ("Is_Tagged_Type", Flag55 (Id));
10013 W ("Is_Thunk", Flag225 (Id));
10014 W ("Is_Trivial_Subprogram", Flag235 (Id));
10015 W ("Is_True_Constant", Flag163 (Id));
10016 W ("Is_Unchecked_Union", Flag117 (Id));
10017 W ("Is_Underlying_Full_View", Flag298 (Id));
10018 W ("Is_Underlying_Record_View", Flag246 (Id));
10019 W ("Is_Unimplemented", Flag284 (Id));
10020 W ("Is_Unsigned_Type", Flag144 (Id));
10021 W ("Is_Uplevel_Referenced_Entity", Flag283 (Id));
10022 W ("Is_Valued_Procedure", Flag127 (Id));
10023 W ("Is_Visible_Formal", Flag206 (Id));
10024 W ("Is_Visible_Lib_Unit", Flag116 (Id));
10025 W ("Is_Volatile", Flag16 (Id));
10026 W ("Is_Volatile_Full_Access", Flag285 (Id));
10027 W ("Itype_Printed", Flag202 (Id));
10028 W ("Kill_Elaboration_Checks", Flag32 (Id));
10029 W ("Kill_Range_Checks", Flag33 (Id));
10030 W ("Known_To_Have_Preelab_Init", Flag207 (Id));
10031 W ("Low_Bound_Tested", Flag205 (Id));
10032 W ("Machine_Radix_10", Flag84 (Id));
10033 W ("Materialize_Entity", Flag168 (Id));
10034 W ("May_Inherit_Delayed_Rep_Aspects", Flag262 (Id));
10035 W ("Must_Be_On_Byte_Boundary", Flag183 (Id));
10036 W ("Must_Have_Preelab_Init", Flag208 (Id));
10037 W ("Needs_Activation_Record", Flag306 (Id));
10038 W ("Needs_Debug_Info", Flag147 (Id));
10039 W ("Needs_No_Actuals", Flag22 (Id));
10040 W ("Never_Set_In_Source", Flag115 (Id));
10041 W ("No_Dynamic_Predicate_On_actual", Flag276 (Id));
10042 W ("No_Pool_Assigned", Flag131 (Id));
10043 W ("No_Predicate_On_actual", Flag275 (Id));
10044 W ("No_Reordering", Flag239 (Id));
10045 W ("No_Return", Flag113 (Id));
10046 W ("No_Strict_Aliasing", Flag136 (Id));
10047 W ("Non_Binary_Modulus", Flag58 (Id));
10048 W ("Nonzero_Is_True", Flag162 (Id));
10049 W ("OK_To_Rename", Flag247 (Id));
10050 W ("Optimize_Alignment_Space", Flag241 (Id));
10051 W ("Optimize_Alignment_Time", Flag242 (Id));
10052 W ("Overlays_Constant", Flag243 (Id));
10053 W ("Partial_View_Has_Unknown_Discr", Flag280 (Id));
10054 W ("Reachable", Flag49 (Id));
10055 W ("Referenced", Flag156 (Id));
10056 W ("Referenced_As_LHS", Flag36 (Id));
10057 W ("Referenced_As_Out_Parameter", Flag227 (Id));
10058 W ("Renamed_In_Spec", Flag231 (Id));
10059 W ("Requires_Overriding", Flag213 (Id));
10060 W ("Return_Present", Flag54 (Id));
10061 W ("Returns_By_Ref", Flag90 (Id));
10062 W ("Reverse_Bit_Order", Flag164 (Id));
10063 W ("Reverse_Storage_Order", Flag93 (Id));
10064 W ("Rewritten_For_C", Flag287 (Id));
10065 W ("Predicates_Ignored", Flag288 (Id));
10066 W ("Sec_Stack_Needed_For_Return", Flag167 (Id));
10067 W ("Size_Depends_On_Discriminant", Flag177 (Id));
10068 W ("Size_Known_At_Compile_Time", Flag92 (Id));
10069 W ("SPARK_Aux_Pragma_Inherited", Flag266 (Id));
10070 W ("SPARK_Pragma_Inherited", Flag265 (Id));
10071 W ("SSO_Set_High_By_Default", Flag273 (Id));
10072 W ("SSO_Set_Low_By_Default", Flag272 (Id));
10073 W ("Static_Elaboration_Desired", Flag77 (Id));
10074 W ("Stores_Attribute_Old_Prefix", Flag270 (Id));
10075 W ("Strict_Alignment", Flag145 (Id));
10076 W ("Suppress_Elaboration_Warnings", Flag303 (Id));
10077 W ("Suppress_Initialization", Flag105 (Id));
10078 W ("Suppress_Style_Checks", Flag165 (Id));
10079 W ("Suppress_Value_Tracking_On_Call", Flag217 (Id));
10080 W ("Treat_As_Volatile", Flag41 (Id));
10081 W ("Universal_Aliasing", Flag216 (Id));
10082 W ("Used_As_Generic_Actual", Flag222 (Id));
10083 W ("Uses_Sec_Stack", Flag95 (Id));
10084 W ("Warnings_Off", Flag96 (Id));
10085 W ("Warnings_Off_Used", Flag236 (Id));
10086 W ("Warnings_Off_Used_Unmodified", Flag237 (Id));
10087 W ("Warnings_Off_Used_Unreferenced", Flag238 (Id));
10088 W ("Was_Hidden", Flag196 (Id));
10089 end Write_Entity_Flags;
10090
10091 -----------------------
10092 -- Write_Entity_Info --
10093 -----------------------
10094
10095 procedure Write_Entity_Info (Id : Entity_Id; Prefix : String) is
10096
10097 procedure Write_Attribute (Which : String; Nam : E);
10098 -- Write attribute value with given string name
10099
10100 procedure Write_Kind (Id : Entity_Id);
10101 -- Write Ekind field of entity
10102
10103 ---------------------
10104 -- Write_Attribute --
10105 ---------------------
10106
10107 procedure Write_Attribute (Which : String; Nam : E) is
10108 begin
10109 Write_Str (Prefix);
10110 Write_Str (Which);
10111 Write_Int (Int (Nam));
10112 Write_Str (" ");
10113 Write_Name (Chars (Nam));
10114 Write_Str (" ");
10115 end Write_Attribute;
10116
10117 ----------------
10118 -- Write_Kind --
10119 ----------------
10120
10121 procedure Write_Kind (Id : Entity_Id) is
10122 K : constant String := Entity_Kind'Image (Ekind (Id));
10123
10124 begin
10125 Write_Str (Prefix);
10126 Write_Str (" Kind ");
10127
10128 if Is_Type (Id) and then Is_Tagged_Type (Id) then
10129 Write_Str ("TAGGED ");
10130 end if;
10131
10132 Write_Str (K (3 .. K'Length));
10133 Write_Str (" ");
10134
10135 if Is_Type (Id) and then Depends_On_Private (Id) then
10136 Write_Str ("Depends_On_Private ");
10137 end if;
10138 end Write_Kind;
10139
10140 -- Start of processing for Write_Entity_Info
10141
10142 begin
10143 Write_Eol;
10144 Write_Attribute ("Name ", Id);
10145 Write_Int (Int (Id));
10146 Write_Eol;
10147 Write_Kind (Id);
10148 Write_Eol;
10149 Write_Attribute (" Type ", Etype (Id));
10150 Write_Eol;
10151 if Id /= Standard_Standard then
10152 Write_Attribute (" Scope ", Scope (Id));
10153 end if;
10154 Write_Eol;
10155
10156 case Ekind (Id) is
10157 when Discrete_Kind =>
10158 Write_Str ("Bounds: Id = ");
10159
10160 if Present (Scalar_Range (Id)) then
10161 Write_Int (Int (Type_Low_Bound (Id)));
10162 Write_Str (" .. Id = ");
10163 Write_Int (Int (Type_High_Bound (Id)));
10164 else
10165 Write_Str ("Empty");
10166 end if;
10167
10168 Write_Eol;
10169
10170 when Array_Kind =>
10171 declare
10172 Index : Entity_Id;
10173
10174 begin
10175 Write_Attribute
10176 (" Component Type ", Component_Type (Id));
10177 Write_Eol;
10178 Write_Str (Prefix);
10179 Write_Str (" Indexes ");
10180
10181 Index := First_Index (Id);
10182 while Present (Index) loop
10183 Write_Attribute (" ", Etype (Index));
10184 Index := Next_Index (Index);
10185 end loop;
10186
10187 Write_Eol;
10188 end;
10189
10190 when Access_Kind =>
10191 Write_Attribute
10192 (" Directly Designated Type ",
10193 Directly_Designated_Type (Id));
10194 Write_Eol;
10195
10196 when Overloadable_Kind =>
10197 if Present (Homonym (Id)) then
10198 Write_Str (" Homonym ");
10199 Write_Name (Chars (Homonym (Id)));
10200 Write_Str (" ");
10201 Write_Int (Int (Homonym (Id)));
10202 Write_Eol;
10203 end if;
10204
10205 Write_Eol;
10206
10207 when E_Component =>
10208 if Is_Record_Type (Scope (Id)) then
10209 Write_Attribute (
10210 " Original_Record_Component ",
10211 Original_Record_Component (Id));
10212 Write_Int (Int (Original_Record_Component (Id)));
10213 Write_Eol;
10214 end if;
10215
10216 when others =>
10217 null;
10218 end case;
10219 end Write_Entity_Info;
10220
10221 -----------------------
10222 -- Write_Field6_Name --
10223 -----------------------
10224
10225 procedure Write_Field6_Name (Id : Entity_Id) is
10226 pragma Unreferenced (Id);
10227 begin
10228 Write_Str ("First_Rep_Item");
10229 end Write_Field6_Name;
10230
10231 -----------------------
10232 -- Write_Field7_Name --
10233 -----------------------
10234
10235 procedure Write_Field7_Name (Id : Entity_Id) is
10236 pragma Unreferenced (Id);
10237 begin
10238 Write_Str ("Freeze_Node");
10239 end Write_Field7_Name;
10240
10241 -----------------------
10242 -- Write_Field8_Name --
10243 -----------------------
10244
10245 procedure Write_Field8_Name (Id : Entity_Id) is
10246 begin
10247 case Ekind (Id) is
10248 when Type_Kind =>
10249 Write_Str ("Associated_Node_For_Itype");
10250
10251 when E_Package =>
10252 Write_Str ("Dependent_Instances");
10253
10254 when E_Loop =>
10255 Write_Str ("First_Exit_Statement");
10256
10257 when E_Variable =>
10258 Write_Str ("Hiding_Loop_Variable");
10259
10260 when Formal_Kind
10261 | E_Function
10262 | E_Subprogram_Body
10263 =>
10264 Write_Str ("Mechanism");
10265
10266 when E_Component
10267 | E_Discriminant
10268 =>
10269 Write_Str ("Normalized_First_Bit");
10270
10271 when E_Abstract_State =>
10272 Write_Str ("Refinement_Constituents");
10273
10274 when E_Block
10275 | E_Return_Statement
10276 =>
10277 Write_Str ("Return_Applies_To");
10278
10279 when others =>
10280 Write_Str ("Field8??");
10281 end case;
10282 end Write_Field8_Name;
10283
10284 -----------------------
10285 -- Write_Field9_Name --
10286 -----------------------
10287
10288 procedure Write_Field9_Name (Id : Entity_Id) is
10289 begin
10290 case Ekind (Id) is
10291 when Type_Kind =>
10292 Write_Str ("Class_Wide_Type");
10293
10294 when Object_Kind =>
10295 Write_Str ("Current_Value");
10296
10297 when E_Function
10298 | E_Generic_Function
10299 | E_Generic_Package
10300 | E_Generic_Procedure
10301 | E_Package
10302 | E_Procedure
10303 =>
10304 Write_Str ("Renaming_Map");
10305
10306 when others =>
10307 Write_Str ("Field9??");
10308 end case;
10309 end Write_Field9_Name;
10310
10311 ------------------------
10312 -- Write_Field10_Name --
10313 ------------------------
10314
10315 procedure Write_Field10_Name (Id : Entity_Id) is
10316 begin
10317 case Ekind (Id) is
10318 when Class_Wide_Kind
10319 | Incomplete_Kind
10320 | E_Record_Type
10321 | E_Record_Subtype
10322 | Private_Kind
10323 | Concurrent_Kind
10324 =>
10325 Write_Str ("Direct_Primitive_Operations");
10326
10327 when E_Constant
10328 | E_In_Parameter
10329 =>
10330 Write_Str ("Discriminal_Link");
10331
10332 when Float_Kind =>
10333 Write_Str ("Float_Rep");
10334
10335 when E_Function
10336 | E_Package
10337 | E_Package_Body
10338 | E_Procedure
10339 =>
10340 Write_Str ("Handler_Records");
10341
10342 when E_Component
10343 | E_Discriminant
10344 =>
10345 Write_Str ("Normalized_Position_Max");
10346
10347 when E_Abstract_State
10348 | E_Variable
10349 =>
10350 Write_Str ("Part_Of_Constituents");
10351
10352 when others =>
10353 Write_Str ("Field10??");
10354 end case;
10355 end Write_Field10_Name;
10356
10357 ------------------------
10358 -- Write_Field11_Name --
10359 ------------------------
10360
10361 procedure Write_Field11_Name (Id : Entity_Id) is
10362 begin
10363 case Ekind (Id) is
10364 when E_Block =>
10365 Write_Str ("Block_Node");
10366
10367 when E_Component
10368 | E_Discriminant
10369 =>
10370 Write_Str ("Component_Bit_Offset");
10371
10372 when Formal_Kind =>
10373 Write_Str ("Entry_Component");
10374
10375 when E_Enumeration_Literal =>
10376 Write_Str ("Enumeration_Pos");
10377
10378 when Type_Kind
10379 | E_Constant
10380 =>
10381 Write_Str ("Full_View");
10382
10383 when E_Generic_Package =>
10384 Write_Str ("Generic_Homonym");
10385
10386 when E_Variable =>
10387 Write_Str ("Part_Of_References");
10388
10389 when E_Entry
10390 | E_Entry_Family
10391 | E_Function
10392 | E_Procedure
10393 =>
10394 Write_Str ("Protected_Body_Subprogram");
10395
10396 when others =>
10397 Write_Str ("Field11??");
10398 end case;
10399 end Write_Field11_Name;
10400
10401 ------------------------
10402 -- Write_Field12_Name --
10403 ------------------------
10404
10405 procedure Write_Field12_Name (Id : Entity_Id) is
10406 begin
10407 case Ekind (Id) is
10408 when E_Package =>
10409 Write_Str ("Associated_Formal_Package");
10410
10411 when Entry_Kind =>
10412 Write_Str ("Barrier_Function");
10413
10414 when E_Enumeration_Literal =>
10415 Write_Str ("Enumeration_Rep");
10416
10417 when Type_Kind
10418 | E_Component
10419 | E_Constant
10420 | E_Discriminant
10421 | E_Exception
10422 | E_In_Parameter
10423 | E_In_Out_Parameter
10424 | E_Out_Parameter
10425 | E_Loop_Parameter
10426 | E_Variable
10427 =>
10428 Write_Str ("Esize");
10429
10430 when E_Function
10431 | E_Procedure
10432 =>
10433 Write_Str ("Next_Inlined_Subprogram");
10434
10435 when others =>
10436 Write_Str ("Field12??");
10437 end case;
10438 end Write_Field12_Name;
10439
10440 ------------------------
10441 -- Write_Field13_Name --
10442 ------------------------
10443
10444 procedure Write_Field13_Name (Id : Entity_Id) is
10445 begin
10446 case Ekind (Id) is
10447 when E_Component
10448 | E_Discriminant
10449 =>
10450 Write_Str ("Component_Clause");
10451
10452 when E_Entry
10453 | E_Entry_Family
10454 | E_Function
10455 | E_Procedure
10456 | E_Package
10457 | Generic_Unit_Kind
10458 =>
10459 Write_Str ("Elaboration_Entity");
10460
10461 when Formal_Kind
10462 | E_Variable
10463 =>
10464 Write_Str ("Extra_Accessibility");
10465
10466 when Type_Kind =>
10467 Write_Str ("RM_Size");
10468
10469 when others =>
10470 Write_Str ("Field13??");
10471 end case;
10472 end Write_Field13_Name;
10473
10474 -----------------------
10475 -- Write_Field14_Name --
10476 -----------------------
10477
10478 procedure Write_Field14_Name (Id : Entity_Id) is
10479 begin
10480 case Ekind (Id) is
10481 when Type_Kind
10482 | Formal_Kind
10483 | E_Constant
10484 | E_Exception
10485 | E_Loop_Parameter
10486 | E_Variable
10487 =>
10488 Write_Str ("Alignment");
10489
10490 when E_Component
10491 | E_Discriminant
10492 =>
10493 Write_Str ("Normalized_Position");
10494
10495 when E_Entry
10496 | E_Entry_Family
10497 | E_Function
10498 | E_Procedure
10499 =>
10500 Write_Str ("Postconditions_Proc");
10501
10502 when others =>
10503 Write_Str ("Field14??");
10504 end case;
10505 end Write_Field14_Name;
10506
10507 ------------------------
10508 -- Write_Field15_Name --
10509 ------------------------
10510
10511 procedure Write_Field15_Name (Id : Entity_Id) is
10512 begin
10513 case Ekind (Id) is
10514 when E_Discriminant =>
10515 Write_Str ("Discriminant_Number");
10516
10517 when E_Component =>
10518 Write_Str ("DT_Entry_Count");
10519
10520 when E_Function
10521 | E_Procedure
10522 =>
10523 Write_Str ("DT_Position");
10524
10525 when Entry_Kind =>
10526 Write_Str ("Entry_Parameters_Type");
10527
10528 when Formal_Kind =>
10529 Write_Str ("Extra_Formal");
10530
10531 when Type_Kind =>
10532 Write_Str ("Pending_Access_Types");
10533
10534 when E_Package
10535 | E_Package_Body
10536 =>
10537 Write_Str ("Related_Instance");
10538
10539 when E_Constant
10540 | E_Loop_Parameter
10541 | E_Variable
10542 =>
10543 Write_Str ("Status_Flag_Or_Transient_Decl");
10544
10545 when others =>
10546 Write_Str ("Field15??");
10547 end case;
10548 end Write_Field15_Name;
10549
10550 ------------------------
10551 -- Write_Field16_Name --
10552 ------------------------
10553
10554 procedure Write_Field16_Name (Id : Entity_Id) is
10555 begin
10556 case Ekind (Id) is
10557 when E_Record_Type
10558 | E_Record_Type_With_Private
10559 =>
10560 Write_Str ("Access_Disp_Table");
10561
10562 when E_Abstract_State =>
10563 Write_Str ("Body_References");
10564
10565 when E_Class_Wide_Subtype
10566 | E_Record_Subtype
10567 =>
10568 Write_Str ("Cloned_Subtype");
10569
10570 when E_Function
10571 | E_Procedure
10572 =>
10573 Write_Str ("DTC_Entity");
10574
10575 when E_Component =>
10576 Write_Str ("Entry_Formal");
10577
10578 when Concurrent_Kind
10579 | E_Generic_Package
10580 | E_Package
10581 =>
10582 Write_Str ("First_Private_Entity");
10583
10584 when Enumeration_Kind =>
10585 Write_Str ("Lit_Strings");
10586
10587 when Decimal_Fixed_Point_Kind =>
10588 Write_Str ("Scale_Value");
10589
10590 when E_String_Literal_Subtype =>
10591 Write_Str ("String_Literal_Length");
10592
10593 when E_Out_Parameter
10594 | E_Variable
10595 =>
10596 Write_Str ("Unset_Reference");
10597
10598 when others =>
10599 Write_Str ("Field16??");
10600 end case;
10601 end Write_Field16_Name;
10602
10603 ------------------------
10604 -- Write_Field17_Name --
10605 ------------------------
10606
10607 procedure Write_Field17_Name (Id : Entity_Id) is
10608 begin
10609 case Ekind (Id) is
10610 when Formal_Kind
10611 | E_Constant
10612 | E_Generic_In_Out_Parameter
10613 | E_Variable
10614 =>
10615 Write_Str ("Actual_Subtype");
10616
10617 when Digits_Kind =>
10618 Write_Str ("Digits_Value");
10619
10620 when E_Discriminant =>
10621 Write_Str ("Discriminal");
10622
10623 when Class_Wide_Kind
10624 | Concurrent_Kind
10625 | Private_Kind
10626 | E_Block
10627 | E_Entry
10628 | E_Entry_Family
10629 | E_Function
10630 | E_Generic_Function
10631 | E_Generic_Package
10632 | E_Generic_Procedure
10633 | E_Loop
10634 | E_Operator
10635 | E_Package
10636 | E_Package_Body
10637 | E_Procedure
10638 | E_Record_Type
10639 | E_Record_Subtype
10640 | E_Return_Statement
10641 | E_Subprogram_Body
10642 | E_Subprogram_Type
10643 =>
10644 Write_Str ("First_Entity");
10645
10646 when Array_Kind =>
10647 Write_Str ("First_Index");
10648
10649 when Enumeration_Kind =>
10650 Write_Str ("First_Literal");
10651
10652 when Access_Kind =>
10653 Write_Str ("Master_Id");
10654
10655 when Modular_Integer_Kind =>
10656 Write_Str ("Modulus");
10657
10658 when E_Component =>
10659 Write_Str ("Prival");
10660
10661 when others =>
10662 Write_Str ("Field17??");
10663 end case;
10664 end Write_Field17_Name;
10665
10666 ------------------------
10667 -- Write_Field18_Name --
10668 ------------------------
10669
10670 procedure Write_Field18_Name (Id : Entity_Id) is
10671 begin
10672 case Ekind (Id) is
10673 when E_Enumeration_Literal
10674 | E_Function
10675 | E_Operator
10676 | E_Procedure
10677 =>
10678 Write_Str ("Alias");
10679
10680 when E_Record_Type =>
10681 Write_Str ("Corresponding_Concurrent_Type");
10682
10683 when E_Subprogram_Body =>
10684 Write_Str ("Corresponding_Protected_Entry");
10685
10686 when Concurrent_Kind =>
10687 Write_Str ("Corresponding_Record_Type");
10688
10689 when E_Block
10690 | E_Label
10691 | E_Loop
10692 =>
10693 Write_Str ("Enclosing_Scope");
10694
10695 when E_Entry_Index_Parameter =>
10696 Write_Str ("Entry_Index_Constant");
10697
10698 when E_Access_Protected_Subprogram_Type
10699 | E_Access_Subprogram_Type
10700 | E_Anonymous_Access_Protected_Subprogram_Type
10701 | E_Exception_Type
10702 | E_Class_Wide_Subtype
10703 =>
10704 Write_Str ("Equivalent_Type");
10705
10706 when Fixed_Point_Kind =>
10707 Write_Str ("Delta_Value");
10708
10709 when Enumeration_Kind =>
10710 Write_Str ("Lit_Indexes");
10711
10712 when Incomplete_Or_Private_Kind
10713 | E_Record_Subtype
10714 =>
10715 Write_Str ("Private_Dependents");
10716
10717 when E_Exception
10718 | E_Generic_Function
10719 | E_Generic_Package
10720 | E_Generic_Procedure
10721 | E_Package
10722 =>
10723 Write_Str ("Renamed_Entity");
10724
10725 when Object_Kind =>
10726 Write_Str ("Renamed_Object");
10727
10728 when E_String_Literal_Subtype =>
10729 Write_Str ("String_Literal_Low_Bound");
10730
10731 when others =>
10732 Write_Str ("Field18??");
10733 end case;
10734 end Write_Field18_Name;
10735
10736 -----------------------
10737 -- Write_Field19_Name --
10738 -----------------------
10739
10740 procedure Write_Field19_Name (Id : Entity_Id) is
10741 begin
10742 case Ekind (Id) is
10743 when E_Generic_Package
10744 | E_Package
10745 =>
10746 Write_Str ("Body_Entity");
10747
10748 when E_Discriminant =>
10749 Write_Str ("Corresponding_Discriminant");
10750
10751 when Scalar_Kind =>
10752 Write_Str ("Default_Aspect_Value");
10753
10754 when E_Array_Type =>
10755 Write_Str ("Default_Component_Value");
10756
10757 when E_Protected_Type =>
10758 Write_Str ("Entry_Bodies_Array");
10759
10760 when E_Function
10761 | E_Operator
10762 | E_Subprogram_Type
10763 =>
10764 Write_Str ("Extra_Accessibility_Of_Result");
10765
10766 when E_Abstract_State
10767 | E_Class_Wide_Type
10768 | E_Incomplete_Type
10769 =>
10770 Write_Str ("Non_Limited_View");
10771
10772 when E_Incomplete_Subtype =>
10773 if From_Limited_With (Id) then
10774 Write_Str ("Non_Limited_View");
10775 end if;
10776
10777 when E_Record_Type =>
10778 Write_Str ("Parent_Subtype");
10779
10780 when E_Procedure =>
10781 Write_Str ("Receiving_Entry");
10782
10783 when E_Constant
10784 | E_Variable
10785 =>
10786 Write_Str ("Size_Check_Code");
10787
10788 when Formal_Kind
10789 | E_Package_Body
10790 =>
10791 Write_Str ("Spec_Entity");
10792
10793 when Private_Kind =>
10794 Write_Str ("Underlying_Full_View");
10795
10796 when others =>
10797 Write_Str ("Field19??");
10798 end case;
10799 end Write_Field19_Name;
10800
10801 -----------------------
10802 -- Write_Field20_Name --
10803 -----------------------
10804
10805 procedure Write_Field20_Name (Id : Entity_Id) is
10806 begin
10807 case Ekind (Id) is
10808 when Array_Kind =>
10809 Write_Str ("Component_Type");
10810
10811 when E_Generic_In_Parameter
10812 | E_In_Parameter
10813 =>
10814 Write_Str ("Default_Value");
10815
10816 when Access_Kind =>
10817 Write_Str ("Directly_Designated_Type");
10818
10819 when E_Component =>
10820 Write_Str ("Discriminant_Checking_Func");
10821
10822 when E_Discriminant =>
10823 Write_Str ("Discriminant_Default_Value");
10824
10825 when Class_Wide_Kind
10826 | Concurrent_Kind
10827 | Private_Kind
10828 | E_Block
10829 | E_Entry
10830 | E_Entry_Family
10831 | E_Function
10832 | E_Generic_Function
10833 | E_Generic_Package
10834 | E_Generic_Procedure
10835 | E_Loop
10836 | E_Operator
10837 | E_Package
10838 | E_Package_Body
10839 | E_Procedure
10840 | E_Record_Type
10841 | E_Record_Subtype
10842 | E_Return_Statement
10843 | E_Subprogram_Body
10844 | E_Subprogram_Type
10845 =>
10846 Write_Str ("Last_Entity");
10847
10848 when E_Constant
10849 | E_Variable
10850 =>
10851 Write_Str ("Prival_Link");
10852
10853 when E_Exception =>
10854 Write_Str ("Register_Exception_Call");
10855
10856 when Scalar_Kind =>
10857 Write_Str ("Scalar_Range");
10858
10859 when others =>
10860 Write_Str ("Field20??");
10861 end case;
10862 end Write_Field20_Name;
10863
10864 -----------------------
10865 -- Write_Field21_Name --
10866 -----------------------
10867
10868 procedure Write_Field21_Name (Id : Entity_Id) is
10869 begin
10870 case Ekind (Id) is
10871 when Entry_Kind =>
10872 Write_Str ("Accept_Address");
10873
10874 when E_Component
10875 | E_Discriminant
10876 =>
10877 Write_Str ("Corresponding_Record_Component");
10878
10879 when E_In_Parameter =>
10880 Write_Str ("Default_Expr_Function");
10881
10882 when Concurrent_Kind
10883 | Incomplete_Or_Private_Kind
10884 | Class_Wide_Kind
10885 | E_Record_Type
10886 | E_Record_Subtype
10887 =>
10888 Write_Str ("Discriminant_Constraint");
10889
10890 when E_Constant
10891 | E_Exception
10892 | E_Function
10893 | E_Generic_Function
10894 | E_Generic_Procedure
10895 | E_Procedure
10896 | E_Variable
10897 =>
10898 Write_Str ("Interface_Name");
10899
10900 when Enumeration_Kind =>
10901 Write_Str ("Lit_Hash");
10902
10903 when Array_Kind
10904 | Modular_Integer_Kind
10905 =>
10906 Write_Str ("Original_Array_Type");
10907
10908 when Fixed_Point_Kind =>
10909 Write_Str ("Small_Value");
10910
10911 when others =>
10912 Write_Str ("Field21??");
10913 end case;
10914 end Write_Field21_Name;
10915
10916 -----------------------
10917 -- Write_Field22_Name --
10918 -----------------------
10919
10920 procedure Write_Field22_Name (Id : Entity_Id) is
10921 begin
10922 case Ekind (Id) is
10923 when Access_Kind =>
10924 Write_Str ("Associated_Storage_Pool");
10925
10926 when Array_Kind =>
10927 Write_Str ("Component_Size");
10928
10929 when E_Record_Type =>
10930 Write_Str ("Corresponding_Remote_Type");
10931
10932 when E_Component
10933 | E_Discriminant
10934 =>
10935 Write_Str ("Original_Record_Component");
10936
10937 when E_Enumeration_Literal =>
10938 Write_Str ("Enumeration_Rep_Expr");
10939
10940 when Formal_Kind =>
10941 Write_Str ("Protected_Formal");
10942
10943 when Concurrent_Kind
10944 | Entry_Kind
10945 | Generic_Unit_Kind
10946 | E_Package
10947 | E_Package_Body
10948 | Subprogram_Kind
10949 | E_Block
10950 | E_Subprogram_Body
10951 | E_Private_Type .. E_Limited_Private_Subtype
10952 | E_Void
10953 | E_Loop
10954 | E_Return_Statement
10955 =>
10956 Write_Str ("Scope_Depth_Value");
10957
10958 when E_Variable =>
10959 Write_Str ("Shared_Var_Procs_Instance");
10960
10961 when others =>
10962 Write_Str ("Field22??");
10963 end case;
10964 end Write_Field22_Name;
10965
10966 ------------------------
10967 -- Write_Field23_Name --
10968 ------------------------
10969
10970 procedure Write_Field23_Name (Id : Entity_Id) is
10971 begin
10972 case Ekind (Id) is
10973 when E_Discriminant =>
10974 Write_Str ("CR_Discriminant");
10975
10976 when E_Block =>
10977 Write_Str ("Entry_Cancel_Parameter");
10978
10979 when E_Enumeration_Type =>
10980 Write_Str ("Enum_Pos_To_Rep");
10981
10982 when Formal_Kind
10983 | E_Variable
10984 =>
10985 Write_Str ("Extra_Constrained");
10986
10987 when Access_Kind =>
10988 Write_Str ("Finalization_Master");
10989
10990 when E_Generic_Function
10991 | E_Generic_Package
10992 | E_Generic_Procedure
10993 =>
10994 Write_Str ("Inner_Instances");
10995
10996 when Array_Kind =>
10997 Write_Str ("Packed_Array_Impl_Type");
10998
10999 when Entry_Kind =>
11000 Write_Str ("Protection_Object");
11001
11002 when Class_Wide_Kind
11003 | Concurrent_Kind
11004 | Incomplete_Or_Private_Kind
11005 | E_Record_Type
11006 | E_Record_Subtype
11007 =>
11008 Write_Str ("Stored_Constraint");
11009
11010 when E_Function
11011 | E_Procedure
11012 =>
11013 if Present (Scope (Id))
11014 and then Is_Protected_Type (Scope (Id))
11015 then
11016 Write_Str ("Protection_Object");
11017 else
11018 Write_Str ("Generic_Renamings");
11019 end if;
11020
11021 when E_Package =>
11022 if Is_Generic_Instance (Id) then
11023 Write_Str ("Generic_Renamings");
11024 else
11025 Write_Str ("Limited_View");
11026 end if;
11027
11028 when others =>
11029 Write_Str ("Field23??");
11030 end case;
11031 end Write_Field23_Name;
11032
11033 ------------------------
11034 -- Write_Field24_Name --
11035 ------------------------
11036
11037 procedure Write_Field24_Name (Id : Entity_Id) is
11038 begin
11039 case Ekind (Id) is
11040 when E_Package =>
11041 Write_Str ("Incomplete_Actuals");
11042
11043 when Type_Kind
11044 | E_Constant
11045 | E_Loop_Parameter
11046 | E_Variable
11047 =>
11048 Write_Str ("Related_Expression");
11049
11050 when Formal_Kind =>
11051 Write_Str ("Minimum_Accessibility");
11052
11053 when E_Function
11054 | E_Operator
11055 | E_Procedure
11056 =>
11057 Write_Str ("Subps_Index");
11058
11059 when others =>
11060 Write_Str ("Field24???");
11061 end case;
11062 end Write_Field24_Name;
11063
11064 ------------------------
11065 -- Write_Field25_Name --
11066 ------------------------
11067
11068 procedure Write_Field25_Name (Id : Entity_Id) is
11069 begin
11070 case Ekind (Id) is
11071 when E_Generic_Package
11072 | E_Package
11073 =>
11074 Write_Str ("Abstract_States");
11075
11076 when E_Entry
11077 | E_Entry_Family
11078 =>
11079 Write_Str ("Contract_Wrapper");
11080
11081 when E_Variable =>
11082 Write_Str ("Debug_Renaming_Link");
11083
11084 when E_Component =>
11085 Write_Str ("DT_Offset_To_Top_Func");
11086
11087 when E_Function
11088 | E_Procedure
11089 =>
11090 Write_Str ("Interface_Alias");
11091
11092 when E_Record_Subtype
11093 | E_Record_Subtype_With_Private
11094 | E_Record_Type
11095 | E_Record_Type_With_Private
11096 =>
11097 Write_Str ("Interfaces");
11098
11099 when E_Array_Subtype
11100 | E_Array_Type
11101 =>
11102 Write_Str ("Related_Array_Object");
11103
11104 when Discrete_Kind =>
11105 Write_Str ("Static_Discrete_Predicate");
11106
11107 when Real_Kind =>
11108 Write_Str ("Static_Real_Or_String_Predicate");
11109
11110 when Task_Kind =>
11111 Write_Str ("Task_Body_Procedure");
11112
11113 when others =>
11114 Write_Str ("Field25??");
11115 end case;
11116 end Write_Field25_Name;
11117
11118 ------------------------
11119 -- Write_Field26_Name --
11120 ------------------------
11121
11122 procedure Write_Field26_Name (Id : Entity_Id) is
11123 begin
11124 case Ekind (Id) is
11125 when E_Record_Type
11126 | E_Record_Type_With_Private
11127 =>
11128 Write_Str ("Dispatch_Table_Wrappers");
11129
11130 when E_In_Out_Parameter
11131 | E_Out_Parameter
11132 | E_Variable
11133 =>
11134 Write_Str ("Last_Assignment");
11135
11136 when E_Function
11137 | E_Procedure
11138 =>
11139 Write_Str ("Overridden_Operation");
11140
11141 when E_Generic_Package
11142 | E_Package
11143 =>
11144 Write_Str ("Package_Instantiation");
11145
11146 when E_Component
11147 | E_Constant
11148 =>
11149 Write_Str ("Related_Type");
11150
11151 when Access_Kind
11152 | Task_Kind
11153 =>
11154 Write_Str ("Storage_Size_Variable");
11155
11156 when others =>
11157 Write_Str ("Field26??");
11158 end case;
11159 end Write_Field26_Name;
11160
11161 ------------------------
11162 -- Write_Field27_Name --
11163 ------------------------
11164
11165 procedure Write_Field27_Name (Id : Entity_Id) is
11166 begin
11167 case Ekind (Id) is
11168 when Type_Kind
11169 | E_Package
11170 =>
11171 Write_Str ("Current_Use_Clause");
11172
11173 when E_Component
11174 | E_Constant
11175 | E_Variable
11176 =>
11177 Write_Str ("Related_Type");
11178
11179 when E_Function
11180 | E_Procedure
11181 =>
11182 Write_Str ("Wrapped_Entity");
11183
11184 when others =>
11185 Write_Str ("Field27??");
11186 end case;
11187 end Write_Field27_Name;
11188
11189 ------------------------
11190 -- Write_Field28_Name --
11191 ------------------------
11192
11193 procedure Write_Field28_Name (Id : Entity_Id) is
11194 begin
11195 case Ekind (Id) is
11196 when E_Entry
11197 | E_Entry_Family
11198 | E_Function
11199 | E_Procedure
11200 | E_Subprogram_Body
11201 | E_Subprogram_Type
11202 =>
11203 Write_Str ("Extra_Formals");
11204
11205 when E_Package
11206 | E_Package_Body
11207 =>
11208 Write_Str ("Finalizer");
11209
11210 when E_Constant
11211 | E_Variable
11212 =>
11213 Write_Str ("Initialization_Statements");
11214
11215 when E_Access_Subprogram_Type =>
11216 Write_Str ("Original_Access_Type");
11217
11218 when Task_Kind =>
11219 Write_Str ("Relative_Deadline_Variable");
11220
11221 when E_Record_Type =>
11222 Write_Str ("Underlying_Record_View");
11223
11224 when others =>
11225 Write_Str ("Field28??");
11226 end case;
11227 end Write_Field28_Name;
11228
11229 ------------------------
11230 -- Write_Field29_Name --
11231 ------------------------
11232
11233 procedure Write_Field29_Name (Id : Entity_Id) is
11234 begin
11235 case Ekind (Id) is
11236 when E_Function
11237 | E_Package
11238 | E_Procedure
11239 | E_Subprogram_Body
11240 =>
11241 Write_Str ("Anonymous_Masters");
11242
11243 when E_Constant
11244 | E_Variable
11245 =>
11246 Write_Str ("BIP_Initialization_Call");
11247
11248 when Type_Kind =>
11249 Write_Str ("Subprograms_For_Type");
11250
11251 when others =>
11252 Write_Str ("Field29??");
11253 end case;
11254 end Write_Field29_Name;
11255
11256 ------------------------
11257 -- Write_Field30_Name --
11258 ------------------------
11259
11260 procedure Write_Field30_Name (Id : Entity_Id) is
11261 begin
11262 case Ekind (Id) is
11263 when E_Record_Type
11264 | E_Record_Type_With_Private
11265 =>
11266 Write_Str ("Access_Disp_Table_Elab_Flag");
11267
11268 when E_Protected_Type
11269 | E_Task_Type
11270 =>
11271 Write_Str ("Anonymous_Object");
11272
11273 when E_Function =>
11274 Write_Str ("Corresponding_Equality");
11275
11276 when E_Constant
11277 | E_Variable
11278 =>
11279 Write_Str ("Last_Aggregate_Assignment");
11280
11281 when E_Procedure =>
11282 Write_Str ("Static_Initialization");
11283
11284 when others =>
11285 Write_Str ("Field30??");
11286 end case;
11287 end Write_Field30_Name;
11288
11289 ------------------------
11290 -- Write_Field31_Name --
11291 ------------------------
11292
11293 procedure Write_Field31_Name (Id : Entity_Id) is
11294 begin
11295 case Ekind (Id) is
11296 when E_Constant
11297 | E_In_Parameter
11298 | E_In_Out_Parameter
11299 | E_Loop_Parameter
11300 | E_Out_Parameter
11301 | E_Variable
11302 =>
11303 Write_Str ("Activation_Record_Component");
11304
11305 when Type_Kind =>
11306 Write_Str ("Derived_Type_Link");
11307
11308 when E_Function
11309 | E_Procedure
11310 =>
11311 Write_Str ("Thunk_Entity");
11312
11313 when others =>
11314 Write_Str ("Field31??");
11315 end case;
11316 end Write_Field31_Name;
11317
11318 ------------------------
11319 -- Write_Field32_Name --
11320 ------------------------
11321
11322 procedure Write_Field32_Name (Id : Entity_Id) is
11323 begin
11324 case Ekind (Id) is
11325 when E_Procedure =>
11326 Write_Str ("Corresponding_Function");
11327
11328 when E_Function =>
11329 Write_Str ("Corresponding_Procedure");
11330
11331 when E_Abstract_State
11332 | E_Constant
11333 | E_Variable
11334 =>
11335 Write_Str ("Encapsulating_State");
11336
11337 when Type_Kind =>
11338 Write_Str ("No_Tagged_Streams_Pragma");
11339
11340 when others =>
11341 Write_Str ("Field32??");
11342 end case;
11343 end Write_Field32_Name;
11344
11345 ------------------------
11346 -- Write_Field33_Name --
11347 ------------------------
11348
11349 procedure Write_Field33_Name (Id : Entity_Id) is
11350 begin
11351 case Ekind (Id) is
11352 when Subprogram_Kind
11353 | Type_Kind
11354 | E_Constant
11355 | E_Variable
11356 =>
11357 Write_Str ("Linker_Section_Pragma");
11358
11359 when others =>
11360 Write_Str ("Field33??");
11361 end case;
11362 end Write_Field33_Name;
11363
11364 ------------------------
11365 -- Write_Field34_Name --
11366 ------------------------
11367
11368 procedure Write_Field34_Name (Id : Entity_Id) is
11369 begin
11370 case Ekind (Id) is
11371 when E_Constant
11372 | E_Entry
11373 | E_Entry_Family
11374 | E_Function
11375 | E_Generic_Function
11376 | E_Generic_Package
11377 | E_Generic_Procedure
11378 | E_Operator
11379 | E_Package
11380 | E_Package_Body
11381 | E_Procedure
11382 | E_Subprogram_Body
11383 | E_Task_Body
11384 | E_Variable
11385 | Type_Kind
11386 | E_Void
11387 =>
11388 Write_Str ("Contract");
11389
11390 when others =>
11391 Write_Str ("Field34??");
11392 end case;
11393 end Write_Field34_Name;
11394
11395 ------------------------
11396 -- Write_Field35_Name --
11397 ------------------------
11398
11399 procedure Write_Field35_Name (Id : Entity_Id) is
11400 begin
11401 case Ekind (Id) is
11402 when E_Variable =>
11403 Write_Str ("Anonymous_Designated_Type");
11404
11405 when E_Entry
11406 | E_Entry_Family
11407 =>
11408 Write_Str ("Entry_Max_Queue_Lenghts_Array");
11409
11410 when Subprogram_Kind =>
11411 Write_Str ("Import_Pragma");
11412
11413 when others =>
11414 Write_Str ("Field35??");
11415 end case;
11416 end Write_Field35_Name;
11417
11418 ------------------------
11419 -- Write_Field36_Name --
11420 ------------------------
11421
11422 procedure Write_Field36_Name (Id : Entity_Id) is
11423 pragma Unreferenced (Id);
11424 begin
11425 Write_Str ("Prev_Entity");
11426 end Write_Field36_Name;
11427
11428 ------------------------
11429 -- Write_Field37_Name --
11430 ------------------------
11431
11432 procedure Write_Field37_Name (Id : Entity_Id) is
11433 pragma Unreferenced (Id);
11434 begin
11435 Write_Str ("Associated_Entity");
11436 end Write_Field37_Name;
11437
11438 ------------------------
11439 -- Write_Field38_Name --
11440 ------------------------
11441
11442 procedure Write_Field38_Name (Id : Entity_Id) is
11443 begin
11444 case Ekind (Id) is
11445 when E_Function
11446 | E_Procedure
11447 =>
11448 Write_Str ("Class_Wide_Clone");
11449
11450 when E_Array_Subtype
11451 | E_Record_Subtype
11452 | E_Record_Subtype_With_Private
11453 =>
11454 Write_Str ("Predicated_Parent");
11455
11456 when E_Variable =>
11457 Write_Str ("Validated_Object");
11458
11459 when others =>
11460 Write_Str ("Field38??");
11461 end case;
11462 end Write_Field38_Name;
11463
11464 ------------------------
11465 -- Write_Field39_Name --
11466 ------------------------
11467
11468 procedure Write_Field39_Name (Id : Entity_Id) is
11469 begin
11470 case Ekind (Id) is
11471 when E_Function
11472 | E_Procedure
11473 =>
11474 Write_Str ("Protected_Subprogram");
11475
11476 when others =>
11477 Write_Str ("Field39??");
11478 end case;
11479 end Write_Field39_Name;
11480
11481 ------------------------
11482 -- Write_Field40_Name --
11483 ------------------------
11484
11485 procedure Write_Field40_Name (Id : Entity_Id) is
11486 begin
11487 case Ekind (Id) is
11488 when E_Abstract_State
11489 | E_Constant
11490 | E_Entry
11491 | E_Entry_Family
11492 | E_Function
11493 | E_Generic_Function
11494 | E_Generic_Package
11495 | E_Generic_Procedure
11496 | E_Operator
11497 | E_Package
11498 | E_Package_Body
11499 | E_Procedure
11500 | E_Protected_Body
11501 | E_Subprogram_Body
11502 | E_Task_Body
11503 | E_Variable
11504 | E_Void
11505 | Type_Kind
11506 =>
11507 Write_Str ("SPARK_Pragma");
11508
11509 when others =>
11510 Write_Str ("Field40??");
11511 end case;
11512 end Write_Field40_Name;
11513
11514 ------------------------
11515 -- Write_Field41_Name --
11516 ------------------------
11517
11518 procedure Write_Field41_Name (Id : Entity_Id) is
11519 begin
11520 case Ekind (Id) is
11521 when E_Function
11522 | E_Procedure
11523 =>
11524 Write_Str ("Original_Protected_Subprogram");
11525
11526 when E_Generic_Package
11527 | E_Package
11528 | E_Package_Body
11529 | E_Protected_Type
11530 | E_Task_Type
11531 =>
11532 Write_Str ("SPARK_Aux_Pragma");
11533
11534 when E_Subprogram_Type =>
11535 Write_Str ("Access_Subprogram_Wrapper");
11536
11537 when others =>
11538 Write_Str ("Field41??");
11539 end case;
11540 end Write_Field41_Name;
11541
11542 -------------------------
11543 -- Iterator Procedures --
11544 -------------------------
11545
11546 procedure Proc_Next_Component (N : in out Node_Id) is
11547 begin
11548 N := Next_Component (N);
11549 end Proc_Next_Component;
11550
11551 procedure Proc_Next_Component_Or_Discriminant (N : in out Node_Id) is
11552 begin
11553 N := Next_Entity (N);
11554 while Present (N) loop
11555 exit when Ekind (N) in E_Component | E_Discriminant;
11556 N := Next_Entity (N);
11557 end loop;
11558 end Proc_Next_Component_Or_Discriminant;
11559
11560 procedure Proc_Next_Discriminant (N : in out Node_Id) is
11561 begin
11562 N := Next_Discriminant (N);
11563 end Proc_Next_Discriminant;
11564
11565 procedure Proc_Next_Formal (N : in out Node_Id) is
11566 begin
11567 N := Next_Formal (N);
11568 end Proc_Next_Formal;
11569
11570 procedure Proc_Next_Formal_With_Extras (N : in out Node_Id) is
11571 begin
11572 N := Next_Formal_With_Extras (N);
11573 end Proc_Next_Formal_With_Extras;
11574
11575 procedure Proc_Next_Index (N : in out Node_Id) is
11576 begin
11577 N := Next_Index (N);
11578 end Proc_Next_Index;
11579
11580 procedure Proc_Next_Inlined_Subprogram (N : in out Node_Id) is
11581 begin
11582 N := Next_Inlined_Subprogram (N);
11583 end Proc_Next_Inlined_Subprogram;
11584
11585 procedure Proc_Next_Literal (N : in out Node_Id) is
11586 begin
11587 N := Next_Literal (N);
11588 end Proc_Next_Literal;
11589
11590 procedure Proc_Next_Stored_Discriminant (N : in out Node_Id) is
11591 begin
11592 N := Next_Stored_Discriminant (N);
11593 end Proc_Next_Stored_Discriminant;
11594
11595 end Einfo;