1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
11 -- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
13 -- GNAT is free software; you can redistribute it and/or modify it under --
14 -- terms of the GNU General Public License as published by the Free Soft- --
15 -- ware Foundation; either version 2, or (at your option) any later ver- --
16 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
19 -- for more details. You should have received a copy of the GNU General --
20 -- Public License distributed with GNAT; see file COPYING. If not, write --
21 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
22 -- MA 02111-1307, USA. --
24 -- GNAT was originally developed by the GNAT team at New York University. --
25 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
27 ------------------------------------------------------------------------------
29 with Butil; use Butil;
30 with Debug; use Debug;
31 with Fname; use Fname;
32 with Namet; use Namet;
33 with Osint; use Osint;
34 with Output; use Output;
39 -- Make control characters visible
45 procedure Initialize_ALI is
47 -- When (re)initializing ALI data structures the ALI user expects to
48 -- get a fresh set of data structures. Thus we first need to erase the
49 -- marks put in the name table by the previous set of ALI routine calls.
50 -- This loop is empty and harmless the first time in.
52 for J in ALIs.First .. ALIs.Last loop
53 Set_Name_Table_Info (ALIs.Table (J).Afile, 0);
66 -- Add dummy zero'th item in Linker_Options for the sort function
68 Linker_Options.Increment_Last;
70 -- Initialize global variables recording cumulative options in all
71 -- ALI files that are read for a given processing run in gnatbind.
73 Dynamic_Elaboration_Checks_Specified := False;
74 Float_Format_Specified := ' ';
75 Locking_Policy_Specified := ' ';
76 No_Normalize_Scalars_Specified := False;
77 No_Object_Specified := False;
78 Normalize_Scalars_Specified := False;
79 No_Run_Time_Specified := False;
80 Queuing_Policy_Specified := ' ';
81 Static_Elaboration_Model_Used := False;
82 Task_Dispatching_Policy_Specified := ' ';
83 Unreserve_All_Interrupts_Specified := False;
84 Zero_Cost_Exceptions_Specified := False;
97 Read_Xref : Boolean := False)
100 P : Text_Ptr := T'First;
101 Line : Logical_Line_Number := 1;
107 function At_Eol return Boolean;
108 -- Test if at end of line
110 function At_End_Of_Field return Boolean;
111 -- Test if at end of line, or if at blank or horizontal tab
113 procedure Check_At_End_Of_Field;
114 -- Check if we are at end of field, fatal error if not
116 procedure Checkc (C : Character);
117 -- Check next character is C. If so bump past it, if not fatal error
119 Bad_ALI_Format : exception;
121 procedure Fatal_Error;
122 -- Generate fatal error message for badly formatted ALI file if
123 -- Err is false, or raise Bad_ALI_Format if Err is True.
125 function Getc return Character;
126 -- Get next character, bumping P past the character obtained
128 function Get_Name (Lower : Boolean := False) return Name_Id;
129 -- Skip blanks, then scan out a name (name is left in Name_Buffer with
130 -- length in Name_Len, as well as being returned in Name_Id form).
131 -- If Lower is set to True then the Name_Buffer will be converted to
132 -- all lower case, for systems where file names are not case sensitive.
133 -- This ensures that gnatbind works correctly regardless of the case
134 -- of the file name on all systems. The name is terminated by a either
135 -- white space or a typeref bracket or an equal sign except for the
136 -- special case of an operator name starting with a double quite which
137 -- is terminated by another double quote.
139 function Get_Nat return Nat;
140 -- Skip blanks, then scan out an unsigned integer value in Nat range
142 function Get_Stamp return Time_Stamp_Type;
143 -- Skip blanks, then scan out a time stamp
145 function Nextc return Character;
146 -- Return current character without modifying pointer P
149 -- Skip past end of line (fatal error if not at end of line)
151 procedure Skip_Space;
152 -- Skip past white space (blanks or horizontal tab)
154 ---------------------
155 -- At_End_Of_Field --
156 ---------------------
158 function At_End_Of_Field return Boolean is
167 function At_Eol return Boolean is
169 return Nextc = EOF or else Nextc = CR or else Nextc = LF;
172 ---------------------------
173 -- Check_At_End_Of_Field --
174 ---------------------------
176 procedure Check_At_End_Of_Field is
178 if not At_End_Of_Field then
181 end Check_At_End_Of_Field;
187 procedure Checkc (C : Character) is
200 procedure Fatal_Error is
205 procedure Wchar (C : Character);
206 -- Write a single character, replacing horizontal tab by spaces
208 procedure Wchar (C : Character) is
213 exit when Col mod 8 = 0;
222 -- Start of processing for Fatal_Error
226 raise Bad_ALI_Format;
230 Write_Str ("fatal error: file ");
232 Write_Str (" is incorrectly formatted");
235 ("make sure you are using consistent versions of gcc/gnatbind");
238 -- Find start of line
243 and then T (Ptr1 - 1) /= CR
244 and then T (Ptr1 - 1) /= LF
249 Write_Int (Int (Line));
264 and then T (Ptr2) /= CR
265 and then T (Ptr2) /= LF
277 if T (Ptr1) = HT then
289 Exit_Program (E_Fatal);
296 function Get_Name (Lower : Boolean := False) return Name_Id is
306 Name_Len := Name_Len + 1;
307 Name_Buffer (Name_Len) := Getc;
309 exit when At_End_Of_Field;
311 if Name_Buffer (1) = '"' then
312 exit when Name_Len > 1 and then Name_Buffer (Name_Len) = '"';
315 exit when At_End_Of_Field
316 or else Nextc = '(' or else Nextc = ')'
317 or else Nextc = '{' or else Nextc = '}'
318 or else Nextc = '<' or else Nextc = '>'
323 -- Convert file name to all lower case if file names are not case
324 -- sensitive. This ensures that we handle names in the canonical
325 -- lower case format, regardless of the actual case.
327 if Lower and not File_Names_Case_Sensitive then
328 Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len));
338 function Get_Nat return Nat is
347 V := V * 10 + (Character'Pos (Getc) - Character'Pos ('0'));
348 exit when At_End_Of_Field;
349 exit when Nextc < '0' or Nextc > '9';
359 function Get_Stamp return Time_Stamp_Type is
370 -- Following reads old style time stamp missing first two digits
372 if Nextc in '7' .. '9' then
377 -- Normal case of full year in time stamp
383 for J in Start .. T'Last loop
394 function Getc return Character is
408 function Nextc return Character is
417 procedure Skip_Eol is
420 if not At_Eol then Fatal_Error; end if;
422 -- Loop to skip past blank lines (first time through skips this EOL)
424 while Nextc < ' ' and then Nextc /= EOF loop
437 procedure Skip_Space is
439 while Nextc = ' ' or else Nextc = HT loop
444 --------------------------------------
445 -- Start of processing for Scan_ALI --
446 --------------------------------------
451 Set_Name_Table_Info (F, Int (Id));
455 Compile_Errors => False,
456 First_Sdep => No_Sdep_Id,
457 First_Unit => No_Unit_Id,
459 Last_Sdep => No_Sdep_Id,
460 Last_Unit => No_Unit_Id,
461 Locking_Policy => ' ',
463 Main_Program => None,
465 No_Run_Time => False,
466 Normalize_Scalars => False,
467 Ofile_Full_Name => Full_Object_File_Name,
468 Queuing_Policy => ' ',
469 Restrictions => (others => ' '),
471 Task_Dispatching_Policy => ' ',
472 Time_Slice_Value => -1,
474 Unit_Exception_Table => False,
475 Ver => (others => ' '),
477 Zero_Cost_Exceptions => False);
479 -- Acquire library version
486 for J in 1 .. Ver_Len_Max loop
489 ALIs.Table (Id).Ver (J) := C;
490 ALIs.Table (Id).Ver_Len := J;
495 -- Acquire main program line if present
506 ALIs.Table (Id).Main_Program := Func;
508 ALIs.Table (Id).Main_Program := Proc;
518 ALIs.Table (Id).Main_Priority := Get_Nat;
526 ALIs.Table (Id).Time_Slice_Value := Get_Nat;
533 ALIs.Table (Id).WC_Encoding := Getc;
541 -- Acquire argument lines
543 First_Arg := Args.Last + 1;
545 Arg_Loop : while C = 'A' loop
549 while not At_Eol loop
550 Name_Len := Name_Len + 1;
551 Name_Buffer (Name_Len) := Getc;
555 Args.Table (Args.Last) := new String'(Name_Buffer (1 .. Name_Len));
561 -- Acquire P line, first set defaults
569 while not At_Eol loop
576 ALIs.Table (Id).Compile_Errors := True;
579 Float_Format_Specified := Getc;
580 ALIs.Table (Id).Float_Format := Float_Format_Specified;
583 Locking_Policy_Specified := Getc;
584 ALIs.Table (Id).Locking_Policy := Locking_Policy_Specified;
590 ALIs.Table (Id).No_Object := True;
591 No_Object_Specified := True;
594 No_Run_Time_Specified := True;
595 ALIs.Table (Id).No_Run_Time := True;
598 ALIs.Table (Id).Normalize_Scalars := True;
599 Normalize_Scalars_Specified := True;
607 Queuing_Policy_Specified := Getc;
608 ALIs.Table (Id).Queuing_Policy := Queuing_Policy_Specified;
611 Task_Dispatching_Policy_Specified := Getc;
612 ALIs.Table (Id).Task_Dispatching_Policy :=
613 Task_Dispatching_Policy_Specified;
617 Unreserve_All_Interrupts_Specified := True;
622 ALIs.Table (Id).Unit_Exception_Table := True;
627 ALIs.Table (Id).Zero_Cost_Exceptions := True;
628 Zero_Cost_Exceptions_Specified := True;
636 No_Normalize_Scalars_Specified := True;
641 -- Acquire restrictions line
650 for J in All_Restrictions loop
652 ALIs.Table (Id).Restrictions (J) := C;
656 Restrictions (J) := 'v';
659 if Restrictions (J) = 'n' then
660 Restrictions (J) := 'r';
679 -- Loop to acquire unit entries
681 Unit_Loop : while C = 'U' loop
684 Units.Increment_Last;
686 if ALIs.Table (Id).First_Unit = No_Unit_Id then
687 ALIs.Table (Id).First_Unit := Units.Last;
690 Units.Table (Units.Last).Uname := Get_Name;
691 Units.Table (Units.Last).Predefined := Is_Predefined_Unit;
692 Units.Table (Units.Last).Internal := Is_Internal_Unit;
693 Units.Table (Units.Last).My_ALI := Id;
694 Units.Table (Units.Last).Sfile := Get_Name (Lower => True);
695 Units.Table (Units.Last).Pure := False;
696 Units.Table (Units.Last).Preelab := False;
697 Units.Table (Units.Last).No_Elab := False;
698 Units.Table (Units.Last).Shared_Passive := False;
699 Units.Table (Units.Last).RCI := False;
700 Units.Table (Units.Last).Remote_Types := False;
701 Units.Table (Units.Last).Has_RACW := False;
702 Units.Table (Units.Last).Init_Scalars := False;
703 Units.Table (Units.Last).Is_Generic := False;
704 Units.Table (Units.Last).Icasing := Mixed_Case;
705 Units.Table (Units.Last).Kcasing := All_Lower_Case;
706 Units.Table (Units.Last).Dynamic_Elab := False;
707 Units.Table (Units.Last).Elaborate_Body := False;
708 Units.Table (Units.Last).Set_Elab_Entity := False;
709 Units.Table (Units.Last).Version := "00000000";
710 Units.Table (Units.Last).First_With := Withs.Last + 1;
711 Units.Table (Units.Last).First_Arg := First_Arg;
712 Units.Table (Units.Last).Elab_Position := 0;
715 Write_Str (" ----> reading unit ");
716 Write_Int (Int (Units.Last));
718 Write_Unit_Name (Units.Table (Units.Last).Uname);
719 Write_Str (" from file ");
720 Write_Name (Units.Table (Units.Last).Sfile);
724 -- Check for duplicated unit in different files
727 Info : constant Int := Get_Name_Table_Info
728 (Units.Table (Units.Last).Uname);
731 and then Units.Table (Units.Last).Sfile /=
732 Units.Table (Unit_Id (Info)).Sfile
734 -- If Err is set then ignore duplicate unit name. This is the
735 -- case of a call from gnatmake, where the situation can arise
736 -- from substitution of source files. In such situations, the
737 -- processing in gnatmake will always result in any required
738 -- recompilations in any case, and if we consider this to be
739 -- an error we get strange cases (for example when a generic
740 -- instantiation is replaced by a normal package) where we
741 -- read the old ali file, decide to recompile, and then decide
742 -- that the old and new ali files are incompatible.
747 -- If Err is not set, then this is a fatal error. This is
748 -- the case of being called from the binder, where we must
749 -- definitely diagnose this as an error.
753 Write_Str ("error: duplicate unit name: ");
756 Write_Str ("error: unit """);
757 Write_Unit_Name (Units.Table (Units.Last).Uname);
758 Write_Str (""" found in file """);
759 Write_Name_Decoded (Units.Table (Units.Last).Sfile);
763 Write_Str ("error: unit """);
764 Write_Unit_Name (Units.Table (Unit_Id (Info)).Uname);
765 Write_Str (""" found in file """);
766 Write_Name_Decoded (Units.Table (Unit_Id (Info)).Sfile);
770 Exit_Program (E_Fatal);
776 (Units.Table (Units.Last).Uname, Int (Units.Last));
778 -- Scan out possible version and other parameters
787 if C in '0' .. '9' or else C in 'a' .. 'f' then
788 Units.Table (Units.Last).Version (1) := C;
792 Units.Table (Units.Last).Version (J) := C;
795 -- DE parameter (Dynamic elaboration checks
799 Check_At_End_Of_Field;
800 Units.Table (Units.Last).Dynamic_Elab := True;
801 Dynamic_Elaboration_Checks_Specified := True;
809 Units.Table (Units.Last).Elaborate_Body := True;
812 Units.Table (Units.Last).Set_Elab_Entity := True;
818 Check_At_End_Of_Field;
820 -- GE parameter (generic)
824 Check_At_End_Of_Field;
825 Units.Table (Units.Last).Is_Generic := True;
827 -- IL/IS/IU parameters
833 Units.Table (Units.Last).Icasing := All_Lower_Case;
836 Units.Table (Units.Last).Init_Scalars := True;
837 Initialize_Scalars_Used := True;
840 Units.Table (Units.Last).Icasing := All_Upper_Case;
846 Check_At_End_Of_Field;
854 Units.Table (Units.Last).Kcasing := Mixed_Case;
857 Units.Table (Units.Last).Kcasing := All_Upper_Case;
863 Check_At_End_Of_Field;
869 Units.Table (Units.Last).No_Elab := True;
870 Check_At_End_Of_Field;
872 -- PR/PU/PK parameters
877 -- PR parameter (preelaborate)
880 Units.Table (Units.Last).Preelab := True;
882 -- PU parameter (pure)
885 Units.Table (Units.Last).Pure := True;
887 -- PK indicates unit is package
890 Units.Table (Units.Last).Unit_Kind := 'p';
896 Check_At_End_Of_Field;
903 -- RC parameter (remote call interface)
906 Units.Table (Units.Last).RCI := True;
908 -- RT parameter (remote types)
911 Units.Table (Units.Last).Remote_Types := True;
913 -- RA parameter (remote access to class wide type)
916 Units.Table (Units.Last).Has_RACW := True;
922 Check_At_End_Of_Field;
927 -- SP parameter (shared passive)
930 Units.Table (Units.Last).Shared_Passive := True;
932 -- SU parameter indicates unit is subprogram
935 Units.Table (Units.Last).Unit_Kind := 's';
941 Check_At_End_Of_Field;
951 -- Check if static elaboration model used
953 if not Units.Table (Units.Last).Dynamic_Elab
954 and then not Units.Table (Units.Last).Internal
956 Static_Elaboration_Model_Used := True;
959 -- Scan out With lines for this unit
963 With_Loop : while C = 'W' loop
966 Withs.Increment_Last;
967 Withs.Table (Withs.Last).Uname := Get_Name;
968 Withs.Table (Withs.Last).Elaborate := False;
969 Withs.Table (Withs.Last).Elaborate_All := False;
970 Withs.Table (Withs.Last).Elab_All_Desirable := False;
972 -- Generic case with no object file available
975 Withs.Table (Withs.Last).Sfile := No_File;
976 Withs.Table (Withs.Last).Afile := No_File;
981 Withs.Table (Withs.Last).Sfile := Get_Name (Lower => True);
982 Withs.Table (Withs.Last).Afile := Get_Name;
984 -- Scan out possible E, EA, and NE parameters
986 while not At_Eol loop
992 if At_End_Of_Field then
993 Withs.Table (Withs.Last).Elaborate := True;
995 elsif Nextc = 'A' then
997 Check_At_End_Of_Field;
998 Withs.Table (Withs.Last).Elaborate_All := True;
1002 Check_At_End_Of_Field;
1004 -- Store ED indication unless ignore required
1006 if not Ignore_ED then
1007 Withs.Table (Withs.Last).Elab_All_Desirable := True;
1019 Units.Table (Units.Last).Last_With := Withs.Last;
1020 Units.Table (Units.Last).Last_Arg := Args.Last;
1022 -- If there are linker options lines present, scan them
1026 Linker_Options_Loop : while C = 'L' loop
1034 if C < Character'Val (16#20#)
1035 or else C > Character'Val (16#7E#)
1040 C := Character'Val (0);
1047 for J in 1 .. 2 loop
1050 if C in '0' .. '9' then
1052 Character'Pos (C) - Character'Pos ('0');
1054 elsif C in 'A' .. 'F' then
1056 Character'Pos (C) - Character'Pos ('A') + 10;
1065 Add_Char_To_Name_Buffer (Character'Val (V));
1070 exit when Nextc /= '"';
1074 Add_Char_To_Name_Buffer (C);
1078 Add_Char_To_Name_Buffer (nul);
1082 end loop Linker_Options_Loop;
1084 -- Store the linker options entry
1086 if Name_Len /= 0 then
1087 Linker_Options.Increment_Last;
1089 Linker_Options.Table (Linker_Options.Last).Name :=
1092 Linker_Options.Table (Linker_Options.Last).Unit :=
1095 Linker_Options.Table (Linker_Options.Last).Internal_File :=
1096 Is_Internal_File_Name (F);
1098 Linker_Options.Table (Linker_Options.Last).Original_Pos :=
1099 Linker_Options.Last;
1103 -- End loop through units for one ALI file
1105 ALIs.Table (Id).Last_Unit := Units.Last;
1106 ALIs.Table (Id).Sfile := Units.Table (ALIs.Table (Id).First_Unit).Sfile;
1108 -- Set types of the units (there can be at most 2 of them)
1110 if ALIs.Table (Id).First_Unit /= ALIs.Table (Id).Last_Unit then
1111 Units.Table (ALIs.Table (Id).First_Unit).Utype := Is_Body;
1112 Units.Table (ALIs.Table (Id).Last_Unit).Utype := Is_Spec;
1115 -- Deal with body only and spec only cases, note that the reason we
1116 -- do our own checking of the name (rather than using Is_Body_Name)
1117 -- is that Uname drags in far too much compiler junk!
1119 Get_Name_String (Units.Table (Units.Last).Uname);
1121 if Name_Buffer (Name_Len) = 'b' then
1122 Units.Table (Units.Last).Utype := Is_Body_Only;
1124 Units.Table (Units.Last).Utype := Is_Spec_Only;
1128 -- Scan out external version references and put in hash table
1143 exit when At_End_Of_Field;
1144 Add_Char_To_Name_Buffer (C);
1147 Version_Ref.Set (new String'(Name_Buffer (1 .. Name_Len)), True);
1152 -- Scan out source dependency lines for this ALI file
1154 ALIs.Table (Id).First_Sdep := Sdep.Last + 1;
1159 Sdep.Increment_Last;
1160 Sdep.Table (Sdep.Last).Sfile := Get_Name (Lower => True);
1161 Sdep.Table (Sdep.Last).Stamp := Get_Stamp;
1162 Sdep.Table (Sdep.Last).Dummy_Entry :=
1163 (Sdep.Table (Sdep.Last).Stamp = Dummy_Time_Stamp);
1165 -- Acquire checksum value
1178 exit when At_Eol or else Ctr = 8;
1180 if Nextc in '0' .. '9' then
1182 Character'Pos (Nextc) - Character'Pos ('0');
1184 elsif Nextc in 'a' .. 'f' then
1186 Character'Pos (Nextc) - Character'Pos ('a') + 10;
1196 if Ctr = 8 and then At_End_Of_Field then
1197 Sdep.Table (Sdep.Last).Checksum := Chk;
1203 -- Acquire subunit and reference file name entries
1205 Sdep.Table (Sdep.Last).Subunit_Name := No_Name;
1206 Sdep.Table (Sdep.Last).Rfile := Sdep.Table (Sdep.Last).Sfile;
1207 Sdep.Table (Sdep.Last).Start_Line := 1;
1212 -- Here for subunit name
1214 if Nextc not in '0' .. '9' then
1217 while not At_End_Of_Field loop
1218 Name_Len := Name_Len + 1;
1219 Name_Buffer (Name_Len) := Getc;
1222 Sdep.Table (Sdep.Last).Subunit_Name := Name_Enter;
1226 -- Here for reference file name entry
1228 if Nextc in '0' .. '9' then
1229 Sdep.Table (Sdep.Last).Start_Line := Get_Nat;
1234 while not At_End_Of_Field loop
1235 Name_Len := Name_Len + 1;
1236 Name_Buffer (Name_Len) := Getc;
1239 Sdep.Table (Sdep.Last).Rfile := Name_Enter;
1247 ALIs.Table (Id).Last_Sdep := Sdep.Last;
1249 -- Loop through Xref sections (skip loop if not reading xref stuff)
1251 while Read_Xref and then C = 'X' loop
1253 -- Make new entry in section table
1255 Xref_Section.Increment_Last;
1257 Read_Refs_For_One_File : declare
1258 XS : Xref_Section_Record renames
1259 Xref_Section.Table (Xref_Section.Last);
1261 Current_File_Num : Sdep_Id;
1262 -- Keeps track of the current file number (changed by nn|)
1265 XS.File_Num := Sdep_Id (Get_Nat + Nat (First_Sdep_Entry) - 1);
1266 XS.File_Name := Get_Name;
1267 XS.First_Entity := Xref_Entity.Last + 1;
1269 Current_File_Num := XS.File_Num;
1274 -- Loop through Xref entities
1276 while C /= 'X' and then C /= EOF loop
1277 Xref_Entity.Increment_Last;
1279 Read_Refs_For_One_Entity : declare
1281 XE : Xref_Entity_Record renames
1282 Xref_Entity.Table (Xref_Entity.Last);
1286 procedure Read_Instantiation_Reference;
1287 -- Acquire instantiation reference. Caller has checked
1288 -- that current character is '[' and on return the cursor
1289 -- is skipped past the corresponding closing ']'.
1291 ----------------------------------
1292 -- Read_Instantiation_Reference --
1293 ----------------------------------
1295 procedure Read_Instantiation_Reference is
1297 Xref.Increment_Last;
1300 XR : Xref_Record renames Xref.Table (Xref.Last);
1303 P := P + 1; -- skip [
1308 Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
1309 Current_File_Num := XR.File_Num;
1314 XR.File_Num := Current_File_Num;
1321 -- Recursive call for next reference
1324 pragma Warnings (Off); -- kill recursion warning
1325 Read_Instantiation_Reference;
1326 pragma Warnings (On);
1329 -- Skip closing bracket after recursive call
1333 end Read_Instantiation_Reference;
1335 -- Start of processing for Read_Refs_For_One_Entity
1341 XE.Lib := (Getc = '*');
1342 XE.Entity := Get_Name;
1344 -- Renaming reference is present
1348 XE.Rref_Line := Get_Nat;
1354 XE.Rref_Col := Get_Nat;
1356 -- No renaming reference present
1365 -- See if type reference present
1368 when '<' => XE.Tref := Tref_Derived;
1369 when '(' => XE.Tref := Tref_Access;
1370 when '{' => XE.Tref := Tref_Type;
1371 when others => XE.Tref := Tref_None;
1374 -- Case of typeref field present
1376 if XE.Tref /= Tref_None then
1377 P := P + 1; -- skip opening bracket
1379 if Nextc in 'a' .. 'z' then
1380 XE.Tref_File_Num := No_Sdep_Id;
1382 XE.Tref_Type := ' ';
1384 XE.Tref_Standard_Entity := Get_Name;
1391 Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
1396 XE.Tref_File_Num := Current_File_Num;
1400 XE.Tref_Type := Getc;
1401 XE.Tref_Col := Get_Nat;
1402 XE.Tref_Standard_Entity := No_Name;
1405 P := P + 1; -- skip closing bracket
1408 -- No typeref entry present
1411 XE.Tref_File_Num := No_Sdep_Id;
1413 XE.Tref_Type := ' ';
1415 XE.Tref_Standard_Entity := No_Name;
1418 XE.First_Xref := Xref.Last + 1;
1420 -- Loop through cross-references for this entity
1422 Current_File_Num := XS.File_Num;
1429 exit when Nextc /= '.';
1433 Xref.Increment_Last;
1436 XR : Xref_Record renames Xref.Table (Xref.Last);
1443 Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
1444 Current_File_Num := XR.File_Num;
1449 XR.File_Num := Current_File_Num;
1457 Read_Instantiation_Reference;
1462 -- Record last cross-reference
1464 XE.Last_Xref := Xref.Last;
1467 end Read_Refs_For_One_Entity;
1470 -- Record last entity
1472 XS.Last_Entity := Xref_Entity.Last;
1474 end Read_Refs_For_One_File;
1479 -- Here after dealing with xref sections
1481 if C /= EOF and then C /= 'X' then
1488 when Bad_ALI_Format =>
1497 function SEq (F1, F2 : String_Ptr) return Boolean is
1499 return F1.all = F2.all;
1506 function SHash (S : String_Ptr) return Vindex is
1511 for J in S.all'Range loop
1512 H := H * 2 + Character'Pos (S (J));
1515 return Vindex (Vindex'First + Vindex (H mod Vindex'Range_Length));