1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2017, 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_Int
(ALIs
.Table
(J
).Afile
, 0);
78 for J
in Units
.First
.. Units
.Last
loop
79 Set_Name_Table_Int
(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 No_Component_Reordering_Specified
:= False;
115 GNATprove_Mode_Specified
:= False;
116 Normalize_Scalars_Specified
:= False;
117 Partition_Elaboration_Policy_Specified
:= ' ';
118 Queuing_Policy_Specified
:= ' ';
119 SSO_Default_Specified
:= False;
120 Task_Dispatching_Policy_Specified
:= ' ';
121 Unreserve_All_Interrupts_Specified
:= False;
122 Frontend_Exceptions_Specified
:= False;
123 Zero_Cost_Exceptions_Specified
:= False;
135 Read_Xref
: Boolean := False;
136 Read_Lines
: String := "";
137 Ignore_Lines
: String := "X";
138 Ignore_Errors
: Boolean := False;
139 Directly_Scanned
: Boolean := False) return ALI_Id
141 P
: Text_Ptr
:= T
'First;
142 Line
: Logical_Line_Number
:= 1;
148 Ignore
: array (Character range 'A' .. 'Z') of Boolean;
149 -- Ignore (X) is set to True if lines starting with X are to
150 -- be ignored by Scan_ALI and skipped, and False if the lines
151 -- are to be read and processed.
153 Bad_ALI_Format
: exception;
154 -- Exception raised by Fatal_Error if Err is True
156 function At_Eol
return Boolean;
157 -- Test if at end of line
159 function At_End_Of_Field
return Boolean;
160 -- Test if at end of line, or if at blank or horizontal tab
162 procedure Check_At_End_Of_Field
;
163 -- Check if we are at end of field, fatal error if not
165 procedure Checkc
(C
: Character);
166 -- Check next character is C. If so bump past it, if not fatal error
168 procedure Check_Unknown_Line
;
169 -- If Ignore_Errors mode, then checks C to make sure that it is not
170 -- an unknown ALI line type characters, and if so, skips lines
171 -- until the first character of the line is one of these characters,
172 -- at which point it does a Getc to put that character in C. The
173 -- call has no effect if C is already an appropriate character.
174 -- If not in Ignore_Errors mode, a fatal error is signalled if the
175 -- line is unknown. Note that if C is an EOL on entry, the line is
176 -- skipped (it is assumed that blank lines are never significant).
177 -- If C is EOF on entry, the call has no effect (it is assumed that
178 -- the caller will properly handle this case).
180 procedure Fatal_Error
;
181 -- Generate fatal error message for badly formatted ALI file if
182 -- Err is false, or raise Bad_ALI_Format if Err is True.
184 procedure Fatal_Error_Ignore
;
185 pragma Inline
(Fatal_Error_Ignore
);
186 -- In Ignore_Errors mode, has no effect, otherwise same as Fatal_Error
188 function Getc
return Character;
189 -- Get next character, bumping P past the character obtained
191 function Get_File_Name
192 (Lower
: Boolean := False;
193 May_Be_Quoted
: Boolean := False) return File_Name_Type
;
194 -- Skip blanks, then scan out a file name (name is left in Name_Buffer
195 -- with length in Name_Len, as well as returning a File_Name_Type value.
196 -- If May_Be_Quoted is True and the first non blank character is '"',
197 -- then remove starting and ending quotes and undoubled internal quotes.
198 -- If lower is false, the case is unchanged, if Lower is True then the
199 -- result is forced to all lower case for systems where file names are
200 -- not case sensitive. This ensures that gnatbind works correctly
201 -- regardless of the case of the file name on all systems. The scan
202 -- is terminated by a end of line, space or horizontal tab. Any other
203 -- special characters are included in the returned name.
206 (Ignore_Spaces
: Boolean := False;
207 Ignore_Special
: Boolean := False;
208 May_Be_Quoted
: Boolean := False) return Name_Id
;
209 -- Skip blanks, then scan out a name (name is left in Name_Buffer with
210 -- length in Name_Len, as well as being returned in Name_Id form).
211 -- If Lower is set to True then the Name_Buffer will be converted to
212 -- all lower case, for systems where file names are not case sensitive.
213 -- This ensures that gnatbind works correctly regardless of the case
214 -- of the file name on all systems. The termination condition depends
215 -- on the settings of Ignore_Spaces and Ignore_Special:
217 -- If Ignore_Spaces is False (normal case), then scan is terminated
218 -- by the normal end of field condition (EOL, space, horizontal tab)
220 -- If Ignore_Special is False (normal case), the scan is terminated by
221 -- a typeref bracket or an equal sign except for the special case of
222 -- an operator name starting with a double quote which is terminated
223 -- by another double quote.
225 -- If May_Be_Quoted is True and the first non blank character is '"'
226 -- the name is 'unquoted'. In this case Ignore_Special is ignored and
227 -- assumed to be True.
229 -- It is an error to set both Ignore_Spaces and Ignore_Special to True.
230 -- This function handles wide characters properly.
232 function Get_Nat
return Nat
;
233 -- Skip blanks, then scan out an unsigned integer value in Nat range
234 -- raises ALI_Reading_Error if the encoutered type is not natural.
236 function Get_Stamp
return Time_Stamp_Type
;
237 -- Skip blanks, then scan out a time stamp
239 function Get_Unit_Name
return Unit_Name_Type
;
240 -- Skip blanks, then scan out a file name (name is left in Name_Buffer
241 -- with length in Name_Len, as well as returning a Unit_Name_Type value.
242 -- The case is unchanged and terminated by a normal end of field.
244 function Nextc
return Character;
245 -- Return current character without modifying pointer P
247 procedure Get_Typeref
248 (Current_File_Num
: Sdep_Id
;
250 File_Num
: out Sdep_Id
;
252 Ref_Type
: out Character;
254 Standard_Entity
: out Name_Id
);
255 -- Parse the definition of a typeref (<...>, {...} or (...))
258 -- Skip past spaces, then skip past end of line (fatal error if not
259 -- at end of line). Also skips past any following blank lines.
262 -- Skip rest of current line and any following blank lines
264 procedure Skip_Space
;
265 -- Skip past white space (blanks or horizontal tab)
268 -- Skip past next character, does not affect value in C. This call
269 -- is like calling Getc and ignoring the returned result.
271 ---------------------
272 -- At_End_Of_Field --
273 ---------------------
275 function At_End_Of_Field
return Boolean is
284 function At_Eol
return Boolean is
286 return Nextc
= EOF
or else Nextc
= CR
or else Nextc
= LF
;
289 ---------------------------
290 -- Check_At_End_Of_Field --
291 ---------------------------
293 procedure Check_At_End_Of_Field
is
295 if not At_End_Of_Field
then
296 if Ignore_Errors
then
297 while Nextc
> ' ' loop
304 end Check_At_End_Of_Field
;
306 ------------------------
307 -- Check_Unknown_Line --
308 ------------------------
310 procedure Check_Unknown_Line
is
312 while C
not in 'A' .. 'Z'
313 or else not Known_ALI_Lines
(C
)
315 if C
= CR
or else C
= LF
then
322 elsif Ignore_Errors
then
330 end Check_Unknown_Line
;
336 procedure Checkc
(C
: Character) is
340 elsif Ignore_Errors
then
351 procedure Fatal_Error
is
356 procedure Wchar
(C
: Character);
357 -- Write a single character, replacing horizontal tab by spaces
359 procedure Wchar
(C
: Character) is
364 exit when Col
mod 8 = 0;
373 -- Start of processing for Fatal_Error
377 raise Bad_ALI_Format
;
381 Write_Str
("fatal error: file ");
383 Write_Str
(" is incorrectly formatted");
386 Write_Str
("make sure you are using consistent versions " &
388 -- Split the following line so that it can easily be transformed for
389 -- other back-ends where the compiler might have a different name.
395 -- Find start of line
399 and then T
(Ptr1
- 1) /= CR
400 and then T
(Ptr1
- 1) /= LF
405 Write_Int
(Int
(Line
));
420 and then T
(Ptr2
) /= CR
421 and then T
(Ptr2
) /= LF
433 if T
(Ptr1
) = HT
then
445 Exit_Program
(E_Fatal
);
448 ------------------------
449 -- Fatal_Error_Ignore --
450 ------------------------
452 procedure Fatal_Error_Ignore
is
454 if not Ignore_Errors
then
457 end Fatal_Error_Ignore
;
463 function Get_File_Name
464 (Lower
: Boolean := False;
465 May_Be_Quoted
: Boolean := False) return File_Name_Type
470 F
:= Get_Name
(Ignore_Special
=> True,
471 May_Be_Quoted
=> May_Be_Quoted
);
473 -- Convert file name to all lower case if file names are not case
474 -- sensitive. This ensures that we handle names in the canonical
475 -- lower case format, regardless of the actual case.
477 if Lower
and not File_Names_Case_Sensitive
then
478 Canonical_Case_File_Name
(Name_Buffer
(1 .. Name_Len
));
481 return File_Name_Type
(F
);
490 (Ignore_Spaces
: Boolean := False;
491 Ignore_Special
: Boolean := False;
492 May_Be_Quoted
: Boolean := False) return Name_Id
501 if Ignore_Errors
then
510 -- Deal with quoted characters
512 if May_Be_Quoted
and then Char
= '"' then
515 if Ignore_Errors
then
538 Add_Char_To_Name_Buffer
(Char
);
541 -- Other than case of quoted character
546 Add_Char_To_Name_Buffer
(Getc
);
548 exit when At_End_Of_Field
and then not Ignore_Spaces
;
550 if not Ignore_Special
then
551 if Name_Buffer
(1) = '"' then
552 exit when Name_Len
> 1
553 and then Name_Buffer
(Name_Len
) = '"';
556 -- Terminate on parens or angle brackets or equal sign
558 exit when Nextc
= '(' or else Nextc
= ')'
559 or else Nextc
= '{' or else Nextc
= '}'
560 or else Nextc
= '<' or else Nextc
= '>'
563 -- Terminate on comma
565 exit when Nextc
= ',';
567 -- Terminate if left bracket not part of wide char
568 -- sequence Note that we only recognize brackets
569 -- notation so far ???
571 exit when Nextc
= '[' and then T
(P
+ 1) /= '"';
573 -- Terminate if right bracket not part of wide char
576 exit when Nextc
= ']' and then T
(P
- 1) /= '"';
589 function Get_Unit_Name
return Unit_Name_Type
is
591 return Unit_Name_Type
(Get_Name
);
598 function Get_Nat
return Nat
is
604 -- Check if we are on a number. In the case of bad ALI files, this
607 if not (Nextc
in '0' .. '9') then
613 V
:= V
* 10 + (Character'Pos (Getc
) - Character'Pos ('0'));
615 exit when At_End_Of_Field
;
616 exit when Nextc
< '0' or else Nextc
> '9';
626 function Get_Stamp
return Time_Stamp_Type
is
634 if Ignore_Errors
then
635 return Dummy_Time_Stamp
;
641 -- Following reads old style time stamp missing first two digits
643 if Nextc
in '7' .. '9' then
648 -- Normal case of full year in time stamp
654 for J
in Start
.. T
'Last loop
665 procedure Get_Typeref
666 (Current_File_Num
: Sdep_Id
;
668 File_Num
: out Sdep_Id
;
670 Ref_Type
: out Character;
672 Standard_Entity
: out Name_Id
)
677 when '<' => Ref
:= Tref_Derived
;
678 when '(' => Ref
:= Tref_Access
;
679 when '{' => Ref
:= Tref_Type
;
680 when others => Ref
:= Tref_None
;
683 -- Case of typeref field present
685 if Ref
/= Tref_None
then
686 P
:= P
+ 1; -- skip opening bracket
688 if Nextc
in 'a' .. 'z' then
689 File_Num
:= No_Sdep_Id
;
693 Standard_Entity
:= Get_Name
(Ignore_Spaces
=> True);
698 File_Num
:= Sdep_Id
(N
+ Nat
(First_Sdep_Entry
) - 1);
702 File_Num
:= Current_File_Num
;
708 Standard_Entity
:= No_Name
;
711 -- ??? Temporary workaround for nested generics case:
712 -- 4i4 Directories{1|4I9[4|6[3|3]]}
716 Nested_Brackets
: Natural := 0;
722 Nested_Brackets
:= Nested_Brackets
+ 1;
724 Nested_Brackets
:= Nested_Brackets
- 1;
726 if Nested_Brackets
= 0 then
735 P
:= P
+ 1; -- skip closing bracket
738 -- No typeref entry present
741 File_Num
:= No_Sdep_Id
;
745 Standard_Entity
:= No_Name
;
753 function Getc
return Character is
767 function Nextc
return Character is
776 procedure Skip_Eol
is
781 if Ignore_Errors
then
782 while not At_Eol
loop
790 -- Loop to skip past blank lines (first time through skips this EOL)
792 while Nextc
< ' ' and then Nextc
/= EOF
loop
805 procedure Skip_Line
is
807 while not At_Eol
loop
818 procedure Skip_Space
is
820 while Nextc
= ' ' or else Nextc
= HT
loop
836 -- Start of processing for Scan_ALI
839 First_Sdep_Entry
:= Sdep
.Last
+ 1;
841 -- Acquire lines to be ignored
845 ('U' |
'W' |
'Y' |
'Z' |
'D' |
'X' => False, others => True);
847 -- Read_Lines parameter given
849 elsif Read_Lines
/= "" then
850 Ignore
:= ('U' => False, others => True);
852 for J
in Read_Lines
'Range loop
853 Ignore
(Read_Lines
(J
)) := False;
856 -- Process Ignore_Lines parameter
859 Ignore
:= (others => False);
861 for J
in Ignore_Lines
'Range loop
862 pragma Assert
(Ignore_Lines
(J
) /= 'U');
863 Ignore
(Ignore_Lines
(J
)) := True;
867 -- Setup ALI Table entry with appropriate defaults
871 Set_Name_Table_Int
(F
, Int
(Id
));
875 Compile_Errors
=> False,
876 First_Interrupt_State
=> Interrupt_States
.Last
+ 1,
877 First_Sdep
=> No_Sdep_Id
,
878 First_Specific_Dispatching
=> Specific_Dispatching
.Last
+ 1,
879 First_Unit
=> No_Unit_Id
,
880 GNATprove_Mode
=> False,
881 Last_Interrupt_State
=> Interrupt_States
.Last
,
882 Last_Sdep
=> No_Sdep_Id
,
883 Last_Specific_Dispatching
=> Specific_Dispatching
.Last
,
884 Last_Unit
=> No_Unit_Id
,
885 Locking_Policy
=> ' ',
888 Main_Program
=> None
,
889 No_Component_Reordering
=> False,
891 Normalize_Scalars
=> False,
892 Ofile_Full_Name
=> Full_Object_File_Name
,
893 Partition_Elaboration_Policy
=> ' ',
894 Queuing_Policy
=> ' ',
895 Restrictions
=> No_Restrictions
,
896 SAL_Interface
=> False,
899 Task_Dispatching_Policy
=> ' ',
900 Time_Slice_Value
=> -1,
902 Unit_Exception_Table
=> False,
903 Ver
=> (others => ' '),
905 Frontend_Exceptions
=> False,
906 Zero_Cost_Exceptions
=> False);
908 -- Now we acquire the input lines from the ALI file. Note that the
909 -- convention in the following code is that as we enter each section,
910 -- C is set to contain the first character of the following line.
915 -- Acquire library version
919 -- The V line missing really indicates trouble, most likely it
920 -- means we don't have an ALI file at all, so here we give a
921 -- fatal error even if we are in Ignore_Errors mode.
925 elsif Ignore
('V') then
933 for J
in 1 .. Ver_Len_Max
loop
936 ALIs
.Table
(Id
).Ver
(J
) := C
;
937 ALIs
.Table
(Id
).Ver_Len
:= J
;
946 -- Acquire main program line if present
959 ALIs
.Table
(Id
).Main_Program
:= Func
;
961 ALIs
.Table
(Id
).Main_Program
:= Proc
;
971 ALIs
.Table
(Id
).Main_Priority
:= Get_Nat
;
979 ALIs
.Table
(Id
).Time_Slice_Value
:= Get_Nat
;
987 ALIs
.Table
(Id
).Main_CPU
:= Get_Nat
;
994 ALIs
.Table
(Id
).WC_Encoding
:= Getc
;
1003 -- Acquire argument lines
1005 First_Arg
:= Args
.Last
+ 1;
1009 exit A_Loop
when C
/= 'A';
1011 if Ignore
('A') then
1017 -- Scan out argument
1020 while not At_Eol
loop
1021 Add_Char_To_Name_Buffer
(Getc
);
1024 -- If -fstack-check, record that it occurred. Note that an
1025 -- additional string parameter can be specified, in the form of
1026 -- -fstack-check={no|generic|specific}. "no" means no checking,
1027 -- "generic" means force the use of old-style checking, and
1028 -- "specific" means use the best checking method.
1031 and then Name_Buffer
(1 .. 13) = "-fstack-check"
1032 and then Name_Buffer
(1 .. Name_Len
) /= "-fstack-check=no"
1034 Stack_Check_Switch_Set
:= True;
1037 -- Store the argument
1039 Args
.Increment_Last
;
1040 Args
.Table
(Args
.Last
) := new String'(Name_Buffer (1 .. Name_Len));
1053 if Ignore_Errors then
1065 if Ignore ('P
') then
1073 while not At_Eol loop
1078 -- Processing for CE
1082 ALIs.Table (Id).Compile_Errors := True;
1084 -- Processing for DB
1088 Detect_Blocking := True;
1090 -- Processing for Ex
1093 Partition_Elaboration_Policy_Specified := Getc;
1094 ALIs.Table (Id).Partition_Elaboration_Policy :=
1095 Partition_Elaboration_Policy_Specified;
1097 -- Processing for FX
1103 ALIs.Table (Id).Frontend_Exceptions := True;
1104 Frontend_Exceptions_Specified := True;
1109 -- Processing for GP
1113 GNATprove_Mode_Specified := True;
1114 ALIs.Table (Id).GNATprove_Mode := True;
1116 -- Processing for Lx
1119 Locking_Policy_Specified := Getc;
1120 ALIs.Table (Id).Locking_Policy := Locking_Policy_Specified;
1122 -- Processing for flags starting with N
1127 -- Processing for NC
1130 ALIs.Table (Id).No_Component_Reordering := True;
1131 No_Component_Reordering_Specified := True;
1133 -- Processing for NO
1136 ALIs.Table (Id).No_Object := True;
1137 No_Object_Specified := True;
1139 -- Processing for NR
1142 No_Run_Time_Mode := True;
1143 Configurable_Run_Time_Mode := True;
1145 -- Processing for NS
1148 ALIs.Table (Id).Normalize_Scalars := True;
1149 Normalize_Scalars_Specified := True;
1152 -- Invalid switch starting with N
1158 -- Processing for OH/OL
1163 if C = 'L
' or else C = 'H
' then
1164 ALIs.Table (Id).SSO_Default := C;
1165 SSO_Default_Specified := True;
1171 -- Processing for Qx
1174 Queuing_Policy_Specified := Getc;
1175 ALIs.Table (Id).Queuing_Policy := Queuing_Policy_Specified;
1177 -- Processing for flags starting with S
1182 -- Processing for SL
1185 ALIs.Table (Id).SAL_Interface := True;
1187 -- Processing for SS
1190 Opt.Sec_Stack_Used := True;
1192 -- Invalid switch starting with S
1198 -- Processing for Tx
1201 Task_Dispatching_Policy_Specified := Getc;
1202 ALIs.Table (Id).Task_Dispatching_Policy :=
1203 Task_Dispatching_Policy_Specified;
1205 -- Processing for switch starting with U
1210 -- Processing for UA
1213 Unreserve_All_Interrupts_Specified := True;
1215 -- Processing for UX
1218 ALIs.Table (Id).Unit_Exception_Table := True;
1220 -- Invalid switches starting with U
1226 -- Processing for ZX
1232 ALIs.Table (Id).Zero_Cost_Exceptions := True;
1233 Zero_Cost_Exceptions_Specified := True;
1238 -- Invalid parameter
1246 if not NS_Found then
1247 No_Normalize_Scalars_Specified := True;
1256 -- Loop to skip to first restrictions line
1259 if Ignore_Errors then
1271 -- Ignore all 'R
' lines if that is required
1273 if Ignore ('R
') then
1279 -- Here we process the restrictions lines (other than unit name cases)
1282 Scan_Restrictions : declare
1283 Save_R : constant Restrictions_Info := Cumulative_Restrictions;
1284 -- Save cumulative restrictions in case we have a fatal error
1286 Bad_R_Line : exception;
1287 -- Signal bad restrictions line (raised on unexpected character)
1294 -- Named restriction case
1300 -- Loop through RR and RV lines
1302 while C = 'R
' and then Nextc /= ' ' loop
1306 -- Acquire restriction name
1309 while not At_Eol and then Nextc /= '=' loop
1310 Name_Len := Name_Len + 1;
1311 Name_Buffer (Name_Len) := Getc;
1314 -- Now search list of restrictions to find match
1317 RN : String renames Name_Buffer (1 .. Name_Len);
1320 R := Restriction_Id'First;
1321 while R /= Not_A_Restriction_Id loop
1322 if Restriction_Id'Image (R) = RN then
1326 R := Restriction_Id'Succ (R);
1329 -- We don't recognize the restriction. This might be
1330 -- thought of as an error, and it really is, but we
1331 -- want to allow building with inconsistent versions
1332 -- of the binder and ali files (see comments at the
1333 -- start of package System.Rident), so we just ignore
1336 goto Done_With_Restriction_Line;
1343 -- Boolean restriction case
1345 when All_Boolean_Restrictions =>
1348 ALIs.Table (Id).Restrictions.Violated (R) :=
1350 Cumulative_Restrictions.Violated (R) := True;
1353 ALIs.Table (Id).Restrictions.Set (R) := True;
1354 Cumulative_Restrictions.Set (R) := True;
1360 -- Parameter restriction case
1362 when All_Parameter_Restrictions =>
1363 if At_Eol or else Nextc /= '=' then
1369 N := Natural (Get_Nat);
1376 ALIs.Table (Id).Restrictions.Set (R) := True;
1377 ALIs.Table (Id).Restrictions.Value (R) := N;
1379 if Cumulative_Restrictions.Set (R) then
1380 Cumulative_Restrictions.Value (R) :=
1382 (Cumulative_Restrictions.Value (R), N);
1384 Cumulative_Restrictions.Set (R) := True;
1385 Cumulative_Restrictions.Value (R) := N;
1388 -- Restriction violated
1391 ALIs.Table (Id).Restrictions.Violated (R) :=
1393 Cumulative_Restrictions.Violated (R) := True;
1394 ALIs.Table (Id).Restrictions.Count (R) := N;
1396 -- Checked Max_Parameter case
1398 if R in Checked_Max_Parameter_Restrictions then
1399 Cumulative_Restrictions.Count (R) :=
1401 (Cumulative_Restrictions.Count (R), N);
1403 -- Other checked parameter cases
1407 pragma Unsuppress (Overflow_Check);
1410 Cumulative_Restrictions.Count (R) :=
1411 Cumulative_Restrictions.Count (R) + N;
1414 when Constraint_Error =>
1416 -- A constraint error comes from the
1417 -- addition. We reset to the maximum
1418 -- and indicate that the real value
1421 Cumulative_Restrictions.Value (R) :=
1423 Cumulative_Restrictions.Unknown (R) :=
1432 ALIs.Table (Id).Restrictions.Unknown (R) :=
1434 Cumulative_Restrictions.Unknown (R) := True;
1437 -- Other than 'R
' or 'V
'
1447 -- Bizarre error case NOT_A_RESTRICTION
1449 when Not_A_Restriction_Id =>
1457 <<Done_With_Restriction_Line>>
1462 -- Positional restriction case
1468 -- Acquire information for boolean restrictions
1470 for R in All_Boolean_Restrictions loop
1475 ALIs.Table (Id).Restrictions.Violated (R) := True;
1476 Cumulative_Restrictions.Violated (R) := True;
1479 ALIs.Table (Id).Restrictions.Set (R) := True;
1480 Cumulative_Restrictions.Set (R) := True;
1490 -- Acquire information for parameter restrictions
1492 for RP in All_Parameter_Restrictions loop
1498 ALIs.Table (Id).Restrictions.Set (RP) := True;
1501 N : constant Integer := Integer (Get_Nat);
1503 ALIs.Table (Id).Restrictions.Value (RP) := N;
1505 if Cumulative_Restrictions.Set (RP) then
1506 Cumulative_Restrictions.Value (RP) :=
1508 (Cumulative_Restrictions.Value (RP), N);
1510 Cumulative_Restrictions.Set (RP) := True;
1511 Cumulative_Restrictions.Value (RP) := N;
1519 -- Acquire restrictions violations information
1527 ALIs.Table (Id).Restrictions.Violated (RP) := True;
1528 Cumulative_Restrictions.Violated (RP) := True;
1531 N : constant Integer := Integer (Get_Nat);
1534 ALIs.Table (Id).Restrictions.Count (RP) := N;
1536 if RP in Checked_Max_Parameter_Restrictions then
1537 Cumulative_Restrictions.Count (RP) :=
1539 (Cumulative_Restrictions.Count (RP), N);
1543 pragma Unsuppress (Overflow_Check);
1546 Cumulative_Restrictions.Count (RP) :=
1547 Cumulative_Restrictions.Count (RP) + N;
1550 when Constraint_Error =>
1552 -- A constraint error comes from the add. We
1553 -- reset to the maximum and indicate that the
1554 -- real value is now unknown.
1556 Cumulative_Restrictions.Value (RP) :=
1558 Cumulative_Restrictions.Unknown (RP) := True;
1564 ALIs.Table (Id).Restrictions.Unknown (RP) := True;
1565 Cumulative_Restrictions.Unknown (RP) := True;
1582 -- Here if error during scanning of restrictions line
1587 -- In Ignore_Errors mode, undo any changes to restrictions
1588 -- from this unit, and continue on, skipping remaining R
1589 -- lines for this unit.
1591 if Ignore_Errors then
1592 Cumulative_Restrictions := Save_R;
1593 ALIs.Table (Id).Restrictions := No_Restrictions;
1601 -- In normal mode, this is a fatal error
1606 end Scan_Restrictions;
1609 -- Acquire additional restrictions (No_Dependence) lines if present
1612 if Ignore ('R
') then
1616 No_Deps.Append ((Id, Get_Name));
1623 -- Acquire 'I
' lines if present
1628 if Ignore ('I
') then
1634 I_State : Character;
1643 Interrupt_States.Append (
1644 (Interrupt_Id => Int_Num,
1645 Interrupt_State => I_State,
1646 IS_Pragma_Line => Line_No));
1648 ALIs.Table (Id).Last_Interrupt_State := Interrupt_States.Last;
1656 -- Acquire 'S
' lines if present
1661 if Ignore ('S
') then
1677 First_Prio := Get_Nat;
1678 Last_Prio := Get_Nat;
1681 Specific_Dispatching.Append (
1682 (Dispatching_Policy => Policy,
1683 First_Priority => First_Prio,
1684 Last_Priority => Last_Prio,
1685 PSD_Pragma_Line => Line_No));
1687 ALIs.Table (Id).Last_Specific_Dispatching :=
1688 Specific_Dispatching.Last;
1697 -- Loop to acquire unit entries
1701 exit U_Loop when C /= 'U
';
1703 -- Note: as per spec, we never ignore U lines
1707 Units.Increment_Last;
1709 if ALIs.Table (Id).First_Unit = No_Unit_Id then
1710 ALIs.Table (Id).First_Unit := Units.Last;
1714 UL : Unit_Record renames Units.Table (Units.Last);
1717 UL.Uname := Get_Unit_Name;
1718 UL.Predefined := Is_Predefined_Unit;
1719 UL.Internal := Is_Internal_Unit;
1721 UL.Sfile := Get_File_Name (Lower => True);
1723 UL.Preelab := False;
1724 UL.No_Elab := False;
1725 UL.Shared_Passive := False;
1727 UL.Remote_Types := False;
1728 UL.Serious_Errors := False;
1729 UL.Has_RACW := False;
1730 UL.Init_Scalars := False;
1731 UL.Is_Generic := False;
1732 UL.Icasing := Mixed_Case;
1733 UL.Kcasing := All_Lower_Case;
1734 UL.Dynamic_Elab := False;
1735 UL.Elaborate_Body := False;
1736 UL.Set_Elab_Entity := False;
1737 UL.Version := "00000000";
1738 UL.First_With := Withs.Last + 1;
1739 UL.First_Arg := First_Arg;
1740 UL.Elab_Position := 0;
1741 UL.SAL_Interface := ALIs.Table (Id).SAL_Interface;
1742 UL.Directly_Scanned := Directly_Scanned;
1743 UL.Body_Needed_For_SAL := False;
1744 UL.Elaborate_Body_Desirable := False;
1745 UL.Optimize_Alignment := 'O
';
1746 UL.Has_Finalizer := False;
1748 if Debug_Flag_U then
1749 Write_Str (" ----> reading unit ");
1750 Write_Int (Int (Units.Last));
1752 Write_Unit_Name (UL.Uname);
1753 Write_Str (" from file ");
1754 Write_Name (UL.Sfile);
1759 -- Check for duplicated unit in different files
1762 Info : constant Int := Get_Name_Table_Int
1763 (Units.Table (Units.Last).Uname);
1766 and then Units.Table (Units.Last).Sfile /=
1767 Units.Table (Unit_Id (Info)).Sfile
1769 -- If Err is set then ignore duplicate unit name. This is the
1770 -- case of a call from gnatmake, where the situation can arise
1771 -- from substitution of source files. In such situations, the
1772 -- processing in gnatmake will always result in any required
1773 -- recompilations in any case, and if we consider this to be
1774 -- an error we get strange cases (for example when a generic
1775 -- instantiation is replaced by a normal package) where we
1776 -- read the old ali file, decide to recompile, and then decide
1777 -- that the old and new ali files are incompatible.
1782 -- If Err is not set, then this is a fatal error. This is
1783 -- the case of being called from the binder, where we must
1784 -- definitely diagnose this as an error.
1788 Write_Str ("error: duplicate unit name: ");
1791 Write_Str ("error: unit """);
1792 Write_Unit_Name (Units.Table (Units.Last).Uname);
1793 Write_Str (""" found in file """);
1794 Write_Name_Decoded (Units.Table (Units.Last).Sfile);
1798 Write_Str ("error
: unit
""");
1799 Write_Unit_Name (Units.Table (Unit_Id (Info)).Uname);
1800 Write_Str (""" found
in file
""");
1801 Write_Name_Decoded (Units.Table (Unit_Id (Info)).Sfile);
1805 Exit_Program (E_Fatal);
1811 (Units.Table (Units.Last).Uname, Int (Units.Last));
1813 -- Scan out possible version and other parameters
1822 if C in '0' .. '9' or else C in 'a
' .. 'f
' then
1823 Units.Table (Units.Last).Version (1) := C;
1825 for J in 2 .. 8 loop
1827 Units.Table (Units.Last).Version (J) := C;
1836 Check_At_End_Of_Field;
1837 Units.Table (Units.Last).Elaborate_Body_Desirable := True;
1840 Check_At_End_Of_Field;
1841 Units.Table (Units.Last).Body_Needed_For_SAL := True;
1847 -- DE parameter (Dynamic elaboration checks)
1853 Check_At_End_Of_Field;
1854 Units.Table (Units.Last).Dynamic_Elab := True;
1855 Dynamic_Elaboration_Checks_Specified := True;
1866 Units.Table (Units.Last).Elaborate_Body := True;
1868 Units.Table (Units.Last).Set_Elab_Entity := True;
1873 Check_At_End_Of_Field;
1875 -- GE parameter (generic)
1881 Check_At_End_Of_Field;
1882 Units.Table (Units.Last).Is_Generic := True;
1887 -- IL/IS/IU parameters
1893 Units.Table (Units.Last).Icasing := All_Lower_Case;
1895 Units.Table (Units.Last).Init_Scalars := True;
1896 Initialize_Scalars_Used := True;
1898 Units.Table (Units.Last).Icasing := All_Upper_Case;
1903 Check_At_End_Of_Field;
1911 Units.Table (Units.Last).Kcasing := Mixed_Case;
1913 Units.Table (Units.Last).Kcasing := All_Upper_Case;
1918 Check_At_End_Of_Field;
1926 Units.Table (Units.Last).No_Elab := True;
1927 Check_At_End_Of_Field;
1932 -- PF/PR/PU/PK parameters
1938 Units.Table (Units.Last).Has_Finalizer := True;
1940 Units.Table (Units.Last).Preelab := True;
1942 Units.Table (Units.Last).Pure := True;
1944 Units.Table (Units.Last).Unit_Kind := 'p
';
1949 Check_At_End_Of_Field;
1951 -- OL/OO/OS/OT parameters
1956 if C = 'L
' or else C = 'O
' or else C = 'S
' or else C = 'T
' then
1957 Units.Table (Units.Last).Optimize_Alignment := C;
1962 Check_At_End_Of_Field;
1970 Units.Table (Units.Last).RCI := True;
1972 Units.Table (Units.Last).Remote_Types := True;
1974 Units.Table (Units.Last).Has_RACW := True;
1979 Check_At_End_Of_Field;
1981 -- SE/SP/SU parameters
1987 Units.Table (Units.Last).Serious_Errors := True;
1989 Units.Table (Units.Last).Shared_Passive := True;
1991 Units.Table (Units.Last).Unit_Kind := 's
';
1996 Check_At_End_Of_Field;
2008 -- Scan out With lines for this unit
2012 exit With_Loop when C /= 'W
' and then C /= 'Y
' and then C /= 'Z
';
2014 if Ignore ('W
') then
2020 Withs.Increment_Last;
2021 Withs.Table (Withs.Last).Uname := Get_Unit_Name;
2022 Withs.Table (Withs.Last).Elaborate := False;
2023 Withs.Table (Withs.Last).Elaborate_All := False;
2024 Withs.Table (Withs.Last).Elab_Desirable := False;
2025 Withs.Table (Withs.Last).Elab_All_Desirable := False;
2026 Withs.Table (Withs.Last).SAL_Interface := False;
2027 Withs.Table (Withs.Last).Limited_With := (C = 'Y
');
2028 Withs.Table (Withs.Last).Implicit_With_From_Instantiation
2031 -- Generic case with no object file available
2034 Withs.Table (Withs.Last).Sfile := No_File;
2035 Withs.Table (Withs.Last).Afile := No_File;
2040 Withs.Table (Withs.Last).Sfile := Get_File_Name
2042 Withs.Table (Withs.Last).Afile := Get_File_Name
2045 -- Scan out possible E, EA, ED, and AD parameters
2047 while not At_Eol loop
2053 Check_At_End_Of_Field;
2055 -- Store AD indication unless ignore required
2057 if not Ignore_ED then
2058 Withs.Table (Withs.Last).Elab_All_Desirable := True;
2061 elsif Nextc = 'E
' then
2064 if At_End_Of_Field then
2065 Withs.Table (Withs.Last).Elaborate := True;
2067 elsif Nextc = 'A
' then
2069 Check_At_End_Of_Field;
2070 Withs.Table (Withs.Last).Elaborate_All := True;
2074 Check_At_End_Of_Field;
2076 -- Store ED indication unless ignore required
2078 if not Ignore_ED then
2079 Withs.Table (Withs.Last).Elab_Desirable :=
2096 Units.Table (Units.Last).Last_With := Withs.Last;
2097 Units.Table (Units.Last).Last_Arg := Args.Last;
2099 -- If there are linker options lines present, scan them
2103 Linker_Options_Loop : loop
2105 exit Linker_Options_Loop when C /= 'L
';
2107 if Ignore ('L
') then
2118 if C < Character'Val (16#20#)
2119 or else C > Character'Val (16#7E#)
2124 C := Character'Val (0);
2131 for J in 1 .. 2 loop
2134 if C in '0' .. '9' then
2137 Character'Pos ('0');
2139 elsif C in 'A' .. 'F' then
2142 Character'Pos ('A') +
2151 Add_Char_To_Name_Buffer (Character'Val (V));
2156 exit when Nextc /= '"';
2160 Add_Char_To_Name_Buffer (C);
2164 Add_Char_To_Name_Buffer (NUL);
2169 end loop Linker_Options_Loop;
2171 -- Store the linker options entry if one was found
2173 if Name_Len /= 0 then
2174 Linker_Options.Increment_Last;
2176 Linker_Options.Table (Linker_Options.Last).Name :=
2179 Linker_Options.Table (Linker_Options.Last).Unit :=
2182 Linker_Options.Table (Linker_Options.Last).Internal_File :=
2183 Is_Internal_File_Name (F);
2185 Linker_Options.Table (Linker_Options.Last).Original_Pos :=
2186 Linker_Options.Last;
2189 -- If there are notes present, scan them
2193 exit Notes_Loop when C /= 'N';
2195 if Ignore ('N') then
2201 Notes.Increment_Last;
2202 Notes.Table (Notes.Last).Pragma_Type := Getc;
2203 Notes.Table (Notes.Last).Pragma_Line := Get_Nat;
2205 Notes.Table (Notes.Last).Pragma_Col := Get_Nat;
2207 if not At_Eol and then Nextc = ':' then
2209 Notes.Table (Notes.Last).Pragma_Source_File :=
2210 Get_File_Name (Lower => True);
2212 Notes.Table (Notes.Last).Pragma_Source_File :=
2213 Units.Table (Units.Last).Sfile;
2217 Notes.Table (Notes.Last).Pragma_Args := No_Name;
2220 -- Note: can't use Get_Name here as the remainder of the
2221 -- line is unstructured text whose syntax depends on the
2222 -- particular pragma used.
2227 while not At_Eol loop
2228 Add_Char_To_Name_Buffer (Getc);
2236 end loop Notes_Loop;
2239 -- End loop through units for one ALI file
2241 ALIs.Table (Id).Last_Unit := Units.Last;
2242 ALIs.Table (Id).Sfile := Units.Table (ALIs.Table (Id).First_Unit).Sfile;
2244 -- Set types of the units (there can be at most 2 of them)
2246 if ALIs.Table (Id).First_Unit /= ALIs.Table (Id).Last_Unit then
2247 Units.Table (ALIs.Table (Id).First_Unit).Utype := Is_Body;
2248 Units.Table (ALIs.Table (Id).Last_Unit).Utype := Is_Spec;
2251 -- Deal with body only and spec only cases, note that the reason we
2252 -- do our own checking of the name (rather than using Is_Body_Name)
2253 -- is that Uname drags in far too much compiler junk.
2255 Get_Name_String (Units.Table (Units.Last).Uname);
2257 if Name_Buffer (Name_Len) = 'b' then
2258 Units.Table (Units.Last).Utype := Is_Body_Only;
2260 Units.Table (Units.Last).Utype := Is_Spec_Only;
2264 -- Scan out external version references and put in hash table
2268 exit E_Loop when C /= 'E';
2270 if Ignore ('E') then
2286 exit when At_End_Of_Field;
2287 Add_Char_To_Name_Buffer (C);
2290 Version_Ref.Set (new String'(Name_Buffer (1 .. Name_Len)), True);
2297 -- Scan out source dependency lines for this ALI file
2299 ALIs.Table (Id).First_Sdep := Sdep.Last + 1;
2303 exit D_Loop when C /= 'D';
2305 if Ignore ('D') then
2311 Sdep.Increment_Last;
2313 -- In the following call, Lower is not set to True, this is either
2314 -- a bug, or it deserves a special comment as to why this is so???
2316 -- The file/path name may be quoted
2318 Sdep.Table (Sdep.Last).Sfile :=
2319 Get_File_Name (May_Be_Quoted => True);
2321 Sdep.Table (Sdep.Last).Stamp := Get_Stamp;
2322 Sdep.Table (Sdep.Last).Dummy_Entry :=
2323 (Sdep.Table (Sdep.Last).Stamp = Dummy_Time_Stamp);
2325 -- Acquire checksum value
2338 exit when At_Eol or else Ctr = 8;
2340 if Nextc in '0' .. '9' then
2342 Character'Pos (Nextc) - Character'Pos ('0');
2344 elsif Nextc in 'a' .. 'f' then
2346 Character'Pos (Nextc) - Character'Pos ('a') + 10;
2356 if Ctr = 8 and then At_End_Of_Field then
2357 Sdep.Table (Sdep.Last).Checksum := Chk;
2363 -- Acquire (sub)unit and reference file name entries
2365 Sdep.Table (Sdep.Last).Subunit_Name := No_Name;
2366 Sdep.Table (Sdep.Last).Unit_Name := No_Name;
2367 Sdep.Table (Sdep.Last).Rfile :=
2368 Sdep.Table (Sdep.Last).Sfile;
2369 Sdep.Table (Sdep.Last).Start_Line := 1;
2374 -- Here for (sub)unit name
2376 if Nextc not in '0' .. '9' then
2378 while not At_End_Of_Field loop
2379 Add_Char_To_Name_Buffer (Getc);
2382 -- Set the (sub)unit name. Note that we use Name_Find rather
2383 -- than Name_Enter here as the subunit name may already
2384 -- have been put in the name table by the Project Manager.
2387 or else Name_Buffer (Name_Len - 1) /= '%'
2389 Sdep.Table (Sdep.Last).Subunit_Name := Name_Find;
2391 Name_Len := Name_Len - 2;
2392 Sdep.Table (Sdep.Last).Unit_Name := Name_Find;
2398 -- Here for reference file name entry
2400 if Nextc in '0' .. '9' then
2401 Sdep.Table (Sdep.Last).Start_Line := Get_Nat;
2406 while not At_End_Of_Field loop
2407 Add_Char_To_Name_Buffer (Getc);
2410 Sdep.Table (Sdep.Last).Rfile := Name_Enter;
2420 ALIs.Table (Id).Last_Sdep := Sdep.Last;
2422 -- We must at this stage be at an Xref line or the end of file
2434 -- If we are ignoring Xref sections we are done (we ignore all
2435 -- remaining lines since only xref related lines follow X).
2437 if Ignore ('X') and then not Debug_Flag_X then
2441 -- Loop through Xref sections
2445 exit X_Loop when C /= 'X';
2447 -- Make new entry in section table
2449 Xref_Section.Increment_Last;
2451 Read_Refs_For_One_File : declare
2452 XS : Xref_Section_Record renames
2453 Xref_Section.Table (Xref_Section.Last);
2455 Current_File_Num : Sdep_Id;
2456 -- Keeps track of the current file number (changed by nn|)
2459 XS.File_Num := Sdep_Id (Get_Nat + Nat (First_Sdep_Entry) - 1);
2460 XS.File_Name := Get_File_Name;
2461 XS.First_Entity := Xref_Entity.Last + 1;
2463 Current_File_Num := XS.File_Num;
2470 -- Loop through Xref entities
2472 while C /= 'X' and then C /= EOF loop
2473 Xref_Entity.Increment_Last;
2475 Read_Refs_For_One_Entity : declare
2476 XE : Xref_Entity_Record renames
2477 Xref_Entity.Table (Xref_Entity.Last);
2480 procedure Read_Instantiation_Reference;
2481 -- Acquire instantiation reference. Caller has checked
2482 -- that current character is '[' and on return the cursor
2483 -- is skipped past the corresponding closing ']'.
2485 ----------------------------------
2486 -- Read_Instantiation_Reference --
2487 ----------------------------------
2489 procedure Read_Instantiation_Reference is
2490 Local_File_Num : Sdep_Id := Current_File_Num;
2493 Xref.Increment_Last;
2496 XR : Xref_Record renames Xref.Table (Xref.Last);
2499 P := P + 1; -- skip [
2504 Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
2505 Local_File_Num := XR.File_Num;
2510 XR.File_Num := Local_File_Num;
2517 -- Recursive call for next reference
2520 pragma Warnings (Off); -- kill recursion warning
2521 Read_Instantiation_Reference;
2522 pragma Warnings (On);
2525 -- Skip closing bracket after recursive call
2529 end Read_Instantiation_Reference;
2531 -- Start of processing for Read_Refs_For_One_Entity
2540 XE.Visibility := Global;
2542 XE.Visibility := Static;
2544 XE.Visibility := Other;
2547 XE.Entity := Get_Name;
2549 -- Handle the information about generic instantiations
2552 Skipc; -- Opening '['
2555 if Nextc /= '|' then
2556 XE.Iref_File_Num := Current_File_Num;
2560 Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
2562 XE.Iref_Line := Get_Nat;
2570 XE.Iref_File_Num := No_Sdep_Id;
2574 Current_File_Num := XS.File_Num;
2576 -- Renaming reference is present
2580 XE.Rref_Line := Get_Nat;
2586 XE.Rref_Col := Get_Nat;
2588 -- No renaming reference present
2597 XE.Oref_File_Num := No_Sdep_Id;
2598 XE.Tref_File_Num := No_Sdep_Id;
2599 XE.Tref := Tref_None;
2600 XE.First_Xref := Xref.Last + 1;
2602 -- Loop to check for additional info present
2615 (Current_File_Num, Ref, File, Line, Typ, Col, Std);
2616 exit when Ref = Tref_None;
2618 -- Do we have an overriding procedure?
2620 if Ref = Tref_Derived and then Typ = 'p' then
2621 XE.Oref_File_Num := File;
2622 XE.Oref_Line := Line;
2625 -- Arrays never override anything, and <> points to
2626 -- the index types instead
2628 elsif Ref = Tref_Derived and then XE.Etype = 'A' then
2630 -- Index types are stored in the list of references
2632 Xref.Increment_Last;
2635 XR : Xref_Record renames Xref.Table (Xref.Last);
2637 XR.File_Num := File;
2639 XR.Rtype := Array_Index_Reference;
2644 -- Interfaces are stored in the list of references,
2645 -- although the parent type itself is stored in XE.
2646 -- The first interface (when there are only
2647 -- interfaces) is stored in XE.Tref*)
2649 elsif Ref = Tref_Derived
2651 and then XE.Tref_File_Num /= No_Sdep_Id
2653 Xref.Increment_Last;
2656 XR : Xref_Record renames Xref.Table (Xref.Last);
2658 XR.File_Num := File;
2660 XR.Rtype := Interface_Reference;
2667 XE.Tref_File_Num := File;
2668 XE.Tref_Line := Line;
2669 XE.Tref_Type := Typ;
2671 XE.Tref_Standard_Entity := Std;
2676 -- Loop through cross-references for this entity
2683 exit when Nextc /= '.';
2687 Xref.Increment_Last;
2690 XR : Xref_Record renames Xref.Table (Xref.Last);
2697 Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
2698 Current_File_Num := XR.File_Num;
2702 XR.File_Num := Current_File_Num;
2708 -- Imported entities reference as in:
2709 -- 494b<c,__gnat_copy_attribs>25
2713 XR.Imported_Lang := Get_Name;
2715 pragma Assert (Nextc = ',');
2718 XR.Imported_Name := Get_Name;
2720 pragma Assert (Nextc = '>');
2724 XR.Imported_Lang := No_Name;
2725 XR.Imported_Name := No_Name;
2731 Read_Instantiation_Reference;
2736 -- Record last cross-reference
2738 XE.Last_Xref := Xref.Last;
2742 when Bad_ALI_Format =>
2744 -- If ignoring errors, then we skip a line with an
2745 -- unexpected error, and try to continue subsequent
2748 if Ignore_Errors then
2749 Xref_Entity.Decrement_Last;
2753 -- Otherwise, we reraise the fatal exception
2758 end Read_Refs_For_One_Entity;
2761 -- Record last entity
2763 XS.Last_Entity := Xref_Entity.Last;
2765 end Read_Refs_For_One_File;
2770 -- Here after dealing with xref sections
2772 -- Ignore remaining lines, which belong to an additional section of the
2773 -- ALI file not considered here (like SCO or SPARK information).
2780 when Bad_ALI_Format =>
2788 function SEq (F1, F2 : String_Ptr) return Boolean is
2790 return F1.all = F2.all;
2797 function SHash (S : String_Ptr) return Vindex is
2802 for J in S.all'Range loop
2803 H := H * 2 + Character'Pos (S (J));
2806 return Vindex (Vindex'First + Vindex (H mod Vindex'Range_Length));