annotate gcc/ada/ali.adb @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ------------------------------------------------------------------------------
kono
parents:
diff changeset
2 -- --
kono
parents:
diff changeset
3 -- GNAT COMPILER COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- A L I --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- B o d y --
kono
parents:
diff changeset
8 -- --
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
9 -- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
111
kono
parents:
diff changeset
10 -- --
kono
parents:
diff changeset
11 -- GNAT is free software; you can redistribute it and/or modify it under --
kono
parents:
diff changeset
12 -- terms of the GNU General Public License as published by the Free Soft- --
kono
parents:
diff changeset
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
kono
parents:
diff changeset
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
kono
parents:
diff changeset
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
kono
parents:
diff changeset
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
kono
parents:
diff changeset
17 -- for more details. You should have received a copy of the GNU General --
kono
parents:
diff changeset
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
kono
parents:
diff changeset
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
kono
parents:
diff changeset
20 -- --
kono
parents:
diff changeset
21 -- GNAT was originally developed by the GNAT team at New York University. --
kono
parents:
diff changeset
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
kono
parents:
diff changeset
23 -- --
kono
parents:
diff changeset
24 ------------------------------------------------------------------------------
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 with Butil; use Butil;
kono
parents:
diff changeset
27 with Debug; use Debug;
kono
parents:
diff changeset
28 with Fname; use Fname;
kono
parents:
diff changeset
29 with Opt; use Opt;
kono
parents:
diff changeset
30 with Osint; use Osint;
kono
parents:
diff changeset
31 with Output; use Output;
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
32 with Snames; use Snames;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
33
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
34 with GNAT; use GNAT;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
35 with GNAT.Dynamic_HTables; use GNAT.Dynamic_HTables;
111
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 package body ALI is
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 use ASCII;
kono
parents:
diff changeset
40 -- Make control characters visible
kono
parents:
diff changeset
41
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
42 -----------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
43 -- Types --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
44 -----------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
45
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
46 -- The following type represents an invocation construct
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
47
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
48 type Invocation_Construct_Record is record
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
49 Body_Placement : Declaration_Placement_Kind := No_Declaration_Placement;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
50 -- The location of the invocation construct's body with respect to the
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
51 -- unit where it is declared.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
52
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
53 Kind : Invocation_Construct_Kind := Regular_Construct;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
54 -- The nature of the invocation construct
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
55
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
56 Signature : Invocation_Signature_Id := No_Invocation_Signature;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
57 -- The invocation signature that uniquely identifies the invocation
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
58 -- construct in the ALI space.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
59
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
60 Spec_Placement : Declaration_Placement_Kind := No_Declaration_Placement;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
61 -- The location of the invocation construct's spec with respect to the
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
62 -- unit where it is declared.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
63 end record;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
64
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
65 -- The following type represents an invocation relation. It associates an
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
66 -- invoker that activates/calls/instantiates with a target.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
67
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
68 type Invocation_Relation_Record is record
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
69 Extra : Name_Id := No_Name;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
70 -- The name of an additional entity used in error diagnostics
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
71
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
72 Invoker : Invocation_Signature_Id := No_Invocation_Signature;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
73 -- The invocation signature that uniquely identifies the invoker within
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
74 -- the ALI space.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
75
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
76 Kind : Invocation_Kind := No_Invocation;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
77 -- The nature of the invocation
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
78
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
79 Target : Invocation_Signature_Id := No_Invocation_Signature;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
80 -- The invocation signature that uniquely identifies the target within
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
81 -- the ALI space.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
82 end record;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
83
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
84 -- The following type represents an invocation signature. Its purpose is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
85 -- to uniquely identify an invocation construct within the ALI space. The
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
86 -- signature comprises several pieces, some of which are used in error
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
87 -- diagnostics by the binder. Identification issues are resolved as
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
88 -- follows:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
89 --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
90 -- * The Column, Line, and Locations attributes together differentiate
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
91 -- between homonyms. In most cases, the Column and Line are sufficient
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
92 -- except when generic instantiations are involved. Together, the three
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
93 -- attributes offer a sequence of column-line pairs that eventually
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
94 -- reflect the location within the generic template.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
95 --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
96 -- * The Name attribute differentiates between invocation constructs at
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
97 -- the scope level. Since it is illegal for two entities with the same
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
98 -- name to coexist in the same scope, the Name attribute is sufficient
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
99 -- to distinguish them. Overloaded entities are already handled by the
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
100 -- Column, Line, and Locations attributes.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
101 --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
102 -- * The Scope attribute differentiates between invocation constructs at
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
103 -- various levels of nesting.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
104
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
105 type Invocation_Signature_Record is record
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
106 Column : Nat := 0;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
107 -- The column number where the invocation construct is declared
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
108
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
109 Line : Nat := 0;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
110 -- The line number where the invocation construct is declared
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
111
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
112 Locations : Name_Id := No_Name;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
113 -- Sequence of column and line numbers within nested instantiations
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
114
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
115 Name : Name_Id := No_Name;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
116 -- The name of the invocation construct
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
117
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
118 Scope : Name_Id := No_Name;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
119 -- The qualified name of the scope where the invocation construct is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
120 -- declared.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
121 end record;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
122
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
123 ---------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
124 -- Data structures --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
125 ---------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
126
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
127 package Invocation_Constructs is new Table.Table
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
128 (Table_Index_Type => Invocation_Construct_Id,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
129 Table_Component_Type => Invocation_Construct_Record,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
130 Table_Low_Bound => First_Invocation_Construct,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
131 Table_Initial => 2500,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
132 Table_Increment => 200,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
133 Table_Name => "Invocation_Constructs");
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
134
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
135 package Invocation_Relations is new Table.Table
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
136 (Table_Index_Type => Invocation_Relation_Id,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
137 Table_Component_Type => Invocation_Relation_Record,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
138 Table_Low_Bound => First_Invocation_Relation,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
139 Table_Initial => 2500,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
140 Table_Increment => 200,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
141 Table_Name => "Invocation_Relation");
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
142
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
143 package Invocation_Signatures is new Table.Table
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
144 (Table_Index_Type => Invocation_Signature_Id,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
145 Table_Component_Type => Invocation_Signature_Record,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
146 Table_Low_Bound => First_Invocation_Signature,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
147 Table_Initial => 2500,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
148 Table_Increment => 200,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
149 Table_Name => "Invocation_Signatures");
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
150
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
151 procedure Destroy (IS_Id : in out Invocation_Signature_Id);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
152 -- Destroy an invocation signature with id IS_Id
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
153
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
154 function Hash
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
155 (IS_Rec : Invocation_Signature_Record) return Bucket_Range_Type;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
156 -- Obtain the hash of key IS_Rec
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
157
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
158 package Sig_Map is new Dynamic_Hash_Tables
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
159 (Key_Type => Invocation_Signature_Record,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
160 Value_Type => Invocation_Signature_Id,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
161 No_Value => No_Invocation_Signature,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
162 Expansion_Threshold => 1.5,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
163 Expansion_Factor => 2,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
164 Compression_Threshold => 0.3,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
165 Compression_Factor => 2,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
166 "=" => "=",
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
167 Destroy_Value => Destroy,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
168 Hash => Hash);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
169
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
170 -- The following map relates invocation signature records to invocation
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
171 -- signature ids.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
172
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
173 Sig_To_Sig_Map : constant Sig_Map.Dynamic_Hash_Table :=
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
174 Sig_Map.Create (500);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
175
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
176 -- The folowing table maps declaration placement kinds to character codes
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
177 -- for invocation construct encoding in ALI files.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
178
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
179 Declaration_Placement_Codes :
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
180 constant array (Declaration_Placement_Kind) of Character :=
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
181 (In_Body => 'b',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
182 In_Spec => 's',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
183 No_Declaration_Placement => 'Z');
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
184
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
185 Compile_Time_Invocation_Graph_Encoding : Invocation_Graph_Encoding_Kind :=
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
186 No_Encoding;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
187 -- The invocation-graph encoding format as specified at compile time. Do
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
188 -- not manipulate this value directly.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
189
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
190 -- The following table maps invocation kinds to character codes for
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
191 -- invocation relation encoding in ALI files.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
192
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
193 Invocation_Codes :
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
194 constant array (Invocation_Kind) of Character :=
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
195 (Accept_Alternative => 'a',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
196 Access_Taken => 'b',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
197 Call => 'c',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
198 Controlled_Adjustment => 'd',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
199 Controlled_Finalization => 'e',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
200 Controlled_Initialization => 'f',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
201 Default_Initial_Condition_Verification => 'g',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
202 Initial_Condition_Verification => 'h',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
203 Instantiation => 'i',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
204 Internal_Controlled_Adjustment => 'j',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
205 Internal_Controlled_Finalization => 'k',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
206 Internal_Controlled_Initialization => 'l',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
207 Invariant_Verification => 'm',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
208 Postcondition_Verification => 'n',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
209 Protected_Entry_Call => 'o',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
210 Protected_Subprogram_Call => 'p',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
211 Task_Activation => 'q',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
212 Task_Entry_Call => 'r',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
213 Type_Initialization => 's',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
214 No_Invocation => 'Z');
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
215
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
216 -- The following table maps invocation construct kinds to character codes
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
217 -- for invocation construct encoding in ALI files.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
218
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
219 Invocation_Construct_Codes :
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
220 constant array (Invocation_Construct_Kind) of Character :=
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
221 (Elaborate_Body_Procedure => 'b',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
222 Elaborate_Spec_Procedure => 's',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
223 Regular_Construct => 'Z');
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
224
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
225 -- The following table maps invocation-graph encoding kinds to character
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
226 -- codes for invocation-graph encoding in ALI files.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
227
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
228 Invocation_Graph_Encoding_Codes :
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
229 constant array (Invocation_Graph_Encoding_Kind) of Character :=
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
230 (Full_Path_Encoding => 'f',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
231 Endpoints_Encoding => 'e',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
232 No_Encoding => 'Z');
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
233
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
234 -- The following table maps invocation-graph line kinds to character codes
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
235 -- used in ALI files.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
236
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
237 Invocation_Graph_Line_Codes :
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
238 constant array (Invocation_Graph_Line_Kind) of Character :=
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
239 (Invocation_Construct_Line => 'c',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
240 Invocation_Graph_Attributes_Line => 'a',
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
241 Invocation_Relation_Line => 'r');
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
242
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
243 -- The following variable records which characters currently are used as
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
244 -- line type markers in the ALI file. This is used in Scan_ALI to detect
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
245 -- (or skip) invalid lines. The following letters are still available:
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
246 --
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
247 -- B F H J K O Q Z
111
kono
parents:
diff changeset
248
kono
parents:
diff changeset
249 Known_ALI_Lines : constant array (Character range 'A' .. 'Z') of Boolean :=
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
250 ('A' => True, -- argument
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
251 'C' => True, -- SCO information
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
252 'D' => True, -- dependency
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
253 'E' => True, -- external
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
254 'G' => True, -- invocation graph
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
255 'I' => True, -- interrupt
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
256 'L' => True, -- linker option
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
257 'M' => True, -- main program
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
258 'N' => True, -- notes
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
259 'P' => True, -- program
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
260 'R' => True, -- restriction
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
261 'S' => True, -- specific dispatching
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
262 'T' => True, -- task stack information
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
263 'U' => True, -- unit
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
264 'V' => True, -- version
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
265 'W' => True, -- with
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
266 'X' => True, -- xref
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
267 'Y' => True, -- limited_with
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
268 'Z' => True, -- implicit with from instantiation
111
kono
parents:
diff changeset
269 others => False);
kono
parents:
diff changeset
270
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
271 ------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
272 -- Add_Invocation_Construct --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
273 ------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
274
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
275 procedure Add_Invocation_Construct
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
276 (Body_Placement : Declaration_Placement_Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
277 Kind : Invocation_Construct_Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
278 Signature : Invocation_Signature_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
279 Spec_Placement : Declaration_Placement_Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
280 Update_Units : Boolean := True)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
281 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
282 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
283 pragma Assert (Present (Signature));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
284
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
285 -- Create a invocation construct from the scanned attributes
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
286
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
287 Invocation_Constructs.Append
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
288 ((Body_Placement => Body_Placement,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
289 Kind => Kind,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
290 Signature => Signature,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
291 Spec_Placement => Spec_Placement));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
292
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
293 -- Update the invocation construct counter of the current unit only when
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
294 -- requested by the caller.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
295
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
296 if Update_Units then
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
297 declare
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
298 Curr_Unit : Unit_Record renames Units.Table (Units.Last);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
299
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
300 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
301 Curr_Unit.Last_Invocation_Construct := Invocation_Constructs.Last;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
302 end;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
303 end if;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
304 end Add_Invocation_Construct;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
305
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
306 -----------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
307 -- Add_Invocation_Relation --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
308 -----------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
309
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
310 procedure Add_Invocation_Relation
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
311 (Extra : Name_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
312 Invoker : Invocation_Signature_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
313 Kind : Invocation_Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
314 Target : Invocation_Signature_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
315 Update_Units : Boolean := True)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
316 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
317 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
318 pragma Assert (Present (Invoker));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
319 pragma Assert (Kind /= No_Invocation);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
320 pragma Assert (Present (Target));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
321
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
322 -- Create an invocation relation from the scanned attributes
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
323
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
324 Invocation_Relations.Append
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
325 ((Extra => Extra,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
326 Invoker => Invoker,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
327 Kind => Kind,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
328 Target => Target));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
329
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
330 -- Update the invocation relation counter of the current unit only when
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
331 -- requested by the caller.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
332
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
333 if Update_Units then
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
334 declare
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
335 Curr_Unit : Unit_Record renames Units.Table (Units.Last);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
336
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
337 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
338 Curr_Unit.Last_Invocation_Relation := Invocation_Relations.Last;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
339 end;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
340 end if;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
341 end Add_Invocation_Relation;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
342
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
343 --------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
344 -- Body_Placement --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
345 --------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
346
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
347 function Body_Placement
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
348 (IC_Id : Invocation_Construct_Id) return Declaration_Placement_Kind
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
349 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
350 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
351 pragma Assert (Present (IC_Id));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
352 return Invocation_Constructs.Table (IC_Id).Body_Placement;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
353 end Body_Placement;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
354
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
355 ----------------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
356 -- Code_To_Declaration_Placement_Kind --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
357 ----------------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
358
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
359 function Code_To_Declaration_Placement_Kind
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
360 (Code : Character) return Declaration_Placement_Kind
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
361 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
362 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
363 -- Determine which placement kind corresponds to the character code by
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
364 -- traversing the contents of the mapping table.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
365
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
366 for Kind in Declaration_Placement_Kind loop
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
367 if Declaration_Placement_Codes (Kind) = Code then
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
368 return Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
369 end if;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
370 end loop;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
371
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
372 raise Program_Error;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
373 end Code_To_Declaration_Placement_Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
374
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
375 ---------------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
376 -- Code_To_Invocation_Construct_Kind --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
377 ---------------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
378
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
379 function Code_To_Invocation_Construct_Kind
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
380 (Code : Character) return Invocation_Construct_Kind
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
381 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
382 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
383 -- Determine which invocation construct kind matches the character code
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
384 -- by traversing the contents of the mapping table.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
385
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
386 for Kind in Invocation_Construct_Kind loop
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
387 if Invocation_Construct_Codes (Kind) = Code then
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
388 return Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
389 end if;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
390 end loop;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
391
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
392 raise Program_Error;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
393 end Code_To_Invocation_Construct_Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
394
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
395 --------------------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
396 -- Code_To_Invocation_Graph_Encoding_Kind --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
397 --------------------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
398
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
399 function Code_To_Invocation_Graph_Encoding_Kind
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
400 (Code : Character) return Invocation_Graph_Encoding_Kind
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
401 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
402 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
403 -- Determine which invocation-graph encoding kind matches the character
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
404 -- code by traversing the contents of the mapping table.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
405
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
406 for Kind in Invocation_Graph_Encoding_Kind loop
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
407 if Invocation_Graph_Encoding_Codes (Kind) = Code then
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
408 return Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
409 end if;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
410 end loop;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
411
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
412 raise Program_Error;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
413 end Code_To_Invocation_Graph_Encoding_Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
414
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
415 -----------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
416 -- Code_To_Invocation_Kind --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
417 -----------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
418
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
419 function Code_To_Invocation_Kind
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
420 (Code : Character) return Invocation_Kind
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
421 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
422 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
423 -- Determine which invocation kind corresponds to the character code by
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
424 -- traversing the contents of the mapping table.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
425
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
426 for Kind in Invocation_Kind loop
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
427 if Invocation_Codes (Kind) = Code then
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
428 return Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
429 end if;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
430 end loop;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
431
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
432 raise Program_Error;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
433 end Code_To_Invocation_Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
434
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
435 ----------------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
436 -- Code_To_Invocation_Graph_Line_Kind --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
437 ----------------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
438
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
439 function Code_To_Invocation_Graph_Line_Kind
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
440 (Code : Character) return Invocation_Graph_Line_Kind
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
441 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
442 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
443 -- Determine which invocation-graph line kind matches the character
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
444 -- code by traversing the contents of the mapping table.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
445
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
446 for Kind in Invocation_Graph_Line_Kind loop
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
447 if Invocation_Graph_Line_Codes (Kind) = Code then
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
448 return Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
449 end if;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
450 end loop;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
451
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
452 raise Program_Error;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
453 end Code_To_Invocation_Graph_Line_Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
454
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
455 ------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
456 -- Column --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
457 ------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
458
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
459 function Column (IS_Id : Invocation_Signature_Id) return Nat is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
460 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
461 pragma Assert (Present (IS_Id));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
462 return Invocation_Signatures.Table (IS_Id).Column;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
463 end Column;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
464
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
465 ----------------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
466 -- Declaration_Placement_Kind_To_Code --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
467 ----------------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
468
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
469 function Declaration_Placement_Kind_To_Code
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
470 (Kind : Declaration_Placement_Kind) return Character
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
471 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
472 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
473 return Declaration_Placement_Codes (Kind);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
474 end Declaration_Placement_Kind_To_Code;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
475
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
476 -------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
477 -- Destroy --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
478 -------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
479
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
480 procedure Destroy (IS_Id : in out Invocation_Signature_Id) is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
481 pragma Unreferenced (IS_Id);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
482 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
483 null;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
484 end Destroy;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
485
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
486 -----------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
487 -- Extra --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
488 -----------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
489
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
490 function Extra (IR_Id : Invocation_Relation_Id) return Name_Id is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
491 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
492 pragma Assert (Present (IR_Id));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
493 return Invocation_Relations.Table (IR_Id).Extra;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
494 end Extra;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
495
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
496 -----------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
497 -- For_Each_Invocation_Construct --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
498 -----------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
499
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
500 procedure For_Each_Invocation_Construct
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
501 (Processor : Invocation_Construct_Processor_Ptr)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
502 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
503 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
504 pragma Assert (Processor /= null);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
505
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
506 for IC_Id in Invocation_Constructs.First ..
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
507 Invocation_Constructs.Last
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
508 loop
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
509 Processor.all (IC_Id);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
510 end loop;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
511 end For_Each_Invocation_Construct;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
512
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
513 -----------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
514 -- For_Each_Invocation_Construct --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
515 -----------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
516
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
517 procedure For_Each_Invocation_Construct
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
518 (U_Id : Unit_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
519 Processor : Invocation_Construct_Processor_Ptr)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
520 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
521 pragma Assert (Present (U_Id));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
522 pragma Assert (Processor /= null);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
523
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
524 U_Rec : Unit_Record renames Units.Table (U_Id);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
525
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
526 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
527 for IC_Id in U_Rec.First_Invocation_Construct ..
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
528 U_Rec.Last_Invocation_Construct
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
529 loop
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
530 Processor.all (IC_Id);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
531 end loop;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
532 end For_Each_Invocation_Construct;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
533
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
534 ----------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
535 -- For_Each_Invocation_Relation --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
536 ----------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
537
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
538 procedure For_Each_Invocation_Relation
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
539 (Processor : Invocation_Relation_Processor_Ptr)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
540 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
541 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
542 pragma Assert (Processor /= null);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
543
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
544 for IR_Id in Invocation_Relations.First ..
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
545 Invocation_Relations.Last
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
546 loop
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
547 Processor.all (IR_Id);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
548 end loop;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
549 end For_Each_Invocation_Relation;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
550
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
551 ----------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
552 -- For_Each_Invocation_Relation --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
553 ----------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
554
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
555 procedure For_Each_Invocation_Relation
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
556 (U_Id : Unit_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
557 Processor : Invocation_Relation_Processor_Ptr)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
558 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
559 pragma Assert (Present (U_Id));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
560 pragma Assert (Processor /= null);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
561
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
562 U_Rec : Unit_Record renames Units.Table (U_Id);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
563
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
564 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
565 for IR_Id in U_Rec.First_Invocation_Relation ..
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
566 U_Rec.Last_Invocation_Relation
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
567 loop
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
568 Processor.all (IR_Id);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
569 end loop;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
570 end For_Each_Invocation_Relation;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
571
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
572 ----------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
573 -- Hash --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
574 ----------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
575
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
576 function Hash
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
577 (IS_Rec : Invocation_Signature_Record) return Bucket_Range_Type
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
578 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
579 Buffer : Bounded_String (2052);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
580 IS_Nam : Name_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
581
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
582 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
583 -- The hash is obtained in the following manner:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
584 --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
585 -- * A String signature based on the scope, name, line number, column
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
586 -- number, and locations, in the following format:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
587 --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
588 -- scope__name__line_column__locations
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
589 --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
590 -- * The String is converted into a Name_Id
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
591 -- * The Name_Id is used as the hash
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
592
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
593 Append (Buffer, IS_Rec.Scope);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
594 Append (Buffer, "__");
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
595 Append (Buffer, IS_Rec.Name);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
596 Append (Buffer, "__");
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
597 Append (Buffer, IS_Rec.Line);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
598 Append (Buffer, '_');
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
599 Append (Buffer, IS_Rec.Column);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
600
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
601 if IS_Rec.Locations /= No_Name then
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
602 Append (Buffer, "__");
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
603 Append (Buffer, IS_Rec.Locations);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
604 end if;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
605
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
606 IS_Nam := Name_Find (Buffer);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
607 return Bucket_Range_Type (IS_Nam);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
608 end Hash;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
609
111
kono
parents:
diff changeset
610 --------------------
kono
parents:
diff changeset
611 -- Initialize_ALI --
kono
parents:
diff changeset
612 --------------------
kono
parents:
diff changeset
613
kono
parents:
diff changeset
614 procedure Initialize_ALI is
kono
parents:
diff changeset
615 begin
kono
parents:
diff changeset
616 -- When (re)initializing ALI data structures the ALI user expects to
kono
parents:
diff changeset
617 -- get a fresh set of data structures. Thus we first need to erase the
kono
parents:
diff changeset
618 -- marks put in the name table by the previous set of ALI routine calls.
kono
parents:
diff changeset
619 -- These two loops are empty and harmless the first time in.
kono
parents:
diff changeset
620
kono
parents:
diff changeset
621 for J in ALIs.First .. ALIs.Last loop
kono
parents:
diff changeset
622 Set_Name_Table_Int (ALIs.Table (J).Afile, 0);
kono
parents:
diff changeset
623 end loop;
kono
parents:
diff changeset
624
kono
parents:
diff changeset
625 for J in Units.First .. Units.Last loop
kono
parents:
diff changeset
626 Set_Name_Table_Int (Units.Table (J).Uname, 0);
kono
parents:
diff changeset
627 end loop;
kono
parents:
diff changeset
628
kono
parents:
diff changeset
629 -- Free argument table strings
kono
parents:
diff changeset
630
kono
parents:
diff changeset
631 for J in Args.First .. Args.Last loop
kono
parents:
diff changeset
632 Free (Args.Table (J));
kono
parents:
diff changeset
633 end loop;
kono
parents:
diff changeset
634
kono
parents:
diff changeset
635 -- Initialize all tables
kono
parents:
diff changeset
636
kono
parents:
diff changeset
637 ALIs.Init;
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
638 Invocation_Constructs.Init;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
639 Invocation_Relations.Init;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
640 Invocation_Signatures.Init;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
641 Linker_Options.Init;
111
kono
parents:
diff changeset
642 No_Deps.Init;
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
643 Notes.Init;
111
kono
parents:
diff changeset
644 Sdep.Init;
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
645 Units.Init;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
646 Version_Ref.Reset;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
647 Withs.Init;
111
kono
parents:
diff changeset
648 Xref_Entity.Init;
kono
parents:
diff changeset
649 Xref.Init;
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
650 Xref_Section.Init;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
651
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
652 -- Add dummy zeroth item in Linker_Options and Notes for sort calls
111
kono
parents:
diff changeset
653
kono
parents:
diff changeset
654 Linker_Options.Increment_Last;
kono
parents:
diff changeset
655 Notes.Increment_Last;
kono
parents:
diff changeset
656
kono
parents:
diff changeset
657 -- Initialize global variables recording cumulative options in all
kono
parents:
diff changeset
658 -- ALI files that are read for a given processing run in gnatbind.
kono
parents:
diff changeset
659
kono
parents:
diff changeset
660 Dynamic_Elaboration_Checks_Specified := False;
kono
parents:
diff changeset
661 Locking_Policy_Specified := ' ';
kono
parents:
diff changeset
662 No_Normalize_Scalars_Specified := False;
kono
parents:
diff changeset
663 No_Object_Specified := False;
kono
parents:
diff changeset
664 No_Component_Reordering_Specified := False;
kono
parents:
diff changeset
665 GNATprove_Mode_Specified := False;
kono
parents:
diff changeset
666 Normalize_Scalars_Specified := False;
kono
parents:
diff changeset
667 Partition_Elaboration_Policy_Specified := ' ';
kono
parents:
diff changeset
668 Queuing_Policy_Specified := ' ';
kono
parents:
diff changeset
669 SSO_Default_Specified := False;
kono
parents:
diff changeset
670 Task_Dispatching_Policy_Specified := ' ';
kono
parents:
diff changeset
671 Unreserve_All_Interrupts_Specified := False;
kono
parents:
diff changeset
672 Frontend_Exceptions_Specified := False;
kono
parents:
diff changeset
673 Zero_Cost_Exceptions_Specified := False;
kono
parents:
diff changeset
674 end Initialize_ALI;
kono
parents:
diff changeset
675
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
676 ---------------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
677 -- Invocation_Construct_Kind_To_Code --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
678 ---------------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
679
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
680 function Invocation_Construct_Kind_To_Code
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
681 (Kind : Invocation_Construct_Kind) return Character
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
682 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
683 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
684 return Invocation_Construct_Codes (Kind);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
685 end Invocation_Construct_Kind_To_Code;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
686
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
687 -------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
688 -- Invocation_Graph_Encoding --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
689 -------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
690
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
691 function Invocation_Graph_Encoding return Invocation_Graph_Encoding_Kind is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
692 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
693 return Compile_Time_Invocation_Graph_Encoding;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
694 end Invocation_Graph_Encoding;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
695
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
696 --------------------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
697 -- Invocation_Graph_Encoding_Kind_To_Code --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
698 --------------------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
699
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
700 function Invocation_Graph_Encoding_Kind_To_Code
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
701 (Kind : Invocation_Graph_Encoding_Kind) return Character
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
702 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
703 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
704 return Invocation_Graph_Encoding_Codes (Kind);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
705 end Invocation_Graph_Encoding_Kind_To_Code;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
706
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
707 ----------------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
708 -- Invocation_Graph_Line_Kind_To_Code --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
709 ----------------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
710
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
711 function Invocation_Graph_Line_Kind_To_Code
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
712 (Kind : Invocation_Graph_Line_Kind) return Character
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
713 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
714 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
715 return Invocation_Graph_Line_Codes (Kind);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
716 end Invocation_Graph_Line_Kind_To_Code;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
717
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
718 -----------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
719 -- Invocation_Kind_To_Code --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
720 -----------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
721
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
722 function Invocation_Kind_To_Code
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
723 (Kind : Invocation_Kind) return Character
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
724 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
725 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
726 return Invocation_Codes (Kind);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
727 end Invocation_Kind_To_Code;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
728
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
729 -----------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
730 -- Invocation_Signature_Of --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
731 -----------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
732
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
733 function Invocation_Signature_Of
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
734 (Column : Nat;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
735 Line : Nat;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
736 Locations : Name_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
737 Name : Name_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
738 Scope : Name_Id) return Invocation_Signature_Id
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
739 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
740 IS_Rec : constant Invocation_Signature_Record :=
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
741 (Column => Column,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
742 Line => Line,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
743 Locations => Locations,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
744 Name => Name,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
745 Scope => Scope);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
746 IS_Id : Invocation_Signature_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
747
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
748 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
749 IS_Id := Sig_Map.Get (Sig_To_Sig_Map, IS_Rec);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
750
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
751 -- The invocation signature lacks an id. This indicates that it
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
752 -- is encountered for the first time during the construction of
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
753 -- the graph.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
754
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
755 if not Present (IS_Id) then
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
756 Invocation_Signatures.Append (IS_Rec);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
757 IS_Id := Invocation_Signatures.Last;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
758
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
759 -- Map the invocation signature record to its corresponding id
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
760
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
761 Sig_Map.Put (Sig_To_Sig_Map, IS_Rec, IS_Id);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
762 end if;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
763
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
764 return IS_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
765 end Invocation_Signature_Of;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
766
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
767 -------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
768 -- Invoker --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
769 -------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
770
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
771 function Invoker
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
772 (IR_Id : Invocation_Relation_Id) return Invocation_Signature_Id
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
773 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
774 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
775 pragma Assert (Present (IR_Id));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
776 return Invocation_Relations.Table (IR_Id).Invoker;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
777 end Invoker;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
778
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
779 ----------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
780 -- Kind --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
781 ----------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
782
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
783 function Kind
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
784 (IC_Id : Invocation_Construct_Id) return Invocation_Construct_Kind
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
785 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
786 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
787 pragma Assert (Present (IC_Id));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
788 return Invocation_Constructs.Table (IC_Id).Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
789 end Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
790
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
791 ----------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
792 -- Kind --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
793 ----------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
794
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
795 function Kind (IR_Id : Invocation_Relation_Id) return Invocation_Kind is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
796 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
797 pragma Assert (Present (IR_Id));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
798 return Invocation_Relations.Table (IR_Id).Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
799 end Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
800
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
801 ----------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
802 -- Line --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
803 ----------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
804
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
805 function Line (IS_Id : Invocation_Signature_Id) return Nat is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
806 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
807 pragma Assert (Present (IS_Id));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
808 return Invocation_Signatures.Table (IS_Id).Line;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
809 end Line;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
810
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
811 ---------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
812 -- Locations --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
813 ---------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
814
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
815 function Locations (IS_Id : Invocation_Signature_Id) return Name_Id is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
816 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
817 pragma Assert (Present (IS_Id));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
818 return Invocation_Signatures.Table (IS_Id).Locations;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
819 end Locations;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
820
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
821 ----------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
822 -- Name --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
823 ----------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
824
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
825 function Name (IS_Id : Invocation_Signature_Id) return Name_Id is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
826 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
827 pragma Assert (Present (IS_Id));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
828 return Invocation_Signatures.Table (IS_Id).Name;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
829 end Name;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
830
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
831 -------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
832 -- Present --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
833 -------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
834
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
835 function Present (IC_Id : Invocation_Construct_Id) return Boolean is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
836 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
837 return IC_Id /= No_Invocation_Construct;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
838 end Present;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
839
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
840 -------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
841 -- Present --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
842 -------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
843
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
844 function Present (IR_Id : Invocation_Relation_Id) return Boolean is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
845 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
846 return IR_Id /= No_Invocation_Relation;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
847 end Present;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
848
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
849 -------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
850 -- Present --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
851 -------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
852
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
853 function Present (IS_Id : Invocation_Signature_Id) return Boolean is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
854 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
855 return IS_Id /= No_Invocation_Signature;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
856 end Present;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
857
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
858 -------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
859 -- Present --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
860 -------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
861
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
862 function Present (Dep : Sdep_Id) return Boolean is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
863 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
864 return Dep /= No_Sdep_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
865 end Present;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
866
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
867 -------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
868 -- Present --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
869 -------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
870
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
871 function Present (U_Id : Unit_Id) return Boolean is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
872 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
873 return U_Id /= No_Unit_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
874 end Present;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
875
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
876 -------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
877 -- Present --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
878 -------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
879
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
880 function Present (W_Id : With_Id) return Boolean is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
881 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
882 return W_Id /= No_With_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
883 end Present;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
884
111
kono
parents:
diff changeset
885 --------------
kono
parents:
diff changeset
886 -- Scan_ALI --
kono
parents:
diff changeset
887 --------------
kono
parents:
diff changeset
888
kono
parents:
diff changeset
889 function Scan_ALI
kono
parents:
diff changeset
890 (F : File_Name_Type;
kono
parents:
diff changeset
891 T : Text_Buffer_Ptr;
kono
parents:
diff changeset
892 Ignore_ED : Boolean;
kono
parents:
diff changeset
893 Err : Boolean;
kono
parents:
diff changeset
894 Read_Xref : Boolean := False;
kono
parents:
diff changeset
895 Read_Lines : String := "";
kono
parents:
diff changeset
896 Ignore_Lines : String := "X";
kono
parents:
diff changeset
897 Ignore_Errors : Boolean := False;
kono
parents:
diff changeset
898 Directly_Scanned : Boolean := False) return ALI_Id
kono
parents:
diff changeset
899 is
kono
parents:
diff changeset
900 P : Text_Ptr := T'First;
kono
parents:
diff changeset
901 Line : Logical_Line_Number := 1;
kono
parents:
diff changeset
902 Id : ALI_Id;
kono
parents:
diff changeset
903 C : Character;
kono
parents:
diff changeset
904 NS_Found : Boolean;
kono
parents:
diff changeset
905 First_Arg : Arg_Id;
kono
parents:
diff changeset
906
kono
parents:
diff changeset
907 Ignore : array (Character range 'A' .. 'Z') of Boolean;
kono
parents:
diff changeset
908 -- Ignore (X) is set to True if lines starting with X are to
kono
parents:
diff changeset
909 -- be ignored by Scan_ALI and skipped, and False if the lines
kono
parents:
diff changeset
910 -- are to be read and processed.
kono
parents:
diff changeset
911
kono
parents:
diff changeset
912 Bad_ALI_Format : exception;
kono
parents:
diff changeset
913 -- Exception raised by Fatal_Error if Err is True
kono
parents:
diff changeset
914
kono
parents:
diff changeset
915 function At_Eol return Boolean;
kono
parents:
diff changeset
916 -- Test if at end of line
kono
parents:
diff changeset
917
kono
parents:
diff changeset
918 function At_End_Of_Field return Boolean;
kono
parents:
diff changeset
919 -- Test if at end of line, or if at blank or horizontal tab
kono
parents:
diff changeset
920
kono
parents:
diff changeset
921 procedure Check_At_End_Of_Field;
kono
parents:
diff changeset
922 -- Check if we are at end of field, fatal error if not
kono
parents:
diff changeset
923
kono
parents:
diff changeset
924 procedure Checkc (C : Character);
kono
parents:
diff changeset
925 -- Check next character is C. If so bump past it, if not fatal error
kono
parents:
diff changeset
926
kono
parents:
diff changeset
927 procedure Check_Unknown_Line;
kono
parents:
diff changeset
928 -- If Ignore_Errors mode, then checks C to make sure that it is not
kono
parents:
diff changeset
929 -- an unknown ALI line type characters, and if so, skips lines
kono
parents:
diff changeset
930 -- until the first character of the line is one of these characters,
kono
parents:
diff changeset
931 -- at which point it does a Getc to put that character in C. The
kono
parents:
diff changeset
932 -- call has no effect if C is already an appropriate character.
kono
parents:
diff changeset
933 -- If not in Ignore_Errors mode, a fatal error is signalled if the
kono
parents:
diff changeset
934 -- line is unknown. Note that if C is an EOL on entry, the line is
kono
parents:
diff changeset
935 -- skipped (it is assumed that blank lines are never significant).
kono
parents:
diff changeset
936 -- If C is EOF on entry, the call has no effect (it is assumed that
kono
parents:
diff changeset
937 -- the caller will properly handle this case).
kono
parents:
diff changeset
938
kono
parents:
diff changeset
939 procedure Fatal_Error;
kono
parents:
diff changeset
940 -- Generate fatal error message for badly formatted ALI file if
kono
parents:
diff changeset
941 -- Err is false, or raise Bad_ALI_Format if Err is True.
kono
parents:
diff changeset
942
kono
parents:
diff changeset
943 procedure Fatal_Error_Ignore;
kono
parents:
diff changeset
944 pragma Inline (Fatal_Error_Ignore);
kono
parents:
diff changeset
945 -- In Ignore_Errors mode, has no effect, otherwise same as Fatal_Error
kono
parents:
diff changeset
946
kono
parents:
diff changeset
947 function Getc return Character;
kono
parents:
diff changeset
948 -- Get next character, bumping P past the character obtained
kono
parents:
diff changeset
949
kono
parents:
diff changeset
950 function Get_File_Name
kono
parents:
diff changeset
951 (Lower : Boolean := False;
kono
parents:
diff changeset
952 May_Be_Quoted : Boolean := False) return File_Name_Type;
kono
parents:
diff changeset
953 -- Skip blanks, then scan out a file name (name is left in Name_Buffer
kono
parents:
diff changeset
954 -- with length in Name_Len, as well as returning a File_Name_Type value.
kono
parents:
diff changeset
955 -- If May_Be_Quoted is True and the first non blank character is '"',
kono
parents:
diff changeset
956 -- then remove starting and ending quotes and undoubled internal quotes.
kono
parents:
diff changeset
957 -- If lower is false, the case is unchanged, if Lower is True then the
kono
parents:
diff changeset
958 -- result is forced to all lower case for systems where file names are
kono
parents:
diff changeset
959 -- not case sensitive. This ensures that gnatbind works correctly
kono
parents:
diff changeset
960 -- regardless of the case of the file name on all systems. The scan
kono
parents:
diff changeset
961 -- is terminated by a end of line, space or horizontal tab. Any other
kono
parents:
diff changeset
962 -- special characters are included in the returned name.
kono
parents:
diff changeset
963
kono
parents:
diff changeset
964 function Get_Name
kono
parents:
diff changeset
965 (Ignore_Spaces : Boolean := False;
kono
parents:
diff changeset
966 Ignore_Special : Boolean := False;
kono
parents:
diff changeset
967 May_Be_Quoted : Boolean := False) return Name_Id;
kono
parents:
diff changeset
968 -- Skip blanks, then scan out a name (name is left in Name_Buffer with
kono
parents:
diff changeset
969 -- length in Name_Len, as well as being returned in Name_Id form).
kono
parents:
diff changeset
970 -- If Lower is set to True then the Name_Buffer will be converted to
kono
parents:
diff changeset
971 -- all lower case, for systems where file names are not case sensitive.
kono
parents:
diff changeset
972 -- This ensures that gnatbind works correctly regardless of the case
kono
parents:
diff changeset
973 -- of the file name on all systems. The termination condition depends
kono
parents:
diff changeset
974 -- on the settings of Ignore_Spaces and Ignore_Special:
kono
parents:
diff changeset
975 --
kono
parents:
diff changeset
976 -- If Ignore_Spaces is False (normal case), then scan is terminated
kono
parents:
diff changeset
977 -- by the normal end of field condition (EOL, space, horizontal tab)
kono
parents:
diff changeset
978 --
kono
parents:
diff changeset
979 -- If Ignore_Special is False (normal case), the scan is terminated by
kono
parents:
diff changeset
980 -- a typeref bracket or an equal sign except for the special case of
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
981 -- an operator name starting with a double quote that is terminated
111
kono
parents:
diff changeset
982 -- by another double quote.
kono
parents:
diff changeset
983 --
kono
parents:
diff changeset
984 -- If May_Be_Quoted is True and the first non blank character is '"'
kono
parents:
diff changeset
985 -- the name is 'unquoted'. In this case Ignore_Special is ignored and
kono
parents:
diff changeset
986 -- assumed to be True.
kono
parents:
diff changeset
987 --
kono
parents:
diff changeset
988 -- It is an error to set both Ignore_Spaces and Ignore_Special to True.
kono
parents:
diff changeset
989 -- This function handles wide characters properly.
kono
parents:
diff changeset
990
kono
parents:
diff changeset
991 function Get_Nat return Nat;
kono
parents:
diff changeset
992 -- Skip blanks, then scan out an unsigned integer value in Nat range
kono
parents:
diff changeset
993 -- raises ALI_Reading_Error if the encoutered type is not natural.
kono
parents:
diff changeset
994
kono
parents:
diff changeset
995 function Get_Stamp return Time_Stamp_Type;
kono
parents:
diff changeset
996 -- Skip blanks, then scan out a time stamp
kono
parents:
diff changeset
997
kono
parents:
diff changeset
998 function Get_Unit_Name return Unit_Name_Type;
kono
parents:
diff changeset
999 -- Skip blanks, then scan out a file name (name is left in Name_Buffer
kono
parents:
diff changeset
1000 -- with length in Name_Len, as well as returning a Unit_Name_Type value.
kono
parents:
diff changeset
1001 -- The case is unchanged and terminated by a normal end of field.
kono
parents:
diff changeset
1002
kono
parents:
diff changeset
1003 function Nextc return Character;
kono
parents:
diff changeset
1004 -- Return current character without modifying pointer P
kono
parents:
diff changeset
1005
kono
parents:
diff changeset
1006 procedure Get_Typeref
kono
parents:
diff changeset
1007 (Current_File_Num : Sdep_Id;
kono
parents:
diff changeset
1008 Ref : out Tref_Kind;
kono
parents:
diff changeset
1009 File_Num : out Sdep_Id;
kono
parents:
diff changeset
1010 Line : out Nat;
kono
parents:
diff changeset
1011 Ref_Type : out Character;
kono
parents:
diff changeset
1012 Col : out Nat;
kono
parents:
diff changeset
1013 Standard_Entity : out Name_Id);
kono
parents:
diff changeset
1014 -- Parse the definition of a typeref (<...>, {...} or (...))
kono
parents:
diff changeset
1015
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1016 procedure Scan_Invocation_Graph_Line;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1017 -- Parse a single line that encodes a piece of the invocation graph
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1018
111
kono
parents:
diff changeset
1019 procedure Skip_Eol;
kono
parents:
diff changeset
1020 -- Skip past spaces, then skip past end of line (fatal error if not
kono
parents:
diff changeset
1021 -- at end of line). Also skips past any following blank lines.
kono
parents:
diff changeset
1022
kono
parents:
diff changeset
1023 procedure Skip_Line;
kono
parents:
diff changeset
1024 -- Skip rest of current line and any following blank lines
kono
parents:
diff changeset
1025
kono
parents:
diff changeset
1026 procedure Skip_Space;
kono
parents:
diff changeset
1027 -- Skip past white space (blanks or horizontal tab)
kono
parents:
diff changeset
1028
kono
parents:
diff changeset
1029 procedure Skipc;
kono
parents:
diff changeset
1030 -- Skip past next character, does not affect value in C. This call
kono
parents:
diff changeset
1031 -- is like calling Getc and ignoring the returned result.
kono
parents:
diff changeset
1032
kono
parents:
diff changeset
1033 ---------------------
kono
parents:
diff changeset
1034 -- At_End_Of_Field --
kono
parents:
diff changeset
1035 ---------------------
kono
parents:
diff changeset
1036
kono
parents:
diff changeset
1037 function At_End_Of_Field return Boolean is
kono
parents:
diff changeset
1038 begin
kono
parents:
diff changeset
1039 return Nextc <= ' ';
kono
parents:
diff changeset
1040 end At_End_Of_Field;
kono
parents:
diff changeset
1041
kono
parents:
diff changeset
1042 ------------
kono
parents:
diff changeset
1043 -- At_Eol --
kono
parents:
diff changeset
1044 ------------
kono
parents:
diff changeset
1045
kono
parents:
diff changeset
1046 function At_Eol return Boolean is
kono
parents:
diff changeset
1047 begin
kono
parents:
diff changeset
1048 return Nextc = EOF or else Nextc = CR or else Nextc = LF;
kono
parents:
diff changeset
1049 end At_Eol;
kono
parents:
diff changeset
1050
kono
parents:
diff changeset
1051 ---------------------------
kono
parents:
diff changeset
1052 -- Check_At_End_Of_Field --
kono
parents:
diff changeset
1053 ---------------------------
kono
parents:
diff changeset
1054
kono
parents:
diff changeset
1055 procedure Check_At_End_Of_Field is
kono
parents:
diff changeset
1056 begin
kono
parents:
diff changeset
1057 if not At_End_Of_Field then
kono
parents:
diff changeset
1058 if Ignore_Errors then
kono
parents:
diff changeset
1059 while Nextc > ' ' loop
kono
parents:
diff changeset
1060 P := P + 1;
kono
parents:
diff changeset
1061 end loop;
kono
parents:
diff changeset
1062 else
kono
parents:
diff changeset
1063 Fatal_Error;
kono
parents:
diff changeset
1064 end if;
kono
parents:
diff changeset
1065 end if;
kono
parents:
diff changeset
1066 end Check_At_End_Of_Field;
kono
parents:
diff changeset
1067
kono
parents:
diff changeset
1068 ------------------------
kono
parents:
diff changeset
1069 -- Check_Unknown_Line --
kono
parents:
diff changeset
1070 ------------------------
kono
parents:
diff changeset
1071
kono
parents:
diff changeset
1072 procedure Check_Unknown_Line is
kono
parents:
diff changeset
1073 begin
kono
parents:
diff changeset
1074 while C not in 'A' .. 'Z'
kono
parents:
diff changeset
1075 or else not Known_ALI_Lines (C)
kono
parents:
diff changeset
1076 loop
kono
parents:
diff changeset
1077 if C = CR or else C = LF then
kono
parents:
diff changeset
1078 Skip_Line;
kono
parents:
diff changeset
1079 C := Nextc;
kono
parents:
diff changeset
1080
kono
parents:
diff changeset
1081 elsif C = EOF then
kono
parents:
diff changeset
1082 return;
kono
parents:
diff changeset
1083
kono
parents:
diff changeset
1084 elsif Ignore_Errors then
kono
parents:
diff changeset
1085 Skip_Line;
kono
parents:
diff changeset
1086 C := Getc;
kono
parents:
diff changeset
1087
kono
parents:
diff changeset
1088 else
kono
parents:
diff changeset
1089 Fatal_Error;
kono
parents:
diff changeset
1090 end if;
kono
parents:
diff changeset
1091 end loop;
kono
parents:
diff changeset
1092 end Check_Unknown_Line;
kono
parents:
diff changeset
1093
kono
parents:
diff changeset
1094 ------------
kono
parents:
diff changeset
1095 -- Checkc --
kono
parents:
diff changeset
1096 ------------
kono
parents:
diff changeset
1097
kono
parents:
diff changeset
1098 procedure Checkc (C : Character) is
kono
parents:
diff changeset
1099 begin
kono
parents:
diff changeset
1100 if Nextc = C then
kono
parents:
diff changeset
1101 P := P + 1;
kono
parents:
diff changeset
1102 elsif Ignore_Errors then
kono
parents:
diff changeset
1103 P := P + 1;
kono
parents:
diff changeset
1104 else
kono
parents:
diff changeset
1105 Fatal_Error;
kono
parents:
diff changeset
1106 end if;
kono
parents:
diff changeset
1107 end Checkc;
kono
parents:
diff changeset
1108
kono
parents:
diff changeset
1109 -----------------
kono
parents:
diff changeset
1110 -- Fatal_Error --
kono
parents:
diff changeset
1111 -----------------
kono
parents:
diff changeset
1112
kono
parents:
diff changeset
1113 procedure Fatal_Error is
kono
parents:
diff changeset
1114 Ptr1 : Text_Ptr;
kono
parents:
diff changeset
1115 Ptr2 : Text_Ptr;
kono
parents:
diff changeset
1116 Col : Int;
kono
parents:
diff changeset
1117
kono
parents:
diff changeset
1118 procedure Wchar (C : Character);
kono
parents:
diff changeset
1119 -- Write a single character, replacing horizontal tab by spaces
kono
parents:
diff changeset
1120
kono
parents:
diff changeset
1121 procedure Wchar (C : Character) is
kono
parents:
diff changeset
1122 begin
kono
parents:
diff changeset
1123 if C = HT then
kono
parents:
diff changeset
1124 loop
kono
parents:
diff changeset
1125 Wchar (' ');
kono
parents:
diff changeset
1126 exit when Col mod 8 = 0;
kono
parents:
diff changeset
1127 end loop;
kono
parents:
diff changeset
1128
kono
parents:
diff changeset
1129 else
kono
parents:
diff changeset
1130 Write_Char (C);
kono
parents:
diff changeset
1131 Col := Col + 1;
kono
parents:
diff changeset
1132 end if;
kono
parents:
diff changeset
1133 end Wchar;
kono
parents:
diff changeset
1134
kono
parents:
diff changeset
1135 -- Start of processing for Fatal_Error
kono
parents:
diff changeset
1136
kono
parents:
diff changeset
1137 begin
kono
parents:
diff changeset
1138 if Err then
kono
parents:
diff changeset
1139 raise Bad_ALI_Format;
kono
parents:
diff changeset
1140 end if;
kono
parents:
diff changeset
1141
kono
parents:
diff changeset
1142 Set_Standard_Error;
kono
parents:
diff changeset
1143 Write_Str ("fatal error: file ");
kono
parents:
diff changeset
1144 Write_Name (F);
kono
parents:
diff changeset
1145 Write_Str (" is incorrectly formatted");
kono
parents:
diff changeset
1146 Write_Eol;
kono
parents:
diff changeset
1147
kono
parents:
diff changeset
1148 Write_Str ("make sure you are using consistent versions " &
kono
parents:
diff changeset
1149
kono
parents:
diff changeset
1150 -- Split the following line so that it can easily be transformed for
kono
parents:
diff changeset
1151 -- other back-ends where the compiler might have a different name.
kono
parents:
diff changeset
1152
kono
parents:
diff changeset
1153 "of gcc/gnatbind");
kono
parents:
diff changeset
1154
kono
parents:
diff changeset
1155 Write_Eol;
kono
parents:
diff changeset
1156
kono
parents:
diff changeset
1157 -- Find start of line
kono
parents:
diff changeset
1158
kono
parents:
diff changeset
1159 Ptr1 := P;
kono
parents:
diff changeset
1160 while Ptr1 > T'First
kono
parents:
diff changeset
1161 and then T (Ptr1 - 1) /= CR
kono
parents:
diff changeset
1162 and then T (Ptr1 - 1) /= LF
kono
parents:
diff changeset
1163 loop
kono
parents:
diff changeset
1164 Ptr1 := Ptr1 - 1;
kono
parents:
diff changeset
1165 end loop;
kono
parents:
diff changeset
1166
kono
parents:
diff changeset
1167 Write_Int (Int (Line));
kono
parents:
diff changeset
1168 Write_Str (". ");
kono
parents:
diff changeset
1169
kono
parents:
diff changeset
1170 if Line < 100 then
kono
parents:
diff changeset
1171 Write_Char (' ');
kono
parents:
diff changeset
1172 end if;
kono
parents:
diff changeset
1173
kono
parents:
diff changeset
1174 if Line < 10 then
kono
parents:
diff changeset
1175 Write_Char (' ');
kono
parents:
diff changeset
1176 end if;
kono
parents:
diff changeset
1177
kono
parents:
diff changeset
1178 Col := 0;
kono
parents:
diff changeset
1179 Ptr2 := Ptr1;
kono
parents:
diff changeset
1180
kono
parents:
diff changeset
1181 while Ptr2 < T'Last
kono
parents:
diff changeset
1182 and then T (Ptr2) /= CR
kono
parents:
diff changeset
1183 and then T (Ptr2) /= LF
kono
parents:
diff changeset
1184 loop
kono
parents:
diff changeset
1185 Wchar (T (Ptr2));
kono
parents:
diff changeset
1186 Ptr2 := Ptr2 + 1;
kono
parents:
diff changeset
1187 end loop;
kono
parents:
diff changeset
1188
kono
parents:
diff changeset
1189 Write_Eol;
kono
parents:
diff changeset
1190
kono
parents:
diff changeset
1191 Write_Str (" ");
kono
parents:
diff changeset
1192 Col := 0;
kono
parents:
diff changeset
1193
kono
parents:
diff changeset
1194 while Ptr1 < P loop
kono
parents:
diff changeset
1195 if T (Ptr1) = HT then
kono
parents:
diff changeset
1196 Wchar (HT);
kono
parents:
diff changeset
1197 else
kono
parents:
diff changeset
1198 Wchar (' ');
kono
parents:
diff changeset
1199 end if;
kono
parents:
diff changeset
1200
kono
parents:
diff changeset
1201 Ptr1 := Ptr1 + 1;
kono
parents:
diff changeset
1202 end loop;
kono
parents:
diff changeset
1203
kono
parents:
diff changeset
1204 Wchar ('|');
kono
parents:
diff changeset
1205 Write_Eol;
kono
parents:
diff changeset
1206
kono
parents:
diff changeset
1207 Exit_Program (E_Fatal);
kono
parents:
diff changeset
1208 end Fatal_Error;
kono
parents:
diff changeset
1209
kono
parents:
diff changeset
1210 ------------------------
kono
parents:
diff changeset
1211 -- Fatal_Error_Ignore --
kono
parents:
diff changeset
1212 ------------------------
kono
parents:
diff changeset
1213
kono
parents:
diff changeset
1214 procedure Fatal_Error_Ignore is
kono
parents:
diff changeset
1215 begin
kono
parents:
diff changeset
1216 if not Ignore_Errors then
kono
parents:
diff changeset
1217 Fatal_Error;
kono
parents:
diff changeset
1218 end if;
kono
parents:
diff changeset
1219 end Fatal_Error_Ignore;
kono
parents:
diff changeset
1220
kono
parents:
diff changeset
1221 -------------------
kono
parents:
diff changeset
1222 -- Get_File_Name --
kono
parents:
diff changeset
1223 -------------------
kono
parents:
diff changeset
1224
kono
parents:
diff changeset
1225 function Get_File_Name
kono
parents:
diff changeset
1226 (Lower : Boolean := False;
kono
parents:
diff changeset
1227 May_Be_Quoted : Boolean := False) return File_Name_Type
kono
parents:
diff changeset
1228 is
kono
parents:
diff changeset
1229 F : Name_Id;
kono
parents:
diff changeset
1230
kono
parents:
diff changeset
1231 begin
kono
parents:
diff changeset
1232 F := Get_Name (Ignore_Special => True,
kono
parents:
diff changeset
1233 May_Be_Quoted => May_Be_Quoted);
kono
parents:
diff changeset
1234
kono
parents:
diff changeset
1235 -- Convert file name to all lower case if file names are not case
kono
parents:
diff changeset
1236 -- sensitive. This ensures that we handle names in the canonical
kono
parents:
diff changeset
1237 -- lower case format, regardless of the actual case.
kono
parents:
diff changeset
1238
kono
parents:
diff changeset
1239 if Lower and not File_Names_Case_Sensitive then
kono
parents:
diff changeset
1240 Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len));
kono
parents:
diff changeset
1241 return Name_Find;
kono
parents:
diff changeset
1242 else
kono
parents:
diff changeset
1243 return File_Name_Type (F);
kono
parents:
diff changeset
1244 end if;
kono
parents:
diff changeset
1245 end Get_File_Name;
kono
parents:
diff changeset
1246
kono
parents:
diff changeset
1247 --------------
kono
parents:
diff changeset
1248 -- Get_Name --
kono
parents:
diff changeset
1249 --------------
kono
parents:
diff changeset
1250
kono
parents:
diff changeset
1251 function Get_Name
kono
parents:
diff changeset
1252 (Ignore_Spaces : Boolean := False;
kono
parents:
diff changeset
1253 Ignore_Special : Boolean := False;
kono
parents:
diff changeset
1254 May_Be_Quoted : Boolean := False) return Name_Id
kono
parents:
diff changeset
1255 is
kono
parents:
diff changeset
1256 Char : Character;
kono
parents:
diff changeset
1257
kono
parents:
diff changeset
1258 begin
kono
parents:
diff changeset
1259 Name_Len := 0;
kono
parents:
diff changeset
1260 Skip_Space;
kono
parents:
diff changeset
1261
kono
parents:
diff changeset
1262 if At_Eol then
kono
parents:
diff changeset
1263 if Ignore_Errors then
kono
parents:
diff changeset
1264 return Error_Name;
kono
parents:
diff changeset
1265 else
kono
parents:
diff changeset
1266 Fatal_Error;
kono
parents:
diff changeset
1267 end if;
kono
parents:
diff changeset
1268 end if;
kono
parents:
diff changeset
1269
kono
parents:
diff changeset
1270 Char := Getc;
kono
parents:
diff changeset
1271
kono
parents:
diff changeset
1272 -- Deal with quoted characters
kono
parents:
diff changeset
1273
kono
parents:
diff changeset
1274 if May_Be_Quoted and then Char = '"' then
kono
parents:
diff changeset
1275 loop
kono
parents:
diff changeset
1276 if At_Eol then
kono
parents:
diff changeset
1277 if Ignore_Errors then
kono
parents:
diff changeset
1278 return Error_Name;
kono
parents:
diff changeset
1279 else
kono
parents:
diff changeset
1280 Fatal_Error;
kono
parents:
diff changeset
1281 end if;
kono
parents:
diff changeset
1282 end if;
kono
parents:
diff changeset
1283
kono
parents:
diff changeset
1284 Char := Getc;
kono
parents:
diff changeset
1285
kono
parents:
diff changeset
1286 if Char = '"' then
kono
parents:
diff changeset
1287 if At_Eol then
kono
parents:
diff changeset
1288 exit;
kono
parents:
diff changeset
1289
kono
parents:
diff changeset
1290 else
kono
parents:
diff changeset
1291 Char := Getc;
kono
parents:
diff changeset
1292
kono
parents:
diff changeset
1293 if Char /= '"' then
kono
parents:
diff changeset
1294 P := P - 1;
kono
parents:
diff changeset
1295 exit;
kono
parents:
diff changeset
1296 end if;
kono
parents:
diff changeset
1297 end if;
kono
parents:
diff changeset
1298 end if;
kono
parents:
diff changeset
1299
kono
parents:
diff changeset
1300 Add_Char_To_Name_Buffer (Char);
kono
parents:
diff changeset
1301 end loop;
kono
parents:
diff changeset
1302
kono
parents:
diff changeset
1303 -- Other than case of quoted character
kono
parents:
diff changeset
1304
kono
parents:
diff changeset
1305 else
kono
parents:
diff changeset
1306 P := P - 1;
kono
parents:
diff changeset
1307 loop
kono
parents:
diff changeset
1308 Add_Char_To_Name_Buffer (Getc);
kono
parents:
diff changeset
1309
kono
parents:
diff changeset
1310 exit when At_End_Of_Field and then not Ignore_Spaces;
kono
parents:
diff changeset
1311
kono
parents:
diff changeset
1312 if not Ignore_Special then
kono
parents:
diff changeset
1313 if Name_Buffer (1) = '"' then
kono
parents:
diff changeset
1314 exit when Name_Len > 1
kono
parents:
diff changeset
1315 and then Name_Buffer (Name_Len) = '"';
kono
parents:
diff changeset
1316
kono
parents:
diff changeset
1317 else
kono
parents:
diff changeset
1318 -- Terminate on parens or angle brackets or equal sign
kono
parents:
diff changeset
1319
kono
parents:
diff changeset
1320 exit when Nextc = '(' or else Nextc = ')'
kono
parents:
diff changeset
1321 or else Nextc = '{' or else Nextc = '}'
kono
parents:
diff changeset
1322 or else Nextc = '<' or else Nextc = '>'
kono
parents:
diff changeset
1323 or else Nextc = '=';
kono
parents:
diff changeset
1324
kono
parents:
diff changeset
1325 -- Terminate on comma
kono
parents:
diff changeset
1326
kono
parents:
diff changeset
1327 exit when Nextc = ',';
kono
parents:
diff changeset
1328
kono
parents:
diff changeset
1329 -- Terminate if left bracket not part of wide char
kono
parents:
diff changeset
1330 -- sequence Note that we only recognize brackets
kono
parents:
diff changeset
1331 -- notation so far ???
kono
parents:
diff changeset
1332
kono
parents:
diff changeset
1333 exit when Nextc = '[' and then T (P + 1) /= '"';
kono
parents:
diff changeset
1334
kono
parents:
diff changeset
1335 -- Terminate if right bracket not part of wide char
kono
parents:
diff changeset
1336 -- sequence.
kono
parents:
diff changeset
1337
kono
parents:
diff changeset
1338 exit when Nextc = ']' and then T (P - 1) /= '"';
kono
parents:
diff changeset
1339 end if;
kono
parents:
diff changeset
1340 end if;
kono
parents:
diff changeset
1341 end loop;
kono
parents:
diff changeset
1342 end if;
kono
parents:
diff changeset
1343
kono
parents:
diff changeset
1344 return Name_Find;
kono
parents:
diff changeset
1345 end Get_Name;
kono
parents:
diff changeset
1346
kono
parents:
diff changeset
1347 -------------------
kono
parents:
diff changeset
1348 -- Get_Unit_Name --
kono
parents:
diff changeset
1349 -------------------
kono
parents:
diff changeset
1350
kono
parents:
diff changeset
1351 function Get_Unit_Name return Unit_Name_Type is
kono
parents:
diff changeset
1352 begin
kono
parents:
diff changeset
1353 return Unit_Name_Type (Get_Name);
kono
parents:
diff changeset
1354 end Get_Unit_Name;
kono
parents:
diff changeset
1355
kono
parents:
diff changeset
1356 -------------
kono
parents:
diff changeset
1357 -- Get_Nat --
kono
parents:
diff changeset
1358 -------------
kono
parents:
diff changeset
1359
kono
parents:
diff changeset
1360 function Get_Nat return Nat is
kono
parents:
diff changeset
1361 V : Nat;
kono
parents:
diff changeset
1362
kono
parents:
diff changeset
1363 begin
kono
parents:
diff changeset
1364 Skip_Space;
kono
parents:
diff changeset
1365
kono
parents:
diff changeset
1366 -- Check if we are on a number. In the case of bad ALI files, this
kono
parents:
diff changeset
1367 -- may not be true.
kono
parents:
diff changeset
1368
kono
parents:
diff changeset
1369 if not (Nextc in '0' .. '9') then
kono
parents:
diff changeset
1370 Fatal_Error;
kono
parents:
diff changeset
1371 end if;
kono
parents:
diff changeset
1372
kono
parents:
diff changeset
1373 V := 0;
kono
parents:
diff changeset
1374 loop
kono
parents:
diff changeset
1375 V := V * 10 + (Character'Pos (Getc) - Character'Pos ('0'));
kono
parents:
diff changeset
1376
kono
parents:
diff changeset
1377 exit when At_End_Of_Field;
kono
parents:
diff changeset
1378 exit when Nextc < '0' or else Nextc > '9';
kono
parents:
diff changeset
1379 end loop;
kono
parents:
diff changeset
1380
kono
parents:
diff changeset
1381 return V;
kono
parents:
diff changeset
1382 end Get_Nat;
kono
parents:
diff changeset
1383
kono
parents:
diff changeset
1384 ---------------
kono
parents:
diff changeset
1385 -- Get_Stamp --
kono
parents:
diff changeset
1386 ---------------
kono
parents:
diff changeset
1387
kono
parents:
diff changeset
1388 function Get_Stamp return Time_Stamp_Type is
kono
parents:
diff changeset
1389 T : Time_Stamp_Type;
kono
parents:
diff changeset
1390 Start : Integer;
kono
parents:
diff changeset
1391
kono
parents:
diff changeset
1392 begin
kono
parents:
diff changeset
1393 Skip_Space;
kono
parents:
diff changeset
1394
kono
parents:
diff changeset
1395 if At_Eol then
kono
parents:
diff changeset
1396 if Ignore_Errors then
kono
parents:
diff changeset
1397 return Dummy_Time_Stamp;
kono
parents:
diff changeset
1398 else
kono
parents:
diff changeset
1399 Fatal_Error;
kono
parents:
diff changeset
1400 end if;
kono
parents:
diff changeset
1401 end if;
kono
parents:
diff changeset
1402
kono
parents:
diff changeset
1403 -- Following reads old style time stamp missing first two digits
kono
parents:
diff changeset
1404
kono
parents:
diff changeset
1405 if Nextc in '7' .. '9' then
kono
parents:
diff changeset
1406 T (1) := '1';
kono
parents:
diff changeset
1407 T (2) := '9';
kono
parents:
diff changeset
1408 Start := 3;
kono
parents:
diff changeset
1409
kono
parents:
diff changeset
1410 -- Normal case of full year in time stamp
kono
parents:
diff changeset
1411
kono
parents:
diff changeset
1412 else
kono
parents:
diff changeset
1413 Start := 1;
kono
parents:
diff changeset
1414 end if;
kono
parents:
diff changeset
1415
kono
parents:
diff changeset
1416 for J in Start .. T'Last loop
kono
parents:
diff changeset
1417 T (J) := Getc;
kono
parents:
diff changeset
1418 end loop;
kono
parents:
diff changeset
1419
kono
parents:
diff changeset
1420 return T;
kono
parents:
diff changeset
1421 end Get_Stamp;
kono
parents:
diff changeset
1422
kono
parents:
diff changeset
1423 -----------------
kono
parents:
diff changeset
1424 -- Get_Typeref --
kono
parents:
diff changeset
1425 -----------------
kono
parents:
diff changeset
1426
kono
parents:
diff changeset
1427 procedure Get_Typeref
kono
parents:
diff changeset
1428 (Current_File_Num : Sdep_Id;
kono
parents:
diff changeset
1429 Ref : out Tref_Kind;
kono
parents:
diff changeset
1430 File_Num : out Sdep_Id;
kono
parents:
diff changeset
1431 Line : out Nat;
kono
parents:
diff changeset
1432 Ref_Type : out Character;
kono
parents:
diff changeset
1433 Col : out Nat;
kono
parents:
diff changeset
1434 Standard_Entity : out Name_Id)
kono
parents:
diff changeset
1435 is
kono
parents:
diff changeset
1436 N : Nat;
kono
parents:
diff changeset
1437 begin
kono
parents:
diff changeset
1438 case Nextc is
kono
parents:
diff changeset
1439 when '<' => Ref := Tref_Derived;
kono
parents:
diff changeset
1440 when '(' => Ref := Tref_Access;
kono
parents:
diff changeset
1441 when '{' => Ref := Tref_Type;
kono
parents:
diff changeset
1442 when others => Ref := Tref_None;
kono
parents:
diff changeset
1443 end case;
kono
parents:
diff changeset
1444
kono
parents:
diff changeset
1445 -- Case of typeref field present
kono
parents:
diff changeset
1446
kono
parents:
diff changeset
1447 if Ref /= Tref_None then
kono
parents:
diff changeset
1448 P := P + 1; -- skip opening bracket
kono
parents:
diff changeset
1449
kono
parents:
diff changeset
1450 if Nextc in 'a' .. 'z' then
kono
parents:
diff changeset
1451 File_Num := No_Sdep_Id;
kono
parents:
diff changeset
1452 Line := 0;
kono
parents:
diff changeset
1453 Ref_Type := ' ';
kono
parents:
diff changeset
1454 Col := 0;
kono
parents:
diff changeset
1455 Standard_Entity := Get_Name (Ignore_Spaces => True);
kono
parents:
diff changeset
1456 else
kono
parents:
diff changeset
1457 N := Get_Nat;
kono
parents:
diff changeset
1458
kono
parents:
diff changeset
1459 if Nextc = '|' then
kono
parents:
diff changeset
1460 File_Num := Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
kono
parents:
diff changeset
1461 P := P + 1;
kono
parents:
diff changeset
1462 N := Get_Nat;
kono
parents:
diff changeset
1463 else
kono
parents:
diff changeset
1464 File_Num := Current_File_Num;
kono
parents:
diff changeset
1465 end if;
kono
parents:
diff changeset
1466
kono
parents:
diff changeset
1467 Line := N;
kono
parents:
diff changeset
1468 Ref_Type := Getc;
kono
parents:
diff changeset
1469 Col := Get_Nat;
kono
parents:
diff changeset
1470 Standard_Entity := No_Name;
kono
parents:
diff changeset
1471 end if;
kono
parents:
diff changeset
1472
kono
parents:
diff changeset
1473 -- ??? Temporary workaround for nested generics case:
kono
parents:
diff changeset
1474 -- 4i4 Directories{1|4I9[4|6[3|3]]}
kono
parents:
diff changeset
1475 -- See C918-002
kono
parents:
diff changeset
1476
kono
parents:
diff changeset
1477 declare
kono
parents:
diff changeset
1478 Nested_Brackets : Natural := 0;
kono
parents:
diff changeset
1479
kono
parents:
diff changeset
1480 begin
kono
parents:
diff changeset
1481 loop
kono
parents:
diff changeset
1482 case Nextc is
kono
parents:
diff changeset
1483 when '[' =>
kono
parents:
diff changeset
1484 Nested_Brackets := Nested_Brackets + 1;
kono
parents:
diff changeset
1485 when ']' =>
kono
parents:
diff changeset
1486 Nested_Brackets := Nested_Brackets - 1;
kono
parents:
diff changeset
1487 when others =>
kono
parents:
diff changeset
1488 if Nested_Brackets = 0 then
kono
parents:
diff changeset
1489 exit;
kono
parents:
diff changeset
1490 end if;
kono
parents:
diff changeset
1491 end case;
kono
parents:
diff changeset
1492
kono
parents:
diff changeset
1493 Skipc;
kono
parents:
diff changeset
1494 end loop;
kono
parents:
diff changeset
1495 end;
kono
parents:
diff changeset
1496
kono
parents:
diff changeset
1497 P := P + 1; -- skip closing bracket
kono
parents:
diff changeset
1498 Skip_Space;
kono
parents:
diff changeset
1499
kono
parents:
diff changeset
1500 -- No typeref entry present
kono
parents:
diff changeset
1501
kono
parents:
diff changeset
1502 else
kono
parents:
diff changeset
1503 File_Num := No_Sdep_Id;
kono
parents:
diff changeset
1504 Line := 0;
kono
parents:
diff changeset
1505 Ref_Type := ' ';
kono
parents:
diff changeset
1506 Col := 0;
kono
parents:
diff changeset
1507 Standard_Entity := No_Name;
kono
parents:
diff changeset
1508 end if;
kono
parents:
diff changeset
1509 end Get_Typeref;
kono
parents:
diff changeset
1510
kono
parents:
diff changeset
1511 ----------
kono
parents:
diff changeset
1512 -- Getc --
kono
parents:
diff changeset
1513 ----------
kono
parents:
diff changeset
1514
kono
parents:
diff changeset
1515 function Getc return Character is
kono
parents:
diff changeset
1516 begin
kono
parents:
diff changeset
1517 if P = T'Last then
kono
parents:
diff changeset
1518 return EOF;
kono
parents:
diff changeset
1519 else
kono
parents:
diff changeset
1520 P := P + 1;
kono
parents:
diff changeset
1521 return T (P - 1);
kono
parents:
diff changeset
1522 end if;
kono
parents:
diff changeset
1523 end Getc;
kono
parents:
diff changeset
1524
kono
parents:
diff changeset
1525 -----------
kono
parents:
diff changeset
1526 -- Nextc --
kono
parents:
diff changeset
1527 -----------
kono
parents:
diff changeset
1528
kono
parents:
diff changeset
1529 function Nextc return Character is
kono
parents:
diff changeset
1530 begin
kono
parents:
diff changeset
1531 return T (P);
kono
parents:
diff changeset
1532 end Nextc;
kono
parents:
diff changeset
1533
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1534 --------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1535 -- Scan_Invocation_Graph_Line --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1536 --------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1537
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1538 procedure Scan_Invocation_Graph_Line is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1539 procedure Scan_Invocation_Construct_Line;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1540 pragma Inline (Scan_Invocation_Construct_Line);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1541 -- Parse an invocation construct line and construct the corresponding
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1542 -- construct. The following data structures are updated:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1543 --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1544 -- * Invocation_Constructs
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1545 -- * Units
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1546
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1547 procedure Scan_Invocation_Graph_Attributes_Line;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1548 pragma Inline (Scan_Invocation_Graph_Attributes_Line);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1549 -- Parse an invocation-graph attributes line. The following data
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1550 -- structures are updated:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1551 --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1552 -- * Units
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1553
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1554 procedure Scan_Invocation_Relation_Line;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1555 pragma Inline (Scan_Invocation_Relation_Line);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1556 -- Parse an invocation relation line and construct the corresponding
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1557 -- relation. The following data structures are updated:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1558 --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1559 -- * Invocation_Relations
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1560 -- * Units
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1561
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1562 function Scan_Invocation_Signature return Invocation_Signature_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1563 pragma Inline (Scan_Invocation_Signature);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1564 -- Parse a single invocation signature while populating the following
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1565 -- data structures:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1566 --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1567 -- * Invocation_Signatures
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1568 -- * Sig_To_Sig_Map
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1569
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1570 ------------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1571 -- Scan_Invocation_Construct_Line --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1572 ------------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1573
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1574 procedure Scan_Invocation_Construct_Line is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1575 Body_Placement : Declaration_Placement_Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1576 Kind : Invocation_Construct_Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1577 Signature : Invocation_Signature_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1578 Spec_Placement : Declaration_Placement_Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1579
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1580 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1581 -- construct-kind
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1582
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1583 Kind := Code_To_Invocation_Construct_Kind (Getc);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1584 Checkc (' ');
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1585 Skip_Space;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1586
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1587 -- construct-spec-placement
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1588
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1589 Spec_Placement := Code_To_Declaration_Placement_Kind (Getc);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1590 Checkc (' ');
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1591 Skip_Space;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1592
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1593 -- construct-body-placement
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1594
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1595 Body_Placement := Code_To_Declaration_Placement_Kind (Getc);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1596 Checkc (' ');
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1597 Skip_Space;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1598
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1599 -- construct-signature
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1600
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1601 Signature := Scan_Invocation_Signature;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1602 Skip_Eol;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1603
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1604 Add_Invocation_Construct
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1605 (Body_Placement => Body_Placement,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1606 Kind => Kind,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1607 Signature => Signature,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1608 Spec_Placement => Spec_Placement);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1609 end Scan_Invocation_Construct_Line;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1610
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1611 -------------------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1612 -- Scan_Invocation_Graph_Attributes_Line --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1613 -------------------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1614
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1615 procedure Scan_Invocation_Graph_Attributes_Line is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1616 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1617 -- encoding-kind
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1618
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1619 Set_Invocation_Graph_Encoding
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1620 (Code_To_Invocation_Graph_Encoding_Kind (Getc));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1621 Skip_Eol;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1622 end Scan_Invocation_Graph_Attributes_Line;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1623
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1624 -----------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1625 -- Scan_Invocation_Relation_Line --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1626 -----------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1627
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1628 procedure Scan_Invocation_Relation_Line is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1629 Extra : Name_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1630 Invoker : Invocation_Signature_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1631 Kind : Invocation_Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1632 Target : Invocation_Signature_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1633
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1634 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1635 -- relation-kind
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1636
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1637 Kind := Code_To_Invocation_Kind (Getc);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1638 Checkc (' ');
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1639 Skip_Space;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1640
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1641 -- (extra-name | "none")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1642
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1643 Extra := Get_Name;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1644
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1645 if Extra = Name_None then
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1646 Extra := No_Name;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1647 end if;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1648
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1649 Checkc (' ');
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1650 Skip_Space;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1651
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1652 -- invoker-signature
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1653
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1654 Invoker := Scan_Invocation_Signature;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1655 Checkc (' ');
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1656 Skip_Space;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1657
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1658 -- target-signature
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1659
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1660 Target := Scan_Invocation_Signature;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1661 Skip_Eol;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1662
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1663 Add_Invocation_Relation
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1664 (Extra => Extra,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1665 Invoker => Invoker,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1666 Kind => Kind,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1667 Target => Target);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1668 end Scan_Invocation_Relation_Line;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1669
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1670 -------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1671 -- Scan_Invocation_Signature --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1672 -------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1673
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1674 function Scan_Invocation_Signature return Invocation_Signature_Id is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1675 Column : Nat;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1676 Line : Nat;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1677 Locations : Name_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1678 Name : Name_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1679 Scope : Name_Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1680
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1681 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1682 -- [
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1683
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1684 Checkc ('[');
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1685
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1686 -- name
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1687
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1688 Name := Get_Name;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1689 Checkc (' ');
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1690 Skip_Space;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1691
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1692 -- scope
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1693
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1694 Scope := Get_Name;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1695 Checkc (' ');
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1696 Skip_Space;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1697
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1698 -- line
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1699
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1700 Line := Get_Nat;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1701 Checkc (' ');
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1702 Skip_Space;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1703
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1704 -- column
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1705
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1706 Column := Get_Nat;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1707 Checkc (' ');
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1708 Skip_Space;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1709
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1710 -- (locations | "none")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1711
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1712 Locations := Get_Name;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1713
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1714 if Locations = Name_None then
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1715 Locations := No_Name;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1716 end if;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1717
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1718 -- ]
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1719
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1720 Checkc (']');
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1721
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1722 -- Create an invocation signature from the scanned attributes
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1723
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1724 return
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1725 Invocation_Signature_Of
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1726 (Column => Column,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1727 Line => Line,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1728 Locations => Locations,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1729 Name => Name,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1730 Scope => Scope);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1731 end Scan_Invocation_Signature;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1732
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1733 -- Local variables
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1734
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1735 Line : Invocation_Graph_Line_Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1736
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1737 -- Start of processing for Scan_Invocation_Graph_Line
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1738
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1739 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1740 if Ignore ('G') then
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1741 return;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1742 end if;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1743
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1744 Checkc (' ');
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1745 Skip_Space;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1746
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1747 -- line-kind
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1748
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1749 Line := Code_To_Invocation_Graph_Line_Kind (Getc);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1750 Checkc (' ');
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1751 Skip_Space;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1752
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1753 -- line-attributes
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1754
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1755 case Line is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1756 when Invocation_Construct_Line =>
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1757 Scan_Invocation_Construct_Line;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1758
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1759 when Invocation_Graph_Attributes_Line =>
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1760 Scan_Invocation_Graph_Attributes_Line;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1761
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1762 when Invocation_Relation_Line =>
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1763 Scan_Invocation_Relation_Line;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1764 end case;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1765 end Scan_Invocation_Graph_Line;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1766
111
kono
parents:
diff changeset
1767 --------------
kono
parents:
diff changeset
1768 -- Skip_Eol --
kono
parents:
diff changeset
1769 --------------
kono
parents:
diff changeset
1770
kono
parents:
diff changeset
1771 procedure Skip_Eol is
kono
parents:
diff changeset
1772 begin
kono
parents:
diff changeset
1773 Skip_Space;
kono
parents:
diff changeset
1774
kono
parents:
diff changeset
1775 if not At_Eol then
kono
parents:
diff changeset
1776 if Ignore_Errors then
kono
parents:
diff changeset
1777 while not At_Eol loop
kono
parents:
diff changeset
1778 P := P + 1;
kono
parents:
diff changeset
1779 end loop;
kono
parents:
diff changeset
1780 else
kono
parents:
diff changeset
1781 Fatal_Error;
kono
parents:
diff changeset
1782 end if;
kono
parents:
diff changeset
1783 end if;
kono
parents:
diff changeset
1784
kono
parents:
diff changeset
1785 -- Loop to skip past blank lines (first time through skips this EOL)
kono
parents:
diff changeset
1786
kono
parents:
diff changeset
1787 while Nextc < ' ' and then Nextc /= EOF loop
kono
parents:
diff changeset
1788 if Nextc = LF then
kono
parents:
diff changeset
1789 Line := Line + 1;
kono
parents:
diff changeset
1790 end if;
kono
parents:
diff changeset
1791
kono
parents:
diff changeset
1792 P := P + 1;
kono
parents:
diff changeset
1793 end loop;
kono
parents:
diff changeset
1794 end Skip_Eol;
kono
parents:
diff changeset
1795
kono
parents:
diff changeset
1796 ---------------
kono
parents:
diff changeset
1797 -- Skip_Line --
kono
parents:
diff changeset
1798 ---------------
kono
parents:
diff changeset
1799
kono
parents:
diff changeset
1800 procedure Skip_Line is
kono
parents:
diff changeset
1801 begin
kono
parents:
diff changeset
1802 while not At_Eol loop
kono
parents:
diff changeset
1803 P := P + 1;
kono
parents:
diff changeset
1804 end loop;
kono
parents:
diff changeset
1805
kono
parents:
diff changeset
1806 Skip_Eol;
kono
parents:
diff changeset
1807 end Skip_Line;
kono
parents:
diff changeset
1808
kono
parents:
diff changeset
1809 ----------------
kono
parents:
diff changeset
1810 -- Skip_Space --
kono
parents:
diff changeset
1811 ----------------
kono
parents:
diff changeset
1812
kono
parents:
diff changeset
1813 procedure Skip_Space is
kono
parents:
diff changeset
1814 begin
kono
parents:
diff changeset
1815 while Nextc = ' ' or else Nextc = HT loop
kono
parents:
diff changeset
1816 P := P + 1;
kono
parents:
diff changeset
1817 end loop;
kono
parents:
diff changeset
1818 end Skip_Space;
kono
parents:
diff changeset
1819
kono
parents:
diff changeset
1820 -----------
kono
parents:
diff changeset
1821 -- Skipc --
kono
parents:
diff changeset
1822 -----------
kono
parents:
diff changeset
1823
kono
parents:
diff changeset
1824 procedure Skipc is
kono
parents:
diff changeset
1825 begin
kono
parents:
diff changeset
1826 if P /= T'Last then
kono
parents:
diff changeset
1827 P := P + 1;
kono
parents:
diff changeset
1828 end if;
kono
parents:
diff changeset
1829 end Skipc;
kono
parents:
diff changeset
1830
kono
parents:
diff changeset
1831 -- Start of processing for Scan_ALI
kono
parents:
diff changeset
1832
kono
parents:
diff changeset
1833 begin
kono
parents:
diff changeset
1834 First_Sdep_Entry := Sdep.Last + 1;
kono
parents:
diff changeset
1835
kono
parents:
diff changeset
1836 -- Acquire lines to be ignored
kono
parents:
diff changeset
1837
kono
parents:
diff changeset
1838 if Read_Xref then
kono
parents:
diff changeset
1839 Ignore :=
kono
parents:
diff changeset
1840 ('T' | 'U' | 'W' | 'Y' | 'Z' | 'D' | 'X' => False, others => True);
kono
parents:
diff changeset
1841
kono
parents:
diff changeset
1842 -- Read_Lines parameter given
kono
parents:
diff changeset
1843
kono
parents:
diff changeset
1844 elsif Read_Lines /= "" then
kono
parents:
diff changeset
1845 Ignore := ('U' => False, others => True);
kono
parents:
diff changeset
1846
kono
parents:
diff changeset
1847 for J in Read_Lines'Range loop
kono
parents:
diff changeset
1848 Ignore (Read_Lines (J)) := False;
kono
parents:
diff changeset
1849 end loop;
kono
parents:
diff changeset
1850
kono
parents:
diff changeset
1851 -- Process Ignore_Lines parameter
kono
parents:
diff changeset
1852
kono
parents:
diff changeset
1853 else
kono
parents:
diff changeset
1854 Ignore := (others => False);
kono
parents:
diff changeset
1855
kono
parents:
diff changeset
1856 for J in Ignore_Lines'Range loop
kono
parents:
diff changeset
1857 pragma Assert (Ignore_Lines (J) /= 'U');
kono
parents:
diff changeset
1858 Ignore (Ignore_Lines (J)) := True;
kono
parents:
diff changeset
1859 end loop;
kono
parents:
diff changeset
1860 end if;
kono
parents:
diff changeset
1861
kono
parents:
diff changeset
1862 -- Setup ALI Table entry with appropriate defaults
kono
parents:
diff changeset
1863
kono
parents:
diff changeset
1864 ALIs.Increment_Last;
kono
parents:
diff changeset
1865 Id := ALIs.Last;
kono
parents:
diff changeset
1866 Set_Name_Table_Int (F, Int (Id));
kono
parents:
diff changeset
1867
kono
parents:
diff changeset
1868 ALIs.Table (Id) := (
kono
parents:
diff changeset
1869 Afile => F,
kono
parents:
diff changeset
1870 Compile_Errors => False,
kono
parents:
diff changeset
1871 First_Interrupt_State => Interrupt_States.Last + 1,
kono
parents:
diff changeset
1872 First_Sdep => No_Sdep_Id,
kono
parents:
diff changeset
1873 First_Specific_Dispatching => Specific_Dispatching.Last + 1,
kono
parents:
diff changeset
1874 First_Unit => No_Unit_Id,
kono
parents:
diff changeset
1875 GNATprove_Mode => False,
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1876 Invocation_Graph_Encoding => No_Encoding,
111
kono
parents:
diff changeset
1877 Last_Interrupt_State => Interrupt_States.Last,
kono
parents:
diff changeset
1878 Last_Sdep => No_Sdep_Id,
kono
parents:
diff changeset
1879 Last_Specific_Dispatching => Specific_Dispatching.Last,
kono
parents:
diff changeset
1880 Last_Unit => No_Unit_Id,
kono
parents:
diff changeset
1881 Locking_Policy => ' ',
kono
parents:
diff changeset
1882 Main_Priority => -1,
kono
parents:
diff changeset
1883 Main_CPU => -1,
kono
parents:
diff changeset
1884 Main_Program => None,
kono
parents:
diff changeset
1885 No_Component_Reordering => False,
kono
parents:
diff changeset
1886 No_Object => False,
kono
parents:
diff changeset
1887 Normalize_Scalars => False,
kono
parents:
diff changeset
1888 Ofile_Full_Name => Full_Object_File_Name,
kono
parents:
diff changeset
1889 Partition_Elaboration_Policy => ' ',
kono
parents:
diff changeset
1890 Queuing_Policy => ' ',
kono
parents:
diff changeset
1891 Restrictions => No_Restrictions,
kono
parents:
diff changeset
1892 SAL_Interface => False,
kono
parents:
diff changeset
1893 Sfile => No_File,
kono
parents:
diff changeset
1894 SSO_Default => ' ',
kono
parents:
diff changeset
1895 Task_Dispatching_Policy => ' ',
kono
parents:
diff changeset
1896 Time_Slice_Value => -1,
kono
parents:
diff changeset
1897 WC_Encoding => 'b',
kono
parents:
diff changeset
1898 Unit_Exception_Table => False,
kono
parents:
diff changeset
1899 Ver => (others => ' '),
kono
parents:
diff changeset
1900 Ver_Len => 0,
kono
parents:
diff changeset
1901 Frontend_Exceptions => False,
kono
parents:
diff changeset
1902 Zero_Cost_Exceptions => False);
kono
parents:
diff changeset
1903
kono
parents:
diff changeset
1904 -- Now we acquire the input lines from the ALI file. Note that the
kono
parents:
diff changeset
1905 -- convention in the following code is that as we enter each section,
kono
parents:
diff changeset
1906 -- C is set to contain the first character of the following line.
kono
parents:
diff changeset
1907
kono
parents:
diff changeset
1908 C := Getc;
kono
parents:
diff changeset
1909 Check_Unknown_Line;
kono
parents:
diff changeset
1910
kono
parents:
diff changeset
1911 -- Acquire library version
kono
parents:
diff changeset
1912
kono
parents:
diff changeset
1913 if C /= 'V' then
kono
parents:
diff changeset
1914
kono
parents:
diff changeset
1915 -- The V line missing really indicates trouble, most likely it
kono
parents:
diff changeset
1916 -- means we don't have an ALI file at all, so here we give a
kono
parents:
diff changeset
1917 -- fatal error even if we are in Ignore_Errors mode.
kono
parents:
diff changeset
1918
kono
parents:
diff changeset
1919 Fatal_Error;
kono
parents:
diff changeset
1920
kono
parents:
diff changeset
1921 elsif Ignore ('V') then
kono
parents:
diff changeset
1922 Skip_Line;
kono
parents:
diff changeset
1923
kono
parents:
diff changeset
1924 else
kono
parents:
diff changeset
1925 Checkc (' ');
kono
parents:
diff changeset
1926 Skip_Space;
kono
parents:
diff changeset
1927 Checkc ('"');
kono
parents:
diff changeset
1928
kono
parents:
diff changeset
1929 for J in 1 .. Ver_Len_Max loop
kono
parents:
diff changeset
1930 C := Getc;
kono
parents:
diff changeset
1931 exit when C = '"';
kono
parents:
diff changeset
1932 ALIs.Table (Id).Ver (J) := C;
kono
parents:
diff changeset
1933 ALIs.Table (Id).Ver_Len := J;
kono
parents:
diff changeset
1934 end loop;
kono
parents:
diff changeset
1935
kono
parents:
diff changeset
1936 Skip_Eol;
kono
parents:
diff changeset
1937 end if;
kono
parents:
diff changeset
1938
kono
parents:
diff changeset
1939 C := Getc;
kono
parents:
diff changeset
1940 Check_Unknown_Line;
kono
parents:
diff changeset
1941
kono
parents:
diff changeset
1942 -- Acquire main program line if present
kono
parents:
diff changeset
1943
kono
parents:
diff changeset
1944 if C = 'M' then
kono
parents:
diff changeset
1945 if Ignore ('M') then
kono
parents:
diff changeset
1946 Skip_Line;
kono
parents:
diff changeset
1947
kono
parents:
diff changeset
1948 else
kono
parents:
diff changeset
1949 Checkc (' ');
kono
parents:
diff changeset
1950 Skip_Space;
kono
parents:
diff changeset
1951
kono
parents:
diff changeset
1952 C := Getc;
kono
parents:
diff changeset
1953
kono
parents:
diff changeset
1954 if C = 'F' then
kono
parents:
diff changeset
1955 ALIs.Table (Id).Main_Program := Func;
kono
parents:
diff changeset
1956 elsif C = 'P' then
kono
parents:
diff changeset
1957 ALIs.Table (Id).Main_Program := Proc;
kono
parents:
diff changeset
1958 else
kono
parents:
diff changeset
1959 P := P - 1;
kono
parents:
diff changeset
1960 Fatal_Error;
kono
parents:
diff changeset
1961 end if;
kono
parents:
diff changeset
1962
kono
parents:
diff changeset
1963 Skip_Space;
kono
parents:
diff changeset
1964
kono
parents:
diff changeset
1965 if not At_Eol then
kono
parents:
diff changeset
1966 if Nextc < 'A' then
kono
parents:
diff changeset
1967 ALIs.Table (Id).Main_Priority := Get_Nat;
kono
parents:
diff changeset
1968 end if;
kono
parents:
diff changeset
1969
kono
parents:
diff changeset
1970 Skip_Space;
kono
parents:
diff changeset
1971
kono
parents:
diff changeset
1972 if Nextc = 'T' then
kono
parents:
diff changeset
1973 P := P + 1;
kono
parents:
diff changeset
1974 Checkc ('=');
kono
parents:
diff changeset
1975 ALIs.Table (Id).Time_Slice_Value := Get_Nat;
kono
parents:
diff changeset
1976 end if;
kono
parents:
diff changeset
1977
kono
parents:
diff changeset
1978 Skip_Space;
kono
parents:
diff changeset
1979
kono
parents:
diff changeset
1980 if Nextc = 'C' then
kono
parents:
diff changeset
1981 P := P + 1;
kono
parents:
diff changeset
1982 Checkc ('=');
kono
parents:
diff changeset
1983 ALIs.Table (Id).Main_CPU := Get_Nat;
kono
parents:
diff changeset
1984 end if;
kono
parents:
diff changeset
1985
kono
parents:
diff changeset
1986 Skip_Space;
kono
parents:
diff changeset
1987
kono
parents:
diff changeset
1988 Checkc ('W');
kono
parents:
diff changeset
1989 Checkc ('=');
kono
parents:
diff changeset
1990 ALIs.Table (Id).WC_Encoding := Getc;
kono
parents:
diff changeset
1991 end if;
kono
parents:
diff changeset
1992
kono
parents:
diff changeset
1993 Skip_Eol;
kono
parents:
diff changeset
1994 end if;
kono
parents:
diff changeset
1995
kono
parents:
diff changeset
1996 C := Getc;
kono
parents:
diff changeset
1997 end if;
kono
parents:
diff changeset
1998
kono
parents:
diff changeset
1999 -- Acquire argument lines
kono
parents:
diff changeset
2000
kono
parents:
diff changeset
2001 First_Arg := Args.Last + 1;
kono
parents:
diff changeset
2002
kono
parents:
diff changeset
2003 A_Loop : loop
kono
parents:
diff changeset
2004 Check_Unknown_Line;
kono
parents:
diff changeset
2005 exit A_Loop when C /= 'A';
kono
parents:
diff changeset
2006
kono
parents:
diff changeset
2007 if Ignore ('A') then
kono
parents:
diff changeset
2008 Skip_Line;
kono
parents:
diff changeset
2009
kono
parents:
diff changeset
2010 else
kono
parents:
diff changeset
2011 Checkc (' ');
kono
parents:
diff changeset
2012
kono
parents:
diff changeset
2013 -- Scan out argument
kono
parents:
diff changeset
2014
kono
parents:
diff changeset
2015 Name_Len := 0;
kono
parents:
diff changeset
2016 while not At_Eol loop
kono
parents:
diff changeset
2017 Add_Char_To_Name_Buffer (Getc);
kono
parents:
diff changeset
2018 end loop;
kono
parents:
diff changeset
2019
kono
parents:
diff changeset
2020 -- If -fstack-check, record that it occurred. Note that an
kono
parents:
diff changeset
2021 -- additional string parameter can be specified, in the form of
kono
parents:
diff changeset
2022 -- -fstack-check={no|generic|specific}. "no" means no checking,
kono
parents:
diff changeset
2023 -- "generic" means force the use of old-style checking, and
kono
parents:
diff changeset
2024 -- "specific" means use the best checking method.
kono
parents:
diff changeset
2025
kono
parents:
diff changeset
2026 if Name_Len >= 13
kono
parents:
diff changeset
2027 and then Name_Buffer (1 .. 13) = "-fstack-check"
kono
parents:
diff changeset
2028 and then Name_Buffer (1 .. Name_Len) /= "-fstack-check=no"
kono
parents:
diff changeset
2029 then
kono
parents:
diff changeset
2030 Stack_Check_Switch_Set := True;
kono
parents:
diff changeset
2031 end if;
kono
parents:
diff changeset
2032
kono
parents:
diff changeset
2033 -- Store the argument
kono
parents:
diff changeset
2034
kono
parents:
diff changeset
2035 Args.Increment_Last;
kono
parents:
diff changeset
2036 Args.Table (Args.Last) := new String'(Name_Buffer (1 .. Name_Len));
kono
parents:
diff changeset
2037
kono
parents:
diff changeset
2038 Skip_Eol;
kono
parents:
diff changeset
2039 end if;
kono
parents:
diff changeset
2040
kono
parents:
diff changeset
2041 C := Getc;
kono
parents:
diff changeset
2042 end loop A_Loop;
kono
parents:
diff changeset
2043
kono
parents:
diff changeset
2044 -- Acquire P line
kono
parents:
diff changeset
2045
kono
parents:
diff changeset
2046 Check_Unknown_Line;
kono
parents:
diff changeset
2047
kono
parents:
diff changeset
2048 while C /= 'P' loop
kono
parents:
diff changeset
2049 if Ignore_Errors then
kono
parents:
diff changeset
2050 if C = EOF then
kono
parents:
diff changeset
2051 Fatal_Error;
kono
parents:
diff changeset
2052 else
kono
parents:
diff changeset
2053 Skip_Line;
kono
parents:
diff changeset
2054 C := Nextc;
kono
parents:
diff changeset
2055 end if;
kono
parents:
diff changeset
2056 else
kono
parents:
diff changeset
2057 Fatal_Error;
kono
parents:
diff changeset
2058 end if;
kono
parents:
diff changeset
2059 end loop;
kono
parents:
diff changeset
2060
kono
parents:
diff changeset
2061 if Ignore ('P') then
kono
parents:
diff changeset
2062 Skip_Line;
kono
parents:
diff changeset
2063
kono
parents:
diff changeset
2064 -- Process P line
kono
parents:
diff changeset
2065
kono
parents:
diff changeset
2066 else
kono
parents:
diff changeset
2067 NS_Found := False;
kono
parents:
diff changeset
2068
kono
parents:
diff changeset
2069 while not At_Eol loop
kono
parents:
diff changeset
2070 Checkc (' ');
kono
parents:
diff changeset
2071 Skip_Space;
kono
parents:
diff changeset
2072 C := Getc;
kono
parents:
diff changeset
2073
kono
parents:
diff changeset
2074 -- Processing for CE
kono
parents:
diff changeset
2075
kono
parents:
diff changeset
2076 if C = 'C' then
kono
parents:
diff changeset
2077 Checkc ('E');
kono
parents:
diff changeset
2078 ALIs.Table (Id).Compile_Errors := True;
kono
parents:
diff changeset
2079
kono
parents:
diff changeset
2080 -- Processing for DB
kono
parents:
diff changeset
2081
kono
parents:
diff changeset
2082 elsif C = 'D' then
kono
parents:
diff changeset
2083 Checkc ('B');
kono
parents:
diff changeset
2084 Detect_Blocking := True;
kono
parents:
diff changeset
2085
kono
parents:
diff changeset
2086 -- Processing for Ex
kono
parents:
diff changeset
2087
kono
parents:
diff changeset
2088 elsif C = 'E' then
kono
parents:
diff changeset
2089 Partition_Elaboration_Policy_Specified := Getc;
kono
parents:
diff changeset
2090 ALIs.Table (Id).Partition_Elaboration_Policy :=
kono
parents:
diff changeset
2091 Partition_Elaboration_Policy_Specified;
kono
parents:
diff changeset
2092
kono
parents:
diff changeset
2093 -- Processing for FX
kono
parents:
diff changeset
2094
kono
parents:
diff changeset
2095 elsif C = 'F' then
kono
parents:
diff changeset
2096 C := Getc;
kono
parents:
diff changeset
2097
kono
parents:
diff changeset
2098 if C = 'X' then
kono
parents:
diff changeset
2099 ALIs.Table (Id).Frontend_Exceptions := True;
kono
parents:
diff changeset
2100 Frontend_Exceptions_Specified := True;
kono
parents:
diff changeset
2101 else
kono
parents:
diff changeset
2102 Fatal_Error_Ignore;
kono
parents:
diff changeset
2103 end if;
kono
parents:
diff changeset
2104
kono
parents:
diff changeset
2105 -- Processing for GP
kono
parents:
diff changeset
2106
kono
parents:
diff changeset
2107 elsif C = 'G' then
kono
parents:
diff changeset
2108 Checkc ('P');
kono
parents:
diff changeset
2109 GNATprove_Mode_Specified := True;
kono
parents:
diff changeset
2110 ALIs.Table (Id).GNATprove_Mode := True;
kono
parents:
diff changeset
2111
kono
parents:
diff changeset
2112 -- Processing for Lx
kono
parents:
diff changeset
2113
kono
parents:
diff changeset
2114 elsif C = 'L' then
kono
parents:
diff changeset
2115 Locking_Policy_Specified := Getc;
kono
parents:
diff changeset
2116 ALIs.Table (Id).Locking_Policy := Locking_Policy_Specified;
kono
parents:
diff changeset
2117
kono
parents:
diff changeset
2118 -- Processing for flags starting with N
kono
parents:
diff changeset
2119
kono
parents:
diff changeset
2120 elsif C = 'N' then
kono
parents:
diff changeset
2121 C := Getc;
kono
parents:
diff changeset
2122
kono
parents:
diff changeset
2123 -- Processing for NC
kono
parents:
diff changeset
2124
kono
parents:
diff changeset
2125 if C = 'C' then
kono
parents:
diff changeset
2126 ALIs.Table (Id).No_Component_Reordering := True;
kono
parents:
diff changeset
2127 No_Component_Reordering_Specified := True;
kono
parents:
diff changeset
2128
kono
parents:
diff changeset
2129 -- Processing for NO
kono
parents:
diff changeset
2130
kono
parents:
diff changeset
2131 elsif C = 'O' then
kono
parents:
diff changeset
2132 ALIs.Table (Id).No_Object := True;
kono
parents:
diff changeset
2133 No_Object_Specified := True;
kono
parents:
diff changeset
2134
kono
parents:
diff changeset
2135 -- Processing for NR
kono
parents:
diff changeset
2136
kono
parents:
diff changeset
2137 elsif C = 'R' then
kono
parents:
diff changeset
2138 No_Run_Time_Mode := True;
kono
parents:
diff changeset
2139 Configurable_Run_Time_Mode := True;
kono
parents:
diff changeset
2140
kono
parents:
diff changeset
2141 -- Processing for NS
kono
parents:
diff changeset
2142
kono
parents:
diff changeset
2143 elsif C = 'S' then
kono
parents:
diff changeset
2144 ALIs.Table (Id).Normalize_Scalars := True;
kono
parents:
diff changeset
2145 Normalize_Scalars_Specified := True;
kono
parents:
diff changeset
2146 NS_Found := True;
kono
parents:
diff changeset
2147
kono
parents:
diff changeset
2148 -- Invalid switch starting with N
kono
parents:
diff changeset
2149
kono
parents:
diff changeset
2150 else
kono
parents:
diff changeset
2151 Fatal_Error_Ignore;
kono
parents:
diff changeset
2152 end if;
kono
parents:
diff changeset
2153
kono
parents:
diff changeset
2154 -- Processing for OH/OL
kono
parents:
diff changeset
2155
kono
parents:
diff changeset
2156 elsif C = 'O' then
kono
parents:
diff changeset
2157 C := Getc;
kono
parents:
diff changeset
2158
kono
parents:
diff changeset
2159 if C = 'L' or else C = 'H' then
kono
parents:
diff changeset
2160 ALIs.Table (Id).SSO_Default := C;
kono
parents:
diff changeset
2161 SSO_Default_Specified := True;
kono
parents:
diff changeset
2162
kono
parents:
diff changeset
2163 else
kono
parents:
diff changeset
2164 Fatal_Error_Ignore;
kono
parents:
diff changeset
2165 end if;
kono
parents:
diff changeset
2166
kono
parents:
diff changeset
2167 -- Processing for Qx
kono
parents:
diff changeset
2168
kono
parents:
diff changeset
2169 elsif C = 'Q' then
kono
parents:
diff changeset
2170 Queuing_Policy_Specified := Getc;
kono
parents:
diff changeset
2171 ALIs.Table (Id).Queuing_Policy := Queuing_Policy_Specified;
kono
parents:
diff changeset
2172
kono
parents:
diff changeset
2173 -- Processing for flags starting with S
kono
parents:
diff changeset
2174
kono
parents:
diff changeset
2175 elsif C = 'S' then
kono
parents:
diff changeset
2176 C := Getc;
kono
parents:
diff changeset
2177
kono
parents:
diff changeset
2178 -- Processing for SL
kono
parents:
diff changeset
2179
kono
parents:
diff changeset
2180 if C = 'L' then
kono
parents:
diff changeset
2181 ALIs.Table (Id).SAL_Interface := True;
kono
parents:
diff changeset
2182
kono
parents:
diff changeset
2183 -- Processing for SS
kono
parents:
diff changeset
2184
kono
parents:
diff changeset
2185 elsif C = 'S' then
kono
parents:
diff changeset
2186 Opt.Sec_Stack_Used := True;
kono
parents:
diff changeset
2187
kono
parents:
diff changeset
2188 -- Invalid switch starting with S
kono
parents:
diff changeset
2189
kono
parents:
diff changeset
2190 else
kono
parents:
diff changeset
2191 Fatal_Error_Ignore;
kono
parents:
diff changeset
2192 end if;
kono
parents:
diff changeset
2193
kono
parents:
diff changeset
2194 -- Processing for Tx
kono
parents:
diff changeset
2195
kono
parents:
diff changeset
2196 elsif C = 'T' then
kono
parents:
diff changeset
2197 Task_Dispatching_Policy_Specified := Getc;
kono
parents:
diff changeset
2198 ALIs.Table (Id).Task_Dispatching_Policy :=
kono
parents:
diff changeset
2199 Task_Dispatching_Policy_Specified;
kono
parents:
diff changeset
2200
kono
parents:
diff changeset
2201 -- Processing for switch starting with U
kono
parents:
diff changeset
2202
kono
parents:
diff changeset
2203 elsif C = 'U' then
kono
parents:
diff changeset
2204 C := Getc;
kono
parents:
diff changeset
2205
kono
parents:
diff changeset
2206 -- Processing for UA
kono
parents:
diff changeset
2207
kono
parents:
diff changeset
2208 if C = 'A' then
kono
parents:
diff changeset
2209 Unreserve_All_Interrupts_Specified := True;
kono
parents:
diff changeset
2210
kono
parents:
diff changeset
2211 -- Processing for UX
kono
parents:
diff changeset
2212
kono
parents:
diff changeset
2213 elsif C = 'X' then
kono
parents:
diff changeset
2214 ALIs.Table (Id).Unit_Exception_Table := True;
kono
parents:
diff changeset
2215
kono
parents:
diff changeset
2216 -- Invalid switches starting with U
kono
parents:
diff changeset
2217
kono
parents:
diff changeset
2218 else
kono
parents:
diff changeset
2219 Fatal_Error_Ignore;
kono
parents:
diff changeset
2220 end if;
kono
parents:
diff changeset
2221
kono
parents:
diff changeset
2222 -- Processing for ZX
kono
parents:
diff changeset
2223
kono
parents:
diff changeset
2224 elsif C = 'Z' then
kono
parents:
diff changeset
2225 C := Getc;
kono
parents:
diff changeset
2226
kono
parents:
diff changeset
2227 if C = 'X' then
kono
parents:
diff changeset
2228 ALIs.Table (Id).Zero_Cost_Exceptions := True;
kono
parents:
diff changeset
2229 Zero_Cost_Exceptions_Specified := True;
kono
parents:
diff changeset
2230 else
kono
parents:
diff changeset
2231 Fatal_Error_Ignore;
kono
parents:
diff changeset
2232 end if;
kono
parents:
diff changeset
2233
kono
parents:
diff changeset
2234 -- Invalid parameter
kono
parents:
diff changeset
2235
kono
parents:
diff changeset
2236 else
kono
parents:
diff changeset
2237 C := Getc;
kono
parents:
diff changeset
2238 Fatal_Error_Ignore;
kono
parents:
diff changeset
2239 end if;
kono
parents:
diff changeset
2240 end loop;
kono
parents:
diff changeset
2241
kono
parents:
diff changeset
2242 if not NS_Found then
kono
parents:
diff changeset
2243 No_Normalize_Scalars_Specified := True;
kono
parents:
diff changeset
2244 end if;
kono
parents:
diff changeset
2245
kono
parents:
diff changeset
2246 Skip_Eol;
kono
parents:
diff changeset
2247 end if;
kono
parents:
diff changeset
2248
kono
parents:
diff changeset
2249 C := Getc;
kono
parents:
diff changeset
2250 Check_Unknown_Line;
kono
parents:
diff changeset
2251
kono
parents:
diff changeset
2252 -- Loop to skip to first restrictions line
kono
parents:
diff changeset
2253
kono
parents:
diff changeset
2254 while C /= 'R' loop
kono
parents:
diff changeset
2255 if Ignore_Errors then
kono
parents:
diff changeset
2256 if C = EOF then
kono
parents:
diff changeset
2257 Fatal_Error;
kono
parents:
diff changeset
2258 else
kono
parents:
diff changeset
2259 Skip_Line;
kono
parents:
diff changeset
2260 C := Nextc;
kono
parents:
diff changeset
2261 end if;
kono
parents:
diff changeset
2262 else
kono
parents:
diff changeset
2263 Fatal_Error;
kono
parents:
diff changeset
2264 end if;
kono
parents:
diff changeset
2265 end loop;
kono
parents:
diff changeset
2266
kono
parents:
diff changeset
2267 -- Ignore all 'R' lines if that is required
kono
parents:
diff changeset
2268
kono
parents:
diff changeset
2269 if Ignore ('R') then
kono
parents:
diff changeset
2270 while C = 'R' loop
kono
parents:
diff changeset
2271 Skip_Line;
kono
parents:
diff changeset
2272 C := Getc;
kono
parents:
diff changeset
2273 end loop;
kono
parents:
diff changeset
2274
kono
parents:
diff changeset
2275 -- Here we process the restrictions lines (other than unit name cases)
kono
parents:
diff changeset
2276
kono
parents:
diff changeset
2277 else
kono
parents:
diff changeset
2278 Scan_Restrictions : declare
kono
parents:
diff changeset
2279 Save_R : constant Restrictions_Info := Cumulative_Restrictions;
kono
parents:
diff changeset
2280 -- Save cumulative restrictions in case we have a fatal error
kono
parents:
diff changeset
2281
kono
parents:
diff changeset
2282 Bad_R_Line : exception;
kono
parents:
diff changeset
2283 -- Signal bad restrictions line (raised on unexpected character)
kono
parents:
diff changeset
2284
kono
parents:
diff changeset
2285 Typ : Character;
kono
parents:
diff changeset
2286 R : Restriction_Id;
kono
parents:
diff changeset
2287 N : Natural;
kono
parents:
diff changeset
2288
kono
parents:
diff changeset
2289 begin
kono
parents:
diff changeset
2290 -- Named restriction case
kono
parents:
diff changeset
2291
kono
parents:
diff changeset
2292 if Nextc = 'N' then
kono
parents:
diff changeset
2293 Skip_Line;
kono
parents:
diff changeset
2294 C := Getc;
kono
parents:
diff changeset
2295
kono
parents:
diff changeset
2296 -- Loop through RR and RV lines
kono
parents:
diff changeset
2297
kono
parents:
diff changeset
2298 while C = 'R' and then Nextc /= ' ' loop
kono
parents:
diff changeset
2299 Typ := Getc;
kono
parents:
diff changeset
2300 Checkc (' ');
kono
parents:
diff changeset
2301
kono
parents:
diff changeset
2302 -- Acquire restriction name
kono
parents:
diff changeset
2303
kono
parents:
diff changeset
2304 Name_Len := 0;
kono
parents:
diff changeset
2305 while not At_Eol and then Nextc /= '=' loop
kono
parents:
diff changeset
2306 Name_Len := Name_Len + 1;
kono
parents:
diff changeset
2307 Name_Buffer (Name_Len) := Getc;
kono
parents:
diff changeset
2308 end loop;
kono
parents:
diff changeset
2309
kono
parents:
diff changeset
2310 -- Now search list of restrictions to find match
kono
parents:
diff changeset
2311
kono
parents:
diff changeset
2312 declare
kono
parents:
diff changeset
2313 RN : String renames Name_Buffer (1 .. Name_Len);
kono
parents:
diff changeset
2314
kono
parents:
diff changeset
2315 begin
kono
parents:
diff changeset
2316 R := Restriction_Id'First;
kono
parents:
diff changeset
2317 while R /= Not_A_Restriction_Id loop
kono
parents:
diff changeset
2318 if Restriction_Id'Image (R) = RN then
kono
parents:
diff changeset
2319 goto R_Found;
kono
parents:
diff changeset
2320 end if;
kono
parents:
diff changeset
2321
kono
parents:
diff changeset
2322 R := Restriction_Id'Succ (R);
kono
parents:
diff changeset
2323 end loop;
kono
parents:
diff changeset
2324
kono
parents:
diff changeset
2325 -- We don't recognize the restriction. This might be
kono
parents:
diff changeset
2326 -- thought of as an error, and it really is, but we
kono
parents:
diff changeset
2327 -- want to allow building with inconsistent versions
kono
parents:
diff changeset
2328 -- of the binder and ali files (see comments at the
kono
parents:
diff changeset
2329 -- start of package System.Rident), so we just ignore
kono
parents:
diff changeset
2330 -- this situation.
kono
parents:
diff changeset
2331
kono
parents:
diff changeset
2332 goto Done_With_Restriction_Line;
kono
parents:
diff changeset
2333 end;
kono
parents:
diff changeset
2334
kono
parents:
diff changeset
2335 <<R_Found>>
kono
parents:
diff changeset
2336
kono
parents:
diff changeset
2337 case R is
kono
parents:
diff changeset
2338
kono
parents:
diff changeset
2339 -- Boolean restriction case
kono
parents:
diff changeset
2340
kono
parents:
diff changeset
2341 when All_Boolean_Restrictions =>
kono
parents:
diff changeset
2342 case Typ is
kono
parents:
diff changeset
2343 when 'V' =>
kono
parents:
diff changeset
2344 ALIs.Table (Id).Restrictions.Violated (R) :=
kono
parents:
diff changeset
2345 True;
kono
parents:
diff changeset
2346 Cumulative_Restrictions.Violated (R) := True;
kono
parents:
diff changeset
2347
kono
parents:
diff changeset
2348 when 'R' =>
kono
parents:
diff changeset
2349 ALIs.Table (Id).Restrictions.Set (R) := True;
kono
parents:
diff changeset
2350 Cumulative_Restrictions.Set (R) := True;
kono
parents:
diff changeset
2351
kono
parents:
diff changeset
2352 when others =>
kono
parents:
diff changeset
2353 raise Bad_R_Line;
kono
parents:
diff changeset
2354 end case;
kono
parents:
diff changeset
2355
kono
parents:
diff changeset
2356 -- Parameter restriction case
kono
parents:
diff changeset
2357
kono
parents:
diff changeset
2358 when All_Parameter_Restrictions =>
kono
parents:
diff changeset
2359 if At_Eol or else Nextc /= '=' then
kono
parents:
diff changeset
2360 raise Bad_R_Line;
kono
parents:
diff changeset
2361 else
kono
parents:
diff changeset
2362 Skipc;
kono
parents:
diff changeset
2363 end if;
kono
parents:
diff changeset
2364
kono
parents:
diff changeset
2365 N := Natural (Get_Nat);
kono
parents:
diff changeset
2366
kono
parents:
diff changeset
2367 case Typ is
kono
parents:
diff changeset
2368
kono
parents:
diff changeset
2369 -- Restriction set
kono
parents:
diff changeset
2370
kono
parents:
diff changeset
2371 when 'R' =>
kono
parents:
diff changeset
2372 ALIs.Table (Id).Restrictions.Set (R) := True;
kono
parents:
diff changeset
2373 ALIs.Table (Id).Restrictions.Value (R) := N;
kono
parents:
diff changeset
2374
kono
parents:
diff changeset
2375 if Cumulative_Restrictions.Set (R) then
kono
parents:
diff changeset
2376 Cumulative_Restrictions.Value (R) :=
kono
parents:
diff changeset
2377 Integer'Min
kono
parents:
diff changeset
2378 (Cumulative_Restrictions.Value (R), N);
kono
parents:
diff changeset
2379 else
kono
parents:
diff changeset
2380 Cumulative_Restrictions.Set (R) := True;
kono
parents:
diff changeset
2381 Cumulative_Restrictions.Value (R) := N;
kono
parents:
diff changeset
2382 end if;
kono
parents:
diff changeset
2383
kono
parents:
diff changeset
2384 -- Restriction violated
kono
parents:
diff changeset
2385
kono
parents:
diff changeset
2386 when 'V' =>
kono
parents:
diff changeset
2387 ALIs.Table (Id).Restrictions.Violated (R) :=
kono
parents:
diff changeset
2388 True;
kono
parents:
diff changeset
2389 Cumulative_Restrictions.Violated (R) := True;
kono
parents:
diff changeset
2390 ALIs.Table (Id).Restrictions.Count (R) := N;
kono
parents:
diff changeset
2391
kono
parents:
diff changeset
2392 -- Checked Max_Parameter case
kono
parents:
diff changeset
2393
kono
parents:
diff changeset
2394 if R in Checked_Max_Parameter_Restrictions then
kono
parents:
diff changeset
2395 Cumulative_Restrictions.Count (R) :=
kono
parents:
diff changeset
2396 Integer'Max
kono
parents:
diff changeset
2397 (Cumulative_Restrictions.Count (R), N);
kono
parents:
diff changeset
2398
kono
parents:
diff changeset
2399 -- Other checked parameter cases
kono
parents:
diff changeset
2400
kono
parents:
diff changeset
2401 else
kono
parents:
diff changeset
2402 declare
kono
parents:
diff changeset
2403 pragma Unsuppress (Overflow_Check);
kono
parents:
diff changeset
2404
kono
parents:
diff changeset
2405 begin
kono
parents:
diff changeset
2406 Cumulative_Restrictions.Count (R) :=
kono
parents:
diff changeset
2407 Cumulative_Restrictions.Count (R) + N;
kono
parents:
diff changeset
2408
kono
parents:
diff changeset
2409 exception
kono
parents:
diff changeset
2410 when Constraint_Error =>
kono
parents:
diff changeset
2411
kono
parents:
diff changeset
2412 -- A constraint error comes from the
kono
parents:
diff changeset
2413 -- addition. We reset to the maximum
kono
parents:
diff changeset
2414 -- and indicate that the real value
kono
parents:
diff changeset
2415 -- is now unknown.
kono
parents:
diff changeset
2416
kono
parents:
diff changeset
2417 Cumulative_Restrictions.Value (R) :=
kono
parents:
diff changeset
2418 Integer'Last;
kono
parents:
diff changeset
2419 Cumulative_Restrictions.Unknown (R) :=
kono
parents:
diff changeset
2420 True;
kono
parents:
diff changeset
2421 end;
kono
parents:
diff changeset
2422 end if;
kono
parents:
diff changeset
2423
kono
parents:
diff changeset
2424 -- Deal with + case
kono
parents:
diff changeset
2425
kono
parents:
diff changeset
2426 if Nextc = '+' then
kono
parents:
diff changeset
2427 Skipc;
kono
parents:
diff changeset
2428 ALIs.Table (Id).Restrictions.Unknown (R) :=
kono
parents:
diff changeset
2429 True;
kono
parents:
diff changeset
2430 Cumulative_Restrictions.Unknown (R) := True;
kono
parents:
diff changeset
2431 end if;
kono
parents:
diff changeset
2432
kono
parents:
diff changeset
2433 -- Other than 'R' or 'V'
kono
parents:
diff changeset
2434
kono
parents:
diff changeset
2435 when others =>
kono
parents:
diff changeset
2436 raise Bad_R_Line;
kono
parents:
diff changeset
2437 end case;
kono
parents:
diff changeset
2438
kono
parents:
diff changeset
2439 if not At_Eol then
kono
parents:
diff changeset
2440 raise Bad_R_Line;
kono
parents:
diff changeset
2441 end if;
kono
parents:
diff changeset
2442
kono
parents:
diff changeset
2443 -- Bizarre error case NOT_A_RESTRICTION
kono
parents:
diff changeset
2444
kono
parents:
diff changeset
2445 when Not_A_Restriction_Id =>
kono
parents:
diff changeset
2446 raise Bad_R_Line;
kono
parents:
diff changeset
2447 end case;
kono
parents:
diff changeset
2448
kono
parents:
diff changeset
2449 if not At_Eol then
kono
parents:
diff changeset
2450 raise Bad_R_Line;
kono
parents:
diff changeset
2451 end if;
kono
parents:
diff changeset
2452
kono
parents:
diff changeset
2453 <<Done_With_Restriction_Line>>
kono
parents:
diff changeset
2454 Skip_Line;
kono
parents:
diff changeset
2455 C := Getc;
kono
parents:
diff changeset
2456 end loop;
kono
parents:
diff changeset
2457
kono
parents:
diff changeset
2458 -- Positional restriction case
kono
parents:
diff changeset
2459
kono
parents:
diff changeset
2460 else
kono
parents:
diff changeset
2461 Checkc (' ');
kono
parents:
diff changeset
2462 Skip_Space;
kono
parents:
diff changeset
2463
kono
parents:
diff changeset
2464 -- Acquire information for boolean restrictions
kono
parents:
diff changeset
2465
kono
parents:
diff changeset
2466 for R in All_Boolean_Restrictions loop
kono
parents:
diff changeset
2467 C := Getc;
kono
parents:
diff changeset
2468
kono
parents:
diff changeset
2469 case C is
kono
parents:
diff changeset
2470 when 'v' =>
kono
parents:
diff changeset
2471 ALIs.Table (Id).Restrictions.Violated (R) := True;
kono
parents:
diff changeset
2472 Cumulative_Restrictions.Violated (R) := True;
kono
parents:
diff changeset
2473
kono
parents:
diff changeset
2474 when 'r' =>
kono
parents:
diff changeset
2475 ALIs.Table (Id).Restrictions.Set (R) := True;
kono
parents:
diff changeset
2476 Cumulative_Restrictions.Set (R) := True;
kono
parents:
diff changeset
2477
kono
parents:
diff changeset
2478 when 'n' =>
kono
parents:
diff changeset
2479 null;
kono
parents:
diff changeset
2480
kono
parents:
diff changeset
2481 when others =>
kono
parents:
diff changeset
2482 raise Bad_R_Line;
kono
parents:
diff changeset
2483 end case;
kono
parents:
diff changeset
2484 end loop;
kono
parents:
diff changeset
2485
kono
parents:
diff changeset
2486 -- Acquire information for parameter restrictions
kono
parents:
diff changeset
2487
kono
parents:
diff changeset
2488 for RP in All_Parameter_Restrictions loop
kono
parents:
diff changeset
2489 case Getc is
kono
parents:
diff changeset
2490 when 'n' =>
kono
parents:
diff changeset
2491 null;
kono
parents:
diff changeset
2492
kono
parents:
diff changeset
2493 when 'r' =>
kono
parents:
diff changeset
2494 ALIs.Table (Id).Restrictions.Set (RP) := True;
kono
parents:
diff changeset
2495
kono
parents:
diff changeset
2496 declare
kono
parents:
diff changeset
2497 N : constant Integer := Integer (Get_Nat);
kono
parents:
diff changeset
2498 begin
kono
parents:
diff changeset
2499 ALIs.Table (Id).Restrictions.Value (RP) := N;
kono
parents:
diff changeset
2500
kono
parents:
diff changeset
2501 if Cumulative_Restrictions.Set (RP) then
kono
parents:
diff changeset
2502 Cumulative_Restrictions.Value (RP) :=
kono
parents:
diff changeset
2503 Integer'Min
kono
parents:
diff changeset
2504 (Cumulative_Restrictions.Value (RP), N);
kono
parents:
diff changeset
2505 else
kono
parents:
diff changeset
2506 Cumulative_Restrictions.Set (RP) := True;
kono
parents:
diff changeset
2507 Cumulative_Restrictions.Value (RP) := N;
kono
parents:
diff changeset
2508 end if;
kono
parents:
diff changeset
2509 end;
kono
parents:
diff changeset
2510
kono
parents:
diff changeset
2511 when others =>
kono
parents:
diff changeset
2512 raise Bad_R_Line;
kono
parents:
diff changeset
2513 end case;
kono
parents:
diff changeset
2514
kono
parents:
diff changeset
2515 -- Acquire restrictions violations information
kono
parents:
diff changeset
2516
kono
parents:
diff changeset
2517 case Getc is
kono
parents:
diff changeset
2518
kono
parents:
diff changeset
2519 when 'n' =>
kono
parents:
diff changeset
2520 null;
kono
parents:
diff changeset
2521
kono
parents:
diff changeset
2522 when 'v' =>
kono
parents:
diff changeset
2523 ALIs.Table (Id).Restrictions.Violated (RP) := True;
kono
parents:
diff changeset
2524 Cumulative_Restrictions.Violated (RP) := True;
kono
parents:
diff changeset
2525
kono
parents:
diff changeset
2526 declare
kono
parents:
diff changeset
2527 N : constant Integer := Integer (Get_Nat);
kono
parents:
diff changeset
2528
kono
parents:
diff changeset
2529 begin
kono
parents:
diff changeset
2530 ALIs.Table (Id).Restrictions.Count (RP) := N;
kono
parents:
diff changeset
2531
kono
parents:
diff changeset
2532 if RP in Checked_Max_Parameter_Restrictions then
kono
parents:
diff changeset
2533 Cumulative_Restrictions.Count (RP) :=
kono
parents:
diff changeset
2534 Integer'Max
kono
parents:
diff changeset
2535 (Cumulative_Restrictions.Count (RP), N);
kono
parents:
diff changeset
2536
kono
parents:
diff changeset
2537 else
kono
parents:
diff changeset
2538 declare
kono
parents:
diff changeset
2539 pragma Unsuppress (Overflow_Check);
kono
parents:
diff changeset
2540
kono
parents:
diff changeset
2541 begin
kono
parents:
diff changeset
2542 Cumulative_Restrictions.Count (RP) :=
kono
parents:
diff changeset
2543 Cumulative_Restrictions.Count (RP) + N;
kono
parents:
diff changeset
2544
kono
parents:
diff changeset
2545 exception
kono
parents:
diff changeset
2546 when Constraint_Error =>
kono
parents:
diff changeset
2547
kono
parents:
diff changeset
2548 -- A constraint error comes from the add. We
kono
parents:
diff changeset
2549 -- reset to the maximum and indicate that the
kono
parents:
diff changeset
2550 -- real value is now unknown.
kono
parents:
diff changeset
2551
kono
parents:
diff changeset
2552 Cumulative_Restrictions.Value (RP) :=
kono
parents:
diff changeset
2553 Integer'Last;
kono
parents:
diff changeset
2554 Cumulative_Restrictions.Unknown (RP) := True;
kono
parents:
diff changeset
2555 end;
kono
parents:
diff changeset
2556 end if;
kono
parents:
diff changeset
2557
kono
parents:
diff changeset
2558 if Nextc = '+' then
kono
parents:
diff changeset
2559 Skipc;
kono
parents:
diff changeset
2560 ALIs.Table (Id).Restrictions.Unknown (RP) := True;
kono
parents:
diff changeset
2561 Cumulative_Restrictions.Unknown (RP) := True;
kono
parents:
diff changeset
2562 end if;
kono
parents:
diff changeset
2563 end;
kono
parents:
diff changeset
2564
kono
parents:
diff changeset
2565 when others =>
kono
parents:
diff changeset
2566 raise Bad_R_Line;
kono
parents:
diff changeset
2567 end case;
kono
parents:
diff changeset
2568 end loop;
kono
parents:
diff changeset
2569
kono
parents:
diff changeset
2570 if not At_Eol then
kono
parents:
diff changeset
2571 raise Bad_R_Line;
kono
parents:
diff changeset
2572 else
kono
parents:
diff changeset
2573 Skip_Line;
kono
parents:
diff changeset
2574 C := Getc;
kono
parents:
diff changeset
2575 end if;
kono
parents:
diff changeset
2576 end if;
kono
parents:
diff changeset
2577
kono
parents:
diff changeset
2578 -- Here if error during scanning of restrictions line
kono
parents:
diff changeset
2579
kono
parents:
diff changeset
2580 exception
kono
parents:
diff changeset
2581 when Bad_R_Line =>
kono
parents:
diff changeset
2582
kono
parents:
diff changeset
2583 -- In Ignore_Errors mode, undo any changes to restrictions
kono
parents:
diff changeset
2584 -- from this unit, and continue on, skipping remaining R
kono
parents:
diff changeset
2585 -- lines for this unit.
kono
parents:
diff changeset
2586
kono
parents:
diff changeset
2587 if Ignore_Errors then
kono
parents:
diff changeset
2588 Cumulative_Restrictions := Save_R;
kono
parents:
diff changeset
2589 ALIs.Table (Id).Restrictions := No_Restrictions;
kono
parents:
diff changeset
2590
kono
parents:
diff changeset
2591 loop
kono
parents:
diff changeset
2592 Skip_Eol;
kono
parents:
diff changeset
2593 C := Getc;
kono
parents:
diff changeset
2594 exit when C /= 'R';
kono
parents:
diff changeset
2595 end loop;
kono
parents:
diff changeset
2596
kono
parents:
diff changeset
2597 -- In normal mode, this is a fatal error
kono
parents:
diff changeset
2598
kono
parents:
diff changeset
2599 else
kono
parents:
diff changeset
2600 Fatal_Error;
kono
parents:
diff changeset
2601 end if;
kono
parents:
diff changeset
2602 end Scan_Restrictions;
kono
parents:
diff changeset
2603 end if;
kono
parents:
diff changeset
2604
kono
parents:
diff changeset
2605 -- Acquire additional restrictions (No_Dependence) lines if present
kono
parents:
diff changeset
2606
kono
parents:
diff changeset
2607 while C = 'R' loop
kono
parents:
diff changeset
2608 if Ignore ('R') then
kono
parents:
diff changeset
2609 Skip_Line;
kono
parents:
diff changeset
2610 else
kono
parents:
diff changeset
2611 Skip_Space;
kono
parents:
diff changeset
2612 No_Deps.Append ((Id, Get_Name));
kono
parents:
diff changeset
2613 Skip_Eol;
kono
parents:
diff changeset
2614 end if;
kono
parents:
diff changeset
2615
kono
parents:
diff changeset
2616 C := Getc;
kono
parents:
diff changeset
2617 end loop;
kono
parents:
diff changeset
2618
kono
parents:
diff changeset
2619 -- Acquire 'I' lines if present
kono
parents:
diff changeset
2620
kono
parents:
diff changeset
2621 Check_Unknown_Line;
kono
parents:
diff changeset
2622
kono
parents:
diff changeset
2623 while C = 'I' loop
kono
parents:
diff changeset
2624 if Ignore ('I') then
kono
parents:
diff changeset
2625 Skip_Line;
kono
parents:
diff changeset
2626
kono
parents:
diff changeset
2627 else
kono
parents:
diff changeset
2628 declare
kono
parents:
diff changeset
2629 Int_Num : Nat;
kono
parents:
diff changeset
2630 I_State : Character;
kono
parents:
diff changeset
2631 Line_No : Nat;
kono
parents:
diff changeset
2632
kono
parents:
diff changeset
2633 begin
kono
parents:
diff changeset
2634 Int_Num := Get_Nat;
kono
parents:
diff changeset
2635 Skip_Space;
kono
parents:
diff changeset
2636 I_State := Getc;
kono
parents:
diff changeset
2637 Line_No := Get_Nat;
kono
parents:
diff changeset
2638
kono
parents:
diff changeset
2639 Interrupt_States.Append (
kono
parents:
diff changeset
2640 (Interrupt_Id => Int_Num,
kono
parents:
diff changeset
2641 Interrupt_State => I_State,
kono
parents:
diff changeset
2642 IS_Pragma_Line => Line_No));
kono
parents:
diff changeset
2643
kono
parents:
diff changeset
2644 ALIs.Table (Id).Last_Interrupt_State := Interrupt_States.Last;
kono
parents:
diff changeset
2645 Skip_Eol;
kono
parents:
diff changeset
2646 end;
kono
parents:
diff changeset
2647 end if;
kono
parents:
diff changeset
2648
kono
parents:
diff changeset
2649 C := Getc;
kono
parents:
diff changeset
2650 end loop;
kono
parents:
diff changeset
2651
kono
parents:
diff changeset
2652 -- Acquire 'S' lines if present
kono
parents:
diff changeset
2653
kono
parents:
diff changeset
2654 Check_Unknown_Line;
kono
parents:
diff changeset
2655
kono
parents:
diff changeset
2656 while C = 'S' loop
kono
parents:
diff changeset
2657 if Ignore ('S') then
kono
parents:
diff changeset
2658 Skip_Line;
kono
parents:
diff changeset
2659
kono
parents:
diff changeset
2660 else
kono
parents:
diff changeset
2661 declare
kono
parents:
diff changeset
2662 Policy : Character;
kono
parents:
diff changeset
2663 First_Prio : Nat;
kono
parents:
diff changeset
2664 Last_Prio : Nat;
kono
parents:
diff changeset
2665 Line_No : Nat;
kono
parents:
diff changeset
2666
kono
parents:
diff changeset
2667 begin
kono
parents:
diff changeset
2668 Checkc (' ');
kono
parents:
diff changeset
2669 Skip_Space;
kono
parents:
diff changeset
2670
kono
parents:
diff changeset
2671 Policy := Getc;
kono
parents:
diff changeset
2672 Skip_Space;
kono
parents:
diff changeset
2673 First_Prio := Get_Nat;
kono
parents:
diff changeset
2674 Last_Prio := Get_Nat;
kono
parents:
diff changeset
2675 Line_No := Get_Nat;
kono
parents:
diff changeset
2676
kono
parents:
diff changeset
2677 Specific_Dispatching.Append (
kono
parents:
diff changeset
2678 (Dispatching_Policy => Policy,
kono
parents:
diff changeset
2679 First_Priority => First_Prio,
kono
parents:
diff changeset
2680 Last_Priority => Last_Prio,
kono
parents:
diff changeset
2681 PSD_Pragma_Line => Line_No));
kono
parents:
diff changeset
2682
kono
parents:
diff changeset
2683 ALIs.Table (Id).Last_Specific_Dispatching :=
kono
parents:
diff changeset
2684 Specific_Dispatching.Last;
kono
parents:
diff changeset
2685
kono
parents:
diff changeset
2686 Skip_Eol;
kono
parents:
diff changeset
2687 end;
kono
parents:
diff changeset
2688 end if;
kono
parents:
diff changeset
2689
kono
parents:
diff changeset
2690 C := Getc;
kono
parents:
diff changeset
2691 end loop;
kono
parents:
diff changeset
2692
kono
parents:
diff changeset
2693 -- Loop to acquire unit entries
kono
parents:
diff changeset
2694
kono
parents:
diff changeset
2695 U_Loop : loop
kono
parents:
diff changeset
2696 Check_Unknown_Line;
kono
parents:
diff changeset
2697 exit U_Loop when C /= 'U';
kono
parents:
diff changeset
2698
kono
parents:
diff changeset
2699 -- Note: as per spec, we never ignore U lines
kono
parents:
diff changeset
2700
kono
parents:
diff changeset
2701 Checkc (' ');
kono
parents:
diff changeset
2702 Skip_Space;
kono
parents:
diff changeset
2703 Units.Increment_Last;
kono
parents:
diff changeset
2704
kono
parents:
diff changeset
2705 if ALIs.Table (Id).First_Unit = No_Unit_Id then
kono
parents:
diff changeset
2706 ALIs.Table (Id).First_Unit := Units.Last;
kono
parents:
diff changeset
2707 end if;
kono
parents:
diff changeset
2708
kono
parents:
diff changeset
2709 declare
kono
parents:
diff changeset
2710 UL : Unit_Record renames Units.Table (Units.Last);
kono
parents:
diff changeset
2711
kono
parents:
diff changeset
2712 begin
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2713 UL.Uname := Get_Unit_Name;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2714 UL.Predefined := Is_Predefined_Unit;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2715 UL.Internal := Is_Internal_Unit;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2716 UL.My_ALI := Id;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2717 UL.Sfile := Get_File_Name (Lower => True);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2718 UL.Pure := False;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2719 UL.Preelab := False;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2720 UL.No_Elab := False;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2721 UL.Shared_Passive := False;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2722 UL.RCI := False;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2723 UL.Remote_Types := False;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2724 UL.Serious_Errors := False;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2725 UL.Has_RACW := False;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2726 UL.Init_Scalars := False;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2727 UL.Is_Generic := False;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2728 UL.Icasing := Mixed_Case;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2729 UL.Kcasing := All_Lower_Case;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2730 UL.Dynamic_Elab := False;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2731 UL.Elaborate_Body := False;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2732 UL.Set_Elab_Entity := False;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2733 UL.Version := "00000000";
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2734 UL.First_With := Withs.Last + 1;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2735 UL.First_Arg := First_Arg;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2736 UL.First_Invocation_Construct := Invocation_Constructs.Last + 1;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2737 UL.Last_Invocation_Construct := No_Invocation_Construct;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2738 UL.First_Invocation_Relation := Invocation_Relations.Last + 1;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2739 UL.Last_Invocation_Relation := No_Invocation_Relation;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2740 UL.Elab_Position := 0;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2741 UL.SAL_Interface := ALIs.Table (Id).SAL_Interface;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2742 UL.Directly_Scanned := Directly_Scanned;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2743 UL.Body_Needed_For_SAL := False;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2744 UL.Elaborate_Body_Desirable := False;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2745 UL.Optimize_Alignment := 'O';
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2746 UL.Has_Finalizer := False;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2747 UL.Primary_Stack_Count := 0;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2748 UL.Sec_Stack_Count := 0;
111
kono
parents:
diff changeset
2749
kono
parents:
diff changeset
2750 if Debug_Flag_U then
kono
parents:
diff changeset
2751 Write_Str (" ----> reading unit ");
kono
parents:
diff changeset
2752 Write_Int (Int (Units.Last));
kono
parents:
diff changeset
2753 Write_Str (" ");
kono
parents:
diff changeset
2754 Write_Unit_Name (UL.Uname);
kono
parents:
diff changeset
2755 Write_Str (" from file ");
kono
parents:
diff changeset
2756 Write_Name (UL.Sfile);
kono
parents:
diff changeset
2757 Write_Eol;
kono
parents:
diff changeset
2758 end if;
kono
parents:
diff changeset
2759 end;
kono
parents:
diff changeset
2760
kono
parents:
diff changeset
2761 -- Check for duplicated unit in different files
kono
parents:
diff changeset
2762
kono
parents:
diff changeset
2763 declare
kono
parents:
diff changeset
2764 Info : constant Int := Get_Name_Table_Int
kono
parents:
diff changeset
2765 (Units.Table (Units.Last).Uname);
kono
parents:
diff changeset
2766 begin
kono
parents:
diff changeset
2767 if Info /= 0
kono
parents:
diff changeset
2768 and then Units.Table (Units.Last).Sfile /=
kono
parents:
diff changeset
2769 Units.Table (Unit_Id (Info)).Sfile
kono
parents:
diff changeset
2770 then
kono
parents:
diff changeset
2771 -- If Err is set then ignore duplicate unit name. This is the
kono
parents:
diff changeset
2772 -- case of a call from gnatmake, where the situation can arise
kono
parents:
diff changeset
2773 -- from substitution of source files. In such situations, the
kono
parents:
diff changeset
2774 -- processing in gnatmake will always result in any required
kono
parents:
diff changeset
2775 -- recompilations in any case, and if we consider this to be
kono
parents:
diff changeset
2776 -- an error we get strange cases (for example when a generic
kono
parents:
diff changeset
2777 -- instantiation is replaced by a normal package) where we
kono
parents:
diff changeset
2778 -- read the old ali file, decide to recompile, and then decide
kono
parents:
diff changeset
2779 -- that the old and new ali files are incompatible.
kono
parents:
diff changeset
2780
kono
parents:
diff changeset
2781 if Err then
kono
parents:
diff changeset
2782 null;
kono
parents:
diff changeset
2783
kono
parents:
diff changeset
2784 -- If Err is not set, then this is a fatal error. This is
kono
parents:
diff changeset
2785 -- the case of being called from the binder, where we must
kono
parents:
diff changeset
2786 -- definitely diagnose this as an error.
kono
parents:
diff changeset
2787
kono
parents:
diff changeset
2788 else
kono
parents:
diff changeset
2789 Set_Standard_Error;
kono
parents:
diff changeset
2790 Write_Str ("error: duplicate unit name: ");
kono
parents:
diff changeset
2791 Write_Eol;
kono
parents:
diff changeset
2792
kono
parents:
diff changeset
2793 Write_Str ("error: unit """);
kono
parents:
diff changeset
2794 Write_Unit_Name (Units.Table (Units.Last).Uname);
kono
parents:
diff changeset
2795 Write_Str (""" found in file """);
kono
parents:
diff changeset
2796 Write_Name_Decoded (Units.Table (Units.Last).Sfile);
kono
parents:
diff changeset
2797 Write_Char ('"');
kono
parents:
diff changeset
2798 Write_Eol;
kono
parents:
diff changeset
2799
kono
parents:
diff changeset
2800 Write_Str ("error: unit """);
kono
parents:
diff changeset
2801 Write_Unit_Name (Units.Table (Unit_Id (Info)).Uname);
kono
parents:
diff changeset
2802 Write_Str (""" found in file """);
kono
parents:
diff changeset
2803 Write_Name_Decoded (Units.Table (Unit_Id (Info)).Sfile);
kono
parents:
diff changeset
2804 Write_Char ('"');
kono
parents:
diff changeset
2805 Write_Eol;
kono
parents:
diff changeset
2806
kono
parents:
diff changeset
2807 Exit_Program (E_Fatal);
kono
parents:
diff changeset
2808 end if;
kono
parents:
diff changeset
2809 end if;
kono
parents:
diff changeset
2810 end;
kono
parents:
diff changeset
2811
kono
parents:
diff changeset
2812 Set_Name_Table_Int
kono
parents:
diff changeset
2813 (Units.Table (Units.Last).Uname, Int (Units.Last));
kono
parents:
diff changeset
2814
kono
parents:
diff changeset
2815 -- Scan out possible version and other parameters
kono
parents:
diff changeset
2816
kono
parents:
diff changeset
2817 loop
kono
parents:
diff changeset
2818 Skip_Space;
kono
parents:
diff changeset
2819 exit when At_Eol;
kono
parents:
diff changeset
2820 C := Getc;
kono
parents:
diff changeset
2821
kono
parents:
diff changeset
2822 -- Version field
kono
parents:
diff changeset
2823
kono
parents:
diff changeset
2824 if C in '0' .. '9' or else C in 'a' .. 'f' then
kono
parents:
diff changeset
2825 Units.Table (Units.Last).Version (1) := C;
kono
parents:
diff changeset
2826
kono
parents:
diff changeset
2827 for J in 2 .. 8 loop
kono
parents:
diff changeset
2828 C := Getc;
kono
parents:
diff changeset
2829 Units.Table (Units.Last).Version (J) := C;
kono
parents:
diff changeset
2830 end loop;
kono
parents:
diff changeset
2831
kono
parents:
diff changeset
2832 -- BD/BN parameters
kono
parents:
diff changeset
2833
kono
parents:
diff changeset
2834 elsif C = 'B' then
kono
parents:
diff changeset
2835 C := Getc;
kono
parents:
diff changeset
2836
kono
parents:
diff changeset
2837 if C = 'D' then
kono
parents:
diff changeset
2838 Check_At_End_Of_Field;
kono
parents:
diff changeset
2839 Units.Table (Units.Last).Elaborate_Body_Desirable := True;
kono
parents:
diff changeset
2840
kono
parents:
diff changeset
2841 elsif C = 'N' then
kono
parents:
diff changeset
2842 Check_At_End_Of_Field;
kono
parents:
diff changeset
2843 Units.Table (Units.Last).Body_Needed_For_SAL := True;
kono
parents:
diff changeset
2844
kono
parents:
diff changeset
2845 else
kono
parents:
diff changeset
2846 Fatal_Error_Ignore;
kono
parents:
diff changeset
2847 end if;
kono
parents:
diff changeset
2848
kono
parents:
diff changeset
2849 -- DE parameter (Dynamic elaboration checks)
kono
parents:
diff changeset
2850
kono
parents:
diff changeset
2851 elsif C = 'D' then
kono
parents:
diff changeset
2852 C := Getc;
kono
parents:
diff changeset
2853
kono
parents:
diff changeset
2854 if C = 'E' then
kono
parents:
diff changeset
2855 Check_At_End_Of_Field;
kono
parents:
diff changeset
2856 Units.Table (Units.Last).Dynamic_Elab := True;
kono
parents:
diff changeset
2857 Dynamic_Elaboration_Checks_Specified := True;
kono
parents:
diff changeset
2858 else
kono
parents:
diff changeset
2859 Fatal_Error_Ignore;
kono
parents:
diff changeset
2860 end if;
kono
parents:
diff changeset
2861
kono
parents:
diff changeset
2862 -- EB/EE parameters
kono
parents:
diff changeset
2863
kono
parents:
diff changeset
2864 elsif C = 'E' then
kono
parents:
diff changeset
2865 C := Getc;
kono
parents:
diff changeset
2866
kono
parents:
diff changeset
2867 if C = 'B' then
kono
parents:
diff changeset
2868 Units.Table (Units.Last).Elaborate_Body := True;
kono
parents:
diff changeset
2869 elsif C = 'E' then
kono
parents:
diff changeset
2870 Units.Table (Units.Last).Set_Elab_Entity := True;
kono
parents:
diff changeset
2871 else
kono
parents:
diff changeset
2872 Fatal_Error_Ignore;
kono
parents:
diff changeset
2873 end if;
kono
parents:
diff changeset
2874
kono
parents:
diff changeset
2875 Check_At_End_Of_Field;
kono
parents:
diff changeset
2876
kono
parents:
diff changeset
2877 -- GE parameter (generic)
kono
parents:
diff changeset
2878
kono
parents:
diff changeset
2879 elsif C = 'G' then
kono
parents:
diff changeset
2880 C := Getc;
kono
parents:
diff changeset
2881
kono
parents:
diff changeset
2882 if C = 'E' then
kono
parents:
diff changeset
2883 Check_At_End_Of_Field;
kono
parents:
diff changeset
2884 Units.Table (Units.Last).Is_Generic := True;
kono
parents:
diff changeset
2885 else
kono
parents:
diff changeset
2886 Fatal_Error_Ignore;
kono
parents:
diff changeset
2887 end if;
kono
parents:
diff changeset
2888
kono
parents:
diff changeset
2889 -- IL/IS/IU parameters
kono
parents:
diff changeset
2890
kono
parents:
diff changeset
2891 elsif C = 'I' then
kono
parents:
diff changeset
2892 C := Getc;
kono
parents:
diff changeset
2893
kono
parents:
diff changeset
2894 if C = 'L' then
kono
parents:
diff changeset
2895 Units.Table (Units.Last).Icasing := All_Lower_Case;
kono
parents:
diff changeset
2896 elsif C = 'S' then
kono
parents:
diff changeset
2897 Units.Table (Units.Last).Init_Scalars := True;
kono
parents:
diff changeset
2898 Initialize_Scalars_Used := True;
kono
parents:
diff changeset
2899 elsif C = 'U' then
kono
parents:
diff changeset
2900 Units.Table (Units.Last).Icasing := All_Upper_Case;
kono
parents:
diff changeset
2901 else
kono
parents:
diff changeset
2902 Fatal_Error_Ignore;
kono
parents:
diff changeset
2903 end if;
kono
parents:
diff changeset
2904
kono
parents:
diff changeset
2905 Check_At_End_Of_Field;
kono
parents:
diff changeset
2906
kono
parents:
diff changeset
2907 -- KM/KU parameters
kono
parents:
diff changeset
2908
kono
parents:
diff changeset
2909 elsif C = 'K' then
kono
parents:
diff changeset
2910 C := Getc;
kono
parents:
diff changeset
2911
kono
parents:
diff changeset
2912 if C = 'M' then
kono
parents:
diff changeset
2913 Units.Table (Units.Last).Kcasing := Mixed_Case;
kono
parents:
diff changeset
2914 elsif C = 'U' then
kono
parents:
diff changeset
2915 Units.Table (Units.Last).Kcasing := All_Upper_Case;
kono
parents:
diff changeset
2916 else
kono
parents:
diff changeset
2917 Fatal_Error_Ignore;
kono
parents:
diff changeset
2918 end if;
kono
parents:
diff changeset
2919
kono
parents:
diff changeset
2920 Check_At_End_Of_Field;
kono
parents:
diff changeset
2921
kono
parents:
diff changeset
2922 -- NE parameter
kono
parents:
diff changeset
2923
kono
parents:
diff changeset
2924 elsif C = 'N' then
kono
parents:
diff changeset
2925 C := Getc;
kono
parents:
diff changeset
2926
kono
parents:
diff changeset
2927 if C = 'E' then
kono
parents:
diff changeset
2928 Units.Table (Units.Last).No_Elab := True;
kono
parents:
diff changeset
2929 Check_At_End_Of_Field;
kono
parents:
diff changeset
2930 else
kono
parents:
diff changeset
2931 Fatal_Error_Ignore;
kono
parents:
diff changeset
2932 end if;
kono
parents:
diff changeset
2933
kono
parents:
diff changeset
2934 -- PF/PR/PU/PK parameters
kono
parents:
diff changeset
2935
kono
parents:
diff changeset
2936 elsif C = 'P' then
kono
parents:
diff changeset
2937 C := Getc;
kono
parents:
diff changeset
2938
kono
parents:
diff changeset
2939 if C = 'F' then
kono
parents:
diff changeset
2940 Units.Table (Units.Last).Has_Finalizer := True;
kono
parents:
diff changeset
2941 elsif C = 'R' then
kono
parents:
diff changeset
2942 Units.Table (Units.Last).Preelab := True;
kono
parents:
diff changeset
2943 elsif C = 'U' then
kono
parents:
diff changeset
2944 Units.Table (Units.Last).Pure := True;
kono
parents:
diff changeset
2945 elsif C = 'K' then
kono
parents:
diff changeset
2946 Units.Table (Units.Last).Unit_Kind := 'p';
kono
parents:
diff changeset
2947 else
kono
parents:
diff changeset
2948 Fatal_Error_Ignore;
kono
parents:
diff changeset
2949 end if;
kono
parents:
diff changeset
2950
kono
parents:
diff changeset
2951 Check_At_End_Of_Field;
kono
parents:
diff changeset
2952
kono
parents:
diff changeset
2953 -- OL/OO/OS/OT parameters
kono
parents:
diff changeset
2954
kono
parents:
diff changeset
2955 elsif C = 'O' then
kono
parents:
diff changeset
2956 C := Getc;
kono
parents:
diff changeset
2957
kono
parents:
diff changeset
2958 if C = 'L' or else C = 'O' or else C = 'S' or else C = 'T' then
kono
parents:
diff changeset
2959 Units.Table (Units.Last).Optimize_Alignment := C;
kono
parents:
diff changeset
2960 else
kono
parents:
diff changeset
2961 Fatal_Error_Ignore;
kono
parents:
diff changeset
2962 end if;
kono
parents:
diff changeset
2963
kono
parents:
diff changeset
2964 Check_At_End_Of_Field;
kono
parents:
diff changeset
2965
kono
parents:
diff changeset
2966 -- RC/RT parameters
kono
parents:
diff changeset
2967
kono
parents:
diff changeset
2968 elsif C = 'R' then
kono
parents:
diff changeset
2969 C := Getc;
kono
parents:
diff changeset
2970
kono
parents:
diff changeset
2971 if C = 'C' then
kono
parents:
diff changeset
2972 Units.Table (Units.Last).RCI := True;
kono
parents:
diff changeset
2973 elsif C = 'T' then
kono
parents:
diff changeset
2974 Units.Table (Units.Last).Remote_Types := True;
kono
parents:
diff changeset
2975 elsif C = 'A' then
kono
parents:
diff changeset
2976 Units.Table (Units.Last).Has_RACW := True;
kono
parents:
diff changeset
2977 else
kono
parents:
diff changeset
2978 Fatal_Error_Ignore;
kono
parents:
diff changeset
2979 end if;
kono
parents:
diff changeset
2980
kono
parents:
diff changeset
2981 Check_At_End_Of_Field;
kono
parents:
diff changeset
2982
kono
parents:
diff changeset
2983 -- SE/SP/SU parameters
kono
parents:
diff changeset
2984
kono
parents:
diff changeset
2985 elsif C = 'S' then
kono
parents:
diff changeset
2986 C := Getc;
kono
parents:
diff changeset
2987
kono
parents:
diff changeset
2988 if C = 'E' then
kono
parents:
diff changeset
2989 Units.Table (Units.Last).Serious_Errors := True;
kono
parents:
diff changeset
2990 elsif C = 'P' then
kono
parents:
diff changeset
2991 Units.Table (Units.Last).Shared_Passive := True;
kono
parents:
diff changeset
2992 elsif C = 'U' then
kono
parents:
diff changeset
2993 Units.Table (Units.Last).Unit_Kind := 's';
kono
parents:
diff changeset
2994 else
kono
parents:
diff changeset
2995 Fatal_Error_Ignore;
kono
parents:
diff changeset
2996 end if;
kono
parents:
diff changeset
2997
kono
parents:
diff changeset
2998 Check_At_End_Of_Field;
kono
parents:
diff changeset
2999
kono
parents:
diff changeset
3000 else
kono
parents:
diff changeset
3001 C := Getc;
kono
parents:
diff changeset
3002 Fatal_Error_Ignore;
kono
parents:
diff changeset
3003 end if;
kono
parents:
diff changeset
3004 end loop;
kono
parents:
diff changeset
3005
kono
parents:
diff changeset
3006 Skip_Eol;
kono
parents:
diff changeset
3007
kono
parents:
diff changeset
3008 C := Getc;
kono
parents:
diff changeset
3009
kono
parents:
diff changeset
3010 -- Scan out With lines for this unit
kono
parents:
diff changeset
3011
kono
parents:
diff changeset
3012 With_Loop : loop
kono
parents:
diff changeset
3013 Check_Unknown_Line;
kono
parents:
diff changeset
3014 exit With_Loop when C /= 'W' and then C /= 'Y' and then C /= 'Z';
kono
parents:
diff changeset
3015
kono
parents:
diff changeset
3016 if Ignore ('W') then
kono
parents:
diff changeset
3017 Skip_Line;
kono
parents:
diff changeset
3018
kono
parents:
diff changeset
3019 else
kono
parents:
diff changeset
3020 Checkc (' ');
kono
parents:
diff changeset
3021 Skip_Space;
kono
parents:
diff changeset
3022 Withs.Increment_Last;
kono
parents:
diff changeset
3023 Withs.Table (Withs.Last).Uname := Get_Unit_Name;
kono
parents:
diff changeset
3024 Withs.Table (Withs.Last).Elaborate := False;
kono
parents:
diff changeset
3025 Withs.Table (Withs.Last).Elaborate_All := False;
kono
parents:
diff changeset
3026 Withs.Table (Withs.Last).Elab_Desirable := False;
kono
parents:
diff changeset
3027 Withs.Table (Withs.Last).Elab_All_Desirable := False;
kono
parents:
diff changeset
3028 Withs.Table (Withs.Last).SAL_Interface := False;
kono
parents:
diff changeset
3029 Withs.Table (Withs.Last).Limited_With := (C = 'Y');
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
3030 Withs.Table (Withs.Last).Implicit_With := (C = 'Z');
111
kono
parents:
diff changeset
3031
kono
parents:
diff changeset
3032 -- Generic case with no object file available
kono
parents:
diff changeset
3033
kono
parents:
diff changeset
3034 if At_Eol then
kono
parents:
diff changeset
3035 Withs.Table (Withs.Last).Sfile := No_File;
kono
parents:
diff changeset
3036 Withs.Table (Withs.Last).Afile := No_File;
kono
parents:
diff changeset
3037
kono
parents:
diff changeset
3038 -- Normal case
kono
parents:
diff changeset
3039
kono
parents:
diff changeset
3040 else
kono
parents:
diff changeset
3041 Withs.Table (Withs.Last).Sfile := Get_File_Name
kono
parents:
diff changeset
3042 (Lower => True);
kono
parents:
diff changeset
3043 Withs.Table (Withs.Last).Afile := Get_File_Name
kono
parents:
diff changeset
3044 (Lower => True);
kono
parents:
diff changeset
3045
kono
parents:
diff changeset
3046 -- Scan out possible E, EA, ED, and AD parameters
kono
parents:
diff changeset
3047
kono
parents:
diff changeset
3048 while not At_Eol loop
kono
parents:
diff changeset
3049 Skip_Space;
kono
parents:
diff changeset
3050
kono
parents:
diff changeset
3051 if Nextc = 'A' then
kono
parents:
diff changeset
3052 P := P + 1;
kono
parents:
diff changeset
3053 Checkc ('D');
kono
parents:
diff changeset
3054 Check_At_End_Of_Field;
kono
parents:
diff changeset
3055
kono
parents:
diff changeset
3056 -- Store AD indication unless ignore required
kono
parents:
diff changeset
3057
kono
parents:
diff changeset
3058 if not Ignore_ED then
kono
parents:
diff changeset
3059 Withs.Table (Withs.Last).Elab_All_Desirable := True;
kono
parents:
diff changeset
3060 end if;
kono
parents:
diff changeset
3061
kono
parents:
diff changeset
3062 elsif Nextc = 'E' then
kono
parents:
diff changeset
3063 P := P + 1;
kono
parents:
diff changeset
3064
kono
parents:
diff changeset
3065 if At_End_Of_Field then
kono
parents:
diff changeset
3066 Withs.Table (Withs.Last).Elaborate := True;
kono
parents:
diff changeset
3067
kono
parents:
diff changeset
3068 elsif Nextc = 'A' then
kono
parents:
diff changeset
3069 P := P + 1;
kono
parents:
diff changeset
3070 Check_At_End_Of_Field;
kono
parents:
diff changeset
3071 Withs.Table (Withs.Last).Elaborate_All := True;
kono
parents:
diff changeset
3072
kono
parents:
diff changeset
3073 else
kono
parents:
diff changeset
3074 Checkc ('D');
kono
parents:
diff changeset
3075 Check_At_End_Of_Field;
kono
parents:
diff changeset
3076
kono
parents:
diff changeset
3077 -- Store ED indication unless ignore required
kono
parents:
diff changeset
3078
kono
parents:
diff changeset
3079 if not Ignore_ED then
kono
parents:
diff changeset
3080 Withs.Table (Withs.Last).Elab_Desirable :=
kono
parents:
diff changeset
3081 True;
kono
parents:
diff changeset
3082 end if;
kono
parents:
diff changeset
3083 end if;
kono
parents:
diff changeset
3084
kono
parents:
diff changeset
3085 else
kono
parents:
diff changeset
3086 Fatal_Error;
kono
parents:
diff changeset
3087 end if;
kono
parents:
diff changeset
3088 end loop;
kono
parents:
diff changeset
3089 end if;
kono
parents:
diff changeset
3090
kono
parents:
diff changeset
3091 Skip_Eol;
kono
parents:
diff changeset
3092 end if;
kono
parents:
diff changeset
3093
kono
parents:
diff changeset
3094 C := Getc;
kono
parents:
diff changeset
3095 end loop With_Loop;
kono
parents:
diff changeset
3096
kono
parents:
diff changeset
3097 Units.Table (Units.Last).Last_With := Withs.Last;
kono
parents:
diff changeset
3098 Units.Table (Units.Last).Last_Arg := Args.Last;
kono
parents:
diff changeset
3099
kono
parents:
diff changeset
3100 -- Scan out task stack information for the unit if present
kono
parents:
diff changeset
3101
kono
parents:
diff changeset
3102 Check_Unknown_Line;
kono
parents:
diff changeset
3103
kono
parents:
diff changeset
3104 if C = 'T' then
kono
parents:
diff changeset
3105 if Ignore ('T') then
kono
parents:
diff changeset
3106 Skip_Line;
kono
parents:
diff changeset
3107
kono
parents:
diff changeset
3108 else
kono
parents:
diff changeset
3109 Checkc (' ');
kono
parents:
diff changeset
3110 Skip_Space;
kono
parents:
diff changeset
3111
kono
parents:
diff changeset
3112 Units.Table (Units.Last).Primary_Stack_Count := Get_Nat;
kono
parents:
diff changeset
3113 Skip_Space;
kono
parents:
diff changeset
3114 Units.Table (Units.Last).Sec_Stack_Count := Get_Nat;
kono
parents:
diff changeset
3115 Skip_Space;
kono
parents:
diff changeset
3116 Skip_Eol;
kono
parents:
diff changeset
3117 end if;
kono
parents:
diff changeset
3118
kono
parents:
diff changeset
3119 C := Getc;
kono
parents:
diff changeset
3120 end if;
kono
parents:
diff changeset
3121
kono
parents:
diff changeset
3122 -- If there are linker options lines present, scan them
kono
parents:
diff changeset
3123
kono
parents:
diff changeset
3124 Name_Len := 0;
kono
parents:
diff changeset
3125
kono
parents:
diff changeset
3126 Linker_Options_Loop : loop
kono
parents:
diff changeset
3127 Check_Unknown_Line;
kono
parents:
diff changeset
3128 exit Linker_Options_Loop when C /= 'L';
kono
parents:
diff changeset
3129
kono
parents:
diff changeset
3130 if Ignore ('L') then
kono
parents:
diff changeset
3131 Skip_Line;
kono
parents:
diff changeset
3132
kono
parents:
diff changeset
3133 else
kono
parents:
diff changeset
3134 Checkc (' ');
kono
parents:
diff changeset
3135 Skip_Space;
kono
parents:
diff changeset
3136 Checkc ('"');
kono
parents:
diff changeset
3137
kono
parents:
diff changeset
3138 loop
kono
parents:
diff changeset
3139 C := Getc;
kono
parents:
diff changeset
3140
kono
parents:
diff changeset
3141 if C < Character'Val (16#20#)
kono
parents:
diff changeset
3142 or else C > Character'Val (16#7E#)
kono
parents:
diff changeset
3143 then
kono
parents:
diff changeset
3144 Fatal_Error_Ignore;
kono
parents:
diff changeset
3145
kono
parents:
diff changeset
3146 elsif C = '{' then
kono
parents:
diff changeset
3147 C := Character'Val (0);
kono
parents:
diff changeset
3148
kono
parents:
diff changeset
3149 declare
kono
parents:
diff changeset
3150 V : Natural;
kono
parents:
diff changeset
3151
kono
parents:
diff changeset
3152 begin
kono
parents:
diff changeset
3153 V := 0;
kono
parents:
diff changeset
3154 for J in 1 .. 2 loop
kono
parents:
diff changeset
3155 C := Getc;
kono
parents:
diff changeset
3156
kono
parents:
diff changeset
3157 if C in '0' .. '9' then
kono
parents:
diff changeset
3158 V := V * 16 +
kono
parents:
diff changeset
3159 Character'Pos (C) -
kono
parents:
diff changeset
3160 Character'Pos ('0');
kono
parents:
diff changeset
3161
kono
parents:
diff changeset
3162 elsif C in 'A' .. 'F' then
kono
parents:
diff changeset
3163 V := V * 16 +
kono
parents:
diff changeset
3164 Character'Pos (C) -
kono
parents:
diff changeset
3165 Character'Pos ('A') +
kono
parents:
diff changeset
3166 10;
kono
parents:
diff changeset
3167
kono
parents:
diff changeset
3168 else
kono
parents:
diff changeset
3169 Fatal_Error_Ignore;
kono
parents:
diff changeset
3170 end if;
kono
parents:
diff changeset
3171 end loop;
kono
parents:
diff changeset
3172
kono
parents:
diff changeset
3173 Checkc ('}');
kono
parents:
diff changeset
3174 Add_Char_To_Name_Buffer (Character'Val (V));
kono
parents:
diff changeset
3175 end;
kono
parents:
diff changeset
3176
kono
parents:
diff changeset
3177 else
kono
parents:
diff changeset
3178 if C = '"' then
kono
parents:
diff changeset
3179 exit when Nextc /= '"';
kono
parents:
diff changeset
3180 C := Getc;
kono
parents:
diff changeset
3181 end if;
kono
parents:
diff changeset
3182
kono
parents:
diff changeset
3183 Add_Char_To_Name_Buffer (C);
kono
parents:
diff changeset
3184 end if;
kono
parents:
diff changeset
3185 end loop;
kono
parents:
diff changeset
3186
kono
parents:
diff changeset
3187 Add_Char_To_Name_Buffer (NUL);
kono
parents:
diff changeset
3188 Skip_Eol;
kono
parents:
diff changeset
3189 end if;
kono
parents:
diff changeset
3190
kono
parents:
diff changeset
3191 C := Getc;
kono
parents:
diff changeset
3192 end loop Linker_Options_Loop;
kono
parents:
diff changeset
3193
kono
parents:
diff changeset
3194 -- Store the linker options entry if one was found
kono
parents:
diff changeset
3195
kono
parents:
diff changeset
3196 if Name_Len /= 0 then
kono
parents:
diff changeset
3197 Linker_Options.Increment_Last;
kono
parents:
diff changeset
3198
kono
parents:
diff changeset
3199 Linker_Options.Table (Linker_Options.Last).Name :=
kono
parents:
diff changeset
3200 Name_Enter;
kono
parents:
diff changeset
3201
kono
parents:
diff changeset
3202 Linker_Options.Table (Linker_Options.Last).Unit :=
kono
parents:
diff changeset
3203 Units.Last;
kono
parents:
diff changeset
3204
kono
parents:
diff changeset
3205 Linker_Options.Table (Linker_Options.Last).Internal_File :=
kono
parents:
diff changeset
3206 Is_Internal_File_Name (F);
kono
parents:
diff changeset
3207 end if;
kono
parents:
diff changeset
3208
kono
parents:
diff changeset
3209 -- If there are notes present, scan them
kono
parents:
diff changeset
3210
kono
parents:
diff changeset
3211 Notes_Loop : loop
kono
parents:
diff changeset
3212 Check_Unknown_Line;
kono
parents:
diff changeset
3213 exit Notes_Loop when C /= 'N';
kono
parents:
diff changeset
3214
kono
parents:
diff changeset
3215 if Ignore ('N') then
kono
parents:
diff changeset
3216 Skip_Line;
kono
parents:
diff changeset
3217
kono
parents:
diff changeset
3218 else
kono
parents:
diff changeset
3219 Checkc (' ');
kono
parents:
diff changeset
3220
kono
parents:
diff changeset
3221 Notes.Increment_Last;
kono
parents:
diff changeset
3222 Notes.Table (Notes.Last).Pragma_Type := Getc;
kono
parents:
diff changeset
3223 Notes.Table (Notes.Last).Pragma_Line := Get_Nat;
kono
parents:
diff changeset
3224 Checkc (':');
kono
parents:
diff changeset
3225 Notes.Table (Notes.Last).Pragma_Col := Get_Nat;
kono
parents:
diff changeset
3226
kono
parents:
diff changeset
3227 if not At_Eol and then Nextc = ':' then
kono
parents:
diff changeset
3228 Checkc (':');
kono
parents:
diff changeset
3229 Notes.Table (Notes.Last).Pragma_Source_File :=
kono
parents:
diff changeset
3230 Get_File_Name (Lower => True);
kono
parents:
diff changeset
3231 else
kono
parents:
diff changeset
3232 Notes.Table (Notes.Last).Pragma_Source_File :=
kono
parents:
diff changeset
3233 Units.Table (Units.Last).Sfile;
kono
parents:
diff changeset
3234 end if;
kono
parents:
diff changeset
3235
kono
parents:
diff changeset
3236 if At_Eol then
kono
parents:
diff changeset
3237 Notes.Table (Notes.Last).Pragma_Args := No_Name;
kono
parents:
diff changeset
3238
kono
parents:
diff changeset
3239 else
kono
parents:
diff changeset
3240 -- Note: can't use Get_Name here as the remainder of the
kono
parents:
diff changeset
3241 -- line is unstructured text whose syntax depends on the
kono
parents:
diff changeset
3242 -- particular pragma used.
kono
parents:
diff changeset
3243
kono
parents:
diff changeset
3244 Checkc (' ');
kono
parents:
diff changeset
3245
kono
parents:
diff changeset
3246 Name_Len := 0;
kono
parents:
diff changeset
3247 while not At_Eol loop
kono
parents:
diff changeset
3248 Add_Char_To_Name_Buffer (Getc);
kono
parents:
diff changeset
3249 end loop;
kono
parents:
diff changeset
3250 end if;
kono
parents:
diff changeset
3251
kono
parents:
diff changeset
3252 Skip_Eol;
kono
parents:
diff changeset
3253 end if;
kono
parents:
diff changeset
3254
kono
parents:
diff changeset
3255 C := Getc;
kono
parents:
diff changeset
3256 end loop Notes_Loop;
kono
parents:
diff changeset
3257 end loop U_Loop;
kono
parents:
diff changeset
3258
kono
parents:
diff changeset
3259 -- End loop through units for one ALI file
kono
parents:
diff changeset
3260
kono
parents:
diff changeset
3261 ALIs.Table (Id).Last_Unit := Units.Last;
kono
parents:
diff changeset
3262 ALIs.Table (Id).Sfile := Units.Table (ALIs.Table (Id).First_Unit).Sfile;
kono
parents:
diff changeset
3263
kono
parents:
diff changeset
3264 -- Set types of the units (there can be at most 2 of them)
kono
parents:
diff changeset
3265
kono
parents:
diff changeset
3266 if ALIs.Table (Id).First_Unit /= ALIs.Table (Id).Last_Unit then
kono
parents:
diff changeset
3267 Units.Table (ALIs.Table (Id).First_Unit).Utype := Is_Body;
kono
parents:
diff changeset
3268 Units.Table (ALIs.Table (Id).Last_Unit).Utype := Is_Spec;
kono
parents:
diff changeset
3269
kono
parents:
diff changeset
3270 else
kono
parents:
diff changeset
3271 -- Deal with body only and spec only cases, note that the reason we
kono
parents:
diff changeset
3272 -- do our own checking of the name (rather than using Is_Body_Name)
kono
parents:
diff changeset
3273 -- is that Uname drags in far too much compiler junk.
kono
parents:
diff changeset
3274
kono
parents:
diff changeset
3275 Get_Name_String (Units.Table (Units.Last).Uname);
kono
parents:
diff changeset
3276
kono
parents:
diff changeset
3277 if Name_Buffer (Name_Len) = 'b' then
kono
parents:
diff changeset
3278 Units.Table (Units.Last).Utype := Is_Body_Only;
kono
parents:
diff changeset
3279 else
kono
parents:
diff changeset
3280 Units.Table (Units.Last).Utype := Is_Spec_Only;
kono
parents:
diff changeset
3281 end if;
kono
parents:
diff changeset
3282 end if;
kono
parents:
diff changeset
3283
kono
parents:
diff changeset
3284 -- Scan out external version references and put in hash table
kono
parents:
diff changeset
3285
kono
parents:
diff changeset
3286 E_Loop : loop
kono
parents:
diff changeset
3287 Check_Unknown_Line;
kono
parents:
diff changeset
3288 exit E_Loop when C /= 'E';
kono
parents:
diff changeset
3289
kono
parents:
diff changeset
3290 if Ignore ('E') then
kono
parents:
diff changeset
3291 Skip_Line;
kono
parents:
diff changeset
3292
kono
parents:
diff changeset
3293 else
kono
parents:
diff changeset
3294 Checkc (' ');
kono
parents:
diff changeset
3295 Skip_Space;
kono
parents:
diff changeset
3296
kono
parents:
diff changeset
3297 Name_Len := 0;
kono
parents:
diff changeset
3298 Name_Len := 0;
kono
parents:
diff changeset
3299 loop
kono
parents:
diff changeset
3300 C := Getc;
kono
parents:
diff changeset
3301
kono
parents:
diff changeset
3302 if C < ' ' then
kono
parents:
diff changeset
3303 Fatal_Error;
kono
parents:
diff changeset
3304 end if;
kono
parents:
diff changeset
3305
kono
parents:
diff changeset
3306 exit when At_End_Of_Field;
kono
parents:
diff changeset
3307 Add_Char_To_Name_Buffer (C);
kono
parents:
diff changeset
3308 end loop;
kono
parents:
diff changeset
3309
kono
parents:
diff changeset
3310 Version_Ref.Set (new String'(Name_Buffer (1 .. Name_Len)), True);
kono
parents:
diff changeset
3311 Skip_Eol;
kono
parents:
diff changeset
3312 end if;
kono
parents:
diff changeset
3313
kono
parents:
diff changeset
3314 C := Getc;
kono
parents:
diff changeset
3315 end loop E_Loop;
kono
parents:
diff changeset
3316
kono
parents:
diff changeset
3317 -- Scan out source dependency lines for this ALI file
kono
parents:
diff changeset
3318
kono
parents:
diff changeset
3319 ALIs.Table (Id).First_Sdep := Sdep.Last + 1;
kono
parents:
diff changeset
3320
kono
parents:
diff changeset
3321 D_Loop : loop
kono
parents:
diff changeset
3322 Check_Unknown_Line;
kono
parents:
diff changeset
3323 exit D_Loop when C /= 'D';
kono
parents:
diff changeset
3324
kono
parents:
diff changeset
3325 if Ignore ('D') then
kono
parents:
diff changeset
3326 Skip_Line;
kono
parents:
diff changeset
3327
kono
parents:
diff changeset
3328 else
kono
parents:
diff changeset
3329 Checkc (' ');
kono
parents:
diff changeset
3330 Skip_Space;
kono
parents:
diff changeset
3331 Sdep.Increment_Last;
kono
parents:
diff changeset
3332
kono
parents:
diff changeset
3333 -- In the following call, Lower is not set to True, this is either
kono
parents:
diff changeset
3334 -- a bug, or it deserves a special comment as to why this is so???
kono
parents:
diff changeset
3335
kono
parents:
diff changeset
3336 -- The file/path name may be quoted
kono
parents:
diff changeset
3337
kono
parents:
diff changeset
3338 Sdep.Table (Sdep.Last).Sfile :=
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
3339 Get_File_Name (May_Be_Quoted => True);
111
kono
parents:
diff changeset
3340
kono
parents:
diff changeset
3341 Sdep.Table (Sdep.Last).Stamp := Get_Stamp;
kono
parents:
diff changeset
3342 Sdep.Table (Sdep.Last).Dummy_Entry :=
kono
parents:
diff changeset
3343 (Sdep.Table (Sdep.Last).Stamp = Dummy_Time_Stamp);
kono
parents:
diff changeset
3344
kono
parents:
diff changeset
3345 -- Acquire checksum value
kono
parents:
diff changeset
3346
kono
parents:
diff changeset
3347 Skip_Space;
kono
parents:
diff changeset
3348
kono
parents:
diff changeset
3349 declare
kono
parents:
diff changeset
3350 Ctr : Natural;
kono
parents:
diff changeset
3351 Chk : Word;
kono
parents:
diff changeset
3352
kono
parents:
diff changeset
3353 begin
kono
parents:
diff changeset
3354 Ctr := 0;
kono
parents:
diff changeset
3355 Chk := 0;
kono
parents:
diff changeset
3356
kono
parents:
diff changeset
3357 loop
kono
parents:
diff changeset
3358 exit when At_Eol or else Ctr = 8;
kono
parents:
diff changeset
3359
kono
parents:
diff changeset
3360 if Nextc in '0' .. '9' then
kono
parents:
diff changeset
3361 Chk := Chk * 16 +
kono
parents:
diff changeset
3362 Character'Pos (Nextc) - Character'Pos ('0');
kono
parents:
diff changeset
3363
kono
parents:
diff changeset
3364 elsif Nextc in 'a' .. 'f' then
kono
parents:
diff changeset
3365 Chk := Chk * 16 +
kono
parents:
diff changeset
3366 Character'Pos (Nextc) - Character'Pos ('a') + 10;
kono
parents:
diff changeset
3367
kono
parents:
diff changeset
3368 else
kono
parents:
diff changeset
3369 exit;
kono
parents:
diff changeset
3370 end if;
kono
parents:
diff changeset
3371
kono
parents:
diff changeset
3372 Ctr := Ctr + 1;
kono
parents:
diff changeset
3373 P := P + 1;
kono
parents:
diff changeset
3374 end loop;
kono
parents:
diff changeset
3375
kono
parents:
diff changeset
3376 if Ctr = 8 and then At_End_Of_Field then
kono
parents:
diff changeset
3377 Sdep.Table (Sdep.Last).Checksum := Chk;
kono
parents:
diff changeset
3378 else
kono
parents:
diff changeset
3379 Fatal_Error;
kono
parents:
diff changeset
3380 end if;
kono
parents:
diff changeset
3381 end;
kono
parents:
diff changeset
3382
kono
parents:
diff changeset
3383 -- Acquire (sub)unit and reference file name entries
kono
parents:
diff changeset
3384
kono
parents:
diff changeset
3385 Sdep.Table (Sdep.Last).Subunit_Name := No_Name;
kono
parents:
diff changeset
3386 Sdep.Table (Sdep.Last).Unit_Name := No_Name;
kono
parents:
diff changeset
3387 Sdep.Table (Sdep.Last).Rfile :=
kono
parents:
diff changeset
3388 Sdep.Table (Sdep.Last).Sfile;
kono
parents:
diff changeset
3389 Sdep.Table (Sdep.Last).Start_Line := 1;
kono
parents:
diff changeset
3390
kono
parents:
diff changeset
3391 if not At_Eol then
kono
parents:
diff changeset
3392 Skip_Space;
kono
parents:
diff changeset
3393
kono
parents:
diff changeset
3394 -- Here for (sub)unit name
kono
parents:
diff changeset
3395
kono
parents:
diff changeset
3396 if Nextc not in '0' .. '9' then
kono
parents:
diff changeset
3397 Name_Len := 0;
kono
parents:
diff changeset
3398 while not At_End_Of_Field loop
kono
parents:
diff changeset
3399 Add_Char_To_Name_Buffer (Getc);
kono
parents:
diff changeset
3400 end loop;
kono
parents:
diff changeset
3401
kono
parents:
diff changeset
3402 -- Set the (sub)unit name. Note that we use Name_Find rather
kono
parents:
diff changeset
3403 -- than Name_Enter here as the subunit name may already
kono
parents:
diff changeset
3404 -- have been put in the name table by the Project Manager.
kono
parents:
diff changeset
3405
kono
parents:
diff changeset
3406 if Name_Len <= 2
kono
parents:
diff changeset
3407 or else Name_Buffer (Name_Len - 1) /= '%'
kono
parents:
diff changeset
3408 then
kono
parents:
diff changeset
3409 Sdep.Table (Sdep.Last).Subunit_Name := Name_Find;
kono
parents:
diff changeset
3410 else
kono
parents:
diff changeset
3411 Name_Len := Name_Len - 2;
kono
parents:
diff changeset
3412 Sdep.Table (Sdep.Last).Unit_Name := Name_Find;
kono
parents:
diff changeset
3413 end if;
kono
parents:
diff changeset
3414
kono
parents:
diff changeset
3415 Skip_Space;
kono
parents:
diff changeset
3416 end if;
kono
parents:
diff changeset
3417
kono
parents:
diff changeset
3418 -- Here for reference file name entry
kono
parents:
diff changeset
3419
kono
parents:
diff changeset
3420 if Nextc in '0' .. '9' then
kono
parents:
diff changeset
3421 Sdep.Table (Sdep.Last).Start_Line := Get_Nat;
kono
parents:
diff changeset
3422 Checkc (':');
kono
parents:
diff changeset
3423
kono
parents:
diff changeset
3424 Name_Len := 0;
kono
parents:
diff changeset
3425
kono
parents:
diff changeset
3426 while not At_End_Of_Field loop
kono
parents:
diff changeset
3427 Add_Char_To_Name_Buffer (Getc);
kono
parents:
diff changeset
3428 end loop;
kono
parents:
diff changeset
3429
kono
parents:
diff changeset
3430 Sdep.Table (Sdep.Last).Rfile := Name_Enter;
kono
parents:
diff changeset
3431 end if;
kono
parents:
diff changeset
3432 end if;
kono
parents:
diff changeset
3433
kono
parents:
diff changeset
3434 Skip_Eol;
kono
parents:
diff changeset
3435 end if;
kono
parents:
diff changeset
3436
kono
parents:
diff changeset
3437 C := Getc;
kono
parents:
diff changeset
3438 end loop D_Loop;
kono
parents:
diff changeset
3439
kono
parents:
diff changeset
3440 ALIs.Table (Id).Last_Sdep := Sdep.Last;
kono
parents:
diff changeset
3441
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3442 -- Loop through invocation-graph lines
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3443
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3444 G_Loop : loop
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3445 Check_Unknown_Line;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3446 exit G_Loop when C /= 'G';
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3447
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3448 Scan_Invocation_Graph_Line;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3449
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3450 C := Getc;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3451 end loop G_Loop;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3452
111
kono
parents:
diff changeset
3453 -- We must at this stage be at an Xref line or the end of file
kono
parents:
diff changeset
3454
kono
parents:
diff changeset
3455 if C = EOF then
kono
parents:
diff changeset
3456 return Id;
kono
parents:
diff changeset
3457 end if;
kono
parents:
diff changeset
3458
kono
parents:
diff changeset
3459 Check_Unknown_Line;
kono
parents:
diff changeset
3460
kono
parents:
diff changeset
3461 if C /= 'X' then
kono
parents:
diff changeset
3462 Fatal_Error;
kono
parents:
diff changeset
3463 end if;
kono
parents:
diff changeset
3464
kono
parents:
diff changeset
3465 -- If we are ignoring Xref sections we are done (we ignore all
kono
parents:
diff changeset
3466 -- remaining lines since only xref related lines follow X).
kono
parents:
diff changeset
3467
kono
parents:
diff changeset
3468 if Ignore ('X') and then not Debug_Flag_X then
kono
parents:
diff changeset
3469 return Id;
kono
parents:
diff changeset
3470 end if;
kono
parents:
diff changeset
3471
kono
parents:
diff changeset
3472 -- Loop through Xref sections
kono
parents:
diff changeset
3473
kono
parents:
diff changeset
3474 X_Loop : loop
kono
parents:
diff changeset
3475 Check_Unknown_Line;
kono
parents:
diff changeset
3476 exit X_Loop when C /= 'X';
kono
parents:
diff changeset
3477
kono
parents:
diff changeset
3478 -- Make new entry in section table
kono
parents:
diff changeset
3479
kono
parents:
diff changeset
3480 Xref_Section.Increment_Last;
kono
parents:
diff changeset
3481
kono
parents:
diff changeset
3482 Read_Refs_For_One_File : declare
kono
parents:
diff changeset
3483 XS : Xref_Section_Record renames
kono
parents:
diff changeset
3484 Xref_Section.Table (Xref_Section.Last);
kono
parents:
diff changeset
3485
kono
parents:
diff changeset
3486 Current_File_Num : Sdep_Id;
kono
parents:
diff changeset
3487 -- Keeps track of the current file number (changed by nn|)
kono
parents:
diff changeset
3488
kono
parents:
diff changeset
3489 begin
kono
parents:
diff changeset
3490 XS.File_Num := Sdep_Id (Get_Nat + Nat (First_Sdep_Entry) - 1);
kono
parents:
diff changeset
3491 XS.File_Name := Get_File_Name;
kono
parents:
diff changeset
3492 XS.First_Entity := Xref_Entity.Last + 1;
kono
parents:
diff changeset
3493
kono
parents:
diff changeset
3494 Current_File_Num := XS.File_Num;
kono
parents:
diff changeset
3495
kono
parents:
diff changeset
3496 Skip_Space;
kono
parents:
diff changeset
3497
kono
parents:
diff changeset
3498 Skip_Eol;
kono
parents:
diff changeset
3499 C := Nextc;
kono
parents:
diff changeset
3500
kono
parents:
diff changeset
3501 -- Loop through Xref entities
kono
parents:
diff changeset
3502
kono
parents:
diff changeset
3503 while C /= 'X' and then C /= EOF loop
kono
parents:
diff changeset
3504 Xref_Entity.Increment_Last;
kono
parents:
diff changeset
3505
kono
parents:
diff changeset
3506 Read_Refs_For_One_Entity : declare
kono
parents:
diff changeset
3507 XE : Xref_Entity_Record renames
kono
parents:
diff changeset
3508 Xref_Entity.Table (Xref_Entity.Last);
kono
parents:
diff changeset
3509 N : Nat;
kono
parents:
diff changeset
3510
kono
parents:
diff changeset
3511 procedure Read_Instantiation_Reference;
kono
parents:
diff changeset
3512 -- Acquire instantiation reference. Caller has checked
kono
parents:
diff changeset
3513 -- that current character is '[' and on return the cursor
kono
parents:
diff changeset
3514 -- is skipped past the corresponding closing ']'.
kono
parents:
diff changeset
3515
kono
parents:
diff changeset
3516 ----------------------------------
kono
parents:
diff changeset
3517 -- Read_Instantiation_Reference --
kono
parents:
diff changeset
3518 ----------------------------------
kono
parents:
diff changeset
3519
kono
parents:
diff changeset
3520 procedure Read_Instantiation_Reference is
kono
parents:
diff changeset
3521 Local_File_Num : Sdep_Id := Current_File_Num;
kono
parents:
diff changeset
3522
kono
parents:
diff changeset
3523 begin
kono
parents:
diff changeset
3524 Xref.Increment_Last;
kono
parents:
diff changeset
3525
kono
parents:
diff changeset
3526 declare
kono
parents:
diff changeset
3527 XR : Xref_Record renames Xref.Table (Xref.Last);
kono
parents:
diff changeset
3528
kono
parents:
diff changeset
3529 begin
kono
parents:
diff changeset
3530 P := P + 1; -- skip [
kono
parents:
diff changeset
3531 N := Get_Nat;
kono
parents:
diff changeset
3532
kono
parents:
diff changeset
3533 if Nextc = '|' then
kono
parents:
diff changeset
3534 XR.File_Num :=
kono
parents:
diff changeset
3535 Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
kono
parents:
diff changeset
3536 Local_File_Num := XR.File_Num;
kono
parents:
diff changeset
3537 P := P + 1;
kono
parents:
diff changeset
3538 N := Get_Nat;
kono
parents:
diff changeset
3539
kono
parents:
diff changeset
3540 else
kono
parents:
diff changeset
3541 XR.File_Num := Local_File_Num;
kono
parents:
diff changeset
3542 end if;
kono
parents:
diff changeset
3543
kono
parents:
diff changeset
3544 XR.Line := N;
kono
parents:
diff changeset
3545 XR.Rtype := ' ';
kono
parents:
diff changeset
3546 XR.Col := 0;
kono
parents:
diff changeset
3547
kono
parents:
diff changeset
3548 -- Recursive call for next reference
kono
parents:
diff changeset
3549
kono
parents:
diff changeset
3550 if Nextc = '[' then
kono
parents:
diff changeset
3551 pragma Warnings (Off); -- kill recursion warning
kono
parents:
diff changeset
3552 Read_Instantiation_Reference;
kono
parents:
diff changeset
3553 pragma Warnings (On);
kono
parents:
diff changeset
3554 end if;
kono
parents:
diff changeset
3555
kono
parents:
diff changeset
3556 -- Skip closing bracket after recursive call
kono
parents:
diff changeset
3557
kono
parents:
diff changeset
3558 P := P + 1;
kono
parents:
diff changeset
3559 end;
kono
parents:
diff changeset
3560 end Read_Instantiation_Reference;
kono
parents:
diff changeset
3561
kono
parents:
diff changeset
3562 -- Start of processing for Read_Refs_For_One_Entity
kono
parents:
diff changeset
3563
kono
parents:
diff changeset
3564 begin
kono
parents:
diff changeset
3565 XE.Line := Get_Nat;
kono
parents:
diff changeset
3566 XE.Etype := Getc;
kono
parents:
diff changeset
3567 XE.Col := Get_Nat;
kono
parents:
diff changeset
3568
kono
parents:
diff changeset
3569 case Getc is
kono
parents:
diff changeset
3570 when '*' =>
kono
parents:
diff changeset
3571 XE.Visibility := Global;
kono
parents:
diff changeset
3572 when '+' =>
kono
parents:
diff changeset
3573 XE.Visibility := Static;
kono
parents:
diff changeset
3574 when others =>
kono
parents:
diff changeset
3575 XE.Visibility := Other;
kono
parents:
diff changeset
3576 end case;
kono
parents:
diff changeset
3577
kono
parents:
diff changeset
3578 XE.Entity := Get_Name;
kono
parents:
diff changeset
3579
kono
parents:
diff changeset
3580 -- Handle the information about generic instantiations
kono
parents:
diff changeset
3581
kono
parents:
diff changeset
3582 if Nextc = '[' then
kono
parents:
diff changeset
3583 Skipc; -- Opening '['
kono
parents:
diff changeset
3584 N := Get_Nat;
kono
parents:
diff changeset
3585
kono
parents:
diff changeset
3586 if Nextc /= '|' then
kono
parents:
diff changeset
3587 XE.Iref_File_Num := Current_File_Num;
kono
parents:
diff changeset
3588 XE.Iref_Line := N;
kono
parents:
diff changeset
3589 else
kono
parents:
diff changeset
3590 XE.Iref_File_Num :=
kono
parents:
diff changeset
3591 Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
kono
parents:
diff changeset
3592 Skipc;
kono
parents:
diff changeset
3593 XE.Iref_Line := Get_Nat;
kono
parents:
diff changeset
3594 end if;
kono
parents:
diff changeset
3595
kono
parents:
diff changeset
3596 if Getc /= ']' then
kono
parents:
diff changeset
3597 Fatal_Error;
kono
parents:
diff changeset
3598 end if;
kono
parents:
diff changeset
3599
kono
parents:
diff changeset
3600 else
kono
parents:
diff changeset
3601 XE.Iref_File_Num := No_Sdep_Id;
kono
parents:
diff changeset
3602 XE.Iref_Line := 0;
kono
parents:
diff changeset
3603 end if;
kono
parents:
diff changeset
3604
kono
parents:
diff changeset
3605 Current_File_Num := XS.File_Num;
kono
parents:
diff changeset
3606
kono
parents:
diff changeset
3607 -- Renaming reference is present
kono
parents:
diff changeset
3608
kono
parents:
diff changeset
3609 if Nextc = '=' then
kono
parents:
diff changeset
3610 P := P + 1;
kono
parents:
diff changeset
3611 XE.Rref_Line := Get_Nat;
kono
parents:
diff changeset
3612
kono
parents:
diff changeset
3613 if Getc /= ':' then
kono
parents:
diff changeset
3614 Fatal_Error;
kono
parents:
diff changeset
3615 end if;
kono
parents:
diff changeset
3616
kono
parents:
diff changeset
3617 XE.Rref_Col := Get_Nat;
kono
parents:
diff changeset
3618
kono
parents:
diff changeset
3619 -- No renaming reference present
kono
parents:
diff changeset
3620
kono
parents:
diff changeset
3621 else
kono
parents:
diff changeset
3622 XE.Rref_Line := 0;
kono
parents:
diff changeset
3623 XE.Rref_Col := 0;
kono
parents:
diff changeset
3624 end if;
kono
parents:
diff changeset
3625
kono
parents:
diff changeset
3626 Skip_Space;
kono
parents:
diff changeset
3627
kono
parents:
diff changeset
3628 XE.Oref_File_Num := No_Sdep_Id;
kono
parents:
diff changeset
3629 XE.Tref_File_Num := No_Sdep_Id;
kono
parents:
diff changeset
3630 XE.Tref := Tref_None;
kono
parents:
diff changeset
3631 XE.First_Xref := Xref.Last + 1;
kono
parents:
diff changeset
3632
kono
parents:
diff changeset
3633 -- Loop to check for additional info present
kono
parents:
diff changeset
3634
kono
parents:
diff changeset
3635 loop
kono
parents:
diff changeset
3636 declare
kono
parents:
diff changeset
3637 Ref : Tref_Kind;
kono
parents:
diff changeset
3638 File : Sdep_Id;
kono
parents:
diff changeset
3639 Line : Nat;
kono
parents:
diff changeset
3640 Typ : Character;
kono
parents:
diff changeset
3641 Col : Nat;
kono
parents:
diff changeset
3642 Std : Name_Id;
kono
parents:
diff changeset
3643
kono
parents:
diff changeset
3644 begin
kono
parents:
diff changeset
3645 Get_Typeref
kono
parents:
diff changeset
3646 (Current_File_Num, Ref, File, Line, Typ, Col, Std);
kono
parents:
diff changeset
3647 exit when Ref = Tref_None;
kono
parents:
diff changeset
3648
kono
parents:
diff changeset
3649 -- Do we have an overriding procedure?
kono
parents:
diff changeset
3650
kono
parents:
diff changeset
3651 if Ref = Tref_Derived and then Typ = 'p' then
kono
parents:
diff changeset
3652 XE.Oref_File_Num := File;
kono
parents:
diff changeset
3653 XE.Oref_Line := Line;
kono
parents:
diff changeset
3654 XE.Oref_Col := Col;
kono
parents:
diff changeset
3655
kono
parents:
diff changeset
3656 -- Arrays never override anything, and <> points to
kono
parents:
diff changeset
3657 -- the index types instead
kono
parents:
diff changeset
3658
kono
parents:
diff changeset
3659 elsif Ref = Tref_Derived and then XE.Etype = 'A' then
kono
parents:
diff changeset
3660
kono
parents:
diff changeset
3661 -- Index types are stored in the list of references
kono
parents:
diff changeset
3662
kono
parents:
diff changeset
3663 Xref.Increment_Last;
kono
parents:
diff changeset
3664
kono
parents:
diff changeset
3665 declare
kono
parents:
diff changeset
3666 XR : Xref_Record renames Xref.Table (Xref.Last);
kono
parents:
diff changeset
3667 begin
kono
parents:
diff changeset
3668 XR.File_Num := File;
kono
parents:
diff changeset
3669 XR.Line := Line;
kono
parents:
diff changeset
3670 XR.Rtype := Array_Index_Reference;
kono
parents:
diff changeset
3671 XR.Col := Col;
kono
parents:
diff changeset
3672 XR.Name := Std;
kono
parents:
diff changeset
3673 end;
kono
parents:
diff changeset
3674
kono
parents:
diff changeset
3675 -- Interfaces are stored in the list of references,
kono
parents:
diff changeset
3676 -- although the parent type itself is stored in XE.
kono
parents:
diff changeset
3677 -- The first interface (when there are only
kono
parents:
diff changeset
3678 -- interfaces) is stored in XE.Tref*)
kono
parents:
diff changeset
3679
kono
parents:
diff changeset
3680 elsif Ref = Tref_Derived
kono
parents:
diff changeset
3681 and then Typ = 'R'
kono
parents:
diff changeset
3682 and then XE.Tref_File_Num /= No_Sdep_Id
kono
parents:
diff changeset
3683 then
kono
parents:
diff changeset
3684 Xref.Increment_Last;
kono
parents:
diff changeset
3685
kono
parents:
diff changeset
3686 declare
kono
parents:
diff changeset
3687 XR : Xref_Record renames Xref.Table (Xref.Last);
kono
parents:
diff changeset
3688 begin
kono
parents:
diff changeset
3689 XR.File_Num := File;
kono
parents:
diff changeset
3690 XR.Line := Line;
kono
parents:
diff changeset
3691 XR.Rtype := Interface_Reference;
kono
parents:
diff changeset
3692 XR.Col := Col;
kono
parents:
diff changeset
3693 XR.Name := Std;
kono
parents:
diff changeset
3694 end;
kono
parents:
diff changeset
3695
kono
parents:
diff changeset
3696 else
kono
parents:
diff changeset
3697 XE.Tref := Ref;
kono
parents:
diff changeset
3698 XE.Tref_File_Num := File;
kono
parents:
diff changeset
3699 XE.Tref_Line := Line;
kono
parents:
diff changeset
3700 XE.Tref_Type := Typ;
kono
parents:
diff changeset
3701 XE.Tref_Col := Col;
kono
parents:
diff changeset
3702 XE.Tref_Standard_Entity := Std;
kono
parents:
diff changeset
3703 end if;
kono
parents:
diff changeset
3704 end;
kono
parents:
diff changeset
3705 end loop;
kono
parents:
diff changeset
3706
kono
parents:
diff changeset
3707 -- Loop through cross-references for this entity
kono
parents:
diff changeset
3708
kono
parents:
diff changeset
3709 loop
kono
parents:
diff changeset
3710 Skip_Space;
kono
parents:
diff changeset
3711
kono
parents:
diff changeset
3712 if At_Eol then
kono
parents:
diff changeset
3713 Skip_Eol;
kono
parents:
diff changeset
3714 exit when Nextc /= '.';
kono
parents:
diff changeset
3715 P := P + 1;
kono
parents:
diff changeset
3716 end if;
kono
parents:
diff changeset
3717
kono
parents:
diff changeset
3718 Xref.Increment_Last;
kono
parents:
diff changeset
3719
kono
parents:
diff changeset
3720 declare
kono
parents:
diff changeset
3721 XR : Xref_Record renames Xref.Table (Xref.Last);
kono
parents:
diff changeset
3722
kono
parents:
diff changeset
3723 begin
kono
parents:
diff changeset
3724 N := Get_Nat;
kono
parents:
diff changeset
3725
kono
parents:
diff changeset
3726 if Nextc = '|' then
kono
parents:
diff changeset
3727 XR.File_Num :=
kono
parents:
diff changeset
3728 Sdep_Id (N + Nat (First_Sdep_Entry) - 1);
kono
parents:
diff changeset
3729 Current_File_Num := XR.File_Num;
kono
parents:
diff changeset
3730 P := P + 1;
kono
parents:
diff changeset
3731 N := Get_Nat;
kono
parents:
diff changeset
3732 else
kono
parents:
diff changeset
3733 XR.File_Num := Current_File_Num;
kono
parents:
diff changeset
3734 end if;
kono
parents:
diff changeset
3735
kono
parents:
diff changeset
3736 XR.Line := N;
kono
parents:
diff changeset
3737 XR.Rtype := Getc;
kono
parents:
diff changeset
3738
kono
parents:
diff changeset
3739 -- Imported entities reference as in:
kono
parents:
diff changeset
3740 -- 494b<c,__gnat_copy_attribs>25
kono
parents:
diff changeset
3741
kono
parents:
diff changeset
3742 if Nextc = '<' then
kono
parents:
diff changeset
3743 Skipc;
kono
parents:
diff changeset
3744 XR.Imported_Lang := Get_Name;
kono
parents:
diff changeset
3745
kono
parents:
diff changeset
3746 pragma Assert (Nextc = ',');
kono
parents:
diff changeset
3747 Skipc;
kono
parents:
diff changeset
3748
kono
parents:
diff changeset
3749 XR.Imported_Name := Get_Name;
kono
parents:
diff changeset
3750
kono
parents:
diff changeset
3751 pragma Assert (Nextc = '>');
kono
parents:
diff changeset
3752 Skipc;
kono
parents:
diff changeset
3753
kono
parents:
diff changeset
3754 else
kono
parents:
diff changeset
3755 XR.Imported_Lang := No_Name;
kono
parents:
diff changeset
3756 XR.Imported_Name := No_Name;
kono
parents:
diff changeset
3757 end if;
kono
parents:
diff changeset
3758
kono
parents:
diff changeset
3759 XR.Col := Get_Nat;
kono
parents:
diff changeset
3760
kono
parents:
diff changeset
3761 if Nextc = '[' then
kono
parents:
diff changeset
3762 Read_Instantiation_Reference;
kono
parents:
diff changeset
3763 end if;
kono
parents:
diff changeset
3764 end;
kono
parents:
diff changeset
3765 end loop;
kono
parents:
diff changeset
3766
kono
parents:
diff changeset
3767 -- Record last cross-reference
kono
parents:
diff changeset
3768
kono
parents:
diff changeset
3769 XE.Last_Xref := Xref.Last;
kono
parents:
diff changeset
3770 C := Nextc;
kono
parents:
diff changeset
3771
kono
parents:
diff changeset
3772 exception
kono
parents:
diff changeset
3773 when Bad_ALI_Format =>
kono
parents:
diff changeset
3774
kono
parents:
diff changeset
3775 -- If ignoring errors, then we skip a line with an
kono
parents:
diff changeset
3776 -- unexpected error, and try to continue subsequent
kono
parents:
diff changeset
3777 -- xref lines.
kono
parents:
diff changeset
3778
kono
parents:
diff changeset
3779 if Ignore_Errors then
kono
parents:
diff changeset
3780 Xref_Entity.Decrement_Last;
kono
parents:
diff changeset
3781 Skip_Line;
kono
parents:
diff changeset
3782 C := Nextc;
kono
parents:
diff changeset
3783
kono
parents:
diff changeset
3784 -- Otherwise, we reraise the fatal exception
kono
parents:
diff changeset
3785
kono
parents:
diff changeset
3786 else
kono
parents:
diff changeset
3787 raise;
kono
parents:
diff changeset
3788 end if;
kono
parents:
diff changeset
3789 end Read_Refs_For_One_Entity;
kono
parents:
diff changeset
3790 end loop;
kono
parents:
diff changeset
3791
kono
parents:
diff changeset
3792 -- Record last entity
kono
parents:
diff changeset
3793
kono
parents:
diff changeset
3794 XS.Last_Entity := Xref_Entity.Last;
kono
parents:
diff changeset
3795 end Read_Refs_For_One_File;
kono
parents:
diff changeset
3796
kono
parents:
diff changeset
3797 C := Getc;
kono
parents:
diff changeset
3798 end loop X_Loop;
kono
parents:
diff changeset
3799
kono
parents:
diff changeset
3800 -- Here after dealing with xref sections
kono
parents:
diff changeset
3801
kono
parents:
diff changeset
3802 -- Ignore remaining lines, which belong to an additional section of the
kono
parents:
diff changeset
3803 -- ALI file not considered here (like SCO or SPARK information).
kono
parents:
diff changeset
3804
kono
parents:
diff changeset
3805 Check_Unknown_Line;
kono
parents:
diff changeset
3806
kono
parents:
diff changeset
3807 return Id;
kono
parents:
diff changeset
3808
kono
parents:
diff changeset
3809 exception
kono
parents:
diff changeset
3810 when Bad_ALI_Format =>
kono
parents:
diff changeset
3811 return No_ALI_Id;
kono
parents:
diff changeset
3812 end Scan_ALI;
kono
parents:
diff changeset
3813
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3814 -----------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3815 -- Scope --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3816 -----------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3817
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3818 function Scope (IS_Id : Invocation_Signature_Id) return Name_Id is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3819 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3820 pragma Assert (Present (IS_Id));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3821 return Invocation_Signatures.Table (IS_Id).Scope;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3822 end Scope;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3823
111
kono
parents:
diff changeset
3824 ---------
kono
parents:
diff changeset
3825 -- SEq --
kono
parents:
diff changeset
3826 ---------
kono
parents:
diff changeset
3827
kono
parents:
diff changeset
3828 function SEq (F1, F2 : String_Ptr) return Boolean is
kono
parents:
diff changeset
3829 begin
kono
parents:
diff changeset
3830 return F1.all = F2.all;
kono
parents:
diff changeset
3831 end SEq;
kono
parents:
diff changeset
3832
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3833 -----------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3834 -- Set_Invocation_Graph_Encoding --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3835 -----------------------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3836
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3837 procedure Set_Invocation_Graph_Encoding
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3838 (Kind : Invocation_Graph_Encoding_Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3839 Update_Units : Boolean := True)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3840 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3841 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3842 Compile_Time_Invocation_Graph_Encoding := Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3843
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3844 -- Update the invocation-graph encoding of the current unit only when
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3845 -- requested by the caller.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3846
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3847 if Update_Units then
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3848 declare
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3849 Curr_Unit : Unit_Record renames Units.Table (Units.Last);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3850 Curr_ALI : ALIs_Record renames ALIs.Table (Curr_Unit.My_ALI);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3851
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3852 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3853 Curr_ALI.Invocation_Graph_Encoding := Kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3854 end;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3855 end if;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3856 end Set_Invocation_Graph_Encoding;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3857
111
kono
parents:
diff changeset
3858 -----------
kono
parents:
diff changeset
3859 -- SHash --
kono
parents:
diff changeset
3860 -----------
kono
parents:
diff changeset
3861
kono
parents:
diff changeset
3862 function SHash (S : String_Ptr) return Vindex is
kono
parents:
diff changeset
3863 H : Word;
kono
parents:
diff changeset
3864
kono
parents:
diff changeset
3865 begin
kono
parents:
diff changeset
3866 H := 0;
kono
parents:
diff changeset
3867 for J in S.all'Range loop
kono
parents:
diff changeset
3868 H := H * 2 + Character'Pos (S (J));
kono
parents:
diff changeset
3869 end loop;
kono
parents:
diff changeset
3870
kono
parents:
diff changeset
3871 return Vindex (Vindex'First + Vindex (H mod Vindex'Range_Length));
kono
parents:
diff changeset
3872 end SHash;
kono
parents:
diff changeset
3873
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3874 ---------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3875 -- Signature --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3876 ---------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3877
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3878 function Signature
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3879 (IC_Id : Invocation_Construct_Id) return Invocation_Signature_Id
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3880 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3881 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3882 pragma Assert (Present (IC_Id));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3883 return Invocation_Constructs.Table (IC_Id).Signature;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3884 end Signature;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3885
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3886 --------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3887 -- Spec_Placement --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3888 --------------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3889
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3890 function Spec_Placement
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3891 (IC_Id : Invocation_Construct_Id) return Declaration_Placement_Kind
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3892 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3893 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3894 pragma Assert (Present (IC_Id));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3895 return Invocation_Constructs.Table (IC_Id).Spec_Placement;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3896 end Spec_Placement;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3897
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3898 ------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3899 -- Target --
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3900 ------------
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3901
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3902 function Target
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3903 (IR_Id : Invocation_Relation_Id) return Invocation_Signature_Id
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3904 is
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3905 begin
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3906 pragma Assert (Present (IR_Id));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3907 return Invocation_Relations.Table (IR_Id).Target;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3908 end Target;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3909
111
kono
parents:
diff changeset
3910 end ALI;