1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2014, 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 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 ------------------------------------------------------------------------------
26 with Butil
; use Butil
;
27 with Debug
; use Debug
;
28 with Fname
; use Fname
;
30 with Osint
; use Osint
;
31 with Output
; use Output
;
36 -- Make control characters visible
38 -- The following variable records which characters currently are
39 -- used as line type markers in the ALI file. This is used in
40 -- Scan_ALI to detect (or skip) invalid lines.
42 Known_ALI_Lines
: constant array (Character range 'A' .. 'Z') of Boolean :=
43 ('V' => True, -- version
44 'M' => True, -- main program
45 'A' => True, -- argument
46 'P' => True, -- program
47 'R' => True, -- restriction
48 'I' => True, -- interrupt
51 'L' => True, -- linker option
53 'E' => True, -- external
54 'D' => True, -- dependency
56 'S' => True, -- specific dispatching
57 'Y' => True, -- limited_with
58 'Z' => True, -- implicit with from instantiation
59 'C' => True, -- SCO information
60 'F' => True, -- SPARK cross-reference information
67 procedure Initialize_ALI
is
69 -- When (re)initializing ALI data structures the ALI user expects to
70 -- get a fresh set of data structures. Thus we first need to erase the
71 -- marks put in the name table by the previous set of ALI routine calls.
72 -- These two loops are empty and harmless the first time in.
74 for J
in ALIs
.First
.. ALIs
.Last
loop
75 Set_Name_Table_Info
(ALIs
.Table
(J
).Afile
, 0);
78 for J
in Units
.First
.. Units
.Last
loop
79 Set_Name_Table_Info
(Units
.Table
(J
).Uname
, 0);
82 -- Free argument table strings
84 for J
in Args
.First
.. Args
.Last
loop
85 Free
(Args
.Table
(J
));
88 -- Initialize all tables
102 -- Add dummy zero'th item in Linker_Options and Notes for sort calls
104 Linker_Options
.Increment_Last
;
105 Notes
.Increment_Last
;
107 -- Initialize global variables recording cumulative options in all
108 -- ALI files that are read for a given processing run in gnatbind.
110 Dynamic_Elaboration_Checks_Specified
:= False;
111 Locking_Policy_Specified
:= ' ';
112 No_Normalize_Scalars_Specified
:= False;
113 No_Object_Specified
:= False;
114 Normalize_Scalars_Specified
:= False;
115 Partition_Elaboration_Policy_Specified
:= ' ';
116 Queuing_Policy_Specified
:= ' ';
117 SSO_Default_Specified
:= False;
118 Static_Elaboration_Model_Used
:= False;
119 Task_Dispatching_Policy_Specified
:= ' ';
120 Unreserve_All_Interrupts_Specified
:= False;
121 Zero_Cost_Exceptions_Specified
:= False;
133 Read_Xref
: Boolean := False;
134 Read_Lines
: String := "";
135 Ignore_Lines
: String := "X";
136 Ignore_Errors
: Boolean := False;
137 Directly_Scanned
: Boolean := False) return ALI_Id
139 P
: Text_Ptr
:= T
'First;
140 Line
: Logical_Line_Number
:= 1;
146 Ignore
: array (Character range 'A' .. 'Z') of Boolean;
147 -- Ignore (X) is set to True if lines starting with X are to
148 -- be ignored by Scan_ALI and skipped, and False if the lines
149 -- are to be read and processed.
151 Bad_ALI_Format
: exception;
152 -- Exception raised by Fatal_Error if Err is True
154 function At_Eol
return Boolean;
155 -- Test if at end of line
157 function At_End_Of_Field
return Boolean;
158 -- Test if at end of line, or if at blank or horizontal tab
160 procedure Check_At_End_Of_Field
;
161 -- Check if we are at end of field, fatal error if not
163 procedure Checkc
(C
: Character);
164 -- Check next character is C. If so bump past it, if not fatal error
166 procedure Check_Unknown_Line
;
167 -- If Ignore_Errors mode, then checks C to make sure that it is not
168 -- an unknown ALI line type characters, and if so, skips lines
169 -- until the first character of the line is one of these characters,
170 -- at which point it does a Getc to put that character in C. The
171 -- call has no effect if C is already an appropriate character.
172 -- If not in Ignore_Errors mode, a fatal error is signalled if the
173 -- line is unknown. Note that if C is an EOL on entry, the line is
174 -- skipped (it is assumed that blank lines are never significant).
175 -- If C is EOF on entry, the call has no effect (it is assumed that
176 -- the caller will properly handle this case).
178 procedure Fatal_Error
;
179 -- Generate fatal error message for badly formatted ALI file if
180 -- Err is false, or raise Bad_ALI_Format if Err is True.
182 procedure Fatal_Error_Ignore
;
183 pragma Inline
(Fatal_Error_Ignore
);
184 -- In Ignore_Errors mode, has no effect, otherwise same as Fatal_Error
186 function Getc
return Character;
187 -- Get next character, bumping P past the character obtained
189 function Get_File_Name
190 (Lower
: Boolean := False;
191 May_Be_Quoted
: Boolean := False) return File_Name_Type
;
192 -- Skip blanks, then scan out a file name (name is left in Name_Buffer
193 -- with length in Name_Len, as well as returning a File_Name_Type value.
194 -- If May_Be_Quoted is True and the first non blank character is '"',
195 -- then remove starting and ending quotes and undoubled internal quotes.
196 -- If lower is false, the case is unchanged, if Lower is True then the
197 -- result is forced to all lower case for systems where file names are
198 -- not case sensitive. This ensures that gnatbind works correctly
199 -- regardless of the case of the file name on all systems. The scan
200 -- is terminated by a end of line, space or horizontal tab. Any other
201 -- special characters are included in the returned name.
204 (Ignore_Spaces
: Boolean := False;
205 Ignore_Special
: Boolean := False;
206 May_Be_Quoted
: Boolean := False) return Name_Id
;
207 -- Skip blanks, then scan out a name (name is left in Name_Buffer with
208 -- length in Name_Len, as well as being returned in Name_Id form).
209 -- If Lower is set to True then the Name_Buffer will be converted to
210 -- all lower case, for systems where file names are not case sensitive.
211 -- This ensures that gnatbind works correctly regardless of the case
212 -- of the file name on all systems. The termination condition depends
213 -- on the settings of Ignore_Spaces and Ignore_Special:
215 -- If Ignore_Spaces is False (normal case), then scan is terminated
216 -- by the normal end of field condition (EOL, space, horizontal tab)
218 -- If Ignore_Special is False (normal case), the scan is terminated by
219 -- a typeref bracket or an equal sign except for the special case of
220 -- an operator name starting with a double quote which is terminated
221 -- by another double quote.
223 -- If May_Be_Quoted is True and the first non blank character is '"'
224 -- the name is 'unquoted'. In this case Ignore_Special is ignored and
225 -- assumed to be True.
227 -- It is an error to set both Ignore_Spaces and Ignore_Special to True.
228 -- This function handles wide characters properly.
230 function Get_Nat
return Nat
;
231 -- Skip blanks, then scan out an unsigned integer value in Nat range
232 -- raises ALI_Reading_Error if the encoutered type is not natural.
234 function Get_Stamp
return Time_Stamp_Type
;
235 -- Skip blanks, then scan out a time stamp
237 function Get_Unit_Name
return Unit_Name_Type
;
238 -- Skip blanks, then scan out a file name (name is left in Name_Buffer
239 -- with length in Name_Len, as well as returning a Unit_Name_Type value.
240 -- The case is unchanged and terminated by a normal end of field.
242 function Nextc
return Character;
243 -- Return current character without modifying pointer P
245 procedure Get_Typeref
246 (Current_File_Num
: Sdep_Id
;
248 File_Num
: out Sdep_Id
;
250 Ref_Type
: out Character;
252 Standard_Entity
: out Name_Id
);
253 -- Parse the definition of a typeref (<...>, {...} or (...))
256 -- Skip past spaces, then skip past end of line (fatal error if not
257 -- at end of line). Also skips past any following blank lines.
260 -- Skip rest of current line and any following blank lines
262 procedure Skip_Space
;
263 -- Skip past white space (blanks or horizontal tab)
266 -- Skip past next character, does not affect value in C. This call
267 -- is like calling Getc and ignoring the returned result.
269 ---------------------
270 -- At_End_Of_Field --
271 ---------------------
273 function At_End_Of_Field
return Boolean is
282 function At_Eol
return Boolean is
284 return Nextc
= EOF
or else Nextc
= CR
or else Nextc
= LF
;
287 ---------------------------
288 -- Check_At_End_Of_Field --
289 ---------------------------
291 procedure Check_At_End_Of_Field
is
293 if not At_End_Of_Field
then
294 if Ignore_Errors
then
295 while Nextc
> ' ' loop
302 end Check_At_End_Of_Field
;
304 ------------------------
305 -- Check_Unknown_Line --
306 ------------------------
308 procedure Check_Unknown_Line
is
310 while C
not in 'A' .. 'Z'
311 or else not Known_ALI_Lines
(C
)
313 if C
= CR
or else C
= LF
then
320 elsif Ignore_Errors
then
328 end Check_Unknown_Line
;
334 procedure Checkc
(C
: Character) is
338 elsif Ignore_Errors
then
349 procedure Fatal_Error
is
354 procedure Wchar
(C
: Character);
355 -- Write a single character, replacing horizontal tab by spaces
357 procedure Wchar
(C
: Character) is
362 exit when Col
mod 8 = 0;
371 -- Start of processing for Fatal_Error
375 raise Bad_ALI_Format
;
379 Write_Str
("fatal error: file ");
381 Write_Str
(" is incorrectly formatted");
384 Write_Str
("make sure you are using consistent versions " &
386 -- Split the following line so that it can easily be transformed for
387 -- e.g. JVM/.NET back-ends where the compiler has a different name.
393 -- Find start of line
397 and then T
(Ptr1
- 1) /= CR
398 and then T
(Ptr1
- 1) /= LF
403 Write_Int
(Int
(Line
));
418 and then T
(Ptr2
) /= CR
419 and then T
(Ptr2
) /= LF
431 if T
(Ptr1
) = HT
then
443 Exit_Program
(E_Fatal
);
446 ------------------------
447 -- Fatal_Error_Ignore --
448 ------------------------
450 procedure Fatal_Error_Ignore
is
452 if not Ignore_Errors
then
455 end Fatal_Error_Ignore
;
461 function Get_File_Name
462 (Lower
: Boolean := False;
463 May_Be_Quoted
: Boolean := False) return File_Name_Type
468 F
:= Get_Name
(Ignore_Special
=> True,
469 May_Be_Quoted
=> May_Be_Quoted
);
471 -- Convert file name to all lower case if file names are not case
472 -- sensitive. This ensures that we handle names in the canonical
473 -- lower case format, regardless of the actual case.
475 if Lower
and not File_Names_Case_Sensitive
then
476 Canonical_Case_File_Name
(Name_Buffer
(1 .. Name_Len
));
479 return File_Name_Type
(F
);
488 (Ignore_Spaces
: Boolean := False;
489 Ignore_Special
: Boolean := False;
490 May_Be_Quoted
: Boolean := False) return Name_Id
499 if Ignore_Errors
then
508 -- Deal with quoted characters
510 if May_Be_Quoted
and then Char
= '"' then
513 if Ignore_Errors
then
536 Add_Char_To_Name_Buffer
(Char
);
539 -- Other than case of quoted character
544 Add_Char_To_Name_Buffer
(Getc
);
546 exit when At_End_Of_Field
and then not Ignore_Spaces
;
548 if not Ignore_Special
then
549 if Name_Buffer
(1) = '"' then
550 exit when Name_Len
> 1
551 and then Name_Buffer
(Name_Len
) = '"';
554 -- Terminate on parens or angle brackets or equal sign
556 exit when Nextc
= '(' or else Nextc
= ')'
557 or else Nextc
= '{' or else Nextc
= '}'
558 or else Nextc
= '<' or else Nextc
= '>'
561 -- Terminate on comma
563 exit when Nextc
= ',';
565 -- Terminate if left bracket not part of wide char
566 -- sequence Note that we only recognize brackets
567 -- notation so far ???
569 exit when Nextc
= '[' and then T
(P
+ 1) /= '"';
571 -- Terminate if right bracket not part of wide char
574 exit when Nextc
= ']' and then T
(P
- 1) /= '"';
587 function Get_Unit_Name
return Unit_Name_Type
is
589 return Unit_Name_Type
(Get_Name
);
596 function Get_Nat
return Nat
is
602 -- Check if we are on a number. In the case of bad ALI files, this
605 if not (Nextc
in '0' .. '9') then
611 V
:= V
* 10 + (Character'Pos (Getc
) - Character'Pos ('0'));
613 exit when At_End_Of_Field
;
614 exit when Nextc
< '0' or else Nextc
> '9';
624 function Get_Stamp
return Time_Stamp_Type
is
632 if Ignore_Errors
then
633 return Dummy_Time_Stamp
;
639 -- Following reads old style time stamp missing first two digits
641 if Nextc
in '7' .. '9' then
646 -- Normal case of full year in time stamp
652 for J
in Start
.. T
'Last loop
663 procedure Get_Typeref
664 (Current_File_Num
: Sdep_Id
;
666 File_Num
: out Sdep_Id
;
668 Ref_Type
: out Character;
670 Standard_Entity
: out Name_Id
)
675 when '<' => Ref
:= Tref_Derived
;
676 when '(' => Ref
:= Tref_Access
;
677 when '{' => Ref
:= Tref_Type
;
678 when others => Ref
:= Tref_None
;
681 -- Case of typeref field present
683 if Ref
/= Tref_None
then
684 P
:= P
+ 1; -- skip opening bracket
686 if Nextc
in 'a' .. 'z' then
687 File_Num
:= No_Sdep_Id
;
691 Standard_Entity
:= Get_Name
(Ignore_Spaces
=> True);
696 File_Num
:= Sdep_Id
(N
+ Nat
(First_Sdep_Entry
) - 1);
700 File_Num
:= Current_File_Num
;
706 Standard_Entity
:= No_Name
;
709 -- ??? Temporary workaround for nested generics case:
710 -- 4i4 Directories{1|4I9[4|6[3|3]]}
714 Nested_Brackets
: Natural := 0;
720 Nested_Brackets
:= Nested_Brackets
+ 1;
722 Nested_Brackets
:= Nested_Brackets
- 1;
724 if Nested_Brackets
= 0 then
733 P
:= P
+ 1; -- skip closing bracket
736 -- No typeref entry present
739 File_Num
:= No_Sdep_Id
;
743 Standard_Entity
:= No_Name
;
751 function Getc
return Character is
765 function Nextc
return Character is
774 procedure Skip_Eol
is
779 if Ignore_Errors
then
780 while not At_Eol
loop
788 -- Loop to skip past blank lines (first time through skips this EOL)
790 while Nextc
< ' ' and then Nextc
/= EOF
loop
803 procedure Skip_Line
is
805 while not At_Eol
loop
816 procedure Skip_Space
is
818 while Nextc
= ' ' or else Nextc
= HT
loop
834 -- Start of processing for Scan_ALI
837 First_Sdep_Entry
:= Sdep
.Last
+ 1;
839 -- Acquire lines to be ignored
843 ('U' |
'W' |
'Y' |
'Z' |
'D' |
'X' => False, others => True);
845 -- Read_Lines parameter given
847 elsif Read_Lines
/= "" then
848 Ignore
:= ('U' => False, others => True);
850 for J
in Read_Lines
'Range loop
851 Ignore
(Read_Lines
(J
)) := False;
854 -- Process Ignore_Lines parameter
857 Ignore
:= (others => False);
859 for J
in Ignore_Lines
'Range loop
860 pragma Assert
(Ignore_Lines
(J
) /= 'U');
861 Ignore
(Ignore_Lines
(J
)) := True;
865 -- Setup ALI Table entry with appropriate defaults
869 Set_Name_Table_Info
(F
, Int
(Id
));
873 Compile_Errors
=> False,
874 First_Interrupt_State
=> Interrupt_States
.Last
+ 1,
875 First_Sdep
=> No_Sdep_Id
,
876 First_Specific_Dispatching
=> Specific_Dispatching
.Last
+ 1,
877 First_Unit
=> No_Unit_Id
,
878 Last_Interrupt_State
=> Interrupt_States
.Last
,
879 Last_Sdep
=> No_Sdep_Id
,
880 Last_Specific_Dispatching
=> Specific_Dispatching
.Last
,
881 Last_Unit
=> No_Unit_Id
,
882 Locking_Policy
=> ' ',
885 Main_Program
=> None
,
887 Normalize_Scalars
=> False,
888 Ofile_Full_Name
=> Full_Object_File_Name
,
889 Partition_Elaboration_Policy
=> ' ',
890 Queuing_Policy
=> ' ',
891 Restrictions
=> No_Restrictions
,
892 SAL_Interface
=> False,
895 Task_Dispatching_Policy
=> ' ',
896 Time_Slice_Value
=> -1,
898 Unit_Exception_Table
=> False,
899 Ver
=> (others => ' '),
901 Zero_Cost_Exceptions
=> False);
903 -- Now we acquire the input lines from the ALI file. Note that the
904 -- convention in the following code is that as we enter each section,
905 -- C is set to contain the first character of the following line.
910 -- Acquire library version
914 -- The V line missing really indicates trouble, most likely it
915 -- means we don't have an ALI file at all, so here we give a
916 -- fatal error even if we are in Ignore_Errors mode.
920 elsif Ignore
('V') then
928 for J
in 1 .. Ver_Len_Max
loop
931 ALIs
.Table
(Id
).Ver
(J
) := C
;
932 ALIs
.Table
(Id
).Ver_Len
:= J
;
941 -- Acquire main program line if present
954 ALIs
.Table
(Id
).Main_Program
:= Func
;
956 ALIs
.Table
(Id
).Main_Program
:= Proc
;
966 ALIs
.Table
(Id
).Main_Priority
:= Get_Nat
;
974 ALIs
.Table
(Id
).Time_Slice_Value
:= Get_Nat
;
982 ALIs
.Table
(Id
).Main_CPU
:= Get_Nat
;
989 ALIs
.Table
(Id
).WC_Encoding
:= Getc
;
998 -- Acquire argument lines
1000 First_Arg
:= Args
.Last
+ 1;
1004 exit A_Loop
when C
/= 'A';
1006 if Ignore
('A') then
1012 -- Scan out argument
1015 while not At_Eol
loop
1016 Add_Char_To_Name_Buffer
(Getc
);
1019 -- If -fstack-check, record that it occurred. Note that an
1020 -- additional string parameter can be specified, in the form of
1021 -- -fstack-check={no|generic|specific}. "no" means no checking,
1022 -- "generic" means force the use of old-style checking, and
1023 -- "specific" means use the best checking method.
1026 and then Name_Buffer
(1 .. 13) = "-fstack-check"
1027 and then Name_Buffer
(1 .. Name_Len
) /= "-fstack-check=no"
1029 Stack_Check_Switch_Set
:= True;
1032 -- Store the argument
1034 Args
.Increment_Last
;
1035 Args
.Table
(Args
.Last
) := new String'(Name_Buffer (1 .. Name_Len));
1048 if Ignore_Errors then
1060 if Ignore ('P
') then
1068 while not At_Eol loop
1073 -- Processing for CE
1077 ALIs.Table (Id).Compile_Errors := True;
1079 -- Processing for DB
1083 Detect_Blocking := True;
1085 -- Processing for Ex
1088 Partition_Elaboration_Policy_Specified := Getc;
1089 ALIs.Table (Id).Partition_Elaboration_Policy :=
1090 Partition_Elaboration_Policy_Specified;
1092 -- Processing for Lx
1095 Locking_Policy_Specified := Getc;
1096 ALIs.Table (Id).Locking_Policy := Locking_Policy_Specified;
1098 -- Processing for flags starting with N
1103 -- Processing for NO
1106 ALIs.Table (Id).No_Object := True;
1107 No_Object_Specified := True;
1109 -- Processing for NR
1112 No_Run_Time_Mode := True;
1113 Configurable_Run_Time_Mode := True;
1115 -- Processing for NS
1118 ALIs.Table (Id).Normalize_Scalars := True;
1119 Normalize_Scalars_Specified := True;
1122 -- Invalid switch starting with N
1128 -- Processing for OH/OL
1133 if C = 'L
' or else C = 'H
' then
1134 ALIs.Table (Id).SSO_Default := C;
1135 SSO_Default_Specified := True;
1141 -- Processing for Qx
1144 Queuing_Policy_Specified := Getc;
1145 ALIs.Table (Id).Queuing_Policy := Queuing_Policy_Specified;
1147 -- Processing for flags starting with S
1152 -- Processing for SL
1155 ALIs.Table (Id).SAL_Interface := True;
1157 -- Processing for SS
1160 Opt.Sec_Stack_Used := True;
1162 -- Invalid switch starting with S
1168 -- Processing for Tx
1171 Task_Dispatching_Policy_Specified := Getc;
1172 ALIs.Table (Id).Task_Dispatching_Policy :=
1173 Task_Dispatching_Policy_Specified;
1175 -- Processing for switch starting with U
1180 -- Processing for UA
1183 Unreserve_All_Interrupts_Specified := True;
1185 -- Processing for UX
1188 ALIs.Table (Id).Unit_Exception_Table := True;
1190 -- Invalid switches starting with U
1196 -- Processing for ZX
1202 ALIs.Table (Id).Zero_Cost_Exceptions := True;
1203 Zero_Cost_Exceptions_Specified := True;
1208 -- Invalid parameter
1216 if not NS_Found then
1217 No_Normalize_Scalars_Specified := True;
1226 -- Loop to skip to first restrictions line
1229 if Ignore_Errors then
1241 -- Ignore all 'R
' lines if that is required
1243 if Ignore ('R
') then
1249 -- Here we process the restrictions lines (other than unit name cases)
1252 Scan_Restrictions : declare
1253 Save_R : constant Restrictions_Info := Cumulative_Restrictions;
1254 -- Save cumulative restrictions in case we have a fatal error
1256 Bad_R_Line : exception;
1257 -- Signal bad restrictions line (raised on unexpected character)
1264 -- Named restriction case
1270 -- Loop through RR and RV lines
1272 while C = 'R
' and then Nextc /= ' ' loop
1276 -- Acquire restriction name
1279 while not At_Eol and then Nextc /= '=' loop
1280 Name_Len := Name_Len + 1;
1281 Name_Buffer (Name_Len) := Getc;
1284 -- Now search list of restrictions to find match
1287 RN : String renames Name_Buffer (1 .. Name_Len);
1290 R := Restriction_Id'First;
1291 while R /= Not_A_Restriction_Id loop
1292 if Restriction_Id'Image (R) = RN then
1296 R := Restriction_Id'Succ (R);
1299 -- We don't recognize the restriction. This might be
1300 -- thought of as an error, and it really is, but we
1301 -- want to allow building with inconsistent versions
1302 -- of the binder and ali files (see comments at the
1303 -- start of package System.Rident), so we just ignore
1306 goto Done_With_Restriction_Line;
1313 -- Boolean restriction case
1315 when All_Boolean_Restrictions =>
1318 ALIs.Table (Id).Restrictions.Violated (R) :=
1320 Cumulative_Restrictions.Violated (R) := True;
1323 ALIs.Table (Id).Restrictions.Set (R) := True;
1324 Cumulative_Restrictions.Set (R) := True;
1330 -- Parameter restriction case
1332 when All_Parameter_Restrictions =>
1333 if At_Eol or else Nextc /= '=' then
1339 N := Natural (Get_Nat);
1346 ALIs.Table (Id).Restrictions.Set (R) := True;
1347 ALIs.Table (Id).Restrictions.Value (R) := N;
1349 if Cumulative_Restrictions.Set (R) then
1350 Cumulative_Restrictions.Value (R) :=
1352 (Cumulative_Restrictions.Value (R), N);
1354 Cumulative_Restrictions.Set (R) := True;
1355 Cumulative_Restrictions.Value (R) := N;
1358 -- Restriction violated
1361 ALIs.Table (Id).Restrictions.Violated (R) :=
1363 Cumulative_Restrictions.Violated (R) := True;
1364 ALIs.Table (Id).Restrictions.Count (R) := N;
1366 -- Checked Max_Parameter case
1368 if R in Checked_Max_Parameter_Restrictions then
1369 Cumulative_Restrictions.Count (R) :=
1371 (Cumulative_Restrictions.Count (R), N);
1373 -- Other checked parameter cases
1377 pragma Unsuppress (Overflow_Check);
1380 Cumulative_Restrictions.Count (R) :=
1381 Cumulative_Restrictions.Count (R) + N;
1384 when Constraint_Error =>
1386 -- A constraint error comes from the
1387 -- addition. We reset to the maximum
1388 -- and indicate that the real value
1391 Cumulative_Restrictions.Value (R) :=
1393 Cumulative_Restrictions.Unknown (R) :=
1402 ALIs.Table (Id).Restrictions.Unknown (R) :=
1404 Cumulative_Restrictions.Unknown (R) := True;
1407 -- Other than 'R
' or 'V
'
1417 -- Bizarre error case NOT_A_RESTRICTION
1419 when Not_A_Restriction_Id =>
1427 <<Done_With_Restriction_Line>>
1432 -- Positional restriction case
1438 -- Acquire information for boolean restrictions
1440 for R in All_Boolean_Restrictions loop
1445 ALIs.Table (Id).Restrictions.Violated (R) := True;
1446 Cumulative_Restrictions.Violated (R) := True;
1449 ALIs.Table (Id).Restrictions.Set (R) := True;
1450 Cumulative_Restrictions.Set (R) := True;
1460 -- Acquire information for parameter restrictions
1462 for RP in All_Parameter_Restrictions loop
1468 ALIs.Table (Id).Restrictions.Set (RP) := True;
1471 N : constant Integer := Integer (Get_Nat);
1473 ALIs.Table (Id).Restrictions.Value (RP) := N;
1475 if Cumulative_Restrictions.Set (RP) then
1476 Cumulative_Restrictions.Value (RP) :=
1478 (Cumulative_Restrictions.Value (RP), N);
1480 Cumulative_Restrictions.Set (RP) := True;
1481 Cumulative_Restrictions.Value (RP) := N;
1489 -- Acquire restrictions violations information
1497 ALIs.Table (Id).Restrictions.Violated (RP) := True;
1498 Cumulative_Restrictions.Violated (RP) := True;
1501 N : constant Integer := Integer (Get_Nat);
1504 ALIs.Table (Id).Restrictions.Count (RP) := N;
1506 if RP in Checked_Max_Parameter_Restrictions then
1507 Cumulative_Restrictions.Count (RP) :=
1509 (Cumulative_Restrictions.Count (RP), N);
1513 pragma Unsuppress (Overflow_Check);
1516 Cumulative_Restrictions.Count (RP) :=
1517 Cumulative_Restrictions.Count (RP) + N;
1520 when Constraint_Error =>
1522 -- A constraint error comes from the add. We
1523 -- reset to the maximum and indicate that the
1524 -- real value is now unknown.
1526 Cumulative_Restrictions.Value (RP) :=
1528 Cumulative_Restrictions.Unknown (RP) := True;
1534 ALIs.Table (Id).Restrictions.Unknown (RP) := True;
1535 Cumulative_Restrictions.Unknown (RP) := True;
1552 -- Here if error during scanning of restrictions line
1557 -- In Ignore_Errors mode, undo any changes to restrictions
1558 -- from this unit, and continue on, skipping remaining R
1559 -- lines for this unit.
1561 if Ignore_Errors then
1562 Cumulative_Restrictions := Save_R;
1563 ALIs.Table (Id).Restrictions := No_Restrictions;
1571 -- In normal mode, this is a fatal error
1576 end Scan_Restrictions;
1579 -- Acquire additional restrictions (No_Dependence) lines if present
1582 if Ignore ('R
') then
1586 No_Deps.Append ((Id, Get_Name));
1593 -- Acquire 'I
' lines if present
1598 if Ignore ('I
') then
1604 I_State : Character;
1613 Interrupt_States.Append (
1614 (Interrupt_Id => Int_Num,
1615 Interrupt_State => I_State,
1616 IS_Pragma_Line => Line_No));
1618 ALIs.Table (Id).Last_Interrupt_State := Interrupt_States.Last;
1626 -- Acquire 'S
' lines if present
1631 if Ignore ('S
') then
1647 First_Prio := Get_Nat;
1648 Last_Prio := Get_Nat;
1651 Specific_Dispatching.Append (
1652 (Dispatching_Policy => Policy,
1653 First_Priority => First_Prio,
1654 Last_Priority => Last_Prio,
1655 PSD_Pragma_Line => Line_No));
1657 ALIs.Table (Id).Last_Specific_Dispatching :=
1658 Specific_Dispatching.Last;
1667 -- Loop to acquire unit entries
1671 exit U_Loop when C /= 'U
';
1673 -- Note: as per spec, we never ignore U lines
1677 Units.Increment_Last;
1679 if ALIs.Table (Id).First_Unit = No_Unit_Id then
1680 ALIs.Table (Id).First_Unit := Units.Last;
1684 UL : Unit_Record renames Units.Table (Units.Last);
1687 UL.Uname := Get_Unit_Name;
1688 UL.Predefined := Is_Predefined_Unit;
1689 UL.Internal := Is_Internal_Unit;
1691 UL.Sfile := Get_File_Name (Lower => True);
1693 UL.Preelab := False;
1694 UL.No_Elab := False;
1695 UL.Shared_Passive := False;
1697 UL.Remote_Types := False;
1698 UL.Has_RACW := False;
1699 UL.Init_Scalars := False;
1700 UL.Is_Generic := False;
1701 UL.Icasing := Mixed_Case;
1702 UL.Kcasing := All_Lower_Case;
1703 UL.Dynamic_Elab := False;
1704 UL.Elaborate_Body := False;
1705 UL.Set_Elab_Entity := False;
1706 UL.Version := "00000000";
1707 UL.First_With := Withs.Last + 1;
1708 UL.First_Arg := First_Arg;
1709 UL.Elab_Position := 0;
1710 UL.SAL_Interface := ALIs.Table (Id).SAL_Interface;
1711 UL.Directly_Scanned := Directly_Scanned;
1712 UL.Body_Needed_For_SAL := False;
1713 UL.Elaborate_Body_Desirable := False;
1714 UL.Optimize_Alignment := 'O
';
1715 UL.Has_Finalizer := False;
1717 if Debug_Flag_U then
1718 Write_Str (" ----> reading unit ");
1719 Write_Int (Int (Units.Last));
1721 Write_Unit_Name (UL.Uname);
1722 Write_Str (" from file ");
1723 Write_Name (UL.Sfile);
1728 -- Check for duplicated unit in different files
1731 Info : constant Int := Get_Name_Table_Info
1732 (Units.Table (Units.Last).Uname);
1735 and then Units.Table (Units.Last).Sfile /=
1736 Units.Table (Unit_Id (Info)).Sfile
1738 -- If Err is set then ignore duplicate unit name. This is the
1739 -- case of a call from gnatmake, where the situation can arise
1740 -- from substitution of source files. In such situations, the
1741 -- processing in gnatmake will always result in any required
1742 -- recompilations in any case, and if we consider this to be
1743 -- an error we get strange cases (for example when a generic
1744 -- instantiation is replaced by a normal package) where we
1745 -- read the old ali file, decide to recompile, and then decide
1746 -- that the old and new ali files are incompatible.
1751 -- If Err is not set, then this is a fatal error. This is
1752 -- the case of being called from the binder, where we must
1753 -- definitely diagnose this as an error.
1757 Write_Str ("error: duplicate unit name: ");
1760 Write_Str ("error: unit """);
1761 Write_Unit_Name (Units.Table (Units.Last).Uname);
1762 Write_Str (""" found in file """);
1763 Write_Name_Decoded (Units.Table (Units.Last).Sfile);
1767 Write_Str ("error
: unit
""");
1768 Write_Unit_Name (Units.Table (Unit_Id (Info)).Uname);
1769 Write_Str (""" found
in file
""");
1770 Write_Name_Decoded (Units.Table (Unit_Id (Info)).Sfile);
1774 Exit_Program (E_Fatal);
1780 (Units.Table (Units.Last).Uname, Int (Units.Last));
1782 -- Scan out possible version and other parameters
1791 if C in '0' .. '9' or else C in 'a
' .. 'f
' then
1792 Units.Table (Units.Last).Version (1) := C;
1794 for J in 2 .. 8 loop
1796 Units.Table (Units.Last).Version (J) := C;
1805 Check_At_End_Of_Field;
1806 Units.Table (Units.Last).Elaborate_Body_Desirable := True;
1809 Check_At_End_Of_Field;
1810 Units.Table (Units.Last).Body_Needed_For_SAL := True;
1816 -- DE parameter (Dynamic elaboration checks)
1822 Check_At_End_Of_Field;
1823 Units.Table (Units.Last).Dynamic_Elab := True;
1824 Dynamic_Elaboration_Checks_Specified := True;
1835 Units.Table (Units.Last).Elaborate_Body := True;
1837 Units.Table (Units.Last).Set_Elab_Entity := True;
1842 Check_At_End_Of_Field;
1844 -- GE parameter (generic)
1850 Check_At_End_Of_Field;
1851 Units.Table (Units.Last).Is_Generic := True;
1856 -- IL/IS/IU parameters
1862 Units.Table (Units.Last).Icasing := All_Lower_Case;
1864 Units.Table (Units.Last).Init_Scalars := True;
1865 Initialize_Scalars_Used := True;
1867 Units.Table (Units.Last).Icasing := All_Upper_Case;
1872 Check_At_End_Of_Field;
1880 Units.Table (Units.Last).Kcasing := Mixed_Case;
1882 Units.Table (Units.Last).Kcasing := All_Upper_Case;
1887 Check_At_End_Of_Field;
1895 Units.Table (Units.Last).No_Elab := True;
1896 Check_At_End_Of_Field;
1901 -- PF/PR/PU/PK parameters
1907 Units.Table (Units.Last).Has_Finalizer := True;
1909 Units.Table (Units.Last).Preelab := True;
1911 Units.Table (Units.Last).Pure := True;
1913 Units.Table (Units.Last).Unit_Kind := 'p
';
1918 Check_At_End_Of_Field;
1920 -- OL/OO/OS/OT parameters
1925 if C = 'L
' or else C = 'O
' or else C = 'S
' or else C = 'T
' then
1926 Units.Table (Units.Last).Optimize_Alignment := C;
1931 Check_At_End_Of_Field;
1939 Units.Table (Units.Last).RCI := True;
1941 Units.Table (Units.Last).Remote_Types := True;
1943 Units.Table (Units.Last).Has_RACW := True;
1948 Check_At_End_Of_Field;
1954 Units.Table (Units.Last).Shared_Passive := True;
1956 Units.Table (Units.Last).Unit_Kind := 's
';
1961 Check_At_End_Of_Field;
1971 -- Check if static elaboration model used
1973 if not Units.Table (Units.Last).Dynamic_Elab
1974 and then not Units.Table (Units.Last).Internal
1976 Static_Elaboration_Model_Used := True;
1981 -- Scan out With lines for this unit
1985 exit With_Loop when C /= 'W
' and then C /= 'Y
' and then C /= 'Z
';
1987 if Ignore ('W
') then
1993 Withs.Increment_Last;
1994 Withs.Table (Withs.Last).Uname := Get_Unit_Name;
1995 Withs.Table (Withs.Last).Elaborate := False;
1996 Withs.Table (Withs.Last).Elaborate_All := False;
1997 Withs.Table (Withs.Last).Elab_Desirable := False;
1998 Withs.Table (Withs.Last).Elab_All_Desirable := False;
1999 Withs.Table (Withs.Last).SAL_Interface := False;
2000 Withs.Table (Withs.Last).Limited_With := (C = 'Y
');
2001 Withs.Table (Withs.Last).Implicit_With_From_Instantiation
2004 -- Generic case with no object file available
2007 Withs.Table (Withs.Last).Sfile := No_File;
2008 Withs.Table (Withs.Last).Afile := No_File;
2013 Withs.Table (Withs.Last).Sfile := Get_File_Name
2015 Withs.Table (Withs.Last).Afile := Get_File_Name
2018 -- Scan out possible E, EA, ED, and AD parameters
2020 while not At_Eol loop
2026 Check_At_End_Of_Field;
2028 -- Store AD indication unless ignore required
2030 if not Ignore_ED then
2031 Withs.Table (Withs.Last).Elab_All_Desirable :=
2035 elsif Nextc = 'E
' then
2038 if At_End_Of_Field then
2039 Withs.Table (Withs.Last).Elaborate := True;
2041 elsif Nextc = 'A
' then
2043 Check_At_End_Of_Field;
2044 Withs.Table (Withs.Last).Elaborate_All := True;
2048 Check_At_End_Of_Field;
2050 -- Store ED indication unless ignore required
2052 if not Ignore_ED then
2053 Withs.Table (Withs.Last).Elab_Desirable :=
2070 Units.Table (Units.Last).Last_With := Withs.Last;
2071 Units.Table (Units.Last).Last_Arg := Args.Last;
2073 -- If there are linker options lines present, scan them
2077 Linker_Options_Loop : loop
2079 exit Linker_Options_Loop when C /= 'L
';
2081 if Ignore ('L
') then
2092 if C < Character'Val (16#20#)
2093 or else C > Character'Val (16#7E#)
2098 C := Character'Val (0);
2105 for J in 1 .. 2 loop
2108 if C in '0' .. '9' then
2111 Character'Pos ('0');
2113 elsif C in 'A' .. 'F' then
2116 Character'Pos ('A') +
2125 Add_Char_To_Name_Buffer (Character'Val (V));
2130 exit when Nextc /= '"';
2134 Add_Char_To_Name_Buffer (C);
2138 Add_Char_To_Name_Buffer (NUL);
2143 end loop Linker_Options_Loop;
2145 -- Store the linker options entry if one was found
2147 if Name_Len /= 0 then
2148 Linker_Options.Increment_Last;
2150 Linker_Options.Table (Linker_Options.Last).Name :=
2153 Linker_Options.Table (Linker_Options.Last).Unit :=
2156 Linker_Options.Table (Linker_Options.Last).Internal_File :=
2157 Is_Internal_File_Name (F);
2159 Linker_Options.Table (Linker_Options.Last).Original_Pos :=
2160 Linker_Options.Last;
2163 -- If there are notes present, scan them
2167 exit Notes_Loop when C /= 'N';
2169 if Ignore ('N') then
2175 Notes.Increment_Last;
2176 Notes.Table (Notes.Last).Pragma_Type := Getc;
2177 Notes.Table (Notes.Last).Pragma_Line := Get_Nat;
2179 Notes.Table (Notes.Last).Pragma_Col := Get_Nat;
2181 if not At_Eol and then Nextc = ':' then
2183 Notes.Table (Notes.Last).Pragma_Source_File :=
2184 Get_File_Name (Lower => True);
2186 Notes.Table (Notes.Last).Pragma_Source_File :=
2187 Units.Table (Units.Last).Sfile;
2191 Notes.Table (Notes.Last).Pragma_Args := No_Name;
2194 -- Note: can't use Get_Name here as the remainder of the
2195 -- line is unstructured text whose syntax depends on the
2196 -- particular pragma used.
2201 while not At_Eol loop
2202 Add_Char_To_Name_Buffer (Getc);
2210 end loop Notes_Loop;
2213 -- End loop through units for one ALI file
2215 ALIs.Table (Id).Last_Unit := Units.Last;
2216 ALIs.Table (Id).Sfile := Units.Table (ALIs.Table (Id).First_Unit).Sfile;
2218 -- Set types of the units (there can be at most 2 of them)
2220 if ALIs.Table (Id).First_Unit /= ALIs.Table (Id).Last_Unit then
2221 Units.Table (ALIs.Table (Id).First_Unit).Utype := Is_Body;
2222 Units.Table (ALIs.Table (Id).Last_Unit).Utype := Is_Spec;
2225 -- Deal with body only and spec only cases, note that the reason we
2226 -- do our own checking of the name (rather than using Is_Body_Name)
2227 -- is that Uname drags in far too much compiler junk.
2229 Get_Name_String (Units.Table (Units.Last).Uname);
2231 if Name_Buffer (Name_Len) = 'b' then
2232 Units.Table (Units.Last).Utype := Is_Body_Only;
2234 Units.Table (Units.Last).Utype := Is_Spec_Only;
2238 -- Scan out external version references and put in hash table
2242 exit E_Loop when C /= 'E';
2244 if Ignore ('E') then
2260 exit when At_End_Of_Field;
2261 Add_Char_To_Name_Buffer (C);
2264 Version_Ref.Set (new String'(Name_Buffer (1 .. Name_Len)), True);
2271 -- Scan out source dependency lines for this ALI file
2273 ALIs.Table (Id).First_Sdep := Sdep.Last + 1;
2277 exit D_Loop when C /= 'D';
2279 if Ignore ('D') then
2285 Sdep.Increment_Last;
2287 -- In the following call, Lower is not set to True, this is either
2288 -- a bug, or it deserves a special comment as to why this is so???
2290 -- The file/path name may be quoted
2292 Sdep.Table (Sdep.Last).Sfile :=
2293 Get_File_Name (May_Be_Quoted => True);
2295 Sdep.Table (Sdep.Last).Stamp := Get_Stamp;
2296 Sdep.Table (Sdep.Last).Dummy_Entry :=
2297 (Sdep.Table (Sdep.Last).Stamp = Dummy_Time_Stamp);
2299 -- Acquire checksum value
2312 exit when At_Eol or else Ctr = 8;
2314 if Nextc in '0' .. '9' then
2316 Character'Pos (Nextc) - Character'Pos ('0');
2318 elsif Nextc in 'a' .. 'f' then
2320 Character'Pos (Nextc) - Character'Pos ('a') + 10;
2330 if Ctr = 8 and then At_End_Of_Field then
2331 Sdep.Table (Sdep.Last).Checksum := Chk;
2337 -- Acquire (sub)unit and reference file name entries
2339 Sdep.Table (Sdep.Last).Subunit_Name := No_Name;
2340 Sdep.Table (Sdep.Last).Unit_Name := No_Name;
2341 Sdep.Table (Sdep.Last).Rfile :=
2342 Sdep.Table (Sdep.Last).Sfile;
2343 Sdep.Table (Sdep.Last).Start_Line := 1;
2348 -- Here for (sub)unit name
2350 if Nextc not in '0' .. '9' then
2352 while not At_End_Of_Field loop
2353 Add_Char_To_Name_Buffer (Getc);
2356 -- Set the (sub)unit name. Note that we use Name_Find rather
2357 -- than Name_Enter here as the subunit name may already
2358 -- have been put in the name table by the Project Manager.
2361 or else Name_Buffer (Name_Len - 1) /= '%'
2363 Sdep.Table (Sdep.Last).Subunit_Name := Name_Find;
2365 Name_Len := Name_Len - 2;
2366 Sdep.Table (Sdep.Last).Unit_Name := Name_Find;
2372 -- Here for reference file name entry
2374 if Nextc in '0' .. '9' then
2375 Sdep.Table (Sdep.Last).Start_Line := Get_Nat;
2380 while not At_End_Of_Field loop
2381 Add_Char_To_Name_Buffer (Getc);
2384 Sdep.Table (Sdep.Last).Rfile := Name_Enter;
2394 ALIs.Table (Id).Last_Sdep := Sdep.Last;
2396 -- We must at this stage be at an Xref line or the end of file
2408 -- If we are ignoring Xref sections we are done (we ignore all
2409 -- remaining lines since only xref related lines follow X).
2411 if Ignore ('X') and then not Debug_Flag_X then
2415 -- Loop through Xref sections
2419 exit X_Loop when C /= 'X';
2421 -- Make new entry in section table
2423 Xref_Section.Increment_Last;
2425 Read_Refs_For_One_File : declare
2426 XS : Xref_Section_Record renames
2427 Xref_Section.Table (Xref_Section.Last);
2429 Current_File_Num : Sdep_Id;
2430 -- Keeps track of the current file number (changed by nn|)
2433 XS.File_Num := Sdep_Id (Get_Nat + Nat (First_Sdep_Entry) - 1);
2434 XS.File_Name := Get_File_Name;
2435 XS.First_Entity := Xref_Entity.Last + 1;
2437 Current_File_Num := XS.File_Num;
2444 -- Loop through Xref entities
2446 while C /= 'X' and then C /= EOF loop
2447 Xref_Entity.Increment_Last;
2449 Read_Refs_For_One_Entity : declare
2450 XE : Xref_Entity_Record renames
2451 Xref_Entity.Table (Xref_Entity.Last);
2454 procedure Read_Instantiation_Reference;
2455 -- Acquire instantiation reference. Caller has checked
2456 -- that current character is '[' and on return the cursor
2457 -- is skipped past the corresponding closing ']'.
2459 ----------------------------------
2460 -- Read_Instantiation_Reference --
2461 ----------------------------------
2463 procedure Read_Instantiation_Reference is
2464 Local_File_Num : Sdep_Id := Current_File_Num;
2467 Xref.Increment_Last;
2470 XR : Xref_Record renames Xref.Table (Xref.Last);
2473 P := P + 1; -- skip [
2478 Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
2479 Local_File_Num := XR.File_Num;
2484 XR.File_Num := Local_File_Num;
2491 -- Recursive call for next reference
2494 pragma Warnings (Off); -- kill recursion warning
2495 Read_Instantiation_Reference;
2496 pragma Warnings (On);
2499 -- Skip closing bracket after recursive call
2503 end Read_Instantiation_Reference;
2505 -- Start of processing for Read_Refs_For_One_Entity
2514 XE.Visibility := Global;
2516 XE.Visibility := Static;
2518 XE.Visibility := Other;
2521 XE.Entity := Get_Name;
2523 -- Handle the information about generic instantiations
2526 Skipc; -- Opening '['
2529 if Nextc /= '|' then
2530 XE.Iref_File_Num := Current_File_Num;
2534 Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
2536 XE.Iref_Line := Get_Nat;
2544 XE.Iref_File_Num := No_Sdep_Id;
2548 Current_File_Num := XS.File_Num;
2550 -- Renaming reference is present
2554 XE.Rref_Line := Get_Nat;
2560 XE.Rref_Col := Get_Nat;
2562 -- No renaming reference present
2571 XE.Oref_File_Num := No_Sdep_Id;
2572 XE.Tref_File_Num := No_Sdep_Id;
2573 XE.Tref := Tref_None;
2574 XE.First_Xref := Xref.Last + 1;
2576 -- Loop to check for additional info present
2589 (Current_File_Num, Ref, File, Line, Typ, Col, Std);
2590 exit when Ref = Tref_None;
2592 -- Do we have an overriding procedure?
2594 if Ref = Tref_Derived and then Typ = 'p' then
2595 XE.Oref_File_Num := File;
2596 XE.Oref_Line := Line;
2599 -- Arrays never override anything, and <> points to
2600 -- the index types instead
2602 elsif Ref = Tref_Derived and then XE.Etype = 'A' then
2604 -- Index types are stored in the list of references
2606 Xref.Increment_Last;
2609 XR : Xref_Record renames Xref.Table (Xref.Last);
2611 XR.File_Num := File;
2613 XR.Rtype := Array_Index_Reference;
2618 -- Interfaces are stored in the list of references,
2619 -- although the parent type itself is stored in XE.
2620 -- The first interface (when there are only
2621 -- interfaces) is stored in XE.Tref*)
2623 elsif Ref = Tref_Derived
2625 and then XE.Tref_File_Num /= No_Sdep_Id
2627 Xref.Increment_Last;
2630 XR : Xref_Record renames Xref.Table (Xref.Last);
2632 XR.File_Num := File;
2634 XR.Rtype := Interface_Reference;
2641 XE.Tref_File_Num := File;
2642 XE.Tref_Line := Line;
2643 XE.Tref_Type := Typ;
2645 XE.Tref_Standard_Entity := Std;
2650 -- Loop through cross-references for this entity
2657 exit when Nextc /= '.';
2661 Xref.Increment_Last;
2664 XR : Xref_Record renames Xref.Table (Xref.Last);
2671 Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
2672 Current_File_Num := XR.File_Num;
2676 XR.File_Num := Current_File_Num;
2682 -- Imported entities reference as in:
2683 -- 494b<c,__gnat_copy_attribs>25
2687 XR.Imported_Lang := Get_Name;
2689 pragma Assert (Nextc = ',');
2692 XR.Imported_Name := Get_Name;
2694 pragma Assert (Nextc = '>');
2698 XR.Imported_Lang := No_Name;
2699 XR.Imported_Name := No_Name;
2705 Read_Instantiation_Reference;
2710 -- Record last cross-reference
2712 XE.Last_Xref := Xref.Last;
2716 when Bad_ALI_Format =>
2718 -- If ignoring errors, then we skip a line with an
2719 -- unexpected error, and try to continue subsequent
2722 if Ignore_Errors then
2723 Xref_Entity.Decrement_Last;
2727 -- Otherwise, we reraise the fatal exception
2732 end Read_Refs_For_One_Entity;
2735 -- Record last entity
2737 XS.Last_Entity := Xref_Entity.Last;
2739 end Read_Refs_For_One_File;
2744 -- Here after dealing with xref sections
2746 -- Ignore remaining lines, which belong to an additional section of the
2747 -- ALI file not considered here (like SCO or SPARK information).
2754 when Bad_ALI_Format =>
2762 function SEq (F1, F2 : String_Ptr) return Boolean is
2764 return F1.all = F2.all;
2771 function SHash (S : String_Ptr) return Vindex is
2776 for J in S.all'Range loop
2777 H := H * 2 + Character'Pos (S (J));
2780 return Vindex (Vindex'First + Vindex (H mod Vindex'Range_Length));