Debian Codegraph @

gcc/ada/ali.ads

raw
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- A L I --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 1992-2025, 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 -- This package defines the internal data structures used for representation
27 -- of Ada Library Information (ALI) acquired from the ALI files generated by
28 -- the front end. The format of the ALI files is documented in Lib.Writ.
29
30 with Casing; use Casing;
31 with Gnatvsn; use Gnatvsn;
32 with Namet; use Namet;
33 with Rident; use Rident;
34 with Table;
35 with Types; use Types;
36
37 with GNAT.Dynamic_Tables;
38 with GNAT.HTable; use GNAT.HTable;
39
40 package ALI is
41
42 --------------
43 -- Id Types --
44 --------------
45
46 type ALI_Id is range 0 .. 99_999_999;
47 -- Id values used for ALIs table entries
48
49 type CUDA_Kernel_Id is range 0 .. 99_999_999;
50 -- Id values used for CUDA_Kernel table entries
51
52 type Unit_Id is range 0 .. 99_999_999;
53 -- Id values used for Unit table entries
54
55 type With_Id is range 0 .. 99_999_999;
56 -- Id values used for Withs table entries
57
58 type Arg_Id is range 0 .. 99_999_999;
59 -- Id values used for argument table entries
60
61 type Sdep_Id is range 0 .. 99_999_999;
62 -- Id values used for Sdep table entries
63
64 type Source_Id is range 0 .. 99_999_999;
65 -- Id values used for Source table entries
66
67 type Interrupt_State_Id is range 0 .. 99_999_999;
68 -- Id values used for Interrupt_State table entries
69
70 type Priority_Specific_Dispatching_Id is range 0 .. 99_999_999;
71 -- Id values used for Priority_Specific_Dispatching table entries
72
73 type Invocation_Construct_Id is range 0 .. 99_999_999;
74 -- Id values used for Invocation_Constructs table entries
75
76 type Invocation_Relation_Id is range 0 .. 99_999_999;
77 -- Id values used for Invocation_Relations table entries
78
79 type Invocation_Signature_Id is range 0 .. 99_999_999;
80 -- Id values used for Invocation_Signatures table entries
81
82 function Present (IC_Id : Invocation_Construct_Id) return Boolean;
83 pragma Inline (Present);
84 -- Determine whether invocation construct IC_Id exists
85
86 function Present (IR_Id : Invocation_Relation_Id) return Boolean;
87 pragma Inline (Present);
88 -- Determine whether invocation relation IR_Id exists
89
90 function Present (IS_Id : Invocation_Signature_Id) return Boolean;
91 pragma Inline (Present);
92 -- Determine whether invocation signature IS_Id exists
93
94 function Present (Dep : Sdep_Id) return Boolean;
95 pragma Inline (Present);
96 -- Determine whether dependant Dep exists
97
98 function Present (U_Id : Unit_Id) return Boolean;
99 pragma Inline (Present);
100 -- Determine whether unit U_Id exists
101
102 function Present (W_Id : With_Id) return Boolean;
103 pragma Inline (Present);
104 -- Determine whether with W_Id exists
105
106 --------------------
107 -- ALI File Table --
108 --------------------
109
110 -- Each ALI file read generates an entry in the ALIs table
111
112 No_ALI_Id : constant ALI_Id := ALI_Id'First;
113 -- Special value indicating no ALI entry
114
115 First_ALI_Entry : constant ALI_Id := No_ALI_Id + 1;
116 -- Id of first actual entry in table
117
118 -- The following type enumerates all possible invocation-graph encoding
119 -- kinds.
120
121 type Invocation_Graph_Encoding_Kind is
122 (Endpoints_Encoding,
123 -- The invocation construct and relation lines contain information for
124 -- the start construct and end target found on an invocation-graph path.
125
126 Full_Path_Encoding,
127 -- The invocation construct and relation lines contain information for
128 -- all constructs and targets found on a invocation-graph path.
129
130 No_Encoding);
131
132 type Main_Program_Type is (None, Proc, Func);
133 -- Indicator of whether unit can be used as main program
134
135 type ALIs_Record is record
136 Afile : File_Name_Type;
137 -- Name of ALI file
138
139 Ofile_Full_Name : File_Name_Type;
140 -- Full name of object file corresponding to the ALI file
141
142 Sfile : File_Name_Type;
143 -- Name of source file that generates this ALI file (which is equal
144 -- to the name of the source file in the first unit table entry for
145 -- this ALI file, since the body if present is always first).
146
147 Ver : String (1 .. Ver_Len_Max);
148 -- Value of library version (V line in ALI file). Not set if
149 -- V lines are ignored as a result of the Ignore_Lines parameter.
150
151 Ver_Len : Natural;
152 -- Length of characters stored in Ver. Not set if V lines are ignored as
153 -- a result of the Ignore_Lines parameter.
154
155 SAL_Interface : Boolean;
156 -- Set True when this is an interface to a standalone library
157
158 First_Unit : Unit_Id;
159 -- Id of first Unit table entry for this file
160
161 Last_Unit : Unit_Id;
162 -- Id of last Unit table entry for this file
163
164 First_Sdep : Sdep_Id;
165 -- Id of first Sdep table entry for this file
166
167 Last_Sdep : Sdep_Id;
168 -- Id of last Sdep table entry for this file
169
170 Main_Program : Main_Program_Type;
171 -- Indicator of whether first unit can be used as main program. Not set
172 -- if 'M' appears in Ignore_Lines.
173
174 Main_Priority : Int;
175 -- Indicates priority value if Main_Program field indicates that this
176 -- can be a main program. A value of -1 (No_Main_Priority) indicates
177 -- that no parameter was found, or no M line was present. Not set if
178 -- 'M' appears in Ignore_Lines.
179
180 Main_CPU : Int;
181 -- Indicates processor if Main_Program field indicates that this can
182 -- be a main program. A value of -1 (No_Main_CPU) indicates that no C
183 -- parameter was found, or no M line was present. Not set if 'M' appears
184 -- in Ignore_Lines.
185
186 Time_Slice_Value : Int;
187 -- Indicates value of time slice parameter from T=xxx on main program
188 -- line. A value of -1 indicates that no T=xxx parameter was found, or
189 -- no M line was present. Not set if 'M' appears in Ignore_Lines.
190
191 WC_Encoding : Character;
192 -- Wide character encoding if main procedure. Otherwise not relevant.
193 -- Not set if 'M' appears in Ignore_Lines.
194
195 Locking_Policy : Character;
196 -- Indicates locking policy for units in this file. Space means tasking
197 -- was not used, or that no Locking_Policy pragma was present or that
198 -- this is a language defined unit. Otherwise set to first character
199 -- (upper case) of policy name. Not set if 'P' appears in Ignore_Lines.
200
201 Partition_Elaboration_Policy : Character;
202 -- Indicates partition elaboration policy for units in this file. Space
203 -- means that no Partition_Elaboration_Policy pragma was present or that
204 -- this is a language defined unit. Otherwise set to first character
205 -- (upper case) of policy name. Not set if 'P' appears in Ignore_Lines.
206
207 Queuing_Policy : Character;
208 -- Indicates queuing policy for units in this file. Space means tasking
209 -- was not used, or that no Queuing_Policy pragma was present or that
210 -- this is a language defined unit. Otherwise set to first character
211 -- (upper case) of policy name. Not set if 'P' appears in Ignore_Lines.
212
213 Task_Dispatching_Policy : Character;
214 -- Indicates task dispatching policy for units in this file. Space means
215 -- tasking was not used, or that no Task_Dispatching_Policy pragma was
216 -- present or that this is a language defined unit. Otherwise set to
217 -- first character (upper case) of policy name. Not set if 'P' appears
218 -- in Ignore_Lines.
219
220 Compile_Errors : Boolean;
221 -- Set to True if compile errors for unit. Note that No_Object will
222 -- always be set as well in this case. Not set if 'P' appears in
223 -- Ignore_Lines.
224
225 GNATprove_Mode : Boolean;
226 -- Set to True if ALI and object file produced in GNATprove_Mode as
227 -- signalled by GP appearing on the P line. Not set if 'P' appears in
228 -- Ignore_Lines.
229
230 Interrupts_Default_To_System : Boolean;
231 -- Set to True if pragma Interrupts_System_By_Default is seen;
232
233 No_Component_Reordering : Boolean;
234 -- Set to True if file was compiled with a configuration pragma file
235 -- containing pragma No_Component_Reordering. Not set if 'P' appears
236 -- in Ignore_Lines.
237
238 No_Object : Boolean;
239 -- Set to True if no object file generated. Not set if 'P' appears in
240 -- Ignore_Lines.
241
242 Normalize_Scalars : Boolean;
243 -- Set to True if file was compiled with Normalize_Scalars. Not set if
244 -- 'P' appears in Ignore_Lines.
245
246 SSO_Default : Character;
247 -- Set to 'H' or 'L' if file was compiled with a configuration pragma
248 -- file containing Default_Scalar_Storage_Order (High/Low_Order_First).
249 -- Set to ' ' if neither pragma was present. Not set if 'P' appears in
250 -- Ignore_Lines.
251
252 Unit_Exception_Table : Boolean;
253 -- Set to True if unit exception table pointer generated. Not set if 'P'
254 -- appears in Ignore_Lines.
255
256 Zero_Cost_Exceptions : Boolean;
257 -- Set to True if file was compiled with zero cost exceptions. Not set
258 -- if 'P' appears in Ignore_Lines.
259
260 Restrictions : Restrictions_Info;
261 -- Restrictions information reconstructed from R lines
262
263 First_CUDA_Kernel : CUDA_Kernel_Id;
264 Last_CUDA_Kernel : CUDA_Kernel_Id'Base;
265 -- These point to the first and last entries in the CUDA_Kernels table
266 -- for this unit. If there are no entries, First_CUDA_Kernel =
267 -- Last_CUDA_Kernel + 1.
268
269 First_Interrupt_State : Interrupt_State_Id;
270 Last_Interrupt_State : Interrupt_State_Id'Base;
271 -- These point to the first and last entries in the interrupt state
272 -- table for this unit. If no entries, then Last_Interrupt_State =
273 -- First_Interrupt_State - 1 (that's why the 'Base reference is there,
274 -- it can be one less than the lower bound of the subtype). Not set if
275 -- 'I' appears in Ignore_Lines
276
277 First_Specific_Dispatching : Priority_Specific_Dispatching_Id;
278 Last_Specific_Dispatching : Priority_Specific_Dispatching_Id'Base;
279 -- These point to the first and last entries in the priority specific
280 -- dispatching table for this unit. If there are no entries, then
281 -- Last_Specific_Dispatching = First_Specific_Dispatching - 1. That
282 -- is why the 'Base reference is there, it can be one less than the
283 -- lower bound of the subtype. Not set if 'S' appears in Ignore_Lines.
284
285 Invocation_Graph_Encoding : Invocation_Graph_Encoding_Kind;
286 -- The encoding format used to capture information about the invocation
287 -- constructs and relations within the corresponding ALI file of this
288 -- unit.
289 end record;
290
291 No_Main_Priority : constant Int := -1;
292 -- Code for no main priority set
293
294 No_Main_CPU : constant Int := -1;
295 -- Code for no main cpu set
296
297 package ALIs is new Table.Table (
298 Table_Component_Type => ALIs_Record,
299 Table_Index_Type => ALI_Id,
300 Table_Low_Bound => First_ALI_Entry,
301 Table_Initial => 500,
302 Table_Increment => 200,
303 Table_Name => "ALIs");
304
305 ---------------------------
306 -- CUDA Kernels Table --
307 ---------------------------
308
309 -- An entry is made in this table for each K (CUDA Kernel) line
310 -- encountered in the input ALI file. The First/Last_CUDA_Kernel_Id
311 -- fields of the ALI file entry show the range of entries defined
312 -- within a particular ALI file.
313
314 type CUDA_Kernel_Record is record
315 Kernel_Name : Name_Id;
316 end record;
317
318 package CUDA_Kernels is new Table.Table (
319 Table_Component_Type => CUDA_Kernel_Record,
320 Table_Index_Type => CUDA_Kernel_Id'Base,
321 Table_Low_Bound => CUDA_Kernel_Id'First,
322 Table_Initial => 100,
323 Table_Increment => 200,
324 Table_Name => "Cuda_Kernels");
325
326 ----------------
327 -- Unit Table --
328 ----------------
329
330 -- Each unit within an ALI file generates an entry in the unit table
331
332 No_Unit_Id : constant Unit_Id := Unit_Id'First;
333 -- Special value indicating no unit table entry
334
335 First_Unit_Entry : constant Unit_Id := No_Unit_Id + 1;
336 -- Id of first actual entry in table
337
338 type Unit_Type is (Is_Spec, Is_Body, Is_Spec_Only, Is_Body_Only);
339 -- Indicates type of entry, if both body and spec appear in the ALI file,
340 -- then the first unit is marked Is_Body, and the second is marked Is_Spec.
341 -- If only a spec appears, then it is marked as Is_Spec_Only, and if only
342 -- a body appears, then it is marked Is_Body_Only).
343
344 subtype Version_String is String (1 .. 8);
345 -- Version string, taken from unit record
346
347 type Unit_Record is record
348 My_ALI : ALI_Id;
349 -- Corresponding ALI entry
350
351 Uname : Unit_Name_Type;
352 -- Name of Unit
353
354 Sfile : File_Name_Type;
355 -- Name of source file
356
357 Preelab : Boolean;
358 -- Indicates presence of PR parameter for a preelaborated package
359
360 No_Elab : Boolean;
361 -- Indicates presence of NE parameter for a unit that has does not
362 -- have an elaboration routine (since it has no elaboration code).
363
364 Pure : Boolean;
365 -- Indicates presence of PU parameter for a package having pragma Pure
366
367 Dynamic_Elab : Boolean;
368 -- Set to True if the unit was compiled with dynamic elaboration checks
369 -- (i.e. either -gnatE or pragma Elaboration_Checks (RM) was used to
370 -- compile the unit).
371
372 Elaborate_Body : Boolean;
373 -- Indicates presence of EB parameter for a package which has a pragma
374 -- Elaborate_Body, and also for generic package instantiations.
375
376 Set_Elab_Entity : Boolean;
377 -- Indicates presence of EE parameter for a unit which has an
378 -- elaboration entity which must be set true as part of the
379 -- elaboration of the unit.
380
381 Has_RACW : Boolean;
382 -- Indicates presence of RA parameter for a package that declares at
383 -- least one Remote Access to Class_Wide (RACW) object.
384
385 Remote_Types : Boolean;
386 -- Indicates presence of RT parameter for a package which has a
387 -- pragma Remote_Types.
388
389 Serious_Errors : Boolean;
390 -- Indicates presence of SE parameter indicating that compilation of
391 -- the unit encountered as serious error.
392
393 Shared_Passive : Boolean;
394 -- Indicates presence of SP parameter for a package which has a pragma
395 -- Shared_Passive.
396
397 RCI : Boolean;
398 -- Indicates presence of RC parameter for a package which has a pragma
399 -- Remote_Call_Interface.
400
401 Predefined : Boolean;
402 -- Indicates if unit is language predefined (or a child of such a unit)
403
404 Internal : Boolean;
405 -- Indicates if unit is an internal unit (or a child of such a unit)
406
407 First_With : With_Id;
408 -- Id of first withs table entry for this file
409
410 Last_With : With_Id;
411 -- Id of last withs table entry for this file
412
413 First_Arg : Arg_Id;
414 -- Id of first args table entry for this file
415
416 Last_Arg : Arg_Id;
417 -- Id of last args table entry for this file
418
419 First_Invocation_Construct : Invocation_Construct_Id;
420 -- Id of the first invocation construct for this unit
421
422 Last_Invocation_Construct : Invocation_Construct_Id;
423 -- Id of the last invocation construct for this unit
424
425 First_Invocation_Relation : Invocation_Relation_Id;
426 -- Id of the first invocation relation for this unit
427
428 Last_Invocation_Relation : Invocation_Relation_Id;
429 -- Id of the last invocation relation for this unit
430
431 Utype : Unit_Type;
432 -- Type of entry
433
434 Is_Generic : Boolean;
435 -- True for generic unit (i.e. a generic declaration, or a generic
436 -- body). False for a non-generic unit.
437
438 Unit_Kind : Character;
439 -- Indicates the nature of the unit. 'p' for Packages and 's' for
440 -- subprograms.
441
442 Version : Version_String;
443 -- Version of unit
444
445 Icasing : Casing_Type;
446 -- Indicates casing of identifiers in source file for this unit. This
447 -- is used for informational output, and also for constructing the main
448 -- unit if it is being built in Ada.
449
450 Kcasing : Casing_Type;
451 -- Indicates casing of keywords in source file for this unit. This is
452 -- used for informational output, and also for constructing the main
453 -- unit if it is being built in Ada.
454
455 Elab_Position : Nat;
456 -- Initialized to zero. Set non-zero when a unit is chosen and
457 -- placed in the elaboration order. The value represents the
458 -- ordinal position in the elaboration order.
459
460 Init_Scalars : Boolean;
461 -- Set True if IS qualifier appears in ALI file, indicating that
462 -- an Initialize_Scalars pragma applies to the unit.
463
464 SAL_Interface : Boolean;
465 -- Set True when this is an interface to a standalone library
466
467 Directly_Scanned : Boolean;
468 -- True iff it is a unit from an ALI file specified to gnatbind
469
470 Body_Needed_For_SAL : Boolean;
471 -- Indicates that the source for the body of the unit (subprogram,
472 -- package, or generic unit) must be included in a standalone library.
473
474 Elaborate_Body_Desirable : Boolean;
475 -- Indicates that the front end elaboration circuitry decided that it
476 -- would be a good idea if this package had Elaborate_Body. The binder
477 -- will attempt, but does not promise, to place the elaboration call
478 -- for the body right after the call for the spec, or at least as close
479 -- together as possible.
480
481 Optimize_Alignment : Character;
482 -- Optimize_Alignment setting. Set to L/S/T/O for OL/OS/OT/OO present.
483
484 Has_Finalizer : Boolean;
485 -- Indicates whether a package body or a spec has a library-level
486 -- finalization routine.
487
488 Primary_Stack_Count : Nat;
489 -- Indicates the number of task objects declared in this unit that have
490 -- default sized primary stacks.
491
492 Sec_Stack_Count : Nat;
493 -- Indicates the number of task objects declared in this unit that have
494 -- default sized secondary stacks.
495 end record;
496
497 package Units is new Table.Table (
498 Table_Component_Type => Unit_Record,
499 Table_Index_Type => Unit_Id,
500 Table_Low_Bound => First_Unit_Entry,
501 Table_Initial => 100,
502 Table_Increment => 200,
503 Table_Name => "Unit");
504
505 package Unit_Id_Tables is new GNAT.Dynamic_Tables
506 (Table_Component_Type => Unit_Id,
507 Table_Index_Type => Nat,
508 Table_Low_Bound => 1,
509 Table_Initial => 500,
510 Table_Increment => 200);
511
512 subtype Unit_Id_Table is Unit_Id_Tables.Instance;
513 subtype Unit_Id_Array is Unit_Id_Tables.Table_Type;
514
515 ---------------------------
516 -- Interrupt State Table --
517 ---------------------------
518
519 -- An entry is made in this table for each I (interrupt state) line
520 -- encountered in the input ALI file. The First/Last_Interrupt_Id
521 -- fields of the ALI file entry show the range of entries defined
522 -- within a particular ALI file.
523
524 type Interrupt_State_Record is record
525 Interrupt_Id : Nat;
526 -- Id from interrupt state entry
527
528 Interrupt_State : Character;
529 -- State from interrupt state entry ('u'/'r'/'s')
530
531 IS_Pragma_Line : Nat;
532 -- Line number of Interrupt_State pragma
533 end record;
534
535 package Interrupt_States is new Table.Table (
536 Table_Component_Type => Interrupt_State_Record,
537 Table_Index_Type => Interrupt_State_Id'Base,
538 Table_Low_Bound => Interrupt_State_Id'First,
539 Table_Initial => 100,
540 Table_Increment => 200,
541 Table_Name => "Interrupt_States");
542
543 -----------------------------------------
544 -- Priority Specific Dispatching Table --
545 -----------------------------------------
546
547 -- An entry is made in this table for each S (priority specific
548 -- dispatching) line encountered in the input ALI file. The
549 -- First/Last_Specific_Dispatching_Id fields of the ALI file
550 -- entry show the range of entries defined within a particular
551 -- ALI file.
552
553 type Specific_Dispatching_Record is record
554 Dispatching_Policy : Character;
555 -- First character (upper case) of the corresponding policy name
556
557 First_Priority : Nat;
558 -- Lower bound of the priority range to which the specified dispatching
559 -- policy applies.
560
561 Last_Priority : Nat;
562 -- Upper bound of the priority range to which the specified dispatching
563 -- policy applies.
564
565 PSD_Pragma_Line : Nat;
566 -- Line number of Priority_Specific_Dispatching pragma
567 end record;
568
569 package Specific_Dispatching is new Table.Table (
570 Table_Component_Type => Specific_Dispatching_Record,
571 Table_Index_Type => Priority_Specific_Dispatching_Id'Base,
572 Table_Low_Bound => Priority_Specific_Dispatching_Id'First,
573 Table_Initial => 100,
574 Table_Increment => 200,
575 Table_Name => "Priority_Specific_Dispatching");
576
577 --------------
578 -- Switches --
579 --------------
580
581 -- These switches record status information about ali files that
582 -- have been read, for quick reference without searching tables.
583
584 -- Note: a switch will be left set at its default value if the line
585 -- which might otherwise set it is ignored (from Ignore_Lines).
586
587 Dynamic_Elaboration_Checks_Specified : Boolean := False;
588 -- Set to False by Initialize_ALI. Set to True if Scan_ALI reads
589 -- a unit for which dynamic elaboration checking is enabled.
590
591 GNATprove_Mode_Specified : Boolean := False;
592 -- Set to True if an ali file was produced in GNATprove mode.
593
594 Initialize_Scalars_Used : Boolean := False;
595 -- Set True if an ali file contains the Initialize_Scalars flag
596
597 Interrupts_Default_To_System_Specified : Boolean := False;
598 -- Set to True if an pragma Interrupts_System_By_Default is seen.
599
600 Locking_Policy_Specified : Character := ' ';
601 -- Set to blank by Initialize_ALI. Set to the appropriate locking policy
602 -- character if an ali file contains a P line setting the locking policy.
603
604 No_Normalize_Scalars_Specified : Boolean := False;
605 -- Set to False by Initialize_ALI. Set to True if an ali file indicates
606 -- that the file was compiled without normalize scalars.
607
608 No_Component_Reordering_Specified : Boolean := False;
609 -- Set to False by Initialize_ALI. Set to True if an ali file contains
610 -- the No_Component_Reordering flag.
611
612 No_Object_Specified : Boolean := False;
613 -- Set to False by Initialize_ALI. Set to True if an ali file contains
614 -- the No_Object flag.
615
616 Normalize_Scalars_Specified : Boolean := False;
617 -- Set to False by Initialize_ALI. Set to True if an ali file indicates
618 -- that the file was compiled in Normalize_Scalars mode.
619
620 Partition_Elaboration_Policy_Specified : Character := ' ';
621 -- Set to blank by Initialize_ALI. Set to the appropriate partition
622 -- elaboration policy character if an ali file contains a P line setting
623 -- the policy.
624
625 Queuing_Policy_Specified : Character := ' ';
626 -- Set to blank by Initialize_ALI. Set to the appropriate queuing policy
627 -- character if an ali file contains a P line setting the queuing policy.
628
629 Cumulative_Restrictions : Restrictions_Info := No_Restrictions;
630 -- This variable records the cumulative contributions of R lines in all
631 -- ali files, showing whether a restriction pragma exists anywhere, and
632 -- accumulating the aggregate knowledge of violations.
633
634 SSO_Default_Specified : Boolean := False;
635 -- Set to True if at least one ALI file contains an OH/OL flag indicating
636 -- that it was compiled with a configuration pragmas file containing the
637 -- pragma Default_Scalar_Storage_Order (OH/OL present in ALI file P line).
638
639 Stack_Check_Switch_Set : Boolean := False;
640 -- Set to True if at least one ALI file contains '-fstack-check' in its
641 -- argument list.
642
643 Task_Dispatching_Policy_Specified : Character := ' ';
644 -- Set to blank by Initialize_ALI. Set to the appropriate task dispatching
645 -- policy character if an ali file contains a P line setting the
646 -- task dispatching policy.
647
648 Unreserve_All_Interrupts_Specified : Boolean := False;
649 -- Set to False by Initialize_ALI. Set to True if an ali file is read that
650 -- has P line specifying unreserve all interrupts mode.
651
652 Zero_Cost_Exceptions_Specified : Boolean := False;
653 -- Set to False by Initialize_ALI. Set to True if an ali file is read that
654 -- has a P line specifying the generation of zero cost exceptions.
655
656 -----------------
657 -- Withs Table --
658 -----------------
659
660 -- Each With line (W line) in an ALI file generates a Withs table entry
661
662 -- Note: there will be no entries in this table if 'W' lines are ignored
663
664 No_With_Id : constant With_Id := With_Id'First;
665 -- Special value indicating no withs table entry
666
667 First_With_Entry : constant With_Id := No_With_Id + 1;
668 -- Id of first actual entry in table
669
670 type With_Record is record
671 Uname : Unit_Name_Type;
672 -- Name of Unit
673
674 Sfile : File_Name_Type;
675 -- Name of source file, set to No_File in generic case
676
677 Afile : File_Name_Type;
678 -- Name of ALI file, set to No_File in generic case
679
680 Elaborate : Boolean;
681 -- Indicates presence of E parameter
682
683 Elaborate_All : Boolean;
684 -- Indicates presence of EA parameter
685
686 Elab_All_Desirable : Boolean;
687 -- Indicates presence of AD parameter
688
689 Elab_Desirable : Boolean;
690 -- Indicates presence of ED parameter
691
692 SAL_Interface : Boolean := False;
693 -- True if the Unit is an Interface of a Stand-Alone Library
694
695 Implicit_With : Boolean := False;
696 -- True if this is an implicit with generated by the compiler
697
698 Limited_With : Boolean := False;
699 -- True if this is a limited_with_clause
700 end record;
701
702 package Withs is new Table.Table (
703 Table_Component_Type => With_Record,
704 Table_Index_Type => With_Id,
705 Table_Low_Bound => First_With_Entry,
706 Table_Initial => 5000,
707 Table_Increment => 200,
708 Table_Name => "Withs");
709
710 ---------------------
711 -- Arguments Table --
712 ---------------------
713
714 -- Each Arg line (A line) in an ALI file generates an Args table entry
715
716 -- Note: there will be no entries in this table if 'A' lines are ignored
717
718 No_Arg_Id : constant Arg_Id := Arg_Id'First;
719 -- Special value indicating no args table entry
720
721 First_Arg_Entry : constant Arg_Id := No_Arg_Id + 1;
722 -- Id of first actual entry in table
723
724 package Args is new Table.Table (
725 Table_Component_Type => String_Ptr,
726 Table_Index_Type => Arg_Id,
727 Table_Low_Bound => First_Arg_Entry,
728 Table_Initial => 1000,
729 Table_Increment => 100,
730 Table_Name => "Args");
731
732 --------------------------
733 -- Linker_Options Table --
734 --------------------------
735
736 -- If an ALI file has one of more Linker_Options lines, then a single
737 -- entry is made in this table. If more than one Linker_Options lines
738 -- appears in a given ALI file, then the arguments are concatenated
739 -- to form the entry in this table, using a NUL character as the
740 -- separator, and a final NUL character is appended to the end.
741
742 -- Note: there will be no entries in this table if 'L' lines are ignored
743
744 type Linker_Option_Record is record
745 Name : Name_Id;
746 -- Name entry containing concatenated list of Linker_Options
747 -- arguments separated by NUL and ended by NUL as described above.
748
749 Unit : Unit_Id;
750 -- Unit_Id for the entry
751
752 Internal_File : Boolean;
753 -- Set True if the linker options are from an internal file. This is
754 -- used to insert certain standard entries after all the user entries
755 -- but before the entries from the run-time.
756 end record;
757
758 -- The indexes of active entries in this table range from 1 to the value of
759 -- Linker_Options.Last. The zeroth element is for convenience if the table
760 -- needs to be sorted.
761
762 package Linker_Options is new Table.Table (
763 Table_Component_Type => Linker_Option_Record,
764 Table_Index_Type => Integer,
765 Table_Low_Bound => 0,
766 Table_Initial => 200,
767 Table_Increment => 400,
768 Table_Name => "Linker_Options");
769
770 -----------------
771 -- Notes Table --
772 -----------------
773
774 -- The notes table records entries from N lines
775
776 type Notes_Record is record
777 Pragma_Type : Character;
778 -- 'A', 'C', 'I', 'S', 'T' for Annotate/Comment/Ident/Subtitle/Title
779
780 Pragma_Line : Nat;
781 -- Line number of pragma
782
783 Pragma_Col : Nat;
784 -- Column number of pragma
785
786 Pragma_Source_File : File_Name_Type;
787 -- Source file of pragma
788
789 Pragma_Args : Name_Id;
790 -- Pragma arguments. No_Name if no arguments, otherwise a single
791 -- name table entry consisting of all the characters on the notes
792 -- line from the first non-blank character following the source
793 -- location to the last character on the line.
794 end record;
795
796 -- The indexes of active entries in this table range from 1 to the value of
797 -- Notes.Last. The zeroth element is for convenience if the table needs to
798 -- be sorted.
799
800 package Notes is new Table.Table (
801 Table_Component_Type => Notes_Record,
802 Table_Index_Type => Integer,
803 Table_Low_Bound => 0,
804 Table_Initial => 200,
805 Table_Increment => 400,
806 Table_Name => "Notes");
807
808 -------------------------------------------
809 -- External Version Reference Hash Table --
810 -------------------------------------------
811
812 -- This hash table keeps track of external version reference strings
813 -- as read from E lines in the ali file. The stored values do not
814 -- include the terminating quote characters.
815
816 -- Note: there will be no entries in this table if 'E' lines are ignored
817
818 type Vindex is range 0 .. 98;
819 -- Type to define range of headers
820
821 function SHash (S : String_Ptr) return Vindex;
822 -- Hash function for this table
823
824 function SEq (F1, F2 : String_Ptr) return Boolean;
825 -- Equality function for this table
826
827 package Version_Ref is new Simple_HTable (
828 Header_Num => Vindex,
829 Element => Boolean,
830 No_Element => False,
831 Key => String_Ptr,
832 Hash => SHash,
833 Equal => SEq);
834
835 -------------------------
836 -- No_Dependency Table --
837 -------------------------
838
839 -- Each R line for a No_Dependency Restriction generates an entry in
840 -- this No_Dependency table.
841
842 type No_Dep_Record is record
843 ALI_File : ALI_Id;
844 -- ALI File containing the entry
845
846 No_Dep_Unit : Name_Id;
847 -- Id for names table entry including entire name, including periods
848 end record;
849
850 package No_Deps is new Table.Table (
851 Table_Component_Type => No_Dep_Record,
852 Table_Index_Type => Integer,
853 Table_Low_Bound => 0,
854 Table_Initial => 200,
855 Table_Increment => 400,
856 Table_Name => "No_Deps");
857
858 ------------------------------------
859 -- Sdep (Source Dependency) Table --
860 ------------------------------------
861
862 -- Each source dependency (D line) in an ALI file generates an entry in the
863 -- Sdep table.
864
865 -- Note: there will be no entries in this table if 'D' lines are ignored
866
867 No_Sdep_Id : constant Sdep_Id := Sdep_Id'First;
868 -- Special value indicating no Sdep table entry
869
870 First_Sdep_Entry : Sdep_Id := No_Sdep_Id + 1;
871 -- Id of first Sdep entry for current ali file. This is initialized to the
872 -- first Sdep entry in the table, and then incremented appropriately as
873 -- successive ALI files are scanned.
874
875 type Sdep_Record is record
876 Sfile : File_Name_Type;
877 -- Name of source file
878
879 Stamp : Time_Stamp_Type;
880 -- Time stamp value. Note that this will be all zero characters for the
881 -- dummy entries for missing or non-dependent files.
882
883 Checksum : Word;
884 -- Checksum value. Note that this will be all zero characters for the
885 -- dummy entries for missing or non-dependent files
886
887 Dummy_Entry : Boolean;
888 -- Set True for dummy entries that correspond to missing files or files
889 -- where no dependency relationship exists.
890
891 Subunit_Name : Unit_Name_Type;
892 -- Subunit name if present, else No_Unit_Name
893
894 Unit_Name : Unit_Name_Type;
895 -- Unit name if not a subunit (No_Unit_Name for a subunit)
896
897 Rfile : File_Name_Type;
898 -- Reference file name. Same as Sfile unless a Source_Reference pragma
899 -- was used, in which case it reflects the name used in the pragma.
900
901 Start_Line : Nat;
902 -- Starting line number in file. Always 1, unless a Source_Reference
903 -- pragma was used, in which case it reflects the line number value
904 -- given in the pragma.
905
906 end record;
907
908 package Sdep is new Table.Table (
909 Table_Component_Type => Sdep_Record,
910 Table_Index_Type => Sdep_Id,
911 Table_Low_Bound => First_Sdep_Entry,
912 Table_Initial => 5000,
913 Table_Increment => 200,
914 Table_Name => "Sdep");
915
916 ----------------------------
917 -- Use of Name Table Info --
918 ----------------------------
919
920 -- All unit names and file names are entered into the Names table. The Info
921 -- fields of these entries are used as follows:
922
923 -- Unit name Info field has Unit_Id of unit table entry
924 -- ALI file name Info field has ALI_Id of ALI table entry
925 -- Source file name Info field has Source_Id of source table entry
926
927 --------------------------
928 -- Cross-Reference Data --
929 --------------------------
930
931 -- The following table records cross-reference sections, there is one entry
932 -- for each X header line in the ALI file for an xref section.
933
934 -- Note: there will be no entries in this table if 'X' lines are ignored
935
936 type Xref_Section_Record is record
937 File_Num : Sdep_Id;
938 -- Dependency number for file (entry in Sdep.Table)
939
940 File_Name : File_Name_Type;
941 -- Name of file
942
943 First_Entity : Nat;
944 -- First entry in Xref_Entity table
945
946 Last_Entity : Nat;
947 -- Last entry in Xref_Entity table
948 end record;
949
950 package Xref_Section is new Table.Table (
951 Table_Component_Type => Xref_Section_Record,
952 Table_Index_Type => Nat,
953 Table_Low_Bound => 1,
954 Table_Initial => 50,
955 Table_Increment => 300,
956 Table_Name => "Xref_Section");
957
958 -- The following is used to indicate whether a typeref field is present
959 -- for the entity, and if so what kind of typeref field.
960
961 type Tref_Kind is (
962 Tref_None, -- No typeref present
963 Tref_Access, -- Access type typeref (points to designated type)
964 Tref_Derived, -- Derived type typeref (points to parent type)
965 Tref_Type); -- All other cases
966
967 type Visibility_Kind is
968 (Global, -- Library level entity
969 Static, -- Static C/C++ entity
970 Other); -- Local and other entity
971
972 -- The following table records entities for which xrefs are recorded
973
974 type Xref_Entity_Record is record
975 Line : Pos;
976 -- Line number of definition
977
978 Etype : Character;
979 -- Set to the identification character for the entity. See section
980 -- "Cross-Reference Entity Identifiers" in lib-xref.ads for details.
981
982 Col : Pos;
983 -- Column number of definition
984
985 Visibility : Visibility_Kind;
986 -- Visibility of entity
987
988 Entity : Name_Id;
989 -- Name of entity
990
991 Iref_File_Num : Sdep_Id;
992 -- This field is set to the dependency reference for the file containing
993 -- the generic entity that this one instantiates, or to No_Sdep_Id if
994 -- the current entity is not an instantiation
995
996 Iref_Line : Nat;
997 -- This field is set to the line number in Iref_File_Num of the generic
998 -- entity that this one instantiates, or to zero if the current entity
999 -- is not an instantiation.
1000
1001 Rref_Line : Nat;
1002 -- This field is set to the line number of a renaming reference if
1003 -- one is present, or to zero if no renaming reference is present
1004
1005 Rref_Col : Nat;
1006 -- This field is set to the column number of a renaming reference
1007 -- if one is present, or to zero if no renaming reference is present.
1008
1009 Tref : Tref_Kind;
1010 -- Indicates if a typeref is present, and if so what kind. Set to
1011 -- Tref_None if no typeref field is present.
1012
1013 Tref_File_Num : Sdep_Id;
1014 -- This field is set to No_Sdep_Id if no typeref is present, or
1015 -- if the typeref refers to an entity in standard. Otherwise it
1016 -- it is the dependency reference for the file containing the
1017 -- declaration of the typeref entity.
1018
1019 Tref_Line : Nat;
1020 -- This field is set to zero if no typeref is present, or if the
1021 -- typeref refers to an entity in standard. Otherwise it contains
1022 -- the line number of the declaration of the typeref entity.
1023
1024 Tref_Type : Character;
1025 -- This field is set to blank if no typeref is present, or if the
1026 -- typeref refers to an entity in standard. Otherwise it contains
1027 -- the identification character for the typeref entity. See section
1028 -- "Cross-Reference Entity Identifiers" in lib-xref.ads for details.
1029
1030 Tref_Col : Nat;
1031 -- This field is set to zero if no typeref is present, or if the
1032 -- typeref refers to an entity in standard. Otherwise it contains
1033 -- the column number of the declaration of the parent type.
1034
1035 Tref_Standard_Entity : Name_Id;
1036 -- This field is set to No_Name if no typeref is present or if the
1037 -- typeref refers to a declared entity rather than an entity in
1038 -- package Standard. If there is a typeref that references an
1039 -- entity in package Standard, then this field is a Name_Id
1040 -- reference for the entity name.
1041
1042 Oref_File_Num : Sdep_Id;
1043 -- This field is set to No_Sdep_Id if the entity doesn't override any
1044 -- other entity, or to the dependency reference for the overridden
1045 -- entity.
1046
1047 Oref_Line : Nat;
1048 Oref_Col : Nat;
1049 -- These two fields are set to the line and column of the overridden
1050 -- entity.
1051
1052 First_Xref : Nat;
1053 -- Index into Xref table of first cross-reference
1054
1055 Last_Xref : Nat;
1056 -- Index into Xref table of last cross-reference. The value in
1057 -- Last_Xref can be less than the First_Xref value to indicate
1058 -- that no entries are present in the Xref Table.
1059 end record;
1060
1061 package Xref_Entity is new Table.Table (
1062 Table_Component_Type => Xref_Entity_Record,
1063 Table_Index_Type => Nat,
1064 Table_Low_Bound => 1,
1065 Table_Initial => 500,
1066 Table_Increment => 300,
1067 Table_Name => "Xref_Entity");
1068
1069 Array_Index_Reference : constant Character := '*';
1070 Interface_Reference : constant Character := 'I';
1071 -- Some special types of references. In the ALI file itself, these
1072 -- are output as attributes of the entity, not as references, but
1073 -- there is no provision in Xref_Entity_Record for storing multiple
1074 -- such references.
1075
1076 -- The following table records actual cross-references
1077
1078 type Xref_Record is record
1079 File_Num : Sdep_Id;
1080 -- Set to the file dependency number for the cross-reference. Note
1081 -- that if no file entry is present explicitly, this is just a copy
1082 -- of the reference for the current cross-reference section.
1083
1084 Line : Nat;
1085 -- Line number for the reference. This is zero when referencing a
1086 -- predefined entity, but in this case Name is set.
1087
1088 Rtype : Character;
1089 -- Indicates type of reference, using code used in ALI file:
1090 -- r = reference
1091 -- m = modification
1092 -- b = body entity
1093 -- c = completion of private or incomplete type
1094 -- x = type extension
1095 -- i = implicit reference
1096 -- Array_Index_Reference = reference to the index of an array
1097 -- Interface_Reference = reference to an interface implemented
1098 -- by the type
1099 -- See description in lib-xref.ads for further details
1100
1101 Col : Nat;
1102 -- Column number for the reference
1103
1104 Name : Name_Id := No_Name;
1105 -- This is only used when referencing a predefined entity. Currently,
1106 -- this only occurs for array indexes.
1107
1108 -- Note: for instantiation references, Rtype is set to ' ', and Col is
1109 -- set to zero. One or more such entries can follow any other reference.
1110 -- When there is more than one such entry, this is to be read as:
1111 -- e.g. ref1 ref2 ref3
1112 -- ref1 is a reference to an entity that was instantied at ref2.
1113 -- ref2 itself is also the result of an instantiation, that took
1114 -- place at ref3
1115
1116 Imported_Lang : Name_Id := No_Name;
1117 Imported_Name : Name_Id := No_Name;
1118 -- Language and name of imported entity reference
1119 end record;
1120
1121 package Xref is new Table.Table (
1122 Table_Component_Type => Xref_Record,
1123 Table_Index_Type => Nat,
1124 Table_Low_Bound => 1,
1125 Table_Initial => 2000,
1126 Table_Increment => 300,
1127 Table_Name => "Xref");
1128
1129 ----------------------------
1130 -- Invocation Graph Types --
1131 ----------------------------
1132
1133 -- The following type identifies an invocation construct
1134
1135 No_Invocation_Construct : constant Invocation_Construct_Id :=
1136 Invocation_Construct_Id'First;
1137 First_Invocation_Construct : constant Invocation_Construct_Id :=
1138 No_Invocation_Construct + 1;
1139
1140 -- The following type identifies an invocation relation
1141
1142 No_Invocation_Relation : constant Invocation_Relation_Id :=
1143 Invocation_Relation_Id'First;
1144 First_Invocation_Relation : constant Invocation_Relation_Id :=
1145 No_Invocation_Relation + 1;
1146
1147 -- The following type identifies an invocation signature
1148
1149 No_Invocation_Signature : constant Invocation_Signature_Id :=
1150 Invocation_Signature_Id'First;
1151 First_Invocation_Signature : constant Invocation_Signature_Id :=
1152 No_Invocation_Signature + 1;
1153
1154 -- The following type enumerates all possible placements of an invocation
1155 -- construct's spec and body with respect to the unit it is declared in.
1156
1157 type Declaration_Placement_Kind is
1158 (In_Body,
1159 -- The declaration of the invocation construct is within the body of the
1160 -- unit it is declared in.
1161
1162 In_Spec,
1163 -- The declaration of the invocation construct is within the spec of the
1164 -- unit it is declared in.
1165
1166 No_Declaration_Placement);
1167 -- The invocation construct does not have a declaration
1168
1169 -- The following type enumerates all possible invocation construct kinds
1170
1171 type Invocation_Construct_Kind is
1172 (Elaborate_Body_Procedure,
1173 -- The invocation construct denotes the procedure which elaborates a
1174 -- package body.
1175
1176 Elaborate_Spec_Procedure,
1177 -- The invocation construct denotes the procedure which elaborates a
1178 -- package spec.
1179
1180 Regular_Construct);
1181 -- The invocation construct is a normal invocation construct
1182
1183 -- The following type enumerates all possible invocation kinds
1184
1185 type Invocation_Kind is
1186 (Accept_Alternative,
1187 Access_Taken,
1188 Call,
1189 Controlled_Adjustment,
1190 Controlled_Finalization,
1191 Controlled_Initialization,
1192 Default_Initial_Condition_Verification,
1193 Initial_Condition_Verification,
1194 Instantiation,
1195 Internal_Controlled_Adjustment,
1196 Internal_Controlled_Finalization,
1197 Internal_Controlled_Initialization,
1198 Invariant_Verification,
1199 Postcondition_Verification,
1200 Protected_Entry_Call,
1201 Protected_Subprogram_Call,
1202 Task_Activation,
1203 Task_Entry_Call,
1204 Type_Initialization,
1205 No_Invocation);
1206
1207 subtype Internal_Controlled_Invocation_Kind is Invocation_Kind range
1208 Internal_Controlled_Adjustment ..
1209 -- Internal_Controlled_Finalization
1210 Internal_Controlled_Initialization;
1211
1212 -- The following type enumerates all possible invocation-graph ALI lines
1213
1214 type Invocation_Graph_Line_Kind is
1215 (Invocation_Construct_Line,
1216 Invocation_Graph_Attributes_Line,
1217 Invocation_Relation_Line);
1218
1219 ----------------------------------
1220 -- Invocation Graph Subprograms --
1221 ----------------------------------
1222
1223 procedure Add_Invocation_Construct
1224 (Body_Placement : Declaration_Placement_Kind;
1225 Kind : Invocation_Construct_Kind;
1226 Signature : Invocation_Signature_Id;
1227 Spec_Placement : Declaration_Placement_Kind;
1228 Update_Units : Boolean := True);
1229 pragma Inline (Add_Invocation_Construct);
1230 -- Add a new invocation construct described by its attributes. Update_Units
1231 -- should be set when this addition must be reflected in the attributes of
1232 -- the current unit.
1233
1234 procedure Add_Invocation_Relation
1235 (Extra : Name_Id;
1236 Invoker : Invocation_Signature_Id;
1237 Kind : Invocation_Kind;
1238 Target : Invocation_Signature_Id;
1239 Update_Units : Boolean := True);
1240 pragma Inline (Add_Invocation_Relation);
1241 -- Add a new invocation relation described by its attributes. Update_Units
1242 -- should be set when this addition must be reflected in the attributes of
1243 -- the current unit.
1244
1245 function Body_Placement
1246 (IC_Id : Invocation_Construct_Id) return Declaration_Placement_Kind;
1247 pragma Inline (Body_Placement);
1248 -- Obtain the location of invocation construct IC_Id's body with respect to
1249 -- the unit where it is declared.
1250
1251 function Code_To_Declaration_Placement_Kind
1252 (Code : Character) return Declaration_Placement_Kind;
1253 pragma Inline (Code_To_Declaration_Placement_Kind);
1254 -- Obtain the declaration placement kind of character encoding Code
1255
1256 function Code_To_Invocation_Construct_Kind
1257 (Code : Character) return Invocation_Construct_Kind;
1258 pragma Inline (Code_To_Invocation_Construct_Kind);
1259 -- Obtain the invocation construct kind of character encoding Code
1260
1261 function Code_To_Invocation_Graph_Encoding_Kind
1262 (Code : Character) return Invocation_Graph_Encoding_Kind;
1263 pragma Inline (Code_To_Invocation_Graph_Encoding_Kind);
1264 -- Obtain the invocation-graph encoding kind of character encoding Code
1265
1266 function Code_To_Invocation_Kind
1267 (Code : Character) return Invocation_Kind;
1268 pragma Inline (Code_To_Invocation_Kind);
1269 -- Obtain the invocation kind of character encoding Code
1270
1271 function Code_To_Invocation_Graph_Line_Kind
1272 (Code : Character) return Invocation_Graph_Line_Kind;
1273 pragma Inline (Code_To_Invocation_Graph_Line_Kind);
1274 -- Obtain the invocation-graph line kind of character encoding Code
1275
1276 function Column (IS_Id : Invocation_Signature_Id) return Nat;
1277 pragma Inline (Column);
1278 -- Obtain the column number of invocation signature IS_Id
1279
1280 function Declaration_Placement_Kind_To_Code
1281 (Kind : Declaration_Placement_Kind) return Character;
1282 pragma Inline (Declaration_Placement_Kind_To_Code);
1283 -- Obtain the character encoding of declaration placement kind Kind
1284
1285 function Extra (IR_Id : Invocation_Relation_Id) return Name_Id;
1286 pragma Inline (Extra);
1287 -- Obtain the name of the additional entity used in error diagnostics for
1288 -- invocation relation IR_Id.
1289
1290 type Invocation_Construct_Processor_Ptr is
1291 access procedure (IC_Id : Invocation_Construct_Id);
1292
1293 procedure For_Each_Invocation_Construct
1294 (Processor : Invocation_Construct_Processor_Ptr);
1295 pragma Inline (For_Each_Invocation_Construct);
1296 -- Invoke Processor on each invocation construct
1297
1298 procedure For_Each_Invocation_Construct
1299 (U_Id : Unit_Id;
1300 Processor : Invocation_Construct_Processor_Ptr);
1301 pragma Inline (For_Each_Invocation_Construct);
1302 -- Invoke Processor on each invocation construct of unit U_Id
1303
1304 type Invocation_Relation_Processor_Ptr is
1305 access procedure (IR_Id : Invocation_Relation_Id);
1306
1307 procedure For_Each_Invocation_Relation
1308 (Processor : Invocation_Relation_Processor_Ptr);
1309 pragma Inline (For_Each_Invocation_Relation);
1310 -- Invoke Processor on each invocation relation
1311
1312 procedure For_Each_Invocation_Relation
1313 (U_Id : Unit_Id;
1314 Processor : Invocation_Relation_Processor_Ptr);
1315 pragma Inline (For_Each_Invocation_Relation);
1316 -- Invoke Processor on each invocation relation of unit U_Id
1317
1318 function Invocation_Construct_Kind_To_Code
1319 (Kind : Invocation_Construct_Kind) return Character;
1320 pragma Inline (Invocation_Construct_Kind_To_Code);
1321 -- Obtain the character encoding of invocation kind Kind
1322
1323 function Invocation_Graph_Encoding return Invocation_Graph_Encoding_Kind;
1324 pragma Inline (Invocation_Graph_Encoding);
1325 -- Obtain the encoding format used to capture information about the
1326 -- invocation constructs and relations within the ALI file of the main
1327 -- unit.
1328
1329 function Invocation_Graph_Encoding_Kind_To_Code
1330 (Kind : Invocation_Graph_Encoding_Kind) return Character;
1331 pragma Inline (Invocation_Graph_Encoding_Kind_To_Code);
1332 -- Obtain the character encoding for invocation-graph encoding kind Kind
1333
1334 function Invocation_Graph_Line_Kind_To_Code
1335 (Kind : Invocation_Graph_Line_Kind) return Character;
1336 pragma Inline (Invocation_Graph_Line_Kind_To_Code);
1337 -- Obtain the character encoding for invocation line kind Kind
1338
1339 function Invocation_Kind_To_Code
1340 (Kind : Invocation_Kind) return Character;
1341 pragma Inline (Invocation_Kind_To_Code);
1342 -- Obtain the character encoding of invocation kind Kind
1343
1344 function Invocation_Signature_Of
1345 (Column : Nat;
1346 Line : Nat;
1347 Locations : Name_Id;
1348 Name : Name_Id;
1349 Scope : Name_Id) return Invocation_Signature_Id;
1350 pragma Inline (Invocation_Signature_Of);
1351 -- Obtain the invocation signature that corresponds to the input attributes
1352
1353 function Invoker
1354 (IR_Id : Invocation_Relation_Id) return Invocation_Signature_Id;
1355 pragma Inline (Invoker);
1356 -- Obtain the signature of the invocation relation IR_Id's invoker
1357
1358 function Kind
1359 (IC_Id : Invocation_Construct_Id) return Invocation_Construct_Kind;
1360 pragma Inline (Kind);
1361 -- Obtain the nature of invocation construct IC_Id
1362
1363 function Kind
1364 (IR_Id : Invocation_Relation_Id) return Invocation_Kind;
1365 pragma Inline (Kind);
1366 -- Obtain the nature of invocation relation IR_Id
1367
1368 function Line (IS_Id : Invocation_Signature_Id) return Nat;
1369 pragma Inline (Line);
1370 -- Obtain the line number of invocation signature IS_Id
1371
1372 function Locations (IS_Id : Invocation_Signature_Id) return Name_Id;
1373 pragma Inline (Locations);
1374 -- Obtain the sequence of column and line numbers within nested instances
1375 -- of invocation signature IS_Id
1376
1377 function Name (IS_Id : Invocation_Signature_Id) return Name_Id;
1378 pragma Inline (Name);
1379 -- Obtain the name of invocation signature IS_Id
1380
1381 function IS_Scope (IS_Id : Invocation_Signature_Id) return Name_Id;
1382 pragma Inline (IS_Scope);
1383 -- Obtain the scope of invocation signature IS_Id
1384
1385 procedure Set_Invocation_Graph_Encoding
1386 (Kind : Invocation_Graph_Encoding_Kind;
1387 Update_Units : Boolean := True);
1388 pragma Inline (Set_Invocation_Graph_Encoding);
1389 -- Set the encoding format used to capture information about the invocation
1390 -- constructs and relations within the ALI file of the main unit to Kind.
1391 -- Update_Units should be set when this action must be reflected in the
1392 -- attributes of the current unit.
1393
1394 function Signature
1395 (IC_Id : Invocation_Construct_Id) return Invocation_Signature_Id;
1396 pragma Inline (Signature);
1397 -- Obtain the signature of invocation construct IC_Id
1398
1399 function Spec_Placement
1400 (IC_Id : Invocation_Construct_Id) return Declaration_Placement_Kind;
1401 pragma Inline (Spec_Placement);
1402 -- Obtain the location of invocation construct IC_Id's spec with respect to
1403 -- the unit where it is declared.
1404
1405 function Target
1406 (IR_Id : Invocation_Relation_Id) return Invocation_Signature_Id;
1407 pragma Inline (Target);
1408 -- Obtain the signature of the invocation relation IR_Id's target
1409
1410 --------------------------------------
1411 -- Subprograms for Reading ALI File --
1412 --------------------------------------
1413
1414 procedure Initialize_ALI;
1415 -- Initialize the ALI tables. Also resets all switch values to defaults
1416
1417 function Scan_ALI
1418 (F : File_Name_Type;
1419 T : Text_Buffer_Ptr;
1420 Err : Boolean;
1421 Ignore_Lines : String := "X";
1422 Ignore_Errors : Boolean := False;
1423 Directly_Scanned : Boolean := False) return ALI_Id;
1424 -- Given the text, T, of an ALI file, F, scan and store the information
1425 -- from the file, and return the Id of the resulting entry in the ALI
1426 -- table. Switch settings may be modified as described above in the
1427 -- switch description settings.
1428 --
1429 -- Err determines the action taken on an incorrectly formatted file.
1430 -- If Err is False, then an error message is output, and the program
1431 -- is terminated. If Err is True, then no error message is output,
1432 -- and No_ALI_Id is returned.
1433 --
1434 -- Ignore_Lines requests that Scan_ALI ignore any lines that start
1435 -- with any given key character. The default value of X causes all
1436 -- Xref lines to be ignored. The corresponding data in the ALI
1437 -- tables will not be filled in this case. It is not possible
1438 -- to ignore U (unit) lines, they are always read.
1439 --
1440 -- Ignore_Errors is normally False. If it is set True, then Scan_ALI
1441 -- will do its best to scan through a file and extract all information
1442 -- it can, even if there are errors. In this case Err is only set if
1443 -- Scan_ALI was completely unable to process the file (e.g. it did not
1444 -- look like an ALI file at all). Ignore_Errors is intended to improve
1445 -- the downward compatibility of new compilers with old tools.
1446 --
1447 -- Directly_Scanned is normally False. If it is set to True, then the
1448 -- units (spec and/or body) corresponding to the ALI file are marked as
1449 -- such. It is used to decide for what units gnatbind should generate
1450 -- the symbols corresponding to 'Version or 'Body_Version in
1451 -- Stand-Alone Libraries.
1452
1453 end ALI;