1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
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 2, 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 COPYING. If not, write --
19 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc. --
25 ------------------------------------------------------------------------------
27 with Butil; use Butil;
28 with Debug; use Debug;
29 with Fname; use Fname;
30 with Namet; use Namet;
31 with Osint; use Osint;
32 with Output; use Output;
37 -- Make control characters visible
43 procedure Initialize_ALI is
45 -- When (re)initializing ALI data structures the ALI user expects to
46 -- get a fresh set of data structures. Thus we first need to erase the
47 -- marks put in the name table by the previous set of ALI routine calls.
48 -- This loop is empty and harmless the first time in.
50 for J in ALIs.First .. ALIs.Last loop
51 Set_Name_Table_Info (ALIs.Table (J).Afile, 0);
64 -- Add dummy zero'th item in Linker_Options for the sort function
66 Linker_Options.Increment_Last;
68 -- Initialize global variables recording cumulative options in all
69 -- ALI files that are read for a given processing run in gnatbind.
71 Dynamic_Elaboration_Checks_Specified := False;
72 Float_Format_Specified := ' ';
73 Locking_Policy_Specified := ' ';
74 No_Normalize_Scalars_Specified := False;
75 No_Object_Specified := False;
76 Normalize_Scalars_Specified := False;
77 No_Run_Time_Specified := False;
78 Queuing_Policy_Specified := ' ';
79 Static_Elaboration_Model_Used := False;
80 Task_Dispatching_Policy_Specified := ' ';
81 Unreserve_All_Interrupts_Specified := False;
82 Zero_Cost_Exceptions_Specified := False;
95 Read_Xref : Boolean := False)
98 P : Text_Ptr := T'First;
99 Line : Logical_Line_Number := 1;
105 function At_Eol return Boolean;
106 -- Test if at end of line
108 function At_End_Of_Field return Boolean;
109 -- Test if at end of line, or if at blank or horizontal tab
111 procedure Check_At_End_Of_Field;
112 -- Check if we are at end of field, fatal error if not
114 procedure Checkc (C : Character);
115 -- Check next character is C. If so bump past it, if not fatal error
117 Bad_ALI_Format : exception;
119 procedure Fatal_Error;
120 -- Generate fatal error message for badly formatted ALI file if
121 -- Err is false, or raise Bad_ALI_Format if Err is True.
123 function Getc return Character;
124 -- Get next character, bumping P past the character obtained
126 function Get_Name (Lower : Boolean := False) return Name_Id;
127 -- Skip blanks, then scan out a name (name is left in Name_Buffer with
128 -- length in Name_Len, as well as being returned in Name_Id form).
129 -- If Lower is set to True then the Name_Buffer will be converted to
130 -- all lower case, for systems where file names are not case sensitive.
131 -- This ensures that gnatbind works correctly regardless of the case
132 -- of the file name on all systems. The name is terminated by a either
133 -- white space or a typeref bracket or an equal sign except for the
134 -- special case of an operator name starting with a double quite which
135 -- is terminated by another double quote.
137 function Get_Nat return Nat;
138 -- Skip blanks, then scan out an unsigned integer value in Nat range
140 function Get_Stamp return Time_Stamp_Type;
141 -- Skip blanks, then scan out a time stamp
143 function Nextc return Character;
144 -- Return current character without modifying pointer P
147 -- Skip past end of line (fatal error if not at end of line)
149 procedure Skip_Space;
150 -- Skip past white space (blanks or horizontal tab)
152 ---------------------
153 -- At_End_Of_Field --
154 ---------------------
156 function At_End_Of_Field return Boolean is
165 function At_Eol return Boolean is
167 return Nextc = EOF or else Nextc = CR or else Nextc = LF;
170 ---------------------------
171 -- Check_At_End_Of_Field --
172 ---------------------------
174 procedure Check_At_End_Of_Field is
176 if not At_End_Of_Field then
179 end Check_At_End_Of_Field;
185 procedure Checkc (C : Character) is
198 procedure Fatal_Error is
203 procedure Wchar (C : Character);
204 -- Write a single character, replacing horizontal tab by spaces
206 procedure Wchar (C : Character) is
211 exit when Col mod 8 = 0;
220 -- Start of processing for Fatal_Error
224 raise Bad_ALI_Format;
228 Write_Str ("fatal error: file ");
230 Write_Str (" is incorrectly formatted");
233 ("make sure you are using consistent versions of gcc/gnatbind");
236 -- Find start of line
241 and then T (Ptr1 - 1) /= CR
242 and then T (Ptr1 - 1) /= LF
247 Write_Int (Int (Line));
262 and then T (Ptr2) /= CR
263 and then T (Ptr2) /= LF
275 if T (Ptr1) = HT then
287 Exit_Program (E_Fatal);
294 function Get_Name (Lower : Boolean := False) return Name_Id is
304 Name_Len := Name_Len + 1;
305 Name_Buffer (Name_Len) := Getc;
307 exit when At_End_Of_Field;
309 if Name_Buffer (1) = '"' then
310 exit when Name_Len > 1 and then Name_Buffer (Name_Len) = '"';
313 exit when At_End_Of_Field
314 or else Nextc = '(' or else Nextc = ')'
315 or else Nextc = '{' or else Nextc = '}'
316 or else Nextc = '<' or else Nextc = '>'
321 -- Convert file name to all lower case if file names are not case
322 -- sensitive. This ensures that we handle names in the canonical
323 -- lower case format, regardless of the actual case.
325 if Lower and not File_Names_Case_Sensitive then
326 Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len));
336 function Get_Nat return Nat is
345 V := V * 10 + (Character'Pos (Getc) - Character'Pos ('0'));
346 exit when At_End_Of_Field;
347 exit when Nextc < '0' or Nextc > '9';
357 function Get_Stamp return Time_Stamp_Type is
368 -- Following reads old style time stamp missing first two digits
370 if Nextc in '7' .. '9' then
375 -- Normal case of full year in time stamp
381 for J in Start .. T'Last loop
392 function Getc return Character is
406 function Nextc return Character is
415 procedure Skip_Eol is
418 if not At_Eol then Fatal_Error; end if;
420 -- Loop to skip past blank lines (first time through skips this EOL)
422 while Nextc < ' ' and then Nextc /= EOF loop
435 procedure Skip_Space is
437 while Nextc = ' ' or else Nextc = HT loop
442 --------------------------------------
443 -- Start of processing for Scan_ALI --
444 --------------------------------------
449 Set_Name_Table_Info (F, Int (Id));
453 Compile_Errors => False,
454 First_Sdep => No_Sdep_Id,
455 First_Unit => No_Unit_Id,
457 Last_Sdep => No_Sdep_Id,
458 Last_Unit => No_Unit_Id,
459 Locking_Policy => ' ',
461 Main_Program => None,
463 No_Run_Time => False,
464 Normalize_Scalars => False,
465 Ofile_Full_Name => Full_Object_File_Name,
466 Queuing_Policy => ' ',
467 Restrictions => (others => ' '),
469 Task_Dispatching_Policy => ' ',
470 Time_Slice_Value => -1,
472 Unit_Exception_Table => False,
473 Ver => (others => ' '),
475 Zero_Cost_Exceptions => False);
477 -- Acquire library version
484 for J in 1 .. Ver_Len_Max loop
487 ALIs.Table (Id).Ver (J) := C;
488 ALIs.Table (Id).Ver_Len := J;
493 -- Acquire main program line if present
504 ALIs.Table (Id).Main_Program := Func;
506 ALIs.Table (Id).Main_Program := Proc;
516 ALIs.Table (Id).Main_Priority := Get_Nat;
524 ALIs.Table (Id).Time_Slice_Value := Get_Nat;
531 ALIs.Table (Id).WC_Encoding := Getc;
539 -- Acquire argument lines
541 First_Arg := Args.Last + 1;
543 Arg_Loop : while C = 'A' loop
547 while not At_Eol loop
548 Name_Len := Name_Len + 1;
549 Name_Buffer (Name_Len) := Getc;
553 Args.Table (Args.Last) := new String'(Name_Buffer (1 .. Name_Len));
559 -- Acquire P line, first set defaults
567 while not At_Eol loop
574 ALIs.Table (Id).Compile_Errors := True;
577 Float_Format_Specified := Getc;
578 ALIs.Table (Id).Float_Format := Float_Format_Specified;
581 Locking_Policy_Specified := Getc;
582 ALIs.Table (Id).Locking_Policy := Locking_Policy_Specified;
588 ALIs.Table (Id).No_Object := True;
589 No_Object_Specified := True;
592 No_Run_Time_Specified := True;
593 ALIs.Table (Id).No_Run_Time := True;
596 ALIs.Table (Id).Normalize_Scalars := True;
597 Normalize_Scalars_Specified := True;
605 Queuing_Policy_Specified := Getc;
606 ALIs.Table (Id).Queuing_Policy := Queuing_Policy_Specified;
609 Task_Dispatching_Policy_Specified := Getc;
610 ALIs.Table (Id).Task_Dispatching_Policy :=
611 Task_Dispatching_Policy_Specified;
615 Unreserve_All_Interrupts_Specified := True;
620 ALIs.Table (Id).Unit_Exception_Table := True;
625 ALIs.Table (Id).Zero_Cost_Exceptions := True;
626 Zero_Cost_Exceptions_Specified := True;
634 No_Normalize_Scalars_Specified := True;
639 -- Acquire restrictions line
648 for J in All_Restrictions loop
650 ALIs.Table (Id).Restrictions (J) := C;
654 Restrictions (J) := 'v';
657 if Restrictions (J) = 'n' then
658 Restrictions (J) := 'r';
677 -- Loop to acquire unit entries
679 Unit_Loop : while C = 'U' loop
682 Units.Increment_Last;
684 if ALIs.Table (Id).First_Unit = No_Unit_Id then
685 ALIs.Table (Id).First_Unit := Units.Last;
688 Units.Table (Units.Last).Uname := Get_Name;
689 Units.Table (Units.Last).Predefined := Is_Predefined_Unit;
690 Units.Table (Units.Last).Internal := Is_Internal_Unit;
691 Units.Table (Units.Last).My_ALI := Id;
692 Units.Table (Units.Last).Sfile := Get_Name (Lower => True);
693 Units.Table (Units.Last).Pure := False;
694 Units.Table (Units.Last).Preelab := False;
695 Units.Table (Units.Last).No_Elab := False;
696 Units.Table (Units.Last).Shared_Passive := False;
697 Units.Table (Units.Last).RCI := False;
698 Units.Table (Units.Last).Remote_Types := False;
699 Units.Table (Units.Last).Has_RACW := False;
700 Units.Table (Units.Last).Init_Scalars := False;
701 Units.Table (Units.Last).Is_Generic := False;
702 Units.Table (Units.Last).Icasing := Mixed_Case;
703 Units.Table (Units.Last).Kcasing := All_Lower_Case;
704 Units.Table (Units.Last).Dynamic_Elab := False;
705 Units.Table (Units.Last).Elaborate_Body := False;
706 Units.Table (Units.Last).Set_Elab_Entity := False;
707 Units.Table (Units.Last).Version := "00000000";
708 Units.Table (Units.Last).First_With := Withs.Last + 1;
709 Units.Table (Units.Last).First_Arg := First_Arg;
710 Units.Table (Units.Last).Elab_Position := 0;
713 Write_Str (" ----> reading unit ");
714 Write_Int (Int (Units.Last));
716 Write_Unit_Name (Units.Table (Units.Last).Uname);
717 Write_Str (" from file ");
718 Write_Name (Units.Table (Units.Last).Sfile);
722 -- Check for duplicated unit in different files
725 Info : constant Int := Get_Name_Table_Info
726 (Units.Table (Units.Last).Uname);
729 and then Units.Table (Units.Last).Sfile /=
730 Units.Table (Unit_Id (Info)).Sfile
732 -- If Err is set then ignore duplicate unit name. This is the
733 -- case of a call from gnatmake, where the situation can arise
734 -- from substitution of source files. In such situations, the
735 -- processing in gnatmake will always result in any required
736 -- recompilations in any case, and if we consider this to be
737 -- an error we get strange cases (for example when a generic
738 -- instantiation is replaced by a normal package) where we
739 -- read the old ali file, decide to recompile, and then decide
740 -- that the old and new ali files are incompatible.
745 -- If Err is not set, then this is a fatal error. This is
746 -- the case of being called from the binder, where we must
747 -- definitely diagnose this as an error.
751 Write_Str ("error: duplicate unit name: ");
754 Write_Str ("error: unit """);
755 Write_Unit_Name (Units.Table (Units.Last).Uname);
756 Write_Str (""" found in file """);
757 Write_Name_Decoded (Units.Table (Units.Last).Sfile);
761 Write_Str ("error: unit """);
762 Write_Unit_Name (Units.Table (Unit_Id (Info)).Uname);
763 Write_Str (""" found in file """);
764 Write_Name_Decoded (Units.Table (Unit_Id (Info)).Sfile);
768 Exit_Program (E_Fatal);
774 (Units.Table (Units.Last).Uname, Int (Units.Last));
776 -- Scan out possible version and other parameters
785 if C in '0' .. '9' or else C in 'a' .. 'f' then
786 Units.Table (Units.Last).Version (1) := C;
790 Units.Table (Units.Last).Version (J) := C;
793 -- DE parameter (Dynamic elaboration checks
797 Check_At_End_Of_Field;
798 Units.Table (Units.Last).Dynamic_Elab := True;
799 Dynamic_Elaboration_Checks_Specified := True;
807 Units.Table (Units.Last).Elaborate_Body := True;
810 Units.Table (Units.Last).Set_Elab_Entity := True;
816 Check_At_End_Of_Field;
818 -- GE parameter (generic)
822 Check_At_End_Of_Field;
823 Units.Table (Units.Last).Is_Generic := True;
825 -- IL/IS/IU parameters
831 Units.Table (Units.Last).Icasing := All_Lower_Case;
834 Units.Table (Units.Last).Init_Scalars := True;
835 Initialize_Scalars_Used := True;
838 Units.Table (Units.Last).Icasing := All_Upper_Case;
844 Check_At_End_Of_Field;
852 Units.Table (Units.Last).Kcasing := Mixed_Case;
855 Units.Table (Units.Last).Kcasing := All_Upper_Case;
861 Check_At_End_Of_Field;
867 Units.Table (Units.Last).No_Elab := True;
868 Check_At_End_Of_Field;
870 -- PR/PU/PK parameters
875 -- PR parameter (preelaborate)
878 Units.Table (Units.Last).Preelab := True;
880 -- PU parameter (pure)
883 Units.Table (Units.Last).Pure := True;
885 -- PK indicates unit is package
888 Units.Table (Units.Last).Unit_Kind := 'p';
894 Check_At_End_Of_Field;
901 -- RC parameter (remote call interface)
904 Units.Table (Units.Last).RCI := True;
906 -- RT parameter (remote types)
909 Units.Table (Units.Last).Remote_Types := True;
911 -- RA parameter (remote access to class wide type)
914 Units.Table (Units.Last).Has_RACW := True;
920 Check_At_End_Of_Field;
925 -- SP parameter (shared passive)
928 Units.Table (Units.Last).Shared_Passive := True;
930 -- SU parameter indicates unit is subprogram
933 Units.Table (Units.Last).Unit_Kind := 's';
939 Check_At_End_Of_Field;
949 -- Check if static elaboration model used
951 if not Units.Table (Units.Last).Dynamic_Elab
952 and then not Units.Table (Units.Last).Internal
954 Static_Elaboration_Model_Used := True;
957 -- Scan out With lines for this unit
961 With_Loop : while C = 'W' loop
964 Withs.Increment_Last;
965 Withs.Table (Withs.Last).Uname := Get_Name;
966 Withs.Table (Withs.Last).Elaborate := False;
967 Withs.Table (Withs.Last).Elaborate_All := False;
968 Withs.Table (Withs.Last).Elab_All_Desirable := False;
970 -- Generic case with no object file available
973 Withs.Table (Withs.Last).Sfile := No_File;
974 Withs.Table (Withs.Last).Afile := No_File;
979 Withs.Table (Withs.Last).Sfile := Get_Name (Lower => True);
980 Withs.Table (Withs.Last).Afile := Get_Name;
982 -- Scan out possible E, EA, and NE parameters
984 while not At_Eol loop
990 if At_End_Of_Field then
991 Withs.Table (Withs.Last).Elaborate := True;
993 elsif Nextc = 'A' then
995 Check_At_End_Of_Field;
996 Withs.Table (Withs.Last).Elaborate_All := True;
1000 Check_At_End_Of_Field;
1002 -- Store ED indication unless ignore required
1004 if not Ignore_ED then
1005 Withs.Table (Withs.Last).Elab_All_Desirable := True;
1017 Units.Table (Units.Last).Last_With := Withs.Last;
1018 Units.Table (Units.Last).Last_Arg := Args.Last;
1020 -- If there are linker options lines present, scan them
1024 Linker_Options_Loop : while C = 'L' loop
1032 if C < Character'Val (16#20#)
1033 or else C > Character'Val (16#7E#)
1038 C := Character'Val (0);
1045 for J in 1 .. 2 loop
1048 if C in '0' .. '9' then
1050 Character'Pos (C) - Character'Pos ('0');
1052 elsif C in 'A' .. 'F' then
1054 Character'Pos (C) - Character'Pos ('A') + 10;
1063 Add_Char_To_Name_Buffer (Character'Val (V));
1068 exit when Nextc /= '"';
1072 Add_Char_To_Name_Buffer (C);
1076 Add_Char_To_Name_Buffer (nul);
1080 end loop Linker_Options_Loop;
1082 -- Store the linker options entry
1084 if Name_Len /= 0 then
1085 Linker_Options.Increment_Last;
1087 Linker_Options.Table (Linker_Options.Last).Name :=
1090 Linker_Options.Table (Linker_Options.Last).Unit :=
1093 Linker_Options.Table (Linker_Options.Last).Internal_File :=
1094 Is_Internal_File_Name (F);
1096 Linker_Options.Table (Linker_Options.Last).Original_Pos :=
1097 Linker_Options.Last;
1101 -- End loop through units for one ALI file
1103 ALIs.Table (Id).Last_Unit := Units.Last;
1104 ALIs.Table (Id).Sfile := Units.Table (ALIs.Table (Id).First_Unit).Sfile;
1106 -- Set types of the units (there can be at most 2 of them)
1108 if ALIs.Table (Id).First_Unit /= ALIs.Table (Id).Last_Unit then
1109 Units.Table (ALIs.Table (Id).First_Unit).Utype := Is_Body;
1110 Units.Table (ALIs.Table (Id).Last_Unit).Utype := Is_Spec;
1113 -- Deal with body only and spec only cases, note that the reason we
1114 -- do our own checking of the name (rather than using Is_Body_Name)
1115 -- is that Uname drags in far too much compiler junk!
1117 Get_Name_String (Units.Table (Units.Last).Uname);
1119 if Name_Buffer (Name_Len) = 'b' then
1120 Units.Table (Units.Last).Utype := Is_Body_Only;
1122 Units.Table (Units.Last).Utype := Is_Spec_Only;
1126 -- Scan out external version references and put in hash table
1141 exit when At_End_Of_Field;
1142 Add_Char_To_Name_Buffer (C);
1145 Version_Ref.Set (new String'(Name_Buffer (1 .. Name_Len)), True);
1150 -- Scan out source dependency lines for this ALI file
1152 ALIs.Table (Id).First_Sdep := Sdep.Last + 1;
1157 Sdep.Increment_Last;
1158 Sdep.Table (Sdep.Last).Sfile := Get_Name (Lower => True);
1159 Sdep.Table (Sdep.Last).Stamp := Get_Stamp;
1160 Sdep.Table (Sdep.Last).Dummy_Entry :=
1161 (Sdep.Table (Sdep.Last).Stamp = Dummy_Time_Stamp);
1163 -- Acquire checksum value
1176 exit when At_Eol or else Ctr = 8;
1178 if Nextc in '0' .. '9' then
1180 Character'Pos (Nextc) - Character'Pos ('0');
1182 elsif Nextc in 'a' .. 'f' then
1184 Character'Pos (Nextc) - Character'Pos ('a') + 10;
1194 if Ctr = 8 and then At_End_Of_Field then
1195 Sdep.Table (Sdep.Last).Checksum := Chk;
1201 -- Acquire subunit and reference file name entries
1203 Sdep.Table (Sdep.Last).Subunit_Name := No_Name;
1204 Sdep.Table (Sdep.Last).Rfile := Sdep.Table (Sdep.Last).Sfile;
1205 Sdep.Table (Sdep.Last).Start_Line := 1;
1210 -- Here for subunit name
1212 if Nextc not in '0' .. '9' then
1215 while not At_End_Of_Field loop
1216 Name_Len := Name_Len + 1;
1217 Name_Buffer (Name_Len) := Getc;
1220 Sdep.Table (Sdep.Last).Subunit_Name := Name_Enter;
1224 -- Here for reference file name entry
1226 if Nextc in '0' .. '9' then
1227 Sdep.Table (Sdep.Last).Start_Line := Get_Nat;
1232 while not At_End_Of_Field loop
1233 Name_Len := Name_Len + 1;
1234 Name_Buffer (Name_Len) := Getc;
1237 Sdep.Table (Sdep.Last).Rfile := Name_Enter;
1245 ALIs.Table (Id).Last_Sdep := Sdep.Last;
1247 -- Loop through Xref sections (skip loop if not reading xref stuff)
1249 while Read_Xref and then C = 'X' loop
1251 -- Make new entry in section table
1253 Xref_Section.Increment_Last;
1255 Read_Refs_For_One_File : declare
1256 XS : Xref_Section_Record renames
1257 Xref_Section.Table (Xref_Section.Last);
1259 Current_File_Num : Sdep_Id;
1260 -- Keeps track of the current file number (changed by nn|)
1263 XS.File_Num := Sdep_Id (Get_Nat + Nat (First_Sdep_Entry) - 1);
1264 XS.File_Name := Get_Name;
1265 XS.First_Entity := Xref_Entity.Last + 1;
1267 Current_File_Num := XS.File_Num;
1272 -- Loop through Xref entities
1274 while C /= 'X' and then C /= EOF loop
1275 Xref_Entity.Increment_Last;
1277 Read_Refs_For_One_Entity : declare
1279 XE : Xref_Entity_Record renames
1280 Xref_Entity.Table (Xref_Entity.Last);
1284 procedure Read_Instantiation_Reference;
1285 -- Acquire instantiation reference. Caller has checked
1286 -- that current character is '[' and on return the cursor
1287 -- is skipped past the corresponding closing ']'.
1289 ----------------------------------
1290 -- Read_Instantiation_Reference --
1291 ----------------------------------
1293 procedure Read_Instantiation_Reference is
1295 Xref.Increment_Last;
1298 XR : Xref_Record renames Xref.Table (Xref.Last);
1301 P := P + 1; -- skip [
1306 Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
1307 Current_File_Num := XR.File_Num;
1312 XR.File_Num := Current_File_Num;
1319 -- Recursive call for next reference
1322 pragma Warnings (Off); -- kill recursion warning
1323 Read_Instantiation_Reference;
1324 pragma Warnings (On);
1327 -- Skip closing bracket after recursive call
1331 end Read_Instantiation_Reference;
1333 -- Start of processing for Read_Refs_For_One_Entity
1339 XE.Lib := (Getc = '*');
1340 XE.Entity := Get_Name;
1342 -- Renaming reference is present
1346 XE.Rref_Line := Get_Nat;
1352 XE.Rref_Col := Get_Nat;
1354 -- No renaming reference present
1363 -- See if type reference present
1366 when '<' => XE.Tref := Tref_Derived;
1367 when '(' => XE.Tref := Tref_Access;
1368 when '{' => XE.Tref := Tref_Type;
1369 when others => XE.Tref := Tref_None;
1372 -- Case of typeref field present
1374 if XE.Tref /= Tref_None then
1375 P := P + 1; -- skip opening bracket
1377 if Nextc in 'a' .. 'z' then
1378 XE.Tref_File_Num := No_Sdep_Id;
1380 XE.Tref_Type := ' ';
1382 XE.Tref_Standard_Entity := Get_Name;
1389 Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
1394 XE.Tref_File_Num := Current_File_Num;
1398 XE.Tref_Type := Getc;
1399 XE.Tref_Col := Get_Nat;
1400 XE.Tref_Standard_Entity := No_Name;
1403 P := P + 1; -- skip closing bracket
1406 -- No typeref entry present
1409 XE.Tref_File_Num := No_Sdep_Id;
1411 XE.Tref_Type := ' ';
1413 XE.Tref_Standard_Entity := No_Name;
1416 XE.First_Xref := Xref.Last + 1;
1418 -- Loop through cross-references for this entity
1420 Current_File_Num := XS.File_Num;
1427 exit when Nextc /= '.';
1431 Xref.Increment_Last;
1434 XR : Xref_Record renames Xref.Table (Xref.Last);
1441 Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
1442 Current_File_Num := XR.File_Num;
1447 XR.File_Num := Current_File_Num;
1455 Read_Instantiation_Reference;
1460 -- Record last cross-reference
1462 XE.Last_Xref := Xref.Last;
1465 end Read_Refs_For_One_Entity;
1468 -- Record last entity
1470 XS.Last_Entity := Xref_Entity.Last;
1472 end Read_Refs_For_One_File;
1477 -- Here after dealing with xref sections
1479 if C /= EOF and then C /= 'X' then
1486 when Bad_ALI_Format =>
1495 function SEq (F1, F2 : String_Ptr) return Boolean is
1497 return F1.all = F2.all;
1504 function SHash (S : String_Ptr) return Vindex is
1509 for J in S.all'Range loop
1510 H := H * 2 + Character'Pos (S (J));
1513 return Vindex (Vindex'First + Vindex (H mod Vindex'Range_Length));