diff options
Diffstat (limited to 'gcc/ada/impunit.ads')
-rw-r--r-- | gcc/ada/impunit.ads | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/gcc/ada/impunit.ads b/gcc/ada/impunit.ads index 02917ccd8d8..075772b7323 100644 --- a/gcc/ada/impunit.ads +++ b/gcc/ada/impunit.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2000 Free Software Foundation, Inc. -- +-- Copyright (C) 2000-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -26,17 +26,36 @@ -- This package contains data and functions used to determine if a given -- unit is an internal unit intended only for use by the implementation --- and which should not be directly WITH'ed by user code. +-- and which should not be directly WITH'ed by user code. It also checks +-- for Ada 05 units that should only be WITH'ed in Ada 05 mode. with Types; use Types; package Impunit is - function Implementation_Unit (U : Unit_Number_Type) return Boolean; - -- Given the unit number of a unit, this function determines if it is a - -- unit that is intended to be used only internally by the implementation. - -- This is used for posting warnings for improper WITH's of such units - -- (such WITH's are allowed without warnings only in GNAT_Mode set by - -- the use of -gnatg). True is returned if a warning should be posted. + type Kind_Of_Unit is + (Implementation_Unit, + -- Unit from predefined library intended to be used only by the + -- compiler generated code, or from the implementation of the run time. + -- Use of such a unit generates a warning unless the client is compiled + -- with the -gnatg switch. If we are being super strict, this should be + -- an error for the case of Ada units, but that seems over strenuous. + + Not_Predefined_Unit, + -- This is not a predefined unit, so no checks are needed + + Ada_95_Unit, + -- This unit is defined in the Ada 95 RM, and can be freely with'ed + -- in both Ada 95 mode and Ada 05 mode. Note that in Ada 83 mode, no + -- child units are allowed, so you can't even name such a unit. + + Ada_05_Unit); + -- This unit is defined in the Ada 05 RM. Withing this unit from a + -- Ada 95 mode program will generate a warning (again, strictly speaking + -- this should be an error, but that seems over-strenuous). + + function Get_Kind_Of_Unit (U : Unit_Number_Type) return Kind_Of_Unit; + -- Given the unit number of a unit, this function determines the type + -- of the unit, as defined above. end Impunit; |