From 8830d1d2a25268b60eba9b47d62f4ddabec6d428 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Tue, 2 Aug 2011 10:19:12 +0200 Subject: [PATCH] [multiple changes] 2011-08-02 Robert Dewar * sem_ch8.adb, aspects.ads: Minor reformatting. 2011-08-02 Eric Botcazou * sem_ch13.ads (Analyze_Aspect_Specification): Add pragma Inline. * sem_ch13.adb (Analyze_Non_Null_Aspect_Specifications): New procedure extracted from... (Analyze_Aspect_Specifications): ...here. Call above procedure. From-SVN: r177094 --- gcc/ada/ChangeLog | 11 +++++++++++ gcc/ada/aspects.ads | 8 +++++--- gcc/ada/sem_ch13.adb | 37 ++++++++++++++++++++++++++++++------- gcc/ada/sem_ch13.ads | 1 + gcc/ada/sem_ch8.adb | 1 - 5 files changed, 47 insertions(+), 11 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 65fb0dcdd36..886bad566de 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2011-08-02 Robert Dewar + + * sem_ch8.adb, aspects.ads: Minor reformatting. + +2011-08-02 Eric Botcazou + + * sem_ch13.ads (Analyze_Aspect_Specification): Add pragma Inline. + * sem_ch13.adb (Analyze_Non_Null_Aspect_Specifications): New procedure + extracted from... + (Analyze_Aspect_Specifications): ...here. Call above procedure. + 2011-08-02 Yannick Moy * exp_ch6.adb (Expand_N_Subprogram_Declaration): issue error in formal diff --git a/gcc/ada/aspects.ads b/gcc/ada/aspects.ads index e2e7e6f0a40..773bf493cfa 100755 --- a/gcc/ada/aspects.ads +++ b/gcc/ada/aspects.ads @@ -88,9 +88,11 @@ package Aspects is Aspect_Universal_Data, -- GNAT -- Remaining aspects have a static boolean value that turns the aspect - -- on or off. They all correspond to pragmas, and the flag Aspect_Cancel - -- is set on the pragma if the corresponding aspect is False. These are - -- also Boolean aspects as defined below. + -- on or off. They all correspond to pragmas, but are only converted to + -- the pragmas where the value is True. A value of False normally means + -- that the aspect is ignored, except in the case of derived types where + -- the aspect value is inherited from the parent, in which case, we do + -- not allow False if we inherit a True value from the parent. Aspect_Ada_2005, -- GNAT Aspect_Ada_2012, -- GNAT diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 59a1cb5d8a6..ac03bd91ab7 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -78,6 +78,16 @@ package body Sem_Ch13 is -- inherited from a derived type that is no longer appropriate for the -- new Esize value. In this case, we reset the Alignment to unknown. + procedure Analyze_Non_Null_Aspect_Specifications + (N : Node_Id; + E : Entity_Id; + L : List_Id); + -- This procedure is called to analyze aspect specifications for node N. + -- E is the corresponding entity declared by the declaration node N, and + -- L is the list of aspect specifications for this node. This procedure + -- does the real work, as opposed to Analyze_Aspect_Specifications which + -- is inlined to fast-track the common case. + procedure Build_Predicate_Function (Typ : Entity_Id; N : Node_Id); -- If Typ has predicates (indicated by Has_Predicates being set for Typ, -- then either there are pragma Invariant entries on the rep chain for the @@ -687,6 +697,25 @@ package body Sem_Ch13 is (N : Node_Id; E : Entity_Id; L : List_Id) + is + begin + -- Return if no aspects + + if L = No_List then + return; + end if; + + Analyze_Non_Null_Aspect_Specifications (N, E, L); + end Analyze_Aspect_Specifications; + + -------------------------------------------- + -- Analyze_Non_Null_Aspect_Specifications -- + -------------------------------------------- + + procedure Analyze_Non_Null_Aspect_Specifications + (N : Node_Id; + E : Entity_Id; + L : List_Id) is Aspect : Node_Id; Aitem : Node_Id; @@ -715,12 +744,6 @@ package body Sem_Ch13 is -- Set True if delay is required begin - -- Return if no aspects - - if L = No_List then - return; - end if; - -- Loop through aspects Aspect := First (L); @@ -1198,7 +1221,7 @@ package body Sem_Ch13 is <> Next (Aspect); end loop; - end Analyze_Aspect_Specifications; + end Analyze_Non_Null_Aspect_Specifications; ----------------------- -- Analyze_At_Clause -- diff --git a/gcc/ada/sem_ch13.ads b/gcc/ada/sem_ch13.ads index 80d44e6282f..a2726fd44ac 100644 --- a/gcc/ada/sem_ch13.ads +++ b/gcc/ada/sem_ch13.ads @@ -46,6 +46,7 @@ package Sem_Ch13 is -- the call is ignored. Note that we can't use a simpler interface of just -- passing the node N, since the analysis of the node may cause it to be -- rewritten to a node not permitting aspect specifications. + pragma Inline (Analyze_Aspect_Specifications); procedure Adjust_Record_For_Reverse_Bit_Order (R : Entity_Id); -- Called from Freeze where R is a record entity for which reverse bit diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 2472474a466..a883c4d19f6 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -2697,7 +2697,6 @@ package body Sem_Ch8 is Mark := First (Subtype_Marks (N)); while Present (Mark) loop Use_One_Type (Mark, Installed => True); - Next (Mark); end loop; -- 2.30.2