* gimplify.c (find_single_pointer_decl_1): New static function.
[official-gcc.git] / gcc / ada / impunit.adb
blob1e859ef5fef56a92527f12b65741144050c2c124
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-2005 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 2, 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 COPYING. If not, write --
19 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, USA. --
21 -- --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 -- --
25 ------------------------------------------------------------------------------
27 with Lib; use Lib;
28 with Namet; use Namet;
30 package body Impunit is
32 subtype File_Name_8 is String (1 .. 8);
33 type File_List is array (Nat range <>) of File_Name_8;
35 ------------------
36 -- Ada 95 Units --
37 ------------------
39 -- The following is a giant string list containing the names of all
40 -- non-implementation internal files, i.e. the complete list of files for
41 -- internal units which a program may legitimately WITH when operating in
42 -- either Ada 95 or Ada 05 mode.
44 -- Note that this list should match the list of units documented in the
45 -- "GNAT Library" section of the GNAT Reference Manual.
47 Non_Imp_File_Names_95 : constant File_List := (
49 ------------------------------------------------------
50 -- Ada Hierarchy Units from Ada-83 Reference Manual --
51 ------------------------------------------------------
53 "a-astaco", -- Ada.Asynchronous_Task_Control
54 "a-calend", -- Ada.Calendar
55 "a-chahan", -- Ada.Characters.Handling
56 "a-charac", -- Ada.Characters
57 "a-chlat1", -- Ada.Characters.Latin_1
58 "a-comlin", -- Ada.Command_Line
59 "a-decima", -- Ada.Decimal
60 "a-direio", -- Ada.Direct_IO
61 "a-dynpri", -- Ada.Dynamic_Priorities
62 "a-except", -- Ada.Exceptions
63 "a-finali", -- Ada.Finalization
64 "a-flteio", -- Ada.Float_Text_IO
65 "a-fwteio", -- Ada.Float_Wide_Text_IO
66 "a-inteio", -- Ada.Integer_Text_IO
67 "a-interr", -- Ada.Interrupts
68 "a-intnam", -- Ada.Interrupts.Names
69 "a-ioexce", -- Ada.IO_Exceptions
70 "a-iwteio", -- Ada.Integer_Wide_Text_IO
71 "a-ncelfu", -- Ada.Numerics.Complex_Elementary_Functions
72 "a-ngcefu", -- Ada.Numerics.Generic_Complex_Elementary_Functions
73 "a-ngcoty", -- Ada.Numerics.Generic_Complex_Types
74 "a-ngelfu", -- Ada.Numerics.Generic_Elementary_Functions
75 "a-nucoty", -- Ada.Numerics.Complex_Types
76 "a-nudira", -- Ada.Numerics.Discrete_Random
77 "a-nuelfu", -- Ada.Numerics.Elementary_Functions
78 "a-nuflra", -- Ada.Numerics.Float_Random
79 "a-numeri", -- Ada.Numerics
80 "a-reatim", -- Ada.Real_Time
81 "a-sequio", -- Ada.Sequential_IO
82 "a-stmaco", -- Ada.Strings.Maps.Constants
83 "a-storio", -- Ada.Storage_IO
84 "a-strbou", -- Ada.Strings.Bounded
85 "a-stream", -- Ada.Streams
86 "a-strfix", -- Ada.Strings.Fixed
87 "a-string", -- Ada.Strings
88 "a-strmap", -- Ada.Strings.Maps
89 "a-strunb", -- Ada.Strings.Unbounded
90 "a-ststio", -- Ada.Streams.Stream_IO
91 "a-stwibo", -- Ada.Strings.Wide_Bounded
92 "a-stwifi", -- Ada.Strings.Wide_Fixed
93 "a-stwima", -- Ada.Strings.Wide_Maps
94 "a-stwiun", -- Ada.Strings.Wide_Unbounded
95 "a-swmwco", -- Ada.Strings.Wide_Maps.Wide_Constants
96 "a-sytaco", -- Ada.Synchronous_Task_Control
97 "a-tags ", -- Ada.Tags
98 "a-tasatt", -- Ada.Task_Attributes
99 "a-taside", -- Ada.Task_Identification
100 "a-teioed", -- Ada.Text_IO.Editing
101 "a-textio", -- Ada.Text_IO
102 "a-ticoio", -- Ada.Text_IO.Complex_IO
103 "a-titest", -- Ada.Text_IO.Text_Streams
104 "a-unccon", -- Ada.Unchecked_Conversion
105 "a-uncdea", -- Ada.Unchecked_Deallocation
106 "a-witeio", -- Ada.Wide_Text_IO
107 "a-wtcoio", -- Ada.Wide_Text_IO.Complex_IO
108 "a-wtedit", -- Ada.Wide_Text_IO.Editing
109 "a-wttest", -- Ada.Wide_Text_IO.Text_Streams
111 -------------------------------------------------
112 -- RM Required Additions to Ada for GNAT Types --
113 -------------------------------------------------
115 "a-lfteio", -- Ada.Long_Float_Text_IO
116 "a-lfwtio", -- Ada.Long_Float_Wide_Text_IO
117 "a-liteio", -- Ada.Long_Integer_Text_IO
118 "a-liwtio", -- Ada.Long_Integer_Wide_Text_IO
119 "a-llftio", -- Ada.Long_Long_Float_Text_IO
120 "a-llfwti", -- Ada.Long_Long_Float_Wide_Text_IO
121 "a-llitio", -- Ada.Long_Long_Integer_Text_IO
122 "a-lliwti", -- Ada.Long_Long_Integer_Wide_Text_IO
123 "a-nlcefu", -- Ada.Long_Complex_Elementary_Functions
124 "a-nlcoty", -- Ada.Numerics.Long_Complex_Types
125 "a-nlelfu", -- Ada.Numerics.Long_Elementary_Functions
126 "a-nllcef", -- Ada.Long_Long_Complex_Elementary_Functions
127 "a-nllefu", -- Ada.Numerics.Long_Long_Elementary_Functions
128 "a-nllcty", -- Ada.Numerics.Long_Long_Complex_Types
129 "a-nscefu", -- Ada.Short_Complex_Elementary_Functions
130 "a-nscoty", -- Ada.Numerics.Short_Complex_Types
131 "a-nselfu", -- Ada.Numerics.Short_Elementary_Functions
132 "a-sfteio", -- Ada.Short_Float_Text_IO
133 "a-sfwtio", -- Ada.Short_Float_Wide_Text_IO
134 "a-siteio", -- Ada.Short_Integer_Text_IO
135 "a-siwtio", -- Ada.Short_Integer_Wide_Text_IO
136 "a-ssitio", -- Ada.Short_Short_Integer_Text_IO
137 "a-ssiwti", -- Ada.Short_Short_Integer_Wide_Text_IO
139 -----------------------------------
140 -- GNAT Defined Additions to Ada --
141 -----------------------------------
143 "a-chlat9", -- Ada.Characters.Latin_9
144 "a-colien", -- Ada.Command_Line.Environment
145 "a-colire", -- Ada.Command_Line.Remove
146 "a-cwila1", -- Ada.Characters.Wide_Latin_1
147 "a-cwila9", -- Ada.Characters.Wide_Latin_9
148 "a-diocst", -- Ada.Direct_IO.C_Streams
149 "a-einuoc", -- Ada.Exceptions.Is_Null_Occurrence
150 "a-elchha", -- Ada.Exceptions.Last_Chance_Handler
151 "a-exctra", -- Ada.Exceptions.Traceback
152 "a-siocst", -- Ada.Sequential_IO.C_Streams
153 "a-ssicst", -- Ada.Streams.Stream_IO.C_Streams
154 "a-suteio", -- Ada.Strings.Unbounded.Text_IO
155 "a-swuwti", -- Ada.Strings.Wide_Unbounded.Wide_Text_IO
156 "a-taidim", -- Ada.Task_Identification.Image
157 "a-tiocst", -- Ada.Text_IO.C_Streams
158 "a-wtcstr", -- Ada.Wide_Text_IO.C_Streams
160 -- Note: strictly the next two should be Ada 2005 units, but it seems
161 -- harmless (and useful) to make then available in Ada 95 mode, since
162 -- they only deal with Wide_Character, not Wide_Wide_Character.
164 "a-wichun", -- Ada.Wide_Characters.Unicode
165 "a-widcha", -- Ada.Wide_Characters
167 ---------------------------
168 -- GNAT Special IO Units --
169 ---------------------------
171 -- As further explained elsewhere (see Sem_Ch10), the internal
172 -- packages of Text_IO and Wide_Text_IO are actually implemented
173 -- as separate children, but this fact is intended to be hidden
174 -- from the user completely. Any attempt to WITH one of these
175 -- units will be diagnosed as an error later on, but for now we
176 -- do not consider these internal implementation units (if we did,
177 -- then we would get a junk warning which would be confusing and
178 -- unecessary, given that we generate a clear error message).
180 "a-tideio", -- Ada.Text_IO.Decimal_IO
181 "a-tienio", -- Ada.Text_IO.Enumeration_IO
182 "a-tifiio", -- Ada.Text_IO.Fixed_IO
183 "a-tiflio", -- Ada.Text_IO.Float_IO
184 "a-tiinio", -- Ada.Text_IO.Integer_IO
185 "a-tiinio", -- Ada.Text_IO.Integer_IO
186 "a-timoio", -- Ada.Text_IO.Modular_IO
187 "a-wtdeio", -- Ada.Wide_Text_IO.Decimal_IO
188 "a-wtenio", -- Ada.Wide_Text_IO.Enumeration_IO
189 "a-wtfiio", -- Ada.Wide_Text_IO.Fixed_IO
190 "a-wtflio", -- Ada.Wide_Text_IO.Float_IO
191 "a-wtinio", -- Ada.Wide_Text_IO.Integer_IO
192 "a-wtmoio", -- Ada.Wide_Text_IO.Modular_IO
194 ------------------------
195 -- GNAT Library Units --
196 ------------------------
198 "g-arrspl", -- GNAT.Array_Split
199 "g-awk ", -- GNAT.AWK
200 "g-boubuf", -- GNAT.Bounded_Buffers
201 "g-boumai", -- GNAT.Bounded_Mailboxes
202 "g-bubsor", -- GNAT.Bubble_Sort
203 "g-busora", -- GNAT.Bubble_Sort_A
204 "g-busorg", -- GNAT.Bubble_Sort_G
205 "g-calend", -- GNAT.Calendar
206 "g-casuti", -- GNAT.Case_Util
207 "g-catiio", -- GNAT.Calendar.Time_IO
208 "g-cgi ", -- GNAT.CGI
209 "g-cgicoo", -- GNAT.CGI.Cookie
210 "g-cgideb", -- GNAT.CGI.Debug
211 "g-comlin", -- GNAT.Command_Line
212 "g-comver", -- GNAT.Compiler_Version
213 "g-crc32 ", -- GNAT.CRC32
214 "g-ctrl_c", -- GNAT.Ctrl_C
215 "g-curexc", -- GNAT.Current_Exception
216 "g-debpoo", -- GNAT.Debug_Pools
217 "g-debuti", -- GNAT.Debug_Utilities
218 "g-diopit", -- GNAT.Directory_Operations.Iteration
219 "g-dirope", -- GNAT.Directory_Operations
220 "g-dynhta", -- GNAT.Dynamic_HTables
221 "g-dyntab", -- GNAT.Dynamic_Tables
222 "g-excact", -- GNAT.Exception_Actions
223 "g-except", -- GNAT.Exceptions
224 "g-exctra", -- GNAT.Exception_Traces
225 "g-expect", -- GNAT.Expect
226 "g-flocon", -- GNAT.Float_Control
227 "g-heasor", -- GNAT.Heap_Sort
228 "g-hesora", -- GNAT.Heap_Sort_A
229 "g-hesorg", -- GNAT.Heap_Sort_G
230 "g-htable", -- GNAT.Htable
231 "g-io ", -- GNAT.IO
232 "g-io_aux", -- GNAT.IO_Aux
233 "g-locfil", -- GNAT.Lock_Files
234 "g-md5 ", -- GNAT.MD5
235 "g-memdum", -- GNAT.Memory_Dump
236 "g-moreex", -- GNAT.Most_Recent_Exception
237 "g-os_lib", -- GNAT.Os_Lib
238 "g-pehage", -- GNAT.Perfect_Hash_Generators
239 "g-regexp", -- GNAT.Regexp
240 "g-regist", -- GNAT.Registry
241 "g-regpat", -- GNAT.Regpat
242 "g-semaph", -- GNAT.Semaphores
243 "g-sestin", -- GNAT.Secondary_Stack_Info
244 "g-signal", -- GNAT.Signals
245 "g-socket", -- GNAT.Sockets
246 "g-souinf", -- GNAT.Source_Info
247 "g-speche", -- GNAT.Spell_Checker
248 "g-spipat", -- GNAT.Spitbol.Patterns
249 "g-spitbo", -- GNAT.Spitbol
250 "g-sptabo", -- GNAT.Spitbol.Table_Boolean
251 "g-sptain", -- GNAT.Spitbol.Table_Integer
252 "g-sptavs", -- GNAT.Spitbol.Table_Vstring
253 "g-string", -- GNAT.Strings
254 "g-strspl", -- GNAT.String_Split
255 "g-table ", -- GNAT.Table
256 "g-tasloc", -- GNAT.Task_Lock
257 "g-thread", -- GNAT.Threads
258 "g-traceb", -- GNAT.Traceback
259 "g-trasym", -- GNAT.Traceback.Symbolic
260 "g-utf_32", -- GNAT.UTF_32
261 "g-wistsp", -- GNAT.Wide_String_Split
263 -----------------------------------------------------
264 -- Interface Hierarchy Units from Reference Manual --
265 -----------------------------------------------------
267 "i-c ", -- Interfaces.C
268 "i-cobol ", -- Interfaces.Cobol
269 "i-cpoint", -- Interfaces.C.Pointers
270 "i-cstrin", -- Interfaces.C.Strings
271 "i-fortra", -- Interfaces.Fortran
273 ------------------------------------------
274 -- GNAT Defined Additions to Interfaces --
275 ------------------------------------------
277 "i-cexten", -- Interfaces.C.Extensions
278 "i-cpp ", -- Interfaces.CPP
279 "i-cstrea", -- Interfaces.C.Streams
280 "i-jalaob", -- Interfaces.Java.Lang.Object
281 "i-jalasy", -- Interfaces.Java.Lang.System
282 "i-jalath", -- Interfaces.Java.Lang.Thread
283 "i-java ", -- Interfaces.Java
284 "i-javlan", -- Interfaces.Java.Lang
285 "i-os2err", -- Interfaces.Os2lib.Errors
286 "i-os2lib", -- Interfaces.Os2lib
287 "i-os2syn", -- Interfaces.Os2lib.Synchronization
288 "i-os2thr", -- Interfaces.Os2lib.Threads
289 "i-pacdec", -- Interfaces.Packed_Decimal
290 "i-vthrea", -- Interfaces.Vthreads
291 "i-vxwoio", -- Interfaces.VxWorks.IO
292 "i-vxwork", -- Interfaces.VxWorks
294 --------------------------------------------------
295 -- System Hierarchy Units from Reference Manual --
296 --------------------------------------------------
298 "s-atacco", -- System.Address_To_Access_Conversions
299 "s-maccod", -- System.Machine_Code
300 "s-rpc ", -- System.Rpc
301 "s-stoele", -- System.Storage_Elements
302 "s-stopoo", -- System.Storage_Pools
304 --------------------------------------
305 -- GNAT Defined Additions to System --
306 --------------------------------------
308 "s-addima", -- System.Address_Image
309 "s-assert", -- System.Assertions
310 "s-memory", -- System.Memory
311 "s-parint", -- System.Partition_Interface
312 "s-pooglo", -- System.Pool_Global
313 "s-pooloc", -- System.Pool_Local
314 "s-restri", -- System.Restrictions
315 "s-rident", -- System.Rident
316 "s-tasinf", -- System.Task_Info
317 "s-wchcnv", -- System.Wch_Cnv
318 "s-wchcon"); -- System.Wch_Con
320 --------------------
321 -- Ada 2005 Units --
322 --------------------
324 -- The following units should be used only in Ada 05 mode
326 Non_Imp_File_Names_05 : constant File_List := (
328 --------------------------------------------------------
329 -- Ada Hierarchy Units from Ada 2005 Reference Manual --
330 --------------------------------------------------------
332 "a-cdlili", -- Ada.Containers.Doubly_Linked_Lists
333 "a-cgaaso", -- Ada.Containers.Generic_Anonymous_Array_Sort
334 "a-cgarso", -- Ada.Containers.Generic_Array_Sort
335 "a-cgcaso", -- Ada.Containers.Generic_Constrained_Array_Sort
336 "a-chacon", -- Ada.Characters.Conversions
337 "a-chtgke", -- Ada.Containers.Hash_Tables.Generic_Keys
338 "a-chtgop", -- Ada.Containers.Hash_Tables.Generic_Operations
339 "a-cidlli", -- Ada.Containers.Indefinite_Doubly_Linked_Lists
340 "a-cihama", -- Ada.Containers.Indefinite_Hashed_Maps
341 "a-cihase", -- Ada.Containers.Indefinite_Hashed_Sets
342 "a-ciorma", -- Ada.Containers.Indefinite_Ordered_Maps
343 "a-ciormu", -- Ada.Containers.Indefinite_Ordered_Multisets
344 "a-ciorse", -- Ada.Containers.Indefinite_Ordered_Sets
345 "a-cohama", -- Ada.Containers.Hashed_Maps
346 "a-cohase", -- Ada.Containers.Hashed_Sets
347 "a-cohata", -- Ada.Containers.Hash_Tables
348 "a-coinve", -- Ada.Containers.Indefinite_Vectors
349 "a-contai", -- Ada.Containers
350 "a-convec", -- Ada.Containers.Vectors
351 "a-coorma", -- Ada.Containers.Ordered_Maps
352 "a-coormu", -- Ada.Containers.Ordered_Multisets
353 "a-coorse", -- Ada.Containers.Ordered_Sets
354 "a-coprnu", -- Ada.Containers.Prime_Numbers
355 "a-crbltr", -- Ada.Containers.Red_Black_Trees
356 "a-crbtgk", -- Ada.Containers.Red_Black_Trees.Generic_Keys
357 "a-crbtgo", -- Ada.Containers.Red_Black_Trees.Generic_Operations
358 "a-direct", -- Ada.Directories
359 "a-rbtgso", -- Ada.Containers.Red_Black_Trees.Generic_Set_Operations
360 "a-secain", -- Ada.Strings.Equal_Case_Insensitive
361 "a-shcain", -- Ada.Strings.Hash_Case_Insensitive
362 "a-slcain", -- Ada.Strings.Less_Case_Insensitive
363 "a-strhas", -- Ada.Strings.Hash
364 "a-stunha", -- Ada.Strings.Unbounded.Hash
365 "a-stwiha", -- Ada.Strings.Wide_Hash
366 "a-stzbou", -- Ada.Strings.Wide_Wide_Bounded
367 "a-stzfix", -- Ada.Strings.Wide_Wide_Fixed
368 "a-stzhas", -- Ada.Strings.Wide_Wide_Hash
369 "a-stzmap", -- Ada.Strings.Wide_Wide_Maps
370 "a-stzunb", -- Ada.Strings.Wide_Wide_Unbounded
371 "a-swuwha", -- Ada.Strings.Wide_Unbounded.Wide_Hash
372 "a-szmzco", -- Ada.Strings.Wide_Wide_Maps.Wide_Wide_Constants;
373 "a-szuzha", -- Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Hash
374 "a-tgdico", -- Ada.Tags.Generic_Dispatching_Constructor;
375 "a-tiunio", -- Ada.Text_IO.Unbounded_IO;
376 "a-wichun", -- Ada.Wide_Characters.Unicode
377 "a-wwunio", -- Ada.Wide_Text_IO.Wide_Unbounded_IO;
378 "a-zchara", -- Ada.Wide_Wide_Characters
379 "a-zttest", -- Ada.Wide_Wide_Text_IO.Text_Streams
380 "a-ztexio", -- Ada.Wide_Wide_Text_IO
381 "a-zzunio", -- Ada.Wide_Wide_Text_IO.Wide_Wide_Unbounded_IO
383 ------------------------------------------------------
384 -- RM Required Additions to Ada 2005 for GNAT Types --
385 ------------------------------------------------------
387 "a-lfztio", -- Ada.Long_Float_Wide_Wide_Text_IO
388 "a-liztio", -- Ada.Long_Integer_Wide_Wide_Text_IO
389 "a-llfzti", -- Ada.Long_Long_Float_Wide_Wide_Text_IO
390 "a-llizti", -- Ada.Long_Long_Integer_Wide_Wide_Text_IO
391 "a-sfztio", -- Ada.Short_Float_Wide_Wide_Text_IO
392 "a-siztio", -- Ada.Short_Integer_Wide_Wide_Text_IO
393 "a-ssizti", -- Ada.Short_Short_Integer_Wide_Wide_Text_IO
394 "a-ztcstr", -- Ada.Wide_Wide_Text_IO.C_Streams
396 ----------------------------------------
397 -- GNAT Defined Additions to Ada 2005 --
398 ----------------------------------------
400 "a-chzla1", -- Ada.Characters.Wide_Wide_Latin_1
401 "a-chzla9", -- Ada.Characters.Wide_Wide_Latin_9
402 "a-szuzti", -- Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO
403 "a-zchuni", -- Ada.Wide_Wide_Characters.Unicode
405 ---------------------------
406 -- GNAT Special IO Units --
407 ---------------------------
409 -- See Ada 95 section for further information. These packages are for the
410 -- implementation of the Wide_Wide_Text_IO generic packages.
412 "a-ztdeio", -- Ada.Wide_Wide_Text_IO.Decimal_IO
413 "a-ztenio", -- Ada.Wide_Wide_Text_IO.Enumeration_IO
414 "a-ztfiio", -- Ada.Wide_Wide_Text_IO.Fixed_IO
415 "a-ztflio", -- Ada.Wide_Wide_Text_IO.Float_IO
416 "a-ztinio", -- Ada.Wide_Wide_Text_IO.Integer_IO
417 "a-ztmoio", -- Ada.Wide_Wide_Text_IO.Modular_IO
419 ------------------------
420 -- GNAT Library Units --
421 ------------------------
423 "g-zstspl"); -- GNAT.Wide_Wide_String_Split
425 ----------------------
426 -- Get_Kind_Of_Unit --
427 ----------------------
429 function Get_Kind_Of_Unit (U : Unit_Number_Type) return Kind_Of_Unit is
430 Fname : constant File_Name_Type := Unit_File_Name (U);
432 begin
433 -- If length of file name is greater than 12, not predefined.
434 -- The value 12 here is an 8 char name with extension .ads.
436 if Length_Of_Name (Fname) > 12 then
437 return Not_Predefined_Unit;
438 end if;
440 -- Otherwise test file name
442 Get_Name_String (Fname);
444 -- Not predefined if file name does not start with a- g- s- i-
446 if Name_Len < 3
447 or else Name_Buffer (2) /= '-'
448 or else (Name_Buffer (1) /= 'a'
449 and then
450 Name_Buffer (1) /= 'g'
451 and then
452 Name_Buffer (1) /= 'i'
453 and then
454 Name_Buffer (1) /= 's')
455 then
456 return Not_Predefined_Unit;
457 end if;
459 -- Not predefined if file name does not end in .ads. This can
460 -- happen when non-standard file names are being used.
462 if Name_Buffer (Name_Len - 3 .. Name_Len) /= ".ads" then
463 return Not_Predefined_Unit;
464 end if;
466 -- Otherwise normalize file name to 8 characters
468 Name_Len := Name_Len - 4;
469 while Name_Len < 8 loop
470 Name_Len := Name_Len + 1;
471 Name_Buffer (Name_Len) := ' ';
472 end loop;
474 -- See if name is in 95 list
476 for J in Non_Imp_File_Names_95'Range loop
477 if Name_Buffer (1 .. 8) = Non_Imp_File_Names_95 (J) then
478 return Ada_95_Unit;
479 end if;
480 end loop;
482 -- See if name is in 05 list
484 for J in Non_Imp_File_Names_05'Range loop
485 if Name_Buffer (1 .. 8) = Non_Imp_File_Names_05 (J) then
486 return Ada_05_Unit;
487 end if;
488 end loop;
490 -- Only remaining special possibilities are children of System.RPC and
491 -- System.Garlic and special files of the form System.Aux...
493 Get_Name_String (Unit_Name (U));
495 if Name_Len > 12
496 and then Name_Buffer (1 .. 11) = "system.rpc."
497 then
498 return Ada_95_Unit;
499 end if;
501 if Name_Len > 15
502 and then Name_Buffer (1 .. 14) = "system.garlic."
503 then
504 return Ada_95_Unit;
505 end if;
507 if Name_Len > 11
508 and then Name_Buffer (1 .. 10) = "system.aux"
509 then
510 return Ada_95_Unit;
511 end if;
513 -- All tests failed, this is definitely an implementation unit
515 return Implementation_Unit;
516 end Get_Kind_Of_Unit;
518 end Impunit;