diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-02-02 12:32:01 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-02-02 12:32:01 +0000 |
commit | 1e16c51c81c146ee5f1cd929c4bdbbe00e70d8c5 (patch) | |
tree | 30150d4eda55a02c6bc00f9262c17b795a63423d /gcc/ada/s-rident.ads | |
parent | 4e090328b4feb4b0227807217cca120441fab2d0 (diff) | |
download | gcc-1e16c51c81c146ee5f1cd929c4bdbbe00e70d8c5.tar.gz |
2004-02-02 Vincent Celier <celier@gnat.com>
* gprcmd.adb (Check_Args): If condition is false, print the invoked
comment before the usage.
Gprcmd: Fail when command is not recognized.
(Usage): Document command "prefix"
* g-md5.adb (Digest): Process last block.
(Update): Do not process last block. Store remaining characters and
length in Context.
* g-md5.ads (Update): Document that several call to update are
equivalent to one call with the concatenated string.
(Context): Add fields to allow new Update behaviour.
* fname-uf.ads/adb (Get_File_Name): New Boolean parameter May_Fail,
defaulted to False.
When May_Fail is True and no existing file can be found, return No_File.
* 6vcstrea.adb: Inlined functions are now wrappers to implementation
functions.
* lib-writ.adb (Write_With_Lines): When body file does not exist, use
spec file name instead on the W line.
2004-02-02 Robert Dewar <dewar@gnat.com>
* ali.adb: Read and acquire info from new format restrictions lines
* bcheck.adb: Add circuits for checking restrictions with parameters
* bindgen.adb: Output dummy restrictions data
To be changed later
* ali.ads, checks.adb, exp_aggr.adb, exp_attr.adb, exp_ch11.adb,
exp_ch3.adb, exp_ch5.adb, exp_ch6.adb, exp_ch7.adb, exp_util.adb,
freeze.adb, gnat1drv.adb, sem_attr.adb, sem_ch10.adb, sem_ch11.adb,
sem_ch12.adb, targparm.adb, targparm.ads, tbuild.adb, sem_ch2.adb,
sem_elab.adb, sem_res.adb: Minor changes for new restrictions handling.
* exp_ch9.adb (Build_Master_Entity): Cleanup the code (also suppresses
the warning message on access to possibly uninitialized variable S)
Minor changes for new restrictions handling.
* gnatbind.adb: Minor reformatting
Minor changes for new restrictions handling
Move circuit for -r processing here from bcheck (cleaner)
* gnatcmd.adb, gnatlink.adb: Minor reformatting
* lib-writ.adb: Output new format restrictions lines
* lib-writ.ads: Document new R format lines for new restrictions
handling.
* s-restri.ads/adb: New files
* Makefile.rtl: Add entry for s-restri.ads/adb
* par-ch3.adb: Fix bad error messages starting with upper case letter
Minor reformatting
* restrict.adb: Major rewrite throughout for new restrictions handling
Major point is to handle restrictions with parameters
* restrict.ads: Major changes in interface to handle restrictions with
parameters. Also generally simplifies setting of restrictions.
* snames.ads/adb: New entry for proper handling of No_Requeue
* sem_ch3.adb (Count_Tasks): New circuitry for implementing Max_Tasks
restriction counting.
Other minor changes for new restrictions handling
* sem_prag.adb: No_Requeue is a synonym for No_Requeue_Statements.
Restriction_Warnings now allows full parameter notation
Major rewrite of Restrictions for new restrictions handling
2004-02-02 Javier Miranda <miranda@gnat.com>
* par-ch3.adb (P_Identifier_Declarations): Give support to the Ada 0Y
syntax rule for object renaming declarations.
(P_Array_Type_Definition): Give support for the Ada 0Y syntax rule for
component definitions.
* sem_ch3.adb (Analyze_Component_Declaration): Give support to access
components.
(Array_Type_Declaration): Give support to access components. In addition
it was also modified to reflect the name of the object in anonymous
array types. The old code did not take into account that it is possible
to have an unconstrained anonymous array with an initial value.
(Check_Or_Process_Discriminants): Allow access discriminant in
non-limited types.
(Process_Discriminants): Allow access discriminant in non-limited types
Initialize the new Access_Definition field in N_Object_Renaming_Decl
node. Change Ada0Y to Ada 0Y in comments
* sem_ch4.adb (Find_Equality_Types): Allow anonymous access types in
equality operators.
Change Ada0Y to Ada 0Y in comments
* sem_ch8.adb (Analyze_Object_Renaming): Give support to access
renamings Change Ada0Y to Ada 0Y in comments
* sem_type.adb (Find_Unique_Type): Give support to the equality
operators for universal access types
Change Ada0Y to Ada 0Y in comments
* sinfo.adb (Access_Definition, Set_Access_Definition): New subprograms
* sinfo.ads (N_Component_Definition): Addition of Access_Definition
field.
(N_Object_Renaming_Declaration): Addition of Access_Definition field
Change Ada0Y to Ada 0Y in comments
* sprint.adb (Sprint_Node_Actual): Give support to the new syntax for
component definition and object renaming nodes
Change Ada0Y to Ada 0Y in comments
2004-02-02 Jose Ruiz <ruiz@act-europe.fr>
* restrict.adb: Use the new restriction identifier
No_Requeue_Statements instead of the old No_Requeue for defining the
restricted profile.
* sem_ch9.adb (Analyze_Requeue): Check the new restriction
No_Requeue_Statements.
* s-rident.ads: Adding restriction No_Requeue_Statements (AI-00249)
that supersedes the GNAT specific restriction No_Requeue. The later is
kept for backward compatibility.
2004-02-02 Ed Schonberg <schonberg@gnat.com>
* lib.ads, i-cobol.ads, * s-stoele.ads, s-thread.ads, style.ads,
5staprop.adb, atree.adb, atree.ads, g-crc32.ads: Remove redundant
pragma and fix incorrect ones.
* sem_prag.adb For pragma Inline and pragma Pure_Function, emit a
warning if the pragma is redundant.
2004-02-02 Thomas Quinot <quinot@act-europe.fr>
* 5staprop.adb: Add missing 'constant' keywords.
* Makefile.in: use consistent value for SYMLIB on
platforms where libaddr2line is supported.
2004-02-02 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* utils.c (end_subprog_body): Do not call rest_of_compilation if just
annotating types.
2004-02-02 Olivier Hainque <hainque@act-europe.fr>
* init.c (__gnat_install_handler): Setup an alternate stack for signal
handlers in the environment thread. This allows proper propagation of
an exception on stack overflows in this thread even when the builtin
ABI stack-checking scheme is used without support for a stack reserve
region.
* utils.c (create_field_decl): Augment the head comment about bitfield
creation, and don't account for DECL_BIT_FIELD in DECL_NONADDRESSABLE_P
here, because the former is not accurate enough at this point.
Let finish_record_type decide instead.
Don't make a bitfield if the field is to be addressable.
Always set a size for the field if the record is packed, to ensure the
checks for bitfield creation are triggered.
(finish_record_type): During last pass over the fields, clear
DECL_BIT_FIELD when possible in the !STRICT_ALIGNMENT case, as this is
not covered by the calls to layout_decl. Adjust DECL_NONADDRESSABLE_P
from DECL_BIT_FIELD.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77110 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-rident.ads')
-rw-r--r-- | gcc/ada/s-rident.ads | 205 |
1 files changed, 165 insertions, 40 deletions
diff --git a/gcc/ada/s-rident.ads b/gcc/ada/s-rident.ads index 6b07f9190af..37bef819f16 100644 --- a/gcc/ada/s-rident.ads +++ b/gcc/ada/s-rident.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2004 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- -- @@ -19,6 +19,13 @@ -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- @@ -40,16 +47,17 @@ generic package System.Rident is -- The following enumeration type defines the set of restriction - -- identifiers not taking a parameter that are implemented in GNAT. + -- identifiers that are implemented in GNAT. + -- To add a new restriction identifier, add an entry with the name -- to be used in the pragma, and add appropriate calls to the -- Restrict.Check_Restriction routine. - type Restriction_Id is ( + type Restriction_Id is -- The following cases are checked for consistency in the binder - Boolean_Entry_Barriers, -- GNAT (Ravenscar) + (Boolean_Entry_Barriers, -- GNAT (Ravenscar) No_Abort_Statements, -- (RM D.7(5), H.4(3)) No_Access_Subprograms, -- (RM H.4(17)) No_Allocators, -- (RM H.4(7)) @@ -83,7 +91,7 @@ package System.Rident is No_Recursion, -- (RM H.4(22)) No_Reentrancy, -- (RM H.4(23)) No_Relative_Delay, -- GNAT (Ravenscar) - No_Requeue, -- GNAT + No_Requeue_Statements, -- GNAT No_Secondary_Stack, -- GNAT No_Select_Statements, -- GNAT (Ravenscar) No_Standard_Storage_Pools, -- GNAT @@ -109,49 +117,166 @@ package System.Rident is No_Implementation_Restrictions, -- GNAT No_Elaboration_Code, -- GNAT + -- The following cases require a parameter value + + -- The following entries are fully checked at compile/bind time, + -- which means that the compiler can in general tell the minimum + -- value which could be used with a restrictions pragma. The binder + -- can deduce the appropriate minimum value for the partition by + -- taking the maximum value required by any unit. + + Max_Protected_Entries, -- (RM D.7(14)) + Max_Select_Alternatives, -- (RM D.7(12)) + Max_Task_Entries, -- (RM D.7(13), H.4(3)) + + -- The following entries are also fully checked at compile/bind + -- time, and the compiler can also at least in some cases tell + -- the minimum value which could be used with a restriction pragma. + -- The difference is that the contributions are additive, so the + -- binder deduces this value by adding the unit contributions. + + Max_Tasks, -- (RM D.7(19), H.4(3)) + + -- The following entries are checked at compile time only for + -- zero/nonzero entries. This means that the compiler can tell + -- at compile time if a restriction value of zero is (would be) + -- violated, but that is all. The compiler cannot distinguish + -- between different non-zero values. + + Max_Asynchronous_Select_Nesting, -- (RM D.7(18), H.4(3)) + Max_Entry_Queue_Depth, -- GNAT + + -- The remaining entries are not checked at compile/bind time + + Max_Storage_At_Blocking, -- (RM D.7(17)) + Not_A_Restriction_Id); + -- Synonyms permitted for historical purposes of compatibility + + -- No_Requeue synonym for No_Requeue_Statements + -- No_Tasking synonym for Max_Tasks => 0 + subtype All_Restrictions is Restriction_Id range - Boolean_Entry_Barriers .. No_Elaboration_Code; - -- All restrictions except Not_A_Restriction_Id + Boolean_Entry_Barriers .. Max_Storage_At_Blocking; + -- All restrictions (excluding only Not_A_Restriction_Id) - -- The following range of Restriction identifiers is checked for - -- consistency across a partition. The generated ali file is marked - -- for each entry to show one of three possibilities: - -- - -- Corresponding restriction is set (so unit does not violate it) - -- Corresponding restriction is not violated - -- Corresponding restriction is violated + subtype All_Boolean_Restrictions is Restriction_Id range + Boolean_Entry_Barriers .. No_Elaboration_Code; + -- All restrictions which do not take a parameter - subtype Partition_Restrictions is Restriction_Id range + subtype Partition_Boolean_Restrictions is All_Boolean_Restrictions range Boolean_Entry_Barriers .. Static_Storage_Size; + -- Boolean restrictions that are checked for partition consistency. + -- Note that all parameter restrictions are checked for partition + -- consistency by default, so this distinction is only needed in the + -- case of Boolean restrictions. - -- The following set of Restriction identifiers is not checked for - -- consistency across a partition. The generated ali file still - -- contains indications of the above three possibilities for the - -- purposes of listing applicable restrictions. - - subtype Compilation_Unit_Restrictions is Restriction_Id range + subtype Cunit_Boolean_Restrictions is All_Boolean_Restrictions range Immediate_Reclamation .. No_Elaboration_Code; + -- Boolean restrictions that are not checked for partition consistency + -- and that thus apply only to the current unit. Note that for these + -- restrictions, the compiler does not apply restrictions found in + -- with'ed units, parent specs etc to the main unit. - -- The following enumeration type defines the set of restriction - -- parameter identifiers taking a parameter that are implemented in - -- GNAT. To add a new restriction parameter identifier, add an entry - -- with the name to be used in the pragma, and add appropriate - -- calls to Restrict.Check_Restriction. - - -- Note: the GNAT implementation currently only accomodates restriction - -- parameter identifiers whose expression value is a non-negative - -- integer. This is true for all language defined parameters. - - type Restriction_Parameter_Id is ( - Max_Asynchronous_Select_Nesting, -- (RM D.7(18), H.4(3)) - Max_Entry_Queue_Depth, -- GNAT - Max_Protected_Entries, -- (RM D.7(14)) - Max_Select_Alternatives, -- (RM D.7(12)) - Max_Storage_At_Blocking, -- (RM D.7(17)) - Max_Task_Entries, -- (RM D.7(13), H.4(3)) - Max_Tasks, -- (RM D.7(19), H.4(3)) - Not_A_Restriction_Parameter_Id); + subtype All_Parameter_Restrictions is + Restriction_Id range + Max_Protected_Entries .. Max_Storage_At_Blocking; + -- All restrictions that are take a parameter + + subtype Checked_Parameter_Restrictions is + All_Parameter_Restrictions range + Max_Protected_Entries .. Max_Entry_Queue_Depth; + -- These are the parameter restrictions that can be at least partially + -- checked at compile/binder time. Minimally, the compiler can detect + -- violations of a restriction pragma with a value of zero reliably. + + subtype Checked_Max_Parameter_Restrictions is + Checked_Parameter_Restrictions range + Max_Protected_Entries .. Max_Task_Entries; + -- Restrictions with parameters that can be checked in some cases by + -- maximizing among statically detected instances where the compiler + -- can determine the count. + + subtype Checked_Add_Parameter_Restrictions is + Checked_Parameter_Restrictions range + Max_Tasks .. Max_Tasks; + -- Restrictions with parameters that can be checked in some cases by + -- summing the statically detected instances where the compiler can + -- determine the count. + + subtype Checked_Val_Parameter_Restrictions is + Checked_Parameter_Restrictions range + Max_Protected_Entries .. Max_Tasks; + -- Restrictions with parameter where the count is known at least in + -- some cases by the compiler/binder. + + subtype Checked_Zero_Parameter_Restrictions is + Checked_Parameter_Restrictions range + Max_Asynchronous_Select_Nesting .. Max_Entry_Queue_Depth; + -- Restrictions with parameters where the compiler can detect the use of + -- the feature, and hence violations of a restriction specifying a value + -- of zero, but cannot detect specific values other than zero/nonzero. + + subtype Unchecked_Parameter_Restrictions is + All_Parameter_Restrictions range + Max_Storage_At_Blocking .. Max_Storage_At_Blocking; + -- Restrictions with parameters where the compiler cannot ever detect + -- corresponding compile time usage, so the binder and compiler never + -- detect violations of any restriction. + + ------------------------------------- + -- Restriction Status Declarations -- + ------------------------------------- + + -- The following declarations are used to record the current status + -- or restrictions (for the current unit, or related units, at compile + -- time, and for all units in a partition at bind time or run time). + + type Restriction_Flags is array (All_Restrictions) of Boolean; + type Restriction_Values is array (All_Parameter_Restrictions) of Natural; + type Parameter_Flags is array (All_Parameter_Restrictions) of Boolean; + + type Restrictions_Info is record + Set : Restriction_Flags := (others => False); + -- An entry is True in the Set array if a restrictions pragma has + -- been encountered for the given restriction. If the value is + -- True for a parameter restriction, then the corresponding entry + -- in the Value array gives the minimum value encountered for any + -- such restriction. + + Value : Restriction_Values; + -- If the entry for a parameter restriction in Set is True (i.e. a + -- restrictions pragma for the restriction has been encountered), then + -- the corresponding entry in the Value array is the minimum value + -- specified by any such restrictions pragma. Note that a restrictions + -- pragma specifying a value greater than Int'Last is simply ignored. + + Violated : Restriction_Flags := (others => False); + -- An entry is True in the violations array if the compiler has + -- detected a violation of the restriction. For a parameter + -- restriction, the Count and Unknown arrays have additional + -- information. + + Count : Restriction_Values := (others => 0); + -- If an entry for a parameter restriction is True in Violated, + -- the corresponding entry in the Count array may record additional + -- information. If the actual minimum count is known (by taking + -- maximums, or sums, depending on the restriction), it will be + -- recorded in this array. If not, then the value will remain zero. + + Unknown : Parameter_Flags := (others => False); + -- If an entry for a parameter restriction is True in Violated, + -- the corresponding entry in the Unknown array may record additional + -- information. If the actual count is not known by the compiler (but + -- is known to be non-zero), then the entry in Unknown will be True. + -- This indicates that the value in Count is not known to be exact, + -- and the actual violation count may be higher. + + -- Note: If Violated (K) is True, then either Count (K) > 0 or + -- Unknown (K) = True. It is possible for both these to be set. + -- For example, if Count (K) = 3 and Unknown (K) is True, it means + -- that the actual violation count is at least 3 but might be higher. + end record; end System.Rident; |