aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-12-21 13:37:27 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2021-05-03 05:28:20 -0400
commit5e024b97f260f393589293e2635a98ca361f57b2 (patch)
tree75eb72d83161d5d3f2f1f715ddd5830a655a1f18
parent03c80e174bc059b50063da24cf89b67e692bc5d8 (diff)
downloadgcc-5e024b97f260f393589293e2635a98ca361f57b2.zip
gcc-5e024b97f260f393589293e2635a98ca361f57b2.tar.gz
gcc-5e024b97f260f393589293e2635a98ca361f57b2.tar.bz2
[Ada] Cleanup processing of aspect Dynamic_Predicate
gcc/ada/ * sem_ch13.adb (Build_Predicate_Functions): Fix typo in comment. (Resolve_Aspect_Expressions): Fix typo in comment; remove redundant check for no aspects; simplify with Discard_Node.
-rw-r--r--gcc/ada/sem_ch13.adb22
1 files changed, 7 insertions, 15 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 005c7b0..1df37d9 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -9998,7 +9998,7 @@ package body Sem_Ch13 is
-- Do not generate predicate bodies within a generic unit. The
-- expressions have been analyzed already, and the bodies play
- -- no role if not within an executable unit. However, if a statc
+ -- no role if not within an executable unit. However, if a static
-- predicate is present it must be processed for legality checks
-- such as case coverage in an expression.
@@ -14914,7 +14914,7 @@ package body Sem_Ch13 is
Find_Direct_Name (N);
Set_Entity (N, Empty);
- -- The name is component association needs no resolution.
+ -- The name is component association needs no resolution
elsif Nkind (N) = N_Component_Association then
Dummy := Resolve_Name (Expression (N));
@@ -14936,10 +14936,6 @@ package body Sem_Ch13 is
-- Start of processing for Resolve_Aspect_Expressions
begin
- if No (ASN) then
- return;
- end if;
-
while Present (ASN) loop
if Nkind (ASN) = N_Aspect_Specification and then Entity (ASN) = E then
declare
@@ -14976,16 +14972,12 @@ package body Sem_Ch13 is
-- discriminants of the type.
if No (Predicate_Function (E)) then
- declare
- FDecl : constant Node_Id :=
- Build_Predicate_Function_Declaration (E);
- pragma Unreferenced (FDecl);
+ Discard_Node
+ (Build_Predicate_Function_Declaration (E));
- begin
- Push_Type (E);
- Resolve_Aspect_Expression (Expr);
- Pop_Type (E);
- end;
+ Push_Type (E);
+ Resolve_Aspect_Expression (Expr);
+ Pop_Type (E);
end if;
when Pre_Post_Aspects =>