aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_case.adb
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2014-07-29 13:02:06 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2014-07-29 15:02:06 +0200
commit60f908dd027ea9561239e46b55246da68839b18b (patch)
tree3d83be6d9e80b289bd87e7433e7c31576768ffb4 /gcc/ada/sem_case.adb
parent96e90ac1ec8cb9261093e434c88cced5d5675e2b (diff)
downloadgcc-60f908dd027ea9561239e46b55246da68839b18b.zip
gcc-60f908dd027ea9561239e46b55246da68839b18b.tar.gz
gcc-60f908dd027ea9561239e46b55246da68839b18b.tar.bz2
sem_aggr.adb, [...]: General cleanup of static predicate handling.
2014-07-29 Robert Dewar <dewar@adacore.com> * sem_aggr.adb, exp_ch5.adb, sem_ch5.adb, exp_util.adb, einfo.adb, einfo.ads, sem_util.adb, sem_attr.adb, sem_case.adb, sem_eval.adb, sem_eval.ads, sem_ch13.adb: General cleanup of static predicate handling. Change name of Discrete_Predicate to Discrete_Static_Predicate, and replace testing of the presence of this field by testing the flag Has_Static_Expression. From-SVN: r213161
Diffstat (limited to 'gcc/ada/sem_case.adb')
-rw-r--r--gcc/ada/sem_case.adb15
1 files changed, 6 insertions, 9 deletions
diff --git a/gcc/ada/sem_case.adb b/gcc/ada/sem_case.adb
index 7a8a60a..709a264 100644
--- a/gcc/ada/sem_case.adb
+++ b/gcc/ada/sem_case.adb
@@ -648,7 +648,7 @@ package body Sem_Case is
Num_Choices : constant Nat := Choice_Table'Last;
Has_Predicate : constant Boolean :=
Is_OK_Static_Subtype (Bounds_Type)
- and then Present (Static_Predicate (Bounds_Type));
+ and then Has_Static_Predicate (Bounds_Type);
Choice : Node_Id;
Choice_Hi : Uint;
@@ -696,13 +696,10 @@ package body Sem_Case is
-- Note that in GNAT the predicate is considered static if the predicate
-- expression is static, independently of whether the aspect mentions
- -- Static explicitly. It is unclear whether this is RM-conforming, but
- -- it's certainly useful, and GNAT source make use of this. The downside
- -- is that currently case expressions cannot appear in predicates that
- -- are not static. ???
+ -- Static explicitly.
if Has_Predicate then
- Pred := First (Static_Predicate (Bounds_Type));
+ Pred := First (Static_Discrete_Predicate (Bounds_Type));
Prev_Lo := Uint_Minus_1;
Prev_Hi := Uint_Minus_1;
Error := False;
@@ -1387,7 +1384,7 @@ package body Sem_Case is
if Is_OK_Static_Subtype (Subtyp) then
if not Has_Predicates (Subtyp)
- or else Present (Static_Predicate (Subtyp))
+ or else Has_Static_Predicate (Subtyp)
then
Bounds_Type := Subtyp;
else
@@ -1464,7 +1461,7 @@ package body Sem_Case is
-- Use of non-static predicate is an error
if not Is_Discrete_Type (E)
- or else No (Static_Predicate (E))
+ or else not Has_Static_Predicate (E)
then
Bad_Predicated_Subtype_Use
("cannot use subtype& with non-static "
@@ -1484,7 +1481,7 @@ package body Sem_Case is
-- list is empty, corresponding to a False
-- predicate, then no choices are checked.
- P := First (Static_Predicate (E));
+ P := First (Static_Discrete_Predicate (E));
while Present (P) loop
C := New_Copy (P);
Set_Sloc (C, Sloc (Choice));