1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
11 -- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
13 -- GNAT is free software; you can redistribute it and/or modify it under --
14 -- terms of the GNU General Public License as published by the Free Soft- --
15 -- ware Foundation; either version 2, or (at your option) any later ver- --
16 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
19 -- for more details. You should have received a copy of the GNU General --
20 -- Public License distributed with GNAT; see file COPYING. If not, write --
21 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
22 -- MA 02111-1307, USA. --
24 -- GNAT was originally developed by the GNAT team at New York University. --
25 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
27 ------------------------------------------------------------------------------
29 -- This package defines the set of restriction identifiers. It is in a
30 -- separate package from Restrict so that it can be easily used by the
31 -- binder without dragging in a lot of stuff.
35 -- The following enumeration type defines the set of restriction
36 -- identifiers not taking a parameter that are implemented in GNAT.
37 -- To add a new restriction identifier, add an entry with the name
38 -- to be used in the pragma, and add appropriate calls to the
39 -- Check_Restriction routine.
41 type Restriction_Id is (
43 -- The following cases are checked for consistency in the binder
45 Boolean_Entry_Barriers, -- GNAT (Ravenscar)
46 No_Abort_Statements, -- (RM D.7(5), H.4(3))
47 No_Access_Subprograms, -- (RM H.4(17))
48 No_Allocators, -- (RM H.4(7))
49 No_Asynchronous_Control, -- (RM D.9(10))
51 No_Delay, -- (RM H.4(21))
52 No_Dispatch, -- (RM H.4(19))
53 No_Dynamic_Interrupts, -- GNAT
54 No_Dynamic_Priorities, -- (RM D.9(9))
55 No_Enumeration_Maps, -- GNAT
56 No_Entry_Calls_In_Elaboration_Code, -- GNAT
57 No_Entry_Queue, -- GNAT
58 No_Exception_Handlers, -- GNAT
59 No_Exceptions, -- (RM H.4(12))
60 No_Fixed_Point, -- (RM H.4(15))
61 No_Floating_Point, -- (RM H.4(14))
62 No_IO, -- (RM H.4(20))
63 No_Implicit_Conditionals, -- GNAT
64 No_Implicit_Dynamic_Code, -- GNAT
65 No_Implicit_Heap_Allocations, -- (RM D.8(8), H.4(3))
66 No_Implicit_Loops, -- GNAT
67 No_Local_Allocators, -- (RM H.4(8))
68 No_Local_Protected_Objects, -- GNAT
69 No_Nested_Finalization, -- (RM D.7(4))
70 No_Protected_Type_Allocators, -- GNAT
71 No_Protected_Types, -- (RM H.4(5))
72 No_Recursion, -- (RM H.4(22))
73 No_Reentrancy, -- (RM H.4(23))
74 No_Relative_Delay, -- GNAT
76 No_Select_Statements, -- GNAT (Ravenscar)
77 No_Standard_Storage_Pools, -- GNAT
79 No_Task_Allocators, -- (RM D.7(7))
80 No_Task_Attributes, -- GNAT
81 No_Task_Hierarchy, -- (RM D.7(3), H.4(3))
82 No_Task_Termination, -- GNAT
83 No_Terminate_Alternatives, -- (RM D.7(6))
84 No_Unchecked_Access, -- (RM H.4(18))
85 No_Unchecked_Conversion, -- (RM H.4(16))
86 No_Unchecked_Deallocation, -- (RM H.4(9))
87 No_Wide_Characters, -- GNAT
88 Static_Priorities, -- GNAT
89 Static_Storage_Size, -- GNAT
91 -- The following cases do not require partition-wide checks
93 Immediate_Reclamation, -- (RM H.4(10))
94 No_Implementation_Attributes, -- GNAT
95 No_Implementation_Pragmas, -- GNAT
96 No_Implementation_Restrictions, -- GNAT
97 No_Elaboration_Code, -- GNAT
99 Not_A_Restriction_Id);
101 -- The following range of Restriction identifiers is checked for
102 -- consistency across a partition. The generated ali file is marked
103 -- for each entry to show one of three possibilities:
105 -- Corresponding restriction is set (so unit does not violate it)
106 -- Corresponding restriction is not violated
107 -- Corresponding restriction is violated
109 subtype Partition_Restrictions is
110 Restriction_Id range Boolean_Entry_Barriers .. Static_Storage_Size;
112 -- The following set of Restriction identifiers is not checked for
113 -- consistency across a partition, and the generated ali files does
114 -- not carry any indications with respect to such restrictions.
116 subtype Compilation_Unit_Restrictions is
117 Restriction_Id range Immediate_Reclamation .. No_Elaboration_Code;
119 -- The following enumeration type defines the set of restriction
120 -- parameter identifiers taking a parameter that are implemented in
121 -- GNAT. To add a new restriction parameter identifier, add an entry
122 -- with the name to be used in the pragma, and add appropriate
123 -- calls to Check_Restriction.
125 -- Note: the GNAT implementation currently only accomodates restriction
126 -- parameter identifiers whose expression value is a non-negative
127 -- integer. This is true for all language defined parameters.
129 type Restriction_Parameter_Id is (
130 Max_Asynchronous_Select_Nesting, -- (RM D.7(18), H.4(3))
131 Max_Entry_Queue_Depth, -- GNAT
132 Max_Protected_Entries, -- (RM D.7(14))
133 Max_Select_Alternatives, -- (RM D.7(12))
134 Max_Storage_At_Blocking, -- (RM D.7(17))
135 Max_Task_Entries, -- (RM D.7(13), H.4(3))
136 Max_Tasks, -- (RM D.7(19), H.4(3))
137 Not_A_Restriction_Parameter_Id);