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