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