aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch13.adb
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2014-07-29 12:56:31 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2014-07-29 14:56:31 +0200
commitedab608853d34224b204dc42d751a3f90daabe39 (patch)
tree6cc8f3aef60cefb58f69e4a2c8d62232b4c13f10 /gcc/ada/sem_ch13.adb
parentc5c780e6deb9cf337f4898db5716659698311d7d (diff)
downloadgcc-edab608853d34224b204dc42d751a3f90daabe39.zip
gcc-edab608853d34224b204dc42d751a3f90daabe39.tar.gz
gcc-edab608853d34224b204dc42d751a3f90daabe39.tar.bz2
sem_aggr.adb (Resolve_Array_Aggregate): Change Is_Static_Range to Is_OK_Static_Range.
2014-07-29 Robert Dewar <dewar@adacore.com> * sem_aggr.adb (Resolve_Array_Aggregate): Change Is_Static_Range to Is_OK_Static_Range. * sem_attr.adb (Eval_Attribute): Make sure we properly flag static attributes (Eval_Attribute, case Size): Handle size of zero properly (Eval_Attribute, case Value_Size): Handle size of zero properly. * sem_ch13.adb: Minor reformatting. * sem_ch3.adb (Process_Range_Expr_In_Decl): Change Is_Static_Range to Is_OK_Static_Range. * sem_eval.adb (Eval_Case_Expression): Total rewrite, was wrong in several ways (Is_Static_Range): Moved here from spec (Is_Static_Subtype): Moved here from spec Change some incorrect Is_Static_Subtype calls to Is_OK_Static_Subtype. * sem_eval.ads: Add comments to section on Is_Static_Expression/Raises_Constraint_Error (Is_OK_Static_Range): Add clarifying comments (Is_Static_Range): Moved to body (Is_Statically_Unevaluated): New function. * sem_util.ads, sem_util.adb (Is_Preelaborable_Expression): Change Is_Static_Range to Is_OK_Static_Range. * sinfo.ads: Additional commments for Is_Static_Expression noting that clients should almost always use Is_OK_Static_Expression instead. Many other changes throughout front end units to obey this rule. * tbuild.ads, tbuild.adb (New_Occurrence_Of): Set Is_Static_Expression for enumeration literal. * exp_ch5.adb, sem_intr.adb, sem_ch5.adb, exp_attr.adb, exp_ch9.adb, lib-writ.adb, sem_ch9.adb, einfo.ads, checks.adb, checks.ads, sem_prag.adb, sem_ch12.adb, freeze.adb, sem_res.adb, exp_ch4.adb, exp_ch6.adb, sem_ch4.adb, sem_ch6.adb, exp_aggr.adb, sem_cat.adb: Replace all occurrences of Is_Static_Expression by Is_OK_Static_Expression. From-SVN: r213159
Diffstat (limited to 'gcc/ada/sem_ch13.adb')
-rw-r--r--gcc/ada/sem_ch13.adb40
1 files changed, 20 insertions, 20 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 390fce7..9c9c6da 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -1688,10 +1688,10 @@ package body Sem_Ch13 is
-- illegal specification of this aspect for a subtype now,
-- to prevent malformed rep_item chains.
- if (A_Id = Aspect_Input
- or else A_Id = Aspect_Output
- or else A_Id = Aspect_Read
- or else A_Id = Aspect_Write)
+ if (A_Id = Aspect_Input or else
+ A_Id = Aspect_Output or else
+ A_Id = Aspect_Read or else
+ A_Id = Aspect_Write)
and not Is_First_Subtype (E)
then
Error_Msg_N
@@ -1931,7 +1931,7 @@ package body Sem_Ch13 is
-- The expression must be static
- elsif not Is_Static_Expression (Expr) then
+ elsif not Is_OK_Static_Expression (Expr) then
Flag_Non_Static_Expr
("aspect requires static expression!", Expr);
@@ -4227,7 +4227,7 @@ package body Sem_Ch13 is
if Etype (Expr) = Any_Type then
return;
- elsif not Is_Static_Expression (Expr) then
+ elsif not Is_OK_Static_Expression (Expr) then
Flag_Non_Static_Expr
("Bit_Order requires static expression!", Expr);
@@ -4367,7 +4367,7 @@ package body Sem_Ch13 is
Preanalyze_Spec_Expression (Expr, RTE (RE_CPU_Range));
Uninstall_Discriminants_And_Pop_Scope (U_Ent);
- if not Is_Static_Expression (Expr) then
+ if not Is_OK_Static_Expression (Expr) then
Check_Restriction (Static_Priorities, Expr);
end if;
end if;
@@ -4466,7 +4466,7 @@ package body Sem_Ch13 is
else
Analyze_And_Resolve (Expr, Standard_String);
- if not Is_Static_Expression (Expr) then
+ if not Is_OK_Static_Expression (Expr) then
Flag_Non_Static_Expr
("static string required for tag name!", Nam);
end if;
@@ -4700,7 +4700,7 @@ package body Sem_Ch13 is
Preanalyze_Spec_Expression (Expr, Standard_Integer);
Uninstall_Discriminants_And_Pop_Scope (U_Ent);
- if not Is_Static_Expression (Expr) then
+ if not Is_OK_Static_Expression (Expr) then
Check_Restriction (Static_Priorities, Expr);
end if;
end if;
@@ -4741,7 +4741,7 @@ package body Sem_Ch13 is
if Etype (Expr) = Any_Type then
return;
- elsif not Is_Static_Expression (Expr) then
+ elsif not Is_OK_Static_Expression (Expr) then
Flag_Non_Static_Expr
("Scalar_Storage_Order requires static expression!", Expr);
@@ -4896,7 +4896,7 @@ package body Sem_Ch13 is
if Etype (Expr) = Any_Type then
return;
- elsif not Is_Static_Expression (Expr) then
+ elsif not Is_OK_Static_Expression (Expr) then
Flag_Non_Static_Expr
("small requires static expression!", Expr);
return;
@@ -5567,7 +5567,7 @@ package body Sem_Ch13 is
-- ??? should allow static subtype with zero/one entry
elsif Etype (Choice) = Base_Type (Enumtype) then
- if not Is_Static_Expression (Choice) then
+ if not Is_OK_Static_Expression (Choice) then
Flag_Non_Static_Expr
("non-static expression used for choice!", Choice);
Err := True;
@@ -6737,7 +6737,7 @@ package body Sem_Ch13 is
while Present (Alt) loop
Dep := Expression (Alt);
- if not Is_Static_Expression (Dep) then
+ if not Is_OK_Static_Expression (Dep) then
raise Non_Static;
elsif Is_True (Expr_Value (Dep)) then
@@ -6781,7 +6781,7 @@ package body Sem_Ch13 is
function Hi_Val (N : Node_Id) return Uint is
begin
- if Is_Static_Expression (N) then
+ if Is_OK_Static_Expression (N) then
return Expr_Value (N);
else
pragma Assert (Nkind (N) = N_Range);
@@ -6826,7 +6826,7 @@ package body Sem_Ch13 is
function Lo_Val (N : Node_Id) return Uint is
begin
- if Is_Static_Expression (N) then
+ if Is_OK_Static_Expression (N) then
return Expr_Value (N);
else
pragma Assert (Nkind (N) = N_Range);
@@ -6860,9 +6860,9 @@ package body Sem_Ch13 is
-- Range case
if Nkind (N) = N_Range then
- if not Is_Static_Expression (Low_Bound (N))
+ if not Is_OK_Static_Expression (Low_Bound (N))
or else
- not Is_Static_Expression (High_Bound (N))
+ not Is_OK_Static_Expression (High_Bound (N))
then
raise Non_Static;
else
@@ -6873,7 +6873,7 @@ package body Sem_Ch13 is
-- Static expression case
- elsif Is_Static_Expression (N) then
+ elsif Is_OK_Static_Expression (N) then
Val := Expr_Value (N);
return RList'(1 => REnt'(Val, Val));
@@ -6892,7 +6892,7 @@ package body Sem_Ch13 is
-- For static subtype without predicates, get range
- elsif Is_Static_Subtype (Entity (N)) then
+ elsif Is_OK_Static_Subtype (Entity (N)) then
SLo := Expr_Value (Type_Low_Bound (Entity (N)));
SHi := Expr_Value (Type_High_Bound (Entity (N)));
return RList'(1 => REnt'(SLo, SHi));
@@ -9606,7 +9606,7 @@ package body Sem_Ch13 is
-- issued elsewhere, since sizes of non-static array types
-- cannot be set implicitly or explicitly.
- if not Is_Static_Subtype (Ityp) then
+ if not Is_OK_Static_Subtype (Ityp) then
return;
end if;