diff options
author | Ed Schonberg <schonberg@adacore.com> | 2014-08-01 14:46:11 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-08-01 16:46:11 +0200 |
commit | 1696d58da2675e9007645304d010710e34022482 (patch) | |
tree | 8bd9b3e28a77d47e7ac709aba3431ab20ad8a3ee /gcc/ada/restrict.adb | |
parent | 9a30c7c4092fa2e7f46ee54883404a3fe34f2919 (diff) | |
download | gcc-1696d58da2675e9007645304d010710e34022482.zip gcc-1696d58da2675e9007645304d010710e34022482.tar.gz gcc-1696d58da2675e9007645304d010710e34022482.tar.bz2 |
restrict.adb (Update_Restrictions): For restrictions with a maximum parameter (e.g.
2014-08-01 Ed Schonberg <schonberg@adacore.com>
* restrict.adb (Update_Restrictions): For restrictions with a
maximum parameter (e.g. number of protected entries in Ravenscar)
do not compute the maximum of the violation over several objects,
because the restriction is per-object.
(Check_Restriction): After possible message, reset the value
of of a checked max_parameter restriction to zero, to prevent
cascaded errors.
* sem_ch3.adb (Build_Derived_Private_Type): Use base of parent
(sub)type to determine whether derived type should be on the
list of private dependents of a type whose full view may become
visible subsequently.
From-SVN: r213483
Diffstat (limited to 'gcc/ada/restrict.adb')
-rw-r--r-- | gcc/ada/restrict.adb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ada/restrict.adb b/gcc/ada/restrict.adb index 3027ffa..ff44e6f 100644 --- a/gcc/ada/restrict.adb +++ b/gcc/ada/restrict.adb @@ -427,6 +427,7 @@ package body Restrict is if VV < 0 then Info.Unknown (R) := True; Info.Count (R) := 1; + else Info.Count (R) := VV; end if; @@ -442,10 +443,11 @@ package body Restrict is if VV < 0 then Info.Unknown (R) := True; - -- If checked by maximization, do maximization + -- If checked by maximization, nothing to do because the + -- check is per-object. elsif R in Checked_Max_Parameter_Restrictions then - Info.Count (R) := Integer'Max (Info.Count (R), VV); + null; -- If checked by adding, do add, checking for overflow @@ -554,6 +556,13 @@ package body Restrict is Msg_Issued := True; Restriction_Msg (R, N); end if; + + -- For Max_Entries and the like, do not carry forward the violation + -- count because it does not affect later declarations. + + if R in Checked_Max_Parameter_Restrictions then + Restrictions.Count (R) := 0; + end if; end Check_Restriction; ------------------------------------- |