hppa: Fix LO_SUM DLTIND14R address support in PRINT_OPERAND_ADDRESS
[official-gcc.git] / gcc / ada / impunit.adb
blob915ec0fe059c5ede09ad2d2016037ea62d113b19
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- I M P U N I T --
6 -- --
7 -- B o d y --
8 -- --
9 -- Copyright (C) 2000-2024, Free Software Foundation, Inc. --
10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
20 -- --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
23 -- --
24 ------------------------------------------------------------------------------
26 with Errout; use Errout;
27 with Sinfo; use Sinfo;
28 with Sinfo.Nodes; use Sinfo.Nodes;
29 with Fname.UF; use Fname.UF;
30 with Lib; use Lib;
31 with Namet; use Namet;
32 with Opt; use Opt;
33 with Uname; use Uname;
35 -- Note: this package body is used by GNAT Studio and GNATBench to supply a
36 -- list of entries for help on available library routines.
38 package body Impunit is
40 subtype File_Name_8 is String (1 .. 8);
42 type File_Name_Record is record
43 Fname : File_Name_8;
44 -- 8 character name of unit
46 RMdef : Boolean;
47 -- True if unit is RM defined. False for any unit that is implementation
48 -- defined (and thus not with'able in No_Implementation_Units mode).
49 end record;
51 type File_List is array (Nat range <>) of File_Name_Record;
53 T : constant Boolean := True;
54 F : constant Boolean := False;
55 -- Short hand for RM_Defined values in lists below
57 ------------------
58 -- Ada 95 Units --
59 ------------------
61 -- The following is a giant string list containing the names of all non-
62 -- implementation internal files, i.e. the complete list of files for
63 -- internal units which a program may legitimately WITH when operating in
64 -- either Ada 95 or Ada 2005 mode.
66 -- Note that this list should match the list of units documented in the
67 -- "GNAT Library" section of the GNAT Reference Manual. A unit listed here
68 -- must either be documented in that section or described in the Ada RM.
70 Non_Imp_File_Names_95 : constant File_List := (
72 ------------------------------------------------------
73 -- Ada Hierarchy Units from Ada-95 Reference Manual --
74 ------------------------------------------------------
76 ("a-astaco", T), -- Ada.Asynchronous_Task_Control
77 ("a-calend", T), -- Ada.Calendar
78 ("a-chahan", T), -- Ada.Characters.Handling
79 ("a-charac", T), -- Ada.Characters
80 ("a-chlat1", T), -- Ada.Characters.Latin_1
81 ("a-comlin", T), -- Ada.Command_Line
82 ("a-decima", T), -- Ada.Decimal
83 ("a-direio", T), -- Ada.Direct_IO
84 ("a-dynpri", T), -- Ada.Dynamic_Priorities
85 ("a-except", T), -- Ada.Exceptions
86 ("a-finali", T), -- Ada.Finalization
87 ("a-flteio", T), -- Ada.Float_Text_IO
88 ("a-fwteio", T), -- Ada.Float_Wide_Text_IO
89 ("a-inteio", T), -- Ada.Integer_Text_IO
90 ("a-interr", T), -- Ada.Interrupts
91 ("a-intnam", T), -- Ada.Interrupts.Names
92 ("a-ioexce", T), -- Ada.IO_Exceptions
93 ("a-iwteio", T), -- Ada.Integer_Wide_Text_IO
94 ("a-ncelfu", T), -- Ada.Numerics.Complex_Elementary_Functions
95 ("a-ngcefu", T), -- Ada.Numerics.Generic_Complex_Elementary_Functions
96 ("a-ngcoty", T), -- Ada.Numerics.Generic_Complex_Types
97 ("a-ngelfu", T), -- Ada.Numerics.Generic_Elementary_Functions
98 ("a-nucoty", T), -- Ada.Numerics.Complex_Types
99 ("a-nudira", T), -- Ada.Numerics.Discrete_Random
100 ("a-nuelfu", T), -- Ada.Numerics.Elementary_Functions
101 ("a-nuflra", T), -- Ada.Numerics.Float_Random
102 ("a-numeri", T), -- Ada.Numerics
103 ("a-reatim", T), -- Ada.Real_Time
104 ("a-sequio", T), -- Ada.Sequential_IO
105 ("a-stmaco", T), -- Ada.Strings.Maps.Constants
106 ("a-storio", T), -- Ada.Storage_IO
107 ("a-strbou", T), -- Ada.Strings.Bounded
108 ("a-stream", T), -- Ada.Streams
109 ("a-strfix", T), -- Ada.Strings.Fixed
110 ("a-string", T), -- Ada.Strings
111 ("a-strmap", T), -- Ada.Strings.Maps
112 ("a-strunb", T), -- Ada.Strings.Unbounded
113 ("a-ststio", T), -- Ada.Streams.Stream_IO
114 ("a-stwibo", T), -- Ada.Strings.Wide_Bounded
115 ("a-stwifi", T), -- Ada.Strings.Wide_Fixed
116 ("a-stwima", T), -- Ada.Strings.Wide_Maps
117 ("a-stwiun", T), -- Ada.Strings.Wide_Unbounded
118 ("a-swmwco", T), -- Ada.Strings.Wide_Maps.Wide_Constants
119 ("a-sytaco", T), -- Ada.Synchronous_Task_Control
120 ("a-tags ", T), -- Ada.Tags
121 ("a-tasatt", T), -- Ada.Task_Attributes
122 ("a-taside", T), -- Ada.Task_Identification
123 ("a-teioed", T), -- Ada.Text_IO.Editing
124 ("a-textio", T), -- Ada.Text_IO
125 ("a-ticoio", T), -- Ada.Text_IO.Complex_IO
126 ("a-titest", T), -- Ada.Text_IO.Text_Streams
127 ("a-unccon", T), -- Ada.Unchecked_Conversion
128 ("a-uncdea", T), -- Ada.Unchecked_Deallocation
129 ("a-witeio", T), -- Ada.Wide_Text_IO
130 ("a-wtcoio", T), -- Ada.Wide_Text_IO.Complex_IO
131 ("a-wtedit", T), -- Ada.Wide_Text_IO.Editing
132 ("a-wttest", T), -- Ada.Wide_Text_IO.Text_Streams
134 -------------------------------------------------
135 -- RM Required Additions to Ada for GNAT Types --
136 -------------------------------------------------
138 -- Note: Long versions are considered RM defined, but not the Long Long,
139 -- Short, or Short_Short versions.
141 ("a-lfteio", T), -- Ada.Long_Float_Text_IO
142 ("a-lfwtio", T), -- Ada.Long_Float_Wide_Text_IO
143 ("a-liteio", T), -- Ada.Long_Integer_Text_IO
144 ("a-liwtio", T), -- Ada.Long_Integer_Wide_Text_IO
145 ("a-llftio", T), -- Ada.Long_Long_Float_Text_IO
146 ("a-llfwti", T), -- Ada.Long_Long_Float_Wide_Text_IO
147 ("a-llitio", T), -- Ada.Long_Long_Integer_Text_IO
148 ("a-lliwti", F), -- Ada.Long_Long_Integer_Wide_Text_IO
149 ("a-llltio", T), -- Ada.Long_Long_Long_Integer_Text_IO
150 ("a-lllwti", F), -- Ada.Long_Long_Long_Integer_Wide_Text_IO
151 ("a-nlcefu", F), -- Ada.Long_Complex_Elementary_Functions
152 ("a-nlcoty", T), -- Ada.Numerics.Long_Complex_Types
153 ("a-nlelfu", T), -- Ada.Numerics.Long_Elementary_Functions
154 ("a-nllcef", F), -- Ada.Long_Long_Complex_Elementary_Functions
155 ("a-nllefu", F), -- Ada.Numerics.Long_Long_Elementary_Functions
156 ("a-nllcty", F), -- Ada.Numerics.Long_Long_Complex_Types
157 ("a-nscefu", F), -- Ada.Short_Complex_Elementary_Functions
158 ("a-nscoty", F), -- Ada.Numerics.Short_Complex_Types
159 ("a-nselfu", F), -- Ada.Numerics.Short_Elementary_Functions
160 ("a-sfteio", F), -- Ada.Short_Float_Text_IO
161 ("a-sfwtio", F), -- Ada.Short_Float_Wide_Text_IO
162 ("a-siteio", F), -- Ada.Short_Integer_Text_IO
163 ("a-siwtio", F), -- Ada.Short_Integer_Wide_Text_IO
164 ("a-ssitio", F), -- Ada.Short_Short_Integer_Text_IO
165 ("a-ssiwti", F), -- Ada.Short_Short_Integer_Wide_Text_IO
167 -----------------------------------
168 -- GNAT Defined Additions to Ada --
169 -----------------------------------
171 ("a-calcon", F), -- Ada.Calendar.Conversions
172 ("a-chlat9", F), -- Ada.Characters.Latin_9
173 ("a-clrefi", F), -- Ada.Command_Line.Response_File
174 ("a-colien", F), -- Ada.Command_Line.Environment
175 ("a-colire", F), -- Ada.Command_Line.Remove
176 ("a-cwila1", F), -- Ada.Characters.Wide_Latin_1
177 ("a-cwila9", F), -- Ada.Characters.Wide_Latin_9
178 ("a-diocst", F), -- Ada.Direct_IO.C_Streams
179 ("a-einuoc", F), -- Ada.Exceptions.Is_Null_Occurrence
180 ("a-elchha", F), -- Ada.Exceptions.Last_Chance_Handler
181 ("a-exctra", F), -- Ada.Exceptions.Traceback
182 ("a-siocst", F), -- Ada.Sequential_IO.C_Streams
183 ("a-ssicst", F), -- Ada.Streams.Stream_IO.C_Streams
184 ("a-suteio", F), -- Ada.Strings.Unbounded.Text_IO
185 ("a-swuwti", F), -- Ada.Strings.Wide_Unbounded.Wide_Text_IO
186 ("a-tasini", F), -- Ada.Task_Initialization
187 ("a-tiocst", F), -- Ada.Text_IO.C_Streams
188 ("a-wtcstr", F), -- Ada.Wide_Text_IO.C_Streams
190 -- Note: strictly the next two should be Ada 2005 units, but it seems
191 -- harmless (and useful) to make then available in Ada 95 mode, since
192 -- they only deal with Wide_Character, not Wide_Wide_Character.
194 ("a-wichun", F), -- Ada.Wide_Characters.Unicode
195 ("a-widcha", F), -- Ada.Wide_Characters
197 -- Note: strictly the following should be Ada 2012 units, but it seems
198 -- harmless (and useful) to make then available in Ada 95 mode, since
199 -- they do not deal with Wide_Wide_Character.
201 ("a-wichha", F), -- Ada.Wide_Characters.Handling
202 ("a-stuten", F), -- Ada.Strings.UTF_Encoding
203 ("a-suenco", F), -- Ada.Strings.UTF_Encoding.Conversions
204 ("a-suenst", F), -- Ada.Strings.UTF_Encoding.Strings
205 ("a-suewst", F), -- Ada.Strings.UTF_Encoding.Wide_Strings
207 ---------------------------
208 -- GNAT Special IO Units --
209 ---------------------------
211 -- As further explained elsewhere (see Sem_Ch10), the internal packages of
212 -- Text_IO and Wide_Text_IO are actually implemented as separate children,
213 -- but this fact is intended to be hidden from the user completely. Any
214 -- attempt to WITH one of these units will be diagnosed as an error later
215 -- on, but for now we do not consider these internal implementation units
216 -- (if we did, then we would get a junk warning which would be confusing
217 -- and unnecessary, given that we generate a clear error message).
219 ("a-tideio", F), -- Ada.Text_IO.Decimal_IO
220 ("a-tienio", F), -- Ada.Text_IO.Enumeration_IO
221 ("a-tifiio", F), -- Ada.Text_IO.Fixed_IO
222 ("a-tiflio", F), -- Ada.Text_IO.Float_IO
223 ("a-tiinio", F), -- Ada.Text_IO.Integer_IO
224 ("a-timoio", F), -- Ada.Text_IO.Modular_IO
225 ("a-wtdeio", F), -- Ada.Wide_Text_IO.Decimal_IO
226 ("a-wtenio", F), -- Ada.Wide_Text_IO.Enumeration_IO
227 ("a-wtfiio", F), -- Ada.Wide_Text_IO.Fixed_IO
228 ("a-wtflio", F), -- Ada.Wide_Text_IO.Float_IO
229 ("a-wtinio", F), -- Ada.Wide_Text_IO.Integer_IO
230 ("a-wtmoio", F), -- Ada.Wide_Text_IO.Modular_IO
232 ------------------------
233 -- GNAT Library Units --
234 ------------------------
236 ("g-altive", F), -- GNAT.Altivec
237 ("g-altcon", F), -- GNAT.Altivec.Conversions
238 ("g-alveop", F), -- GNAT.Altivec.Vector_Operations
239 ("g-alvety", F), -- GNAT.Altivec.Vector_Types
240 ("g-alvevi", F), -- GNAT.Altivec.Vector_Views
241 ("g-arrspl", F), -- GNAT.Array_Split
242 ("g-awk ", F), -- GNAT.AWK
243 ("g-binenv", F), -- GNAT.Bind_Environment
244 ("g-binsea", F), -- GNAT.Binary_Search
245 ("g-boubuf", F), -- GNAT.Bounded_Buffers
246 ("g-boumai", F), -- GNAT.Bounded_Mailboxes
247 ("g-brapre", F), -- GNAT.Branch_Prediction
248 ("g-bubsor", F), -- GNAT.Bubble_Sort
249 ("g-busora", F), -- GNAT.Bubble_Sort_A
250 ("g-busorg", F), -- GNAT.Bubble_Sort_G
251 ("g-byorma", F), -- GNAT.Byte_Order_Mark
252 ("g-bytswa", F), -- GNAT.Byte_Swapping
253 ("g-calend", F), -- GNAT.Calendar
254 ("g-catiio", F), -- GNAT.Calendar.Time_IO
255 ("g-casuti", F), -- GNAT.Case_Util
256 ("g-cgi ", F), -- GNAT.CGI
257 ("g-cgicoo", F), -- GNAT.CGI.Cookie
258 ("g-cgideb", F), -- GNAT.CGI.Debug
259 ("g-comlin", F), -- GNAT.Command_Line
260 ("g-comver", F), -- GNAT.Compiler_Version
261 ("g-cppexc", F), -- GNAT.CPP_Exceptions
262 ("g-crc32 ", F), -- GNAT.CRC32
263 ("g-ctrl_c", F), -- GNAT.Ctrl_C
264 ("g-curexc", F), -- GNAT.Current_Exception
265 ("g-debpoo", F), -- GNAT.Debug_Pools
266 ("g-debuti", F), -- GNAT.Debug_Utilities
267 ("g-decstr", F), -- GNAT.Decode_String
268 ("g-deutst", F), -- GNAT.Decode_UTF8_String
269 ("g-dirope", F), -- GNAT.Directory_Operations
270 ("g-diopit", F), -- GNAT.Directory_Operations.Iteration
271 ("g-dynhta", F), -- GNAT.Dynamic_HTables
272 ("g-dyntab", F), -- GNAT.Dynamic_Tables
273 ("g-encstr", F), -- GNAT.Encode_String
274 ("g-enutst", F), -- GNAT.Encode_UTF8_String
275 ("g-excact", F), -- GNAT.Exception_Actions
276 ("g-except", F), -- GNAT.Exceptions
277 ("g-exctra", F), -- GNAT.Exception_Traces
278 ("g-expect", F), -- GNAT.Expect
279 ("g-exptty", F), -- GNAT.Expect.TTY
280 ("g-flocon", F), -- GNAT.Float_Control
281 ("g-forstr", F), -- GNAT.Formatted_String
282 ("g-gfmafu", F), -- GNAT.Generic_Fast_Math_Functions
283 ("g-graphs", F), -- GNAT.Graphs
284 ("g-heasor", F), -- GNAT.Heap_Sort
285 ("g-hesora", F), -- GNAT.Heap_Sort_A
286 ("g-hesorg", F), -- GNAT.Heap_Sort_G
287 ("g-htable", F), -- GNAT.Htable
288 ("g-io ", F), -- GNAT.IO
289 ("g-io_aux", F), -- GNAT.IO_Aux
290 ("g-lists ", F), -- GNAT.Lists
291 ("g-locfil", F), -- GNAT.Lock_Files
292 ("g-mbdira", F), -- GNAT.MBBS_Discrete_Random
293 ("g-mbflra", F), -- GNAT.MBBS_Float_Random
294 ("g-md5 ", F), -- GNAT.MD5
295 ("g-memdum", F), -- GNAT.Memory_Dump
296 ("g-moreex", F), -- GNAT.Most_Recent_Exception
297 ("g-os_lib", F), -- GNAT.Os_Lib
298 ("g-pehage", F), -- GNAT.Perfect_Hash_Generators
299 ("g-rannum", F), -- GNAT.Random_Numbers
300 ("g-regexp", F), -- GNAT.Regexp
301 ("g-regist", F), -- GNAT.Registry
302 ("g-regpat", F), -- GNAT.Regpat
303 ("g-rewdat", F), -- GNAT.Rewrite_Data
304 ("g-semaph", F), -- GNAT.Semaphores
305 ("g-sercom", F), -- GNAT.Serial_Communications
306 ("g-sestin", F), -- GNAT.Secondary_Stack_Info
307 ("g-sets ", F), -- GNAT.Sets
308 ("g-sha1 ", F), -- GNAT.SHA1
309 ("g-sha224", F), -- GNAT.SHA224
310 ("g-sha256", F), -- GNAT.SHA256
311 ("g-sha384", F), -- GNAT.SHA384
312 ("g-sha512", F), -- GNAT.SHA512
313 ("g-signal", F), -- GNAT.Signals
314 ("g-socket", F), -- GNAT.Sockets
315 ("g-socpol", F), -- GNAT.Sockets.Poll
316 ("g-souinf", F), -- GNAT.Source_Info
317 ("g-speche", F), -- GNAT.Spell_Checker
318 ("g-spchge", F), -- GNAT.Spell_Checker_Generic
319 ("g-spitbo", F), -- GNAT.Spitbol
320 ("g-spipat", F), -- GNAT.Spitbol.Patterns
321 ("g-sptabo", F), -- GNAT.Spitbol.Table_Boolean
322 ("g-sptain", F), -- GNAT.Spitbol.Table_Integer
323 ("g-sptavs", F), -- GNAT.Spitbol.Table_Vstring
324 ("g-strhas", F), -- GNAT.String_Hash
325 ("g-string", F), -- GNAT.Strings
326 ("g-strspl", F), -- GNAT.String_Split
327 ("g-sse ", F), -- GNAT.SSE
328 ("g-ssvety", F), -- GNAT.SSE.Vector_Types
329 ("g-table ", F), -- GNAT.Table
330 ("g-tasloc", F), -- GNAT.Task_Lock
331 ("g-tastus", F), -- GNAT.Task_Stack_Usage
332 ("g-thread", F), -- GNAT.Threads
333 ("g-timsta", F), -- GNAT.Time_Stamp
334 ("g-traceb", F), -- GNAT.Traceback
335 ("g-trasym", F), -- GNAT.Traceback.Symbolic
336 ("g-tty ", F), -- GNAT.TTY
337 ("g-utf_32", F), -- GNAT.UTF_32
338 ("g-u3spch", F), -- GNAT.UTF_32_Spelling_Checker
339 ("g-wispch", F), -- GNAT.Wide_Spelling_Checker
340 ("g-wistsp", F), -- GNAT.Wide_String_Split
342 -----------------------------------------------------
343 -- Interface Hierarchy Units from Reference Manual --
344 -----------------------------------------------------
346 ("i-c ", T), -- Interfaces.C
347 ("i-cobol ", T), -- Interfaces.Cobol
348 ("i-cpoint", T), -- Interfaces.C.Pointers
349 ("i-cstrin", T), -- Interfaces.C.Strings
350 ("i-fortra", T), -- Interfaces.Fortran
352 ------------------------------------------
353 -- GNAT Defined Additions to Interfaces --
354 ------------------------------------------
356 ("i-cexten", F), -- Interfaces.C.Extensions
357 ("i-cil ", F), -- Interfaces.CIL
358 ("i-cilobj", F), -- Interfaces.CIL.Object
359 ("i-cstrea", F), -- Interfaces.C.Streams
360 ("i-java ", F), -- Interfaces.Java
361 ("i-javjni", F), -- Interfaces.Java.JNI
362 ("i-pacdec", F), -- Interfaces.Packed_Decimal
363 ("i-vxinco", F), -- Interfaces.VxWorks.Int_Connection
364 ("i-vxwoio", F), -- Interfaces.VxWorks.IO
365 ("i-vxwork", F), -- Interfaces.VxWorks
367 --------------------------------------------------
368 -- System Hierarchy Units from Reference Manual --
369 --------------------------------------------------
371 ("s-atacco", T), -- System.Address_To_Access_Conversions
372 ("s-maccod", T), -- System.Machine_Code
373 ("s-rpc ", T), -- System.Rpc
374 ("s-stoele", T), -- System.Storage_Elements
375 ("s-stopoo", T), -- System.Storage_Pools
377 --------------------------------------
378 -- GNAT Defined Additions to System --
379 --------------------------------------
381 ("s-addima", F), -- System.Address_Image
382 ("s-atocou", F), -- System.Atomic_Counters
383 ("s-assert", F), -- System.Assertions
384 ("s-dfmkio", F), -- System.Dim.Float_Mks_IO
385 ("s-dfmopr", F), -- System.Dim.Float_Mks.Other_Prefixes
386 ("s-dgmgop", F), -- System.Dim.Generic_Mks.Generic_Other_Prefixes
387 ("s-dlmopr", F), -- System.Dim.Long_Mks.Other_Prefixes
388 ("s-diflio", F), -- System.Dim.Float_IO
389 ("s-diflmk", F), -- System.Dim.Float_Mks
390 ("s-digemk", F), -- System.Dim.Generic_Mks
391 ("s-diinio", F), -- System.Dim.Integer_IO
392 ("s-dilomk", F), -- System.Dim.Long_Mks
393 ("s-dimkio", F), -- System.Dim.Mks_IO
394 ("s-dimmks", F), -- System.Dim.Mks
395 ("s-dlmkio", F), -- System.Dim.Long_Mks_IO
396 ("s-dmotpr", F), -- System.Dim.Mks.Other_Prefixes
397 ("s-memory", F), -- System.Memory
398 ("s-parint", F), -- System.Partition_Interface
399 ("s-pooglo", F), -- System.Pool_Global
400 ("s-pooloc", F), -- System.Pool_Local
401 ("s-restri", F), -- System.Restrictions
402 ("s-rident", F), -- System.Rident
403 ("s-ststop", F), -- System.Strings.Stream_Ops
404 ("s-tasinf", F), -- System.Task_Info
405 ("s-unstyp", F), -- System.Unsigned_Types
406 ("s-wchcnv", F), -- System.WCh_Cnv
407 ("s-wchcon", F), -- System.WCh_Con
409 -- The following are strictly speaking Ada 2012 units, but we are allowed
410 -- to add children to system, so we consider them to be implementation
411 -- defined additions to System in earlier versions of Ada.
413 ("s-multip", T), -- System.Multiprocessors
414 ("s-mudido", T)); -- System.Multiprocessors.Dispatching_Domains
416 --------------------
417 -- Ada 2005 Units --
418 --------------------
420 -- The following units should be used only in Ada 05 mode
422 Non_Imp_File_Names_05 : constant File_List := (
424 --------------------------------------------------------
425 -- Ada Hierarchy Units from Ada 2005 Reference Manual --
426 --------------------------------------------------------
428 ("a-assert", T), -- Ada.Assertions
429 ("a-calari", T), -- Ada.Calendar.Arithmetic
430 ("a-calfor", T), -- Ada.Calendar.Formatting
431 ("a-catizo", T), -- Ada.Calendar.Time_Zones
432 ("a-cdlili", T), -- Ada.Containers.Doubly_Linked_Lists
433 ("a-cgarso", T), -- Ada.Containers.Generic_Array_Sort
434 ("a-cgcaso", T), -- Ada.Containers.Generic_Constrained_Array_Sort
435 ("a-chacon", T), -- Ada.Characters.Conversions
436 ("a-cidlli", T), -- Ada.Containers.Indefinite_Doubly_Linked_Lists
437 ("a-cihama", T), -- Ada.Containers.Indefinite_Hashed_Maps
438 ("a-cihase", T), -- Ada.Containers.Indefinite_Hashed_Sets
439 ("a-ciorma", T), -- Ada.Containers.Indefinite_Ordered_Maps
440 ("a-ciorse", T), -- Ada.Containers.Indefinite_Ordered_Sets
441 ("a-cohama", T), -- Ada.Containers.Hashed_Maps
442 ("a-cohase", T), -- Ada.Containers.Hashed_Sets
443 ("a-coinve", T), -- Ada.Containers.Indefinite_Vectors
444 ("a-contai", T), -- Ada.Containers
445 ("a-convec", T), -- Ada.Containers.Vectors
446 ("a-coorma", T), -- Ada.Containers.Ordered_Maps
447 ("a-coorse", T), -- Ada.Containers.Ordered_Sets
448 ("a-coteio", T), -- Ada.Complex_Text_IO
449 ("a-direct", T), -- Ada.Directories
450 ("a-dinopr", T), -- Ada.Dispatching.Non_Preemptive
451 ("a-diroro", T), -- Ada.Dispatching.Round_Robin
452 ("a-disedf", T), -- Ada.Dispatching.EDF
453 ("a-dispat", T), -- Ada.Dispatching
454 ("a-envvar", T), -- Ada.Environment_Variables
455 ("a-etgrbu", T), -- Ada.Execution_Time.Group_Budgets
456 ("a-exetim", T), -- Ada.Execution_Time
457 ("a-extiti", T), -- Ada.Execution_Time.Timers
458 ("a-izteio", T), -- Ada.Integer_Wide_Wide_Text_IO
459 ("a-rttiev", T), -- Ada.Real_Time.Timing_Events
460 ("a-ngcoar", T), -- Ada.Numerics.Generic_Complex_Arrays
461 ("a-ngrear", T), -- Ada.Numerics.Generic_Real_Arrays
462 ("a-nucoar", T), -- Ada.Numerics.Complex_Arrays
463 ("a-nurear", T), -- Ada.Numerics.Real_Arrays
464 ("a-stboha", T), -- Ada.Strings.Bounded.Hash
465 ("a-stfiha", T), -- Ada.Strings.Fixed.Hash
466 ("a-strhas", T), -- Ada.Strings.Hash
467 ("a-stunha", T), -- Ada.Strings.Unbounded.Hash
468 ("a-stwiha", T), -- Ada.Strings.Wide_Hash
469 ("a-stzbou", T), -- Ada.Strings.Wide_Wide_Bounded
470 ("a-stzfix", T), -- Ada.Strings.Wide_Wide_Fixed
471 ("a-stzhas", T), -- Ada.Strings.Wide_Wide_Hash
472 ("a-stzmap", T), -- Ada.Strings.Wide_Wide_Maps
473 ("a-stzunb", T), -- Ada.Strings.Wide_Wide_Unbounded
474 ("a-swbwha", T), -- Ada.Strings.Wide_Bounded.Wide_Hash
475 ("a-swfwha", T), -- Ada.Strings.Wide_Fixed.Wide_Hash
476 ("a-swuwha", T), -- Ada.Strings.Wide_Unbounded.Wide_Hash
477 ("a-szbzha", T), -- Ada.Strings.Wide_Wide_Bounded.Wide_Wide_Hash
478 ("a-szfzha", T), -- Ada.Strings.Wide_Wide_Fixed.Wide_Wide_Hash
479 ("a-szmzco", T), -- Ada.Strings.Wide_Wide_Maps.Wide_Wide_Constants
480 ("a-szuzha", T), -- Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Hash
481 ("a-taster", T), -- Ada.Task_Termination
482 ("a-tgdico", T), -- Ada.Tags.Generic_Dispatching_Constructor
483 ("a-tiboio", T), -- Ada.Text_IO.Bounded_IO
484 ("a-tiunio", T), -- Ada.Text_IO.Unbounded_IO
485 ("a-wichun", T), -- Ada.Wide_Characters.Unicode
486 ("a-wwboio", T), -- Ada.Wide_Text_IO.Wide_Bounded_IO
487 ("a-wwunio", T), -- Ada.Wide_Text_IO.Wide_Unbounded_IO
488 ("a-zchara", T), -- Ada.Wide_Wide_Characters
489 ("a-zchhan", T), -- Ada.Wide_Wide_Characters.Handling
490 ("a-ztcoio", T), -- Ada.Wide_Wide_Text_IO.Complex_IO
491 ("a-ztedit", T), -- Ada.Wide_Wide_Text_IO.Editing
492 ("a-zttest", T), -- Ada.Wide_Wide_Text_IO.Text_Streams
493 ("a-ztexio", T), -- Ada.Wide_Wide_Text_IO
494 ("a-zzboio", T), -- Ada.Wide_Wide_Text_IO.Wide_Wide_Bounded_IO
495 ("a-zzunio", T), -- Ada.Wide_Wide_Text_IO.Wide_Wide_Unbounded_IO
497 ------------------------------------------------------
498 -- RM Required Additions to Ada 2005 for GNAT Types --
499 ------------------------------------------------------
501 -- Note: Long versions are considered RM defined, but not the Long Long,
502 -- Short, or Short_Short versions.
504 ("a-lcteio", T), -- Ada.Long_Complex_Text_IO
505 ("a-lfztio", T), -- Ada.Long_Float_Wide_Wide_Text_IO
506 ("a-liztio", T), -- Ada.Long_Integer_Wide_Wide_Text_IO
507 ("a-llctio", T), -- Ada.Long_Long_Complex_Text_IO
508 ("a-llfzti", T), -- Ada.Long_Long_Float_Wide_Wide_Text_IO
509 ("a-llizti", T), -- Ada.Long_Long_Integer_Wide_Wide_Text_IO
510 ("a-lllzti", T), -- Ada.Long_Long_Long_Integer_Wide_Wide_Text_IO
511 ("a-nlcoar", T), -- Ada.Numerics.Long_Complex_Arrays
512 ("a-nllcar", T), -- Ada.Numerics.Long_Long_Complex_Arrays
513 ("a-nllrar", T), -- Ada.Numerics.Long_Long_Real_Arrays
514 ("a-nlrear", T), -- Ada.Numerics.Long_Real_Arrays
515 ("a-scteio", F), -- Ada.Short_Complex_Text_IO
516 ("a-sfztio", F), -- Ada.Short_Float_Wide_Wide_Text_IO
517 ("a-siztio", F), -- Ada.Short_Integer_Wide_Wide_Text_IO
518 ("a-ssizti", F), -- Ada.Short_Short_Integer_Wide_Wide_Text_IO
520 ----------------------------------------
521 -- GNAT Defined Additions to Ada 2005 --
522 ----------------------------------------
524 ("a-cgaaso", F), -- Ada.Containers.Generic_Anonymous_Array_Sort
525 ("a-chzla1", F), -- Ada.Characters.Wide_Wide_Latin_1
526 ("a-chzla9", F), -- Ada.Characters.Wide_Wide_Latin_9
527 ("a-ciormu", F), -- Ada.Containers.Indefinite_Ordered_Multisets
528 ("a-coormu", F), -- Ada.Containers.Ordered_Multisets
529 ("a-crdlli", F), -- Ada.Containers.Restricted_Doubly_Linked_Lists
530 ("a-szuzti", F), -- Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO
531 ("a-zchuni", F), -- Ada.Wide_Wide_Characters.Unicode
532 ("a-ztcstr", F), -- Ada.Wide_Wide_Text_IO.C_Streams
534 -- Note: strictly the following should be Ada 2012 units, but it seems
535 -- harmless (and useful) to make then available in Ada 2005 mode.
537 ("a-cogeso", T), -- Ada.Containers.Generic_Sort
538 ("a-dhfina", T), -- Ada.Directories.Hierarchical_File_Names
539 ("a-secain", T), -- Ada.Strings.Equal_Case_Insensitive
540 ("a-shcain", T), -- Ada.Strings.Hash_Case_Insensitive
541 ("a-slcain", T), -- Ada.Strings.Less_Case_Insensitive
542 ("a-sfecin", T), -- Ada.Strings.Fixed.Equal_Case_Insensitive
543 ("a-sfhcin", T), -- Ada.Strings.Fixed.Hash_Case_Insensitive
544 ("a-sflcin", T), -- Ada.Strings.Fixed.Less_Case_Insensitive
545 ("a-sbecin", T), -- Ada.Strings.Bounded.Equal_Case_Insensitive
546 ("a-sbhcin", T), -- Ada.Strings.Bounded.Hash_Case_Insensitive
547 ("a-sblcin", T), -- Ada.Strings.Bounded.Less_Case_Insensitive
548 ("a-suecin", T), -- Ada.Strings.Unbounded.Equal_Case_Insensitive
549 ("a-suhcin", T), -- Ada.Strings.Unbounded.Hash_Case_Insensitive
550 ("a-sulcin", T), -- Ada.Strings.Unbounded.Less_Case_Insensitive
551 ("a-suezst", T), -- Ada.Strings.UTF_Encoding.Wide_Wide_Strings
553 ---------------------------
554 -- GNAT Special IO Units --
555 ---------------------------
557 -- See Ada 95 section for further information. These packages are for the
558 -- implementation of the Wide_Wide_Text_IO generic packages.
560 ("a-ztdeio", F), -- Ada.Wide_Wide_Text_IO.Decimal_IO
561 ("a-ztenio", F), -- Ada.Wide_Wide_Text_IO.Enumeration_IO
562 ("a-ztfiio", F), -- Ada.Wide_Wide_Text_IO.Fixed_IO
563 ("a-ztflio", F), -- Ada.Wide_Wide_Text_IO.Float_IO
564 ("a-ztinio", F), -- Ada.Wide_Wide_Text_IO.Integer_IO
565 ("a-ztmoio", F), -- Ada.Wide_Wide_Text_IO.Modular_IO
567 ------------------------
568 -- GNAT Library Units --
569 ------------------------
571 ("g-zspche", F), -- GNAT.Wide_Wide_Spelling_Checker
572 ("g-zstspl", F)); -- GNAT.Wide_Wide_String_Split
574 --------------------
575 -- Ada 2012 Units --
576 --------------------
578 -- The following units should be used only in Ada 2012 mode
580 Non_Imp_File_Names_12 : constant File_List := (
581 ("s-stposu", T), -- System.Storage_Pools.Subpools
582 ("a-cobove", T), -- Ada.Containers.Bounded_Vectors
583 ("a-cbdlli", T), -- Ada.Containers.Bounded_Doubly_Linked_Lists
584 ("a-cborse", T), -- Ada.Containers.Bounded_Ordered_Sets
585 ("a-cborma", T), -- Ada.Containers.Bounded_Ordered_Maps
586 ("a-cbhase", T), -- Ada.Containers.Bounded_Hashed_Sets
587 ("a-cbhama", T), -- Ada.Containers.Bounded_Hashed_Maps
588 ("a-coinho", T), -- Ada.Containers.Indefinite_Holders
589 ("a-comutr", T), -- Ada.Containers.Multiway_Trees
590 ("a-cimutr", T), -- Ada.Containers.Indefinite_Multiway_Trees
591 ("a-cbmutr", T), -- Ada.Containers.Bounded_Multiway_Trees
592 ("a-csquin", T), -- Ada.Containers.Synchronized_Queue_Interfaces
593 ("a-cusyqu", T), -- Ada.Containers.Unbounded_Synchronized_Queues
594 ("a-cuprqu", T), -- Ada.Containers.Unbounded_Priority_Queues
595 ("a-cbsyqu", T), -- Ada.Containers.Bounded_Synchronized_Queues
596 ("a-cbprqu", T), -- Ada.Containers.Bounded_Priority_Queues
597 ("a-extiin", T), -- Ada.Execution_Time.Interrupts
598 ("a-iteint", T), -- Ada.Iterator_Interfaces
599 ("a-locale", T), -- Ada.Locales
600 ("a-stcoed", T), -- Ada.Synchronous_Task_Control.EDF
601 ("a-synbar", T), -- Ada.Synchronous_Barriers
602 ("a-undesu", T), -- Ada.Unchecked_Deallocate_Subpool
604 ----------------------------------------
605 -- GNAT Defined Additions to Ada 2012 --
606 ----------------------------------------
608 ("a-coboho", F), -- Ada.Containers.Bounded_Holders
609 ("a-cvgpso", F) -- Ada.Containers.Vectors.Generic_Parallel_Sorting from
610 ); -- GNATCOLL.OMP
612 --------------------
613 -- Ada 2022 Units --
614 --------------------
616 -- The following units should be used only in Ada 2022 mode
618 Non_Imp_File_Names_22 : constant File_List := (
619 ("a-nubinu", T), -- Ada.Numerics.Big_Numbers
620 ("a-nbnbin", T), -- Ada.Numerics.Big_Numbers.Big_Integers
621 ("a-nbnbre", T), -- Ada.Numerics.Big_Numbers.Big_Reals
622 ("s-aoinar", T), -- System.Atomic_Operations.Integer_Arithmetic
623 ("s-aomoar", T), -- System.Atomic_Operations.Modular_Arithmetic
624 ("s-aotase", T), -- System.Atomic_Operations.Test_And_Set
625 ("s-atoope", T), -- System.Atomic_Operations
626 ("s-atopex", T), -- System.Atomic_Operations.Exchange
627 ("a-sttebu", T), -- Ada.Strings.Text_Buffers
628 ("a-stbuun", T), -- Ada.Strings.Text_Buffers.Unbounded
629 ("a-stbubo", T), -- Ada.Strings.Text_Buffers.Bounded
630 ("a-strsto", T), -- Ada.Streams.Storage
631 ("a-ststbo", T), -- Ada.Streams.Storage.Bounded
632 ("a-ststun", T), -- Ada.Streams.Storage.Unbounded
634 ----------------------------------------
635 -- GNAT Defined Additions to Ada 2022 --
636 ----------------------------------------
638 ("a-stbufi", T), -- Ada.Strings.Text_Buffers.Files
639 ("a-stbufo", T), -- Ada.Strings.Text_Buffers.Formatting
640 ("a-stbuut", T) -- Ada.Strings.Text_Buffers.Utils
643 -----------------------
644 -- Alternative Units --
645 -----------------------
647 -- For some implementation units, there is a unit in the GNAT library
648 -- that has identical functionality that is usable. If we have such a
649 -- case we record the appropriate Unit name in Error_Msg_String.
651 type Aunit_Record is record
652 Fname : String (1 .. 6);
653 Aname : String_Ptr_Const;
654 end record;
656 -- Array of alternative unit names
658 Scasuti : aliased constant String := "GNAT.Case_Util";
659 Scrc32 : aliased constant String := "GNAT.CRC32";
660 Shtable : aliased constant String := "GNAT.HTable";
661 Sos_lib : aliased constant String := "GNAT.OS_Lib";
662 Sregexp : aliased constant String := "GNAT.Regexp";
663 Sregpat : aliased constant String := "GNAT.Regpat";
664 Sstring : aliased constant String := "GNAT.Strings";
665 Sstusta : aliased constant String := "GNAT.Task_Stack_Usage";
666 Stasloc : aliased constant String := "GNAT.Task_Lock";
667 Sutf_32 : aliased constant String := "GNAT.UTF_32";
669 -- Array giving mapping
671 Map_Array : constant array (1 .. 10) of Aunit_Record := (
672 ("casuti", Scasuti'Access),
673 ("crc32 ", Scrc32 'Access),
674 ("htable", Shtable'Access),
675 ("os_lib", Sos_lib'Access),
676 ("regexp", Sregexp'Access),
677 ("regpat", Sregpat'Access),
678 ("string", Sstring'Access),
679 ("stusta", Sstusta'Access),
680 ("tasloc", Stasloc'Access),
681 ("utf_32", Sutf_32'Access));
683 ----------------------
684 -- Get_Kind_Of_File --
685 ----------------------
687 function Get_Kind_Of_File (File : String) return Kind_Of_Unit is
688 pragma Assert (File'First = 1);
690 Buffer : String (1 .. 9);
692 begin
693 Error_Msg_Strlen := 0;
695 -- Ada/System/Interfaces are all Ada 95 units
697 if File = "ada.ads"
698 or else File = "interfac.ads"
699 or else File = "system.ads"
700 then
701 return Ada_95_Unit;
702 end if;
704 -- Not predefined if file name does not start with a- g- s- i-
706 if File'Length < 3
707 or else File (2) /= '-'
708 or else
709 (File (1) /= 'a'
710 and then File (1) /= 'g'
711 and then File (1) /= 'i'
712 and then File (1) /= 's')
713 then
714 return Not_Predefined_Unit;
715 end if;
717 -- If length of file name is greater than 12, not predefined. The value
718 -- 12 here is an 8 char name with extension .ads. The exception of 13 is
719 -- for the implementation units of the 128-bit types under System.
721 if File'Length > 12
722 and then not (File'Length = 13 and then File (1) = 's')
723 then
724 return Not_Predefined_Unit;
725 end if;
727 -- Not predefined if file name does not end in .ads. This can happen
728 -- when non-standard file names are being used.
730 if Name_Buffer (Name_Len - 3 .. Name_Len) /= ".ads" then
731 return Not_Predefined_Unit;
732 end if;
734 -- Otherwise normalize file name to 8 characters
736 Buffer (1 .. File'Length - 4) := File (1 .. File'Length - 4);
738 for J in File'Length - 3 .. 8 loop
739 Buffer (J) := ' ';
740 end loop;
742 -- See if name is in 95 list
744 for J in Non_Imp_File_Names_95'Range loop
745 if Buffer (1 .. 8) = Non_Imp_File_Names_95 (J).Fname then
746 return Ada_95_Unit;
747 end if;
748 end loop;
750 -- See if name is in 2005 list
752 for J in Non_Imp_File_Names_05'Range loop
753 if Buffer (1 .. 8) = Non_Imp_File_Names_05 (J).Fname then
754 return Ada_2005_Unit;
755 end if;
756 end loop;
758 -- See if name is in 2012 list
760 for J in Non_Imp_File_Names_12'Range loop
761 if Buffer (1 .. 8) = Non_Imp_File_Names_12 (J).Fname then
762 return Ada_2012_Unit;
763 end if;
764 end loop;
766 -- See if name is in 2022 list
768 for J in Non_Imp_File_Names_22'Range loop
769 if Buffer (1 .. 8) = Non_Imp_File_Names_22 (J).Fname then
770 return Ada_2022_Unit;
771 end if;
772 end loop;
774 -- Only remaining special possibilities are children of System.RPC and
775 -- System.Garlic and special files of the form System.Aux...
777 if File (1 .. 5) = "s-aux"
778 or else File (1 .. 5) = "s-gar"
779 or else File (1 .. 5) = "s-rpc"
780 then
781 return Ada_95_Unit;
782 end if;
784 -- All tests failed, this is definitely an implementation unit. See if
785 -- we have an alternative name.
787 if File'Length in 11 .. 12
788 and then File (1 .. 2) = "s-"
789 and then File (File'Last - 3 .. File'Last) = ".ads"
790 then
791 for J in Map_Array'Range loop
792 if (File'Length = 12 and then
793 File (3 .. 8) = Map_Array (J).Fname)
794 or else
795 (File'Length = 11 and then
796 File (3 .. 7) = Map_Array (J).Fname (1 .. 5))
797 then
798 Error_Msg_Strlen := Map_Array (J).Aname'Length;
799 Error_Msg_String (1 .. Error_Msg_Strlen) :=
800 Map_Array (J).Aname.all;
801 end if;
802 end loop;
803 end if;
805 return Implementation_Unit;
806 end Get_Kind_Of_File;
808 ----------------------
809 -- Get_Kind_Of_Unit --
810 ----------------------
812 function Get_Kind_Of_Unit (U : Unit_Number_Type) return Kind_Of_Unit is
813 begin
814 Get_Name_String (Unit_File_Name (U));
815 return Get_Kind_Of_File (Name_Buffer (1 .. Name_Len));
816 end Get_Kind_Of_Unit;
818 -------------------
819 -- Is_Known_Unit --
820 -------------------
822 function Is_Known_Unit (Nam : Node_Id) return Boolean is
823 Unam : Unit_Name_Type;
824 Fnam : File_Name_Type;
826 begin
827 -- If selector is not an identifier (e.g. it is a character literal or
828 -- some junk from a previous error), then definitely not a known unit.
830 if Nkind (Selector_Name (Nam)) /= N_Identifier then
831 return False;
832 end if;
834 -- Otherwise get corresponding file name
836 Unam := Get_Unit_Name (Nam);
837 Fnam := Get_File_Name (Unam, Subunit => False);
838 Get_Name_String (Fnam);
840 Error_Msg_Strlen := 0;
842 -- Ada/System/Interfaces are all Ada 95 units
844 if (Name_Len = 7 and then Name_Buffer (1 .. 7) = "ada.ads")
845 or else
846 (Name_Len = 10 and then Name_Buffer (1 .. 10) = "system.ads")
847 or else
848 (Name_Len = 12 and then Name_Buffer (1 .. 12) = "interfac.ads")
849 then
850 return True;
851 end if;
853 -- Remove extension from file name
855 if Name_Buffer (Name_Len - 3 .. Name_Len) = ".adb"
856 or else
857 Name_Buffer (Name_Len - 3 .. Name_Len) = ".ads"
858 then
859 Name_Len := Name_Len - 4;
860 else
861 return False;
862 end if;
864 -- Pad name to 8 characters
866 while Name_Len < 8 loop
867 Name_Len := Name_Len + 1;
868 Name_Buffer (Name_Len) := ' ';
869 end loop;
871 -- If length more than 8, definitely not a match
873 if Name_Len /= 8 then
874 return False;
875 end if;
877 -- If length is 8, search our tables
879 for J in Non_Imp_File_Names_95'Range loop
880 if Name_Buffer (1 .. 8) = Non_Imp_File_Names_95 (J).Fname then
881 return True;
882 end if;
883 end loop;
885 for J in Non_Imp_File_Names_05'Range loop
886 if Name_Buffer (1 .. 8) = Non_Imp_File_Names_05 (J).Fname then
887 return True;
888 end if;
889 end loop;
891 for J in Non_Imp_File_Names_12'Range loop
892 if Name_Buffer (1 .. 8) = Non_Imp_File_Names_12 (J).Fname then
893 return True;
894 end if;
895 end loop;
897 -- If not found, not known
899 return False;
901 -- A safety guard, if we get an exception during this processing then it
902 -- is most likely the result of a previous error, or a peculiar case we
903 -- have not thought of. Since this routine is only used for error message
904 -- refinement, we will just return False.
906 exception
907 when others =>
908 return False;
909 end Is_Known_Unit;
911 ---------------------------
912 -- Not_Impl_Defined_Unit --
913 ---------------------------
915 function Not_Impl_Defined_Unit (U : Unit_Number_Type) return Boolean is
916 Fname : constant File_Name_Type := Unit_File_Name (U);
918 begin
919 Error_Msg_Strlen := 0;
920 Get_Name_String (Fname);
922 -- Ada/System/Interfaces are all RM-defined Ada 95 units
924 if (Name_Len = 7 and then Name_Buffer (1 .. 7) = "ada.ads")
925 or else
926 (Name_Len = 10 and then Name_Buffer (1 .. 10) = "system.ads")
927 or else
928 (Name_Len = 12 and then Name_Buffer (1 .. 12) = "interfac.ads")
929 then
930 return True;
931 end if;
933 -- Implementation defined if unit in the gnat hierarchy
935 if (Name_Len = 8 and then Name_Buffer (1 .. 8) = "gnat.ads")
936 or else (Name_Len > 2 and then Name_Buffer (1 .. 2) = "g-")
937 then
938 return False;
939 end if;
941 -- Not implementation defined if file name does not start with a- s- i-
943 if Name_Len < 3
944 or else Name_Buffer (2) /= '-'
945 or else (Name_Buffer (1) /= 'a'
946 and then
947 Name_Buffer (1) /= 'i'
948 and then
949 Name_Buffer (1) /= 's')
950 then
951 return True;
952 end if;
954 -- If length of file name is greater than 12, not predefined. The value
955 -- 12 here is an 8 char name with extension .ads. The exception of 13 is
956 -- for the implementation units of the 128-bit types under System.
958 if Name_Len > 12
959 and then not (Name_Len = 13 and then Name_Buffer (1) = 's')
960 then
961 return True;
962 end if;
964 -- Not impl-defined if file name does not end in .ads. This can happen
965 -- when non-standard file names are being used.
967 if Name_Buffer (Name_Len - 3 .. Name_Len) /= ".ads" then
968 return True;
969 end if;
971 -- Otherwise normalize file name to 8 characters
973 Name_Len := Name_Len - 4;
974 while Name_Len < 8 loop
975 Name_Len := Name_Len + 1;
976 Name_Buffer (Name_Len) := ' ';
977 end loop;
979 -- Check our lists of names, if we find a match, return corresponding
980 -- indication of whether the file is RM defined, respecting the RM
981 -- version in which it is defined.
983 for J in Non_Imp_File_Names_95'Range loop
984 if Name_Buffer (1 .. 8) = Non_Imp_File_Names_95 (J).Fname then
985 return Non_Imp_File_Names_95 (J).RMdef;
986 end if;
987 end loop;
989 for J in Non_Imp_File_Names_05'Range loop
990 if Name_Buffer (1 .. 8) = Non_Imp_File_Names_05 (J).Fname then
991 return Non_Imp_File_Names_05 (J).RMdef
992 and then Ada_Version >= Ada_2005;
993 end if;
994 end loop;
996 for J in Non_Imp_File_Names_12'Range loop
997 if Name_Buffer (1 .. 8) = Non_Imp_File_Names_12 (J).Fname then
998 return Non_Imp_File_Names_12 (J).RMdef
999 and then Ada_Version >= Ada_2012;
1000 end if;
1001 end loop;
1003 -- If unit is in System, Ada or Interfaces hierarchies and did not match
1004 -- any entry in the list, means it is an internal implementation defined
1005 -- unit which the restriction should definition forbid.
1007 return True;
1008 end Not_Impl_Defined_Unit;
1010 end Impunit;