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 GNATprove_Mode_Specified
:= False;
115 Normalize_Scalars_Specified
:= False;
116 Partition_Elaboration_Policy_Specified
:= ' ';
117 Queuing_Policy_Specified
:= ' ';
118 SSO_Default_Specified
:= False;
119 Static_Elaboration_Model_Used
:= False;
120 Task_Dispatching_Policy_Specified
:= ' ';
121 Unreserve_All_Interrupts_Specified
:= False;
122 Zero_Cost_Exceptions_Specified
:= False;
134 Read_Xref
: Boolean := False;
135 Read_Lines
: String := "";
136 Ignore_Lines
: String := "X";
137 Ignore_Errors
: Boolean := False;
138 Directly_Scanned
: Boolean := False) return ALI_Id
140 P
: Text_Ptr
:= T
'First;
141 Line
: Logical_Line_Number
:= 1;
147 Ignore
: array (Character range 'A' .. 'Z') of Boolean;
148 -- Ignore (X) is set to True if lines starting with X are to
149 -- be ignored by Scan_ALI and skipped, and False if the lines
150 -- are to be read and processed.
152 Bad_ALI_Format
: exception;
153 -- Exception raised by Fatal_Error if Err is True
155 function At_Eol
return Boolean;
156 -- Test if at end of line
158 function At_End_Of_Field
return Boolean;
159 -- Test if at end of line, or if at blank or horizontal tab
161 procedure Check_At_End_Of_Field
;
162 -- Check if we are at end of field, fatal error if not
164 procedure Checkc
(C
: Character);
165 -- Check next character is C. If so bump past it, if not fatal error
167 procedure Check_Unknown_Line
;
168 -- If Ignore_Errors mode, then checks C to make sure that it is not
169 -- an unknown ALI line type characters, and if so, skips lines
170 -- until the first character of the line is one of these characters,
171 -- at which point it does a Getc to put that character in C. The
172 -- call has no effect if C is already an appropriate character.
173 -- If not in Ignore_Errors mode, a fatal error is signalled if the
174 -- line is unknown. Note that if C is an EOL on entry, the line is
175 -- skipped (it is assumed that blank lines are never significant).
176 -- If C is EOF on entry, the call has no effect (it is assumed that
177 -- the caller will properly handle this case).
179 procedure Fatal_Error
;
180 -- Generate fatal error message for badly formatted ALI file if
181 -- Err is false, or raise Bad_ALI_Format if Err is True.
183 procedure Fatal_Error_Ignore
;
184 pragma Inline
(Fatal_Error_Ignore
);
185 -- In Ignore_Errors mode, has no effect, otherwise same as Fatal_Error
187 function Getc
return Character;
188 -- Get next character, bumping P past the character obtained
190 function Get_File_Name
191 (Lower
: Boolean := False;
192 May_Be_Quoted
: Boolean := False) return File_Name_Type
;
193 -- Skip blanks, then scan out a file name (name is left in Name_Buffer
194 -- with length in Name_Len, as well as returning a File_Name_Type value.
195 -- If May_Be_Quoted is True and the first non blank character is '"',
196 -- then remove starting and ending quotes and undoubled internal quotes.
197 -- If lower is false, the case is unchanged, if Lower is True then the
198 -- result is forced to all lower case for systems where file names are
199 -- not case sensitive. This ensures that gnatbind works correctly
200 -- regardless of the case of the file name on all systems. The scan
201 -- is terminated by a end of line, space or horizontal tab. Any other
202 -- special characters are included in the returned name.
205 (Ignore_Spaces
: Boolean := False;
206 Ignore_Special
: Boolean := False;
207 May_Be_Quoted
: Boolean := False) return Name_Id
;
208 -- Skip blanks, then scan out a name (name is left in Name_Buffer with
209 -- length in Name_Len, as well as being returned in Name_Id form).
210 -- If Lower is set to True then the Name_Buffer will be converted to
211 -- all lower case, for systems where file names are not case sensitive.
212 -- This ensures that gnatbind works correctly regardless of the case
213 -- of the file name on all systems. The termination condition depends
214 -- on the settings of Ignore_Spaces and Ignore_Special:
216 -- If Ignore_Spaces is False (normal case), then scan is terminated
217 -- by the normal end of field condition (EOL, space, horizontal tab)
219 -- If Ignore_Special is False (normal case), the scan is terminated by
220 -- a typeref bracket or an equal sign except for the special case of
221 -- an operator name starting with a double quote which is terminated
222 -- by another double quote.
224 -- If May_Be_Quoted is True and the first non blank character is '"'
225 -- the name is 'unquoted'. In this case Ignore_Special is ignored and
226 -- assumed to be True.
228 -- It is an error to set both Ignore_Spaces and Ignore_Special to True.
229 -- This function handles wide characters properly.
231 function Get_Nat
return Nat
;
232 -- Skip blanks, then scan out an unsigned integer value in Nat range
233 -- raises ALI_Reading_Error if the encoutered type is not natural.
235 function Get_Stamp
return Time_Stamp_Type
;
236 -- Skip blanks, then scan out a time stamp
238 function Get_Unit_Name
return Unit_Name_Type
;
239 -- Skip blanks, then scan out a file name (name is left in Name_Buffer
240 -- with length in Name_Len, as well as returning a Unit_Name_Type value.
241 -- The case is unchanged and terminated by a normal end of field.
243 function Nextc
return Character;
244 -- Return current character without modifying pointer P
246 procedure Get_Typeref
247 (Current_File_Num
: Sdep_Id
;
249 File_Num
: out Sdep_Id
;
251 Ref_Type
: out Character;
253 Standard_Entity
: out Name_Id
);
254 -- Parse the definition of a typeref (<...>, {...} or (...))
257 -- Skip past spaces, then skip past end of line (fatal error if not
258 -- at end of line). Also skips past any following blank lines.
261 -- Skip rest of current line and any following blank lines
263 procedure Skip_Space
;
264 -- Skip past white space (blanks or horizontal tab)
267 -- Skip past next character, does not affect value in C. This call
268 -- is like calling Getc and ignoring the returned result.
270 ---------------------
271 -- At_End_Of_Field --
272 ---------------------
274 function At_End_Of_Field
return Boolean is
283 function At_Eol
return Boolean is
285 return Nextc
= EOF
or else Nextc
= CR
or else Nextc
= LF
;
288 ---------------------------
289 -- Check_At_End_Of_Field --
290 ---------------------------
292 procedure Check_At_End_Of_Field
is
294 if not At_End_Of_Field
then
295 if Ignore_Errors
then
296 while Nextc
> ' ' loop
303 end Check_At_End_Of_Field
;
305 ------------------------
306 -- Check_Unknown_Line --
307 ------------------------
309 procedure Check_Unknown_Line
is
311 while C
not in 'A' .. 'Z'
312 or else not Known_ALI_Lines
(C
)
314 if C
= CR
or else C
= LF
then
321 elsif Ignore_Errors
then
329 end Check_Unknown_Line
;
335 procedure Checkc
(C
: Character) is
339 elsif Ignore_Errors
then
350 procedure Fatal_Error
is
355 procedure Wchar
(C
: Character);
356 -- Write a single character, replacing horizontal tab by spaces
358 procedure Wchar
(C
: Character) is
363 exit when Col
mod 8 = 0;
372 -- Start of processing for Fatal_Error
376 raise Bad_ALI_Format
;
380 Write_Str
("fatal error: file ");
382 Write_Str
(" is incorrectly formatted");
385 Write_Str
("make sure you are using consistent versions " &
387 -- Split the following line so that it can easily be transformed for
388 -- e.g. JVM/.NET back-ends where the compiler has a different name.
394 -- Find start of line
398 and then T
(Ptr1
- 1) /= CR
399 and then T
(Ptr1
- 1) /= LF
404 Write_Int
(Int
(Line
));
419 and then T
(Ptr2
) /= CR
420 and then T
(Ptr2
) /= LF
432 if T
(Ptr1
) = HT
then
444 Exit_Program
(E_Fatal
);
447 ------------------------
448 -- Fatal_Error_Ignore --
449 ------------------------
451 procedure Fatal_Error_Ignore
is
453 if not Ignore_Errors
then
456 end Fatal_Error_Ignore
;
462 function Get_File_Name
463 (Lower
: Boolean := False;
464 May_Be_Quoted
: Boolean := False) return File_Name_Type
469 F
:= Get_Name
(Ignore_Special
=> True,
470 May_Be_Quoted
=> May_Be_Quoted
);
472 -- Convert file name to all lower case if file names are not case
473 -- sensitive. This ensures that we handle names in the canonical
474 -- lower case format, regardless of the actual case.
476 if Lower
and not File_Names_Case_Sensitive
then
477 Canonical_Case_File_Name
(Name_Buffer
(1 .. Name_Len
));
480 return File_Name_Type
(F
);
489 (Ignore_Spaces
: Boolean := False;
490 Ignore_Special
: Boolean := False;
491 May_Be_Quoted
: Boolean := False) return Name_Id
500 if Ignore_Errors
then
509 -- Deal with quoted characters
511 if May_Be_Quoted
and then Char
= '"' then
514 if Ignore_Errors
then
537 Add_Char_To_Name_Buffer
(Char
);
540 -- Other than case of quoted character
545 Add_Char_To_Name_Buffer
(Getc
);
547 exit when At_End_Of_Field
and then not Ignore_Spaces
;
549 if not Ignore_Special
then
550 if Name_Buffer
(1) = '"' then
551 exit when Name_Len
> 1
552 and then Name_Buffer
(Name_Len
) = '"';
555 -- Terminate on parens or angle brackets or equal sign
557 exit when Nextc
= '(' or else Nextc
= ')'
558 or else Nextc
= '{' or else Nextc
= '}'
559 or else Nextc
= '<' or else Nextc
= '>'
562 -- Terminate on comma
564 exit when Nextc
= ',';
566 -- Terminate if left bracket not part of wide char
567 -- sequence Note that we only recognize brackets
568 -- notation so far ???
570 exit when Nextc
= '[' and then T
(P
+ 1) /= '"';
572 -- Terminate if right bracket not part of wide char
575 exit when Nextc
= ']' and then T
(P
- 1) /= '"';
588 function Get_Unit_Name
return Unit_Name_Type
is
590 return Unit_Name_Type
(Get_Name
);
597 function Get_Nat
return Nat
is
603 -- Check if we are on a number. In the case of bad ALI files, this
606 if not (Nextc
in '0' .. '9') then
612 V
:= V
* 10 + (Character'Pos (Getc
) - Character'Pos ('0'));
614 exit when At_End_Of_Field
;
615 exit when Nextc
< '0' or else Nextc
> '9';
625 function Get_Stamp
return Time_Stamp_Type
is
633 if Ignore_Errors
then
634 return Dummy_Time_Stamp
;
640 -- Following reads old style time stamp missing first two digits
642 if Nextc
in '7' .. '9' then
647 -- Normal case of full year in time stamp
653 for J
in Start
.. T
'Last loop
664 procedure Get_Typeref
665 (Current_File_Num
: Sdep_Id
;
667 File_Num
: out Sdep_Id
;
669 Ref_Type
: out Character;
671 Standard_Entity
: out Name_Id
)
676 when '<' => Ref
:= Tref_Derived
;
677 when '(' => Ref
:= Tref_Access
;
678 when '{' => Ref
:= Tref_Type
;
679 when others => Ref
:= Tref_None
;
682 -- Case of typeref field present
684 if Ref
/= Tref_None
then
685 P
:= P
+ 1; -- skip opening bracket
687 if Nextc
in 'a' .. 'z' then
688 File_Num
:= No_Sdep_Id
;
692 Standard_Entity
:= Get_Name
(Ignore_Spaces
=> True);
697 File_Num
:= Sdep_Id
(N
+ Nat
(First_Sdep_Entry
) - 1);
701 File_Num
:= Current_File_Num
;
707 Standard_Entity
:= No_Name
;
710 -- ??? Temporary workaround for nested generics case:
711 -- 4i4 Directories{1|4I9[4|6[3|3]]}
715 Nested_Brackets
: Natural := 0;
721 Nested_Brackets
:= Nested_Brackets
+ 1;
723 Nested_Brackets
:= Nested_Brackets
- 1;
725 if Nested_Brackets
= 0 then
734 P
:= P
+ 1; -- skip closing bracket
737 -- No typeref entry present
740 File_Num
:= No_Sdep_Id
;
744 Standard_Entity
:= No_Name
;
752 function Getc
return Character is
766 function Nextc
return Character is
775 procedure Skip_Eol
is
780 if Ignore_Errors
then
781 while not At_Eol
loop
789 -- Loop to skip past blank lines (first time through skips this EOL)
791 while Nextc
< ' ' and then Nextc
/= EOF
loop
804 procedure Skip_Line
is
806 while not At_Eol
loop
817 procedure Skip_Space
is
819 while Nextc
= ' ' or else Nextc
= HT
loop
835 -- Start of processing for Scan_ALI
838 First_Sdep_Entry
:= Sdep
.Last
+ 1;
840 -- Acquire lines to be ignored
844 ('U' |
'W' |
'Y' |
'Z' |
'D' |
'X' => False, others => True);
846 -- Read_Lines parameter given
848 elsif Read_Lines
/= "" then
849 Ignore
:= ('U' => False, others => True);
851 for J
in Read_Lines
'Range loop
852 Ignore
(Read_Lines
(J
)) := False;
855 -- Process Ignore_Lines parameter
858 Ignore
:= (others => False);
860 for J
in Ignore_Lines
'Range loop
861 pragma Assert
(Ignore_Lines
(J
) /= 'U');
862 Ignore
(Ignore_Lines
(J
)) := True;
866 -- Setup ALI Table entry with appropriate defaults
870 Set_Name_Table_Info
(F
, Int
(Id
));
874 Compile_Errors
=> False,
875 First_Interrupt_State
=> Interrupt_States
.Last
+ 1,
876 First_Sdep
=> No_Sdep_Id
,
877 First_Specific_Dispatching
=> Specific_Dispatching
.Last
+ 1,
878 First_Unit
=> No_Unit_Id
,
879 GNATprove_Mode
=> False,
880 Last_Interrupt_State
=> Interrupt_States
.Last
,
881 Last_Sdep
=> No_Sdep_Id
,
882 Last_Specific_Dispatching
=> Specific_Dispatching
.Last
,
883 Last_Unit
=> No_Unit_Id
,
884 Locking_Policy
=> ' ',
887 Main_Program
=> None
,
889 Normalize_Scalars
=> False,
890 Ofile_Full_Name
=> Full_Object_File_Name
,
891 Partition_Elaboration_Policy
=> ' ',
892 Queuing_Policy
=> ' ',
893 Restrictions
=> No_Restrictions
,
894 SAL_Interface
=> False,
897 Task_Dispatching_Policy
=> ' ',
898 Time_Slice_Value
=> -1,
900 Unit_Exception_Table
=> False,
901 Ver
=> (others => ' '),
903 Zero_Cost_Exceptions
=> False);
905 -- Now we acquire the input lines from the ALI file. Note that the
906 -- convention in the following code is that as we enter each section,
907 -- C is set to contain the first character of the following line.
912 -- Acquire library version
916 -- The V line missing really indicates trouble, most likely it
917 -- means we don't have an ALI file at all, so here we give a
918 -- fatal error even if we are in Ignore_Errors mode.
922 elsif Ignore
('V') then
930 for J
in 1 .. Ver_Len_Max
loop
933 ALIs
.Table
(Id
).Ver
(J
) := C
;
934 ALIs
.Table
(Id
).Ver_Len
:= J
;
943 -- Acquire main program line if present
956 ALIs
.Table
(Id
).Main_Program
:= Func
;
958 ALIs
.Table
(Id
).Main_Program
:= Proc
;
968 ALIs
.Table
(Id
).Main_Priority
:= Get_Nat
;
976 ALIs
.Table
(Id
).Time_Slice_Value
:= Get_Nat
;
984 ALIs
.Table
(Id
).Main_CPU
:= Get_Nat
;
991 ALIs
.Table
(Id
).WC_Encoding
:= Getc
;
1000 -- Acquire argument lines
1002 First_Arg
:= Args
.Last
+ 1;
1006 exit A_Loop
when C
/= 'A';
1008 if Ignore
('A') then
1014 -- Scan out argument
1017 while not At_Eol
loop
1018 Add_Char_To_Name_Buffer
(Getc
);
1021 -- If -fstack-check, record that it occurred. Note that an
1022 -- additional string parameter can be specified, in the form of
1023 -- -fstack-check={no|generic|specific}. "no" means no checking,
1024 -- "generic" means force the use of old-style checking, and
1025 -- "specific" means use the best checking method.
1028 and then Name_Buffer
(1 .. 13) = "-fstack-check"
1029 and then Name_Buffer
(1 .. Name_Len
) /= "-fstack-check=no"
1031 Stack_Check_Switch_Set
:= True;
1034 -- Store the argument
1036 Args
.Increment_Last
;
1037 Args
.Table
(Args
.Last
) := new String'(Name_Buffer (1 .. Name_Len));
1050 if Ignore_Errors then
1062 if Ignore ('P
') then
1070 while not At_Eol loop
1075 -- Processing for CE
1079 ALIs.Table (Id).Compile_Errors := True;
1081 -- Processing for DB
1085 Detect_Blocking := True;
1087 -- Processing for Ex
1090 Partition_Elaboration_Policy_Specified := Getc;
1091 ALIs.Table (Id).Partition_Elaboration_Policy :=
1092 Partition_Elaboration_Policy_Specified;
1094 -- Processing for GP
1098 GNATprove_Mode_Specified := True;
1099 ALIs.Table (Id).GNATprove_Mode := True;
1101 -- Processing for Lx
1104 Locking_Policy_Specified := Getc;
1105 ALIs.Table (Id).Locking_Policy := Locking_Policy_Specified;
1107 -- Processing for flags starting with N
1112 -- Processing for NO
1115 ALIs.Table (Id).No_Object := True;
1116 No_Object_Specified := True;
1118 -- Processing for NR
1121 No_Run_Time_Mode := True;
1122 Configurable_Run_Time_Mode := True;
1124 -- Processing for NS
1127 ALIs.Table (Id).Normalize_Scalars := True;
1128 Normalize_Scalars_Specified := True;
1131 -- Invalid switch starting with N
1137 -- Processing for OH/OL
1142 if C = 'L
' or else C = 'H
' then
1143 ALIs.Table (Id).SSO_Default := C;
1144 SSO_Default_Specified := True;
1150 -- Processing for Qx
1153 Queuing_Policy_Specified := Getc;
1154 ALIs.Table (Id).Queuing_Policy := Queuing_Policy_Specified;
1156 -- Processing for flags starting with S
1161 -- Processing for SL
1164 ALIs.Table (Id).SAL_Interface := True;
1166 -- Processing for SS
1169 Opt.Sec_Stack_Used := True;
1171 -- Invalid switch starting with S
1177 -- Processing for Tx
1180 Task_Dispatching_Policy_Specified := Getc;
1181 ALIs.Table (Id).Task_Dispatching_Policy :=
1182 Task_Dispatching_Policy_Specified;
1184 -- Processing for switch starting with U
1189 -- Processing for UA
1192 Unreserve_All_Interrupts_Specified := True;
1194 -- Processing for UX
1197 ALIs.Table (Id).Unit_Exception_Table := True;
1199 -- Invalid switches starting with U
1205 -- Processing for ZX
1211 ALIs.Table (Id).Zero_Cost_Exceptions := True;
1212 Zero_Cost_Exceptions_Specified := True;
1217 -- Invalid parameter
1225 if not NS_Found then
1226 No_Normalize_Scalars_Specified := True;
1235 -- Loop to skip to first restrictions line
1238 if Ignore_Errors then
1250 -- Ignore all 'R
' lines if that is required
1252 if Ignore ('R
') then
1258 -- Here we process the restrictions lines (other than unit name cases)
1261 Scan_Restrictions : declare
1262 Save_R : constant Restrictions_Info := Cumulative_Restrictions;
1263 -- Save cumulative restrictions in case we have a fatal error
1265 Bad_R_Line : exception;
1266 -- Signal bad restrictions line (raised on unexpected character)
1273 -- Named restriction case
1279 -- Loop through RR and RV lines
1281 while C = 'R
' and then Nextc /= ' ' loop
1285 -- Acquire restriction name
1288 while not At_Eol and then Nextc /= '=' loop
1289 Name_Len := Name_Len + 1;
1290 Name_Buffer (Name_Len) := Getc;
1293 -- Now search list of restrictions to find match
1296 RN : String renames Name_Buffer (1 .. Name_Len);
1299 R := Restriction_Id'First;
1300 while R /= Not_A_Restriction_Id loop
1301 if Restriction_Id'Image (R) = RN then
1305 R := Restriction_Id'Succ (R);
1308 -- We don't recognize the restriction. This might be
1309 -- thought of as an error, and it really is, but we
1310 -- want to allow building with inconsistent versions
1311 -- of the binder and ali files (see comments at the
1312 -- start of package System.Rident), so we just ignore
1315 goto Done_With_Restriction_Line;
1322 -- Boolean restriction case
1324 when All_Boolean_Restrictions =>
1327 ALIs.Table (Id).Restrictions.Violated (R) :=
1329 Cumulative_Restrictions.Violated (R) := True;
1332 ALIs.Table (Id).Restrictions.Set (R) := True;
1333 Cumulative_Restrictions.Set (R) := True;
1339 -- Parameter restriction case
1341 when All_Parameter_Restrictions =>
1342 if At_Eol or else Nextc /= '=' then
1348 N := Natural (Get_Nat);
1355 ALIs.Table (Id).Restrictions.Set (R) := True;
1356 ALIs.Table (Id).Restrictions.Value (R) := N;
1358 if Cumulative_Restrictions.Set (R) then
1359 Cumulative_Restrictions.Value (R) :=
1361 (Cumulative_Restrictions.Value (R), N);
1363 Cumulative_Restrictions.Set (R) := True;
1364 Cumulative_Restrictions.Value (R) := N;
1367 -- Restriction violated
1370 ALIs.Table (Id).Restrictions.Violated (R) :=
1372 Cumulative_Restrictions.Violated (R) := True;
1373 ALIs.Table (Id).Restrictions.Count (R) := N;
1375 -- Checked Max_Parameter case
1377 if R in Checked_Max_Parameter_Restrictions then
1378 Cumulative_Restrictions.Count (R) :=
1380 (Cumulative_Restrictions.Count (R), N);
1382 -- Other checked parameter cases
1386 pragma Unsuppress (Overflow_Check);
1389 Cumulative_Restrictions.Count (R) :=
1390 Cumulative_Restrictions.Count (R) + N;
1393 when Constraint_Error =>
1395 -- A constraint error comes from the
1396 -- addition. We reset to the maximum
1397 -- and indicate that the real value
1400 Cumulative_Restrictions.Value (R) :=
1402 Cumulative_Restrictions.Unknown (R) :=
1411 ALIs.Table (Id).Restrictions.Unknown (R) :=
1413 Cumulative_Restrictions.Unknown (R) := True;
1416 -- Other than 'R
' or 'V
'
1426 -- Bizarre error case NOT_A_RESTRICTION
1428 when Not_A_Restriction_Id =>
1436 <<Done_With_Restriction_Line>>
1441 -- Positional restriction case
1447 -- Acquire information for boolean restrictions
1449 for R in All_Boolean_Restrictions loop
1454 ALIs.Table (Id).Restrictions.Violated (R) := True;
1455 Cumulative_Restrictions.Violated (R) := True;
1458 ALIs.Table (Id).Restrictions.Set (R) := True;
1459 Cumulative_Restrictions.Set (R) := True;
1469 -- Acquire information for parameter restrictions
1471 for RP in All_Parameter_Restrictions loop
1477 ALIs.Table (Id).Restrictions.Set (RP) := True;
1480 N : constant Integer := Integer (Get_Nat);
1482 ALIs.Table (Id).Restrictions.Value (RP) := N;
1484 if Cumulative_Restrictions.Set (RP) then
1485 Cumulative_Restrictions.Value (RP) :=
1487 (Cumulative_Restrictions.Value (RP), N);
1489 Cumulative_Restrictions.Set (RP) := True;
1490 Cumulative_Restrictions.Value (RP) := N;
1498 -- Acquire restrictions violations information
1506 ALIs.Table (Id).Restrictions.Violated (RP) := True;
1507 Cumulative_Restrictions.Violated (RP) := True;
1510 N : constant Integer := Integer (Get_Nat);
1513 ALIs.Table (Id).Restrictions.Count (RP) := N;
1515 if RP in Checked_Max_Parameter_Restrictions then
1516 Cumulative_Restrictions.Count (RP) :=
1518 (Cumulative_Restrictions.Count (RP), N);
1522 pragma Unsuppress (Overflow_Check);
1525 Cumulative_Restrictions.Count (RP) :=
1526 Cumulative_Restrictions.Count (RP) + N;
1529 when Constraint_Error =>
1531 -- A constraint error comes from the add. We
1532 -- reset to the maximum and indicate that the
1533 -- real value is now unknown.
1535 Cumulative_Restrictions.Value (RP) :=
1537 Cumulative_Restrictions.Unknown (RP) := True;
1543 ALIs.Table (Id).Restrictions.Unknown (RP) := True;
1544 Cumulative_Restrictions.Unknown (RP) := True;
1561 -- Here if error during scanning of restrictions line
1566 -- In Ignore_Errors mode, undo any changes to restrictions
1567 -- from this unit, and continue on, skipping remaining R
1568 -- lines for this unit.
1570 if Ignore_Errors then
1571 Cumulative_Restrictions := Save_R;
1572 ALIs.Table (Id).Restrictions := No_Restrictions;
1580 -- In normal mode, this is a fatal error
1585 end Scan_Restrictions;
1588 -- Acquire additional restrictions (No_Dependence) lines if present
1591 if Ignore ('R
') then
1595 No_Deps.Append ((Id, Get_Name));
1602 -- Acquire 'I
' lines if present
1607 if Ignore ('I
') then
1613 I_State : Character;
1622 Interrupt_States.Append (
1623 (Interrupt_Id => Int_Num,
1624 Interrupt_State => I_State,
1625 IS_Pragma_Line => Line_No));
1627 ALIs.Table (Id).Last_Interrupt_State := Interrupt_States.Last;
1635 -- Acquire 'S
' lines if present
1640 if Ignore ('S
') then
1656 First_Prio := Get_Nat;
1657 Last_Prio := Get_Nat;
1660 Specific_Dispatching.Append (
1661 (Dispatching_Policy => Policy,
1662 First_Priority => First_Prio,
1663 Last_Priority => Last_Prio,
1664 PSD_Pragma_Line => Line_No));
1666 ALIs.Table (Id).Last_Specific_Dispatching :=
1667 Specific_Dispatching.Last;
1676 -- Loop to acquire unit entries
1680 exit U_Loop when C /= 'U
';
1682 -- Note: as per spec, we never ignore U lines
1686 Units.Increment_Last;
1688 if ALIs.Table (Id).First_Unit = No_Unit_Id then
1689 ALIs.Table (Id).First_Unit := Units.Last;
1693 UL : Unit_Record renames Units.Table (Units.Last);
1696 UL.Uname := Get_Unit_Name;
1697 UL.Predefined := Is_Predefined_Unit;
1698 UL.Internal := Is_Internal_Unit;
1700 UL.Sfile := Get_File_Name (Lower => True);
1702 UL.Preelab := False;
1703 UL.No_Elab := False;
1704 UL.Shared_Passive := False;
1706 UL.Remote_Types := False;
1707 UL.Has_RACW := False;
1708 UL.Init_Scalars := False;
1709 UL.Is_Generic := False;
1710 UL.Icasing := Mixed_Case;
1711 UL.Kcasing := All_Lower_Case;
1712 UL.Dynamic_Elab := False;
1713 UL.Elaborate_Body := False;
1714 UL.Set_Elab_Entity := False;
1715 UL.Version := "00000000";
1716 UL.First_With := Withs.Last + 1;
1717 UL.First_Arg := First_Arg;
1718 UL.Elab_Position := 0;
1719 UL.SAL_Interface := ALIs.Table (Id).SAL_Interface;
1720 UL.Directly_Scanned := Directly_Scanned;
1721 UL.Body_Needed_For_SAL := False;
1722 UL.Elaborate_Body_Desirable := False;
1723 UL.Optimize_Alignment := 'O
';
1724 UL.Has_Finalizer := False;
1726 if Debug_Flag_U then
1727 Write_Str (" ----> reading unit ");
1728 Write_Int (Int (Units.Last));
1730 Write_Unit_Name (UL.Uname);
1731 Write_Str (" from file ");
1732 Write_Name (UL.Sfile);
1737 -- Check for duplicated unit in different files
1740 Info : constant Int := Get_Name_Table_Info
1741 (Units.Table (Units.Last).Uname);
1744 and then Units.Table (Units.Last).Sfile /=
1745 Units.Table (Unit_Id (Info)).Sfile
1747 -- If Err is set then ignore duplicate unit name. This is the
1748 -- case of a call from gnatmake, where the situation can arise
1749 -- from substitution of source files. In such situations, the
1750 -- processing in gnatmake will always result in any required
1751 -- recompilations in any case, and if we consider this to be
1752 -- an error we get strange cases (for example when a generic
1753 -- instantiation is replaced by a normal package) where we
1754 -- read the old ali file, decide to recompile, and then decide
1755 -- that the old and new ali files are incompatible.
1760 -- If Err is not set, then this is a fatal error. This is
1761 -- the case of being called from the binder, where we must
1762 -- definitely diagnose this as an error.
1766 Write_Str ("error: duplicate unit name: ");
1769 Write_Str ("error: unit """);
1770 Write_Unit_Name (Units.Table (Units.Last).Uname);
1771 Write_Str (""" found in file """);
1772 Write_Name_Decoded (Units.Table (Units.Last).Sfile);
1776 Write_Str ("error
: unit
""");
1777 Write_Unit_Name (Units.Table (Unit_Id (Info)).Uname);
1778 Write_Str (""" found
in file
""");
1779 Write_Name_Decoded (Units.Table (Unit_Id (Info)).Sfile);
1783 Exit_Program (E_Fatal);
1789 (Units.Table (Units.Last).Uname, Int (Units.Last));
1791 -- Scan out possible version and other parameters
1800 if C in '0' .. '9' or else C in 'a
' .. 'f
' then
1801 Units.Table (Units.Last).Version (1) := C;
1803 for J in 2 .. 8 loop
1805 Units.Table (Units.Last).Version (J) := C;
1814 Check_At_End_Of_Field;
1815 Units.Table (Units.Last).Elaborate_Body_Desirable := True;
1818 Check_At_End_Of_Field;
1819 Units.Table (Units.Last).Body_Needed_For_SAL := True;
1825 -- DE parameter (Dynamic elaboration checks)
1831 Check_At_End_Of_Field;
1832 Units.Table (Units.Last).Dynamic_Elab := True;
1833 Dynamic_Elaboration_Checks_Specified := True;
1844 Units.Table (Units.Last).Elaborate_Body := True;
1846 Units.Table (Units.Last).Set_Elab_Entity := True;
1851 Check_At_End_Of_Field;
1853 -- GE parameter (generic)
1859 Check_At_End_Of_Field;
1860 Units.Table (Units.Last).Is_Generic := True;
1865 -- IL/IS/IU parameters
1871 Units.Table (Units.Last).Icasing := All_Lower_Case;
1873 Units.Table (Units.Last).Init_Scalars := True;
1874 Initialize_Scalars_Used := True;
1876 Units.Table (Units.Last).Icasing := All_Upper_Case;
1881 Check_At_End_Of_Field;
1889 Units.Table (Units.Last).Kcasing := Mixed_Case;
1891 Units.Table (Units.Last).Kcasing := All_Upper_Case;
1896 Check_At_End_Of_Field;
1904 Units.Table (Units.Last).No_Elab := True;
1905 Check_At_End_Of_Field;
1910 -- PF/PR/PU/PK parameters
1916 Units.Table (Units.Last).Has_Finalizer := True;
1918 Units.Table (Units.Last).Preelab := True;
1920 Units.Table (Units.Last).Pure := True;
1922 Units.Table (Units.Last).Unit_Kind := 'p
';
1927 Check_At_End_Of_Field;
1929 -- OL/OO/OS/OT parameters
1934 if C = 'L
' or else C = 'O
' or else C = 'S
' or else C = 'T
' then
1935 Units.Table (Units.Last).Optimize_Alignment := C;
1940 Check_At_End_Of_Field;
1948 Units.Table (Units.Last).RCI := True;
1950 Units.Table (Units.Last).Remote_Types := True;
1952 Units.Table (Units.Last).Has_RACW := True;
1957 Check_At_End_Of_Field;
1963 Units.Table (Units.Last).Shared_Passive := True;
1965 Units.Table (Units.Last).Unit_Kind := 's
';
1970 Check_At_End_Of_Field;
1980 -- Check if static elaboration model used
1982 if not Units.Table (Units.Last).Dynamic_Elab
1983 and then not Units.Table (Units.Last).Internal
1985 Static_Elaboration_Model_Used := True;
1990 -- Scan out With lines for this unit
1994 exit With_Loop when C /= 'W
' and then C /= 'Y
' and then C /= 'Z
';
1996 if Ignore ('W
') then
2002 Withs.Increment_Last;
2003 Withs.Table (Withs.Last).Uname := Get_Unit_Name;
2004 Withs.Table (Withs.Last).Elaborate := False;
2005 Withs.Table (Withs.Last).Elaborate_All := False;
2006 Withs.Table (Withs.Last).Elab_Desirable := False;
2007 Withs.Table (Withs.Last).Elab_All_Desirable := False;
2008 Withs.Table (Withs.Last).SAL_Interface := False;
2009 Withs.Table (Withs.Last).Limited_With := (C = 'Y
');
2010 Withs.Table (Withs.Last).Implicit_With_From_Instantiation
2013 -- Generic case with no object file available
2016 Withs.Table (Withs.Last).Sfile := No_File;
2017 Withs.Table (Withs.Last).Afile := No_File;
2022 Withs.Table (Withs.Last).Sfile := Get_File_Name
2024 Withs.Table (Withs.Last).Afile := Get_File_Name
2027 -- Scan out possible E, EA, ED, and AD parameters
2029 while not At_Eol loop
2035 Check_At_End_Of_Field;
2037 -- Store AD indication unless ignore required
2039 if not Ignore_ED then
2040 Withs.Table (Withs.Last).Elab_All_Desirable :=
2044 elsif Nextc = 'E
' then
2047 if At_End_Of_Field then
2048 Withs.Table (Withs.Last).Elaborate := True;
2050 elsif Nextc = 'A
' then
2052 Check_At_End_Of_Field;
2053 Withs.Table (Withs.Last).Elaborate_All := True;
2057 Check_At_End_Of_Field;
2059 -- Store ED indication unless ignore required
2061 if not Ignore_ED then
2062 Withs.Table (Withs.Last).Elab_Desirable :=
2079 Units.Table (Units.Last).Last_With := Withs.Last;
2080 Units.Table (Units.Last).Last_Arg := Args.Last;
2082 -- If there are linker options lines present, scan them
2086 Linker_Options_Loop : loop
2088 exit Linker_Options_Loop when C /= 'L
';
2090 if Ignore ('L
') then
2101 if C < Character'Val (16#20#)
2102 or else C > Character'Val (16#7E#)
2107 C := Character'Val (0);
2114 for J in 1 .. 2 loop
2117 if C in '0' .. '9' then
2120 Character'Pos ('0');
2122 elsif C in 'A' .. 'F' then
2125 Character'Pos ('A') +
2134 Add_Char_To_Name_Buffer (Character'Val (V));
2139 exit when Nextc /= '"';
2143 Add_Char_To_Name_Buffer (C);
2147 Add_Char_To_Name_Buffer (NUL);
2152 end loop Linker_Options_Loop;
2154 -- Store the linker options entry if one was found
2156 if Name_Len /= 0 then
2157 Linker_Options.Increment_Last;
2159 Linker_Options.Table (Linker_Options.Last).Name :=
2162 Linker_Options.Table (Linker_Options.Last).Unit :=
2165 Linker_Options.Table (Linker_Options.Last).Internal_File :=
2166 Is_Internal_File_Name (F);
2168 Linker_Options.Table (Linker_Options.Last).Original_Pos :=
2169 Linker_Options.Last;
2172 -- If there are notes present, scan them
2176 exit Notes_Loop when C /= 'N';
2178 if Ignore ('N') then
2184 Notes.Increment_Last;
2185 Notes.Table (Notes.Last).Pragma_Type := Getc;
2186 Notes.Table (Notes.Last).Pragma_Line := Get_Nat;
2188 Notes.Table (Notes.Last).Pragma_Col := Get_Nat;
2190 if not At_Eol and then Nextc = ':' then
2192 Notes.Table (Notes.Last).Pragma_Source_File :=
2193 Get_File_Name (Lower => True);
2195 Notes.Table (Notes.Last).Pragma_Source_File :=
2196 Units.Table (Units.Last).Sfile;
2200 Notes.Table (Notes.Last).Pragma_Args := No_Name;
2203 -- Note: can't use Get_Name here as the remainder of the
2204 -- line is unstructured text whose syntax depends on the
2205 -- particular pragma used.
2210 while not At_Eol loop
2211 Add_Char_To_Name_Buffer (Getc);
2219 end loop Notes_Loop;
2222 -- End loop through units for one ALI file
2224 ALIs.Table (Id).Last_Unit := Units.Last;
2225 ALIs.Table (Id).Sfile := Units.Table (ALIs.Table (Id).First_Unit).Sfile;
2227 -- Set types of the units (there can be at most 2 of them)
2229 if ALIs.Table (Id).First_Unit /= ALIs.Table (Id).Last_Unit then
2230 Units.Table (ALIs.Table (Id).First_Unit).Utype := Is_Body;
2231 Units.Table (ALIs.Table (Id).Last_Unit).Utype := Is_Spec;
2234 -- Deal with body only and spec only cases, note that the reason we
2235 -- do our own checking of the name (rather than using Is_Body_Name)
2236 -- is that Uname drags in far too much compiler junk.
2238 Get_Name_String (Units.Table (Units.Last).Uname);
2240 if Name_Buffer (Name_Len) = 'b' then
2241 Units.Table (Units.Last).Utype := Is_Body_Only;
2243 Units.Table (Units.Last).Utype := Is_Spec_Only;
2247 -- Scan out external version references and put in hash table
2251 exit E_Loop when C /= 'E';
2253 if Ignore ('E') then
2269 exit when At_End_Of_Field;
2270 Add_Char_To_Name_Buffer (C);
2273 Version_Ref.Set (new String'(Name_Buffer (1 .. Name_Len)), True);
2280 -- Scan out source dependency lines for this ALI file
2282 ALIs.Table (Id).First_Sdep := Sdep.Last + 1;
2286 exit D_Loop when C /= 'D';
2288 if Ignore ('D') then
2294 Sdep.Increment_Last;
2296 -- In the following call, Lower is not set to True, this is either
2297 -- a bug, or it deserves a special comment as to why this is so???
2299 -- The file/path name may be quoted
2301 Sdep.Table (Sdep.Last).Sfile :=
2302 Get_File_Name (May_Be_Quoted => True);
2304 Sdep.Table (Sdep.Last).Stamp := Get_Stamp;
2305 Sdep.Table (Sdep.Last).Dummy_Entry :=
2306 (Sdep.Table (Sdep.Last).Stamp = Dummy_Time_Stamp);
2308 -- Acquire checksum value
2321 exit when At_Eol or else Ctr = 8;
2323 if Nextc in '0' .. '9' then
2325 Character'Pos (Nextc) - Character'Pos ('0');
2327 elsif Nextc in 'a' .. 'f' then
2329 Character'Pos (Nextc) - Character'Pos ('a') + 10;
2339 if Ctr = 8 and then At_End_Of_Field then
2340 Sdep.Table (Sdep.Last).Checksum := Chk;
2346 -- Acquire (sub)unit and reference file name entries
2348 Sdep.Table (Sdep.Last).Subunit_Name := No_Name;
2349 Sdep.Table (Sdep.Last).Unit_Name := No_Name;
2350 Sdep.Table (Sdep.Last).Rfile :=
2351 Sdep.Table (Sdep.Last).Sfile;
2352 Sdep.Table (Sdep.Last).Start_Line := 1;
2357 -- Here for (sub)unit name
2359 if Nextc not in '0' .. '9' then
2361 while not At_End_Of_Field loop
2362 Add_Char_To_Name_Buffer (Getc);
2365 -- Set the (sub)unit name. Note that we use Name_Find rather
2366 -- than Name_Enter here as the subunit name may already
2367 -- have been put in the name table by the Project Manager.
2370 or else Name_Buffer (Name_Len - 1) /= '%'
2372 Sdep.Table (Sdep.Last).Subunit_Name := Name_Find;
2374 Name_Len := Name_Len - 2;
2375 Sdep.Table (Sdep.Last).Unit_Name := Name_Find;
2381 -- Here for reference file name entry
2383 if Nextc in '0' .. '9' then
2384 Sdep.Table (Sdep.Last).Start_Line := Get_Nat;
2389 while not At_End_Of_Field loop
2390 Add_Char_To_Name_Buffer (Getc);
2393 Sdep.Table (Sdep.Last).Rfile := Name_Enter;
2403 ALIs.Table (Id).Last_Sdep := Sdep.Last;
2405 -- We must at this stage be at an Xref line or the end of file
2417 -- If we are ignoring Xref sections we are done (we ignore all
2418 -- remaining lines since only xref related lines follow X).
2420 if Ignore ('X') and then not Debug_Flag_X then
2424 -- Loop through Xref sections
2428 exit X_Loop when C /= 'X';
2430 -- Make new entry in section table
2432 Xref_Section.Increment_Last;
2434 Read_Refs_For_One_File : declare
2435 XS : Xref_Section_Record renames
2436 Xref_Section.Table (Xref_Section.Last);
2438 Current_File_Num : Sdep_Id;
2439 -- Keeps track of the current file number (changed by nn|)
2442 XS.File_Num := Sdep_Id (Get_Nat + Nat (First_Sdep_Entry) - 1);
2443 XS.File_Name := Get_File_Name;
2444 XS.First_Entity := Xref_Entity.Last + 1;
2446 Current_File_Num := XS.File_Num;
2453 -- Loop through Xref entities
2455 while C /= 'X' and then C /= EOF loop
2456 Xref_Entity.Increment_Last;
2458 Read_Refs_For_One_Entity : declare
2459 XE : Xref_Entity_Record renames
2460 Xref_Entity.Table (Xref_Entity.Last);
2463 procedure Read_Instantiation_Reference;
2464 -- Acquire instantiation reference. Caller has checked
2465 -- that current character is '[' and on return the cursor
2466 -- is skipped past the corresponding closing ']'.
2468 ----------------------------------
2469 -- Read_Instantiation_Reference --
2470 ----------------------------------
2472 procedure Read_Instantiation_Reference is
2473 Local_File_Num : Sdep_Id := Current_File_Num;
2476 Xref.Increment_Last;
2479 XR : Xref_Record renames Xref.Table (Xref.Last);
2482 P := P + 1; -- skip [
2487 Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
2488 Local_File_Num := XR.File_Num;
2493 XR.File_Num := Local_File_Num;
2500 -- Recursive call for next reference
2503 pragma Warnings (Off); -- kill recursion warning
2504 Read_Instantiation_Reference;
2505 pragma Warnings (On);
2508 -- Skip closing bracket after recursive call
2512 end Read_Instantiation_Reference;
2514 -- Start of processing for Read_Refs_For_One_Entity
2523 XE.Visibility := Global;
2525 XE.Visibility := Static;
2527 XE.Visibility := Other;
2530 XE.Entity := Get_Name;
2532 -- Handle the information about generic instantiations
2535 Skipc; -- Opening '['
2538 if Nextc /= '|' then
2539 XE.Iref_File_Num := Current_File_Num;
2543 Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
2545 XE.Iref_Line := Get_Nat;
2553 XE.Iref_File_Num := No_Sdep_Id;
2557 Current_File_Num := XS.File_Num;
2559 -- Renaming reference is present
2563 XE.Rref_Line := Get_Nat;
2569 XE.Rref_Col := Get_Nat;
2571 -- No renaming reference present
2580 XE.Oref_File_Num := No_Sdep_Id;
2581 XE.Tref_File_Num := No_Sdep_Id;
2582 XE.Tref := Tref_None;
2583 XE.First_Xref := Xref.Last + 1;
2585 -- Loop to check for additional info present
2598 (Current_File_Num, Ref, File, Line, Typ, Col, Std);
2599 exit when Ref = Tref_None;
2601 -- Do we have an overriding procedure?
2603 if Ref = Tref_Derived and then Typ = 'p' then
2604 XE.Oref_File_Num := File;
2605 XE.Oref_Line := Line;
2608 -- Arrays never override anything, and <> points to
2609 -- the index types instead
2611 elsif Ref = Tref_Derived and then XE.Etype = 'A' then
2613 -- Index types are stored in the list of references
2615 Xref.Increment_Last;
2618 XR : Xref_Record renames Xref.Table (Xref.Last);
2620 XR.File_Num := File;
2622 XR.Rtype := Array_Index_Reference;
2627 -- Interfaces are stored in the list of references,
2628 -- although the parent type itself is stored in XE.
2629 -- The first interface (when there are only
2630 -- interfaces) is stored in XE.Tref*)
2632 elsif Ref = Tref_Derived
2634 and then XE.Tref_File_Num /= No_Sdep_Id
2636 Xref.Increment_Last;
2639 XR : Xref_Record renames Xref.Table (Xref.Last);
2641 XR.File_Num := File;
2643 XR.Rtype := Interface_Reference;
2650 XE.Tref_File_Num := File;
2651 XE.Tref_Line := Line;
2652 XE.Tref_Type := Typ;
2654 XE.Tref_Standard_Entity := Std;
2659 -- Loop through cross-references for this entity
2666 exit when Nextc /= '.';
2670 Xref.Increment_Last;
2673 XR : Xref_Record renames Xref.Table (Xref.Last);
2680 Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
2681 Current_File_Num := XR.File_Num;
2685 XR.File_Num := Current_File_Num;
2691 -- Imported entities reference as in:
2692 -- 494b<c,__gnat_copy_attribs>25
2696 XR.Imported_Lang := Get_Name;
2698 pragma Assert (Nextc = ',');
2701 XR.Imported_Name := Get_Name;
2703 pragma Assert (Nextc = '>');
2707 XR.Imported_Lang := No_Name;
2708 XR.Imported_Name := No_Name;
2714 Read_Instantiation_Reference;
2719 -- Record last cross-reference
2721 XE.Last_Xref := Xref.Last;
2725 when Bad_ALI_Format =>
2727 -- If ignoring errors, then we skip a line with an
2728 -- unexpected error, and try to continue subsequent
2731 if Ignore_Errors then
2732 Xref_Entity.Decrement_Last;
2736 -- Otherwise, we reraise the fatal exception
2741 end Read_Refs_For_One_Entity;
2744 -- Record last entity
2746 XS.Last_Entity := Xref_Entity.Last;
2748 end Read_Refs_For_One_File;
2753 -- Here after dealing with xref sections
2755 -- Ignore remaining lines, which belong to an additional section of the
2756 -- ALI file not considered here (like SCO or SPARK information).
2763 when Bad_ALI_Format =>
2771 function SEq (F1, F2 : String_Ptr) return Boolean is
2773 return F1.all = F2.all;
2780 function SHash (S : String_Ptr) return Vindex is
2785 for J in S.all'Range loop
2786 H := H * 2 + Character'Pos (S (J));
2789 return Vindex (Vindex'First + Vindex (H mod Vindex'Range_Length));