comparison gcc/ada/gnatbind.adb @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
4 -- -- 4 -- --
5 -- G N A T B I N D -- 5 -- G N A T B I N D --
6 -- -- 6 -- --
7 -- B o d y -- 7 -- B o d y --
8 -- -- 8 -- --
9 -- Copyright (C) 1992-2017, Free Software Foundation, Inc. -- 9 -- Copyright (C) 1992-2018, Free Software Foundation, Inc. --
10 -- -- 10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under -- 11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- -- 12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- -- 13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- 14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
165 165
166 -- Define those restrictions that should be output if the gnatbind 166 -- Define those restrictions that should be output if the gnatbind
167 -- -r switch is used. Not all restrictions are output for the reasons 167 -- -r switch is used. Not all restrictions are output for the reasons
168 -- given below in the list, and this array is used to test whether 168 -- given below in the list, and this array is used to test whether
169 -- the corresponding pragma should be listed. True means that it 169 -- the corresponding pragma should be listed. True means that it
170 -- should not be listed. 170 -- should be listed.
171 171
172 No_Restriction_List : constant array (All_Restrictions) of Boolean := 172 Restrictions_To_List : constant array (All_Restrictions) of Boolean :=
173 (No_Standard_Allocators_After_Elaboration => True, 173 (No_Standard_Allocators_After_Elaboration => False,
174 -- This involves run-time conditions not checkable at compile time 174 -- This involves run-time conditions not checkable at compile time
175 175
176 No_Anonymous_Allocators => True, 176 No_Anonymous_Allocators => False,
177 -- Premature, since we have not implemented this yet 177 -- Premature, since we have not implemented this yet
178 178
179 No_Exception_Propagation => True, 179 No_Exception_Propagation => False,
180 -- Modifies code resulting in different exception semantics 180 -- Modifies code resulting in different exception semantics
181 181
182 No_Exceptions => True, 182 No_Exceptions => False,
183 -- Has unexpected Suppress (All_Checks) effect 183 -- Has unexpected Suppress (All_Checks) effect
184 184
185 No_Implicit_Conditionals => True, 185 No_Implicit_Conditionals => False,
186 -- This could modify and pessimize generated code 186 -- This could modify and pessimize generated code
187 187
188 No_Implicit_Dynamic_Code => True, 188 No_Implicit_Dynamic_Code => False,
189 -- This could modify and pessimize generated code 189 -- This could modify and pessimize generated code
190 190
191 No_Implicit_Loops => True, 191 No_Implicit_Loops => False,
192 -- This could modify and pessimize generated code 192 -- This could modify and pessimize generated code
193 193
194 No_Recursion => True, 194 No_Recursion => False,
195 -- Not checkable at compile time 195 -- Not checkable at compile time
196 196
197 No_Reentrancy => True, 197 No_Reentrancy => False,
198 -- Not checkable at compile time 198 -- Not checkable at compile time
199 199
200 Max_Entry_Queue_Length => True, 200 Max_Entry_Queue_Length => False,
201 -- Not checkable at compile time 201 -- Not checkable at compile time
202 202
203 Max_Storage_At_Blocking => True, 203 Max_Storage_At_Blocking => False,
204 -- Not checkable at compile time 204 -- Not checkable at compile time
205
206 No_Implementation_Restrictions => False,
207 -- Listing this one would cause a chicken&egg problem; the program
208 -- doesn't use implementation-defined restrictions, but after
209 -- applying the listed restrictions, it probably WILL use them,
210 -- so No_Implementation_Restrictions will cause an error.
205 211
206 -- The following three should not be partition-wide, so the 212 -- The following three should not be partition-wide, so the
207 -- following tests are junk to be removed eventually ??? 213 -- following tests are junk to be removed eventually ???
208 214
209 No_Specification_Of_Aspect => True, 215 No_Specification_Of_Aspect => False,
210 -- Requires a parameter value, not a count 216 -- Requires a parameter value, not a count
211 217
212 No_Use_Of_Attribute => True, 218 No_Use_Of_Attribute => False,
213 -- Requires a parameter value, not a count 219 -- Requires a parameter value, not a count
214 220
215 No_Use_Of_Pragma => True, 221 No_Use_Of_Pragma => False,
216 -- Requires a parameter value, not a count 222 -- Requires a parameter value, not a count
217 223
218 others => False); 224 others => True);
219 225
220 Additional_Restrictions_Listed : Boolean := False; 226 Additional_Restrictions_Listed : Boolean := False;
221 -- Set True if we have listed header for restrictions 227 -- Set True if we have listed header for restrictions
222 228
223 function Restriction_Could_Be_Set (R : Restriction_Id) return Boolean; 229 function Restriction_Could_Be_Set (R : Restriction_Id) return Boolean;
277 283
278 begin 284 begin
279 -- Loop through restrictions 285 -- Loop through restrictions
280 286
281 for R in All_Restrictions loop 287 for R in All_Restrictions loop
282 if not No_Restriction_List (R) 288 if Restrictions_To_List (R)
283 and then Restriction_Could_Be_Set (R) 289 and then Restriction_Could_Be_Set (R)
284 then 290 then
285 if not Additional_Restrictions_Listed then 291 if not Additional_Restrictions_Listed then
286 Write_Eol; 292 Write_Eol;
287 Write_Line 293 Write_Line
288 ("The following additional restrictions may be applied to " 294 ("-- The following additional restrictions may be applied "
289 & "this partition:"); 295 & "to this partition:");
290 Additional_Restrictions_Listed := True; 296 Additional_Restrictions_Listed := True;
291 end if; 297 end if;
292 298
293 Write_Str ("pragma Restrictions ("); 299 Write_Str ("pragma Restrictions (");
294 300
328 if Opt.Output_File_Name_Present 334 if Opt.Output_File_Name_Present
329 and then not Output_File_Name_Seen 335 and then not Output_File_Name_Seen
330 then 336 then
331 Output_File_Name_Seen := True; 337 Output_File_Name_Seen := True;
332 338
333 if Argv'Length = 0 339 if Argv'Length = 0 or else Argv (1) = '-' then
334 or else (Argv'Length >= 1 and then Argv (1) = '-')
335 then
336 Fail ("output File_Name missing after -o"); 340 Fail ("output File_Name missing after -o");
337 341
338 else 342 else
339 Output_File_Name := new String'(Argv); 343 Output_File_Name := new String'(Argv);
340 end if; 344 end if;