OSDN Git Service

2011-08-02 Robert Dewar <dewar@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Aug 2011 08:19:12 +0000 (08:19 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Aug 2011 08:19:12 +0000 (08:19 +0000)
* sem_ch8.adb, aspects.ads: Minor reformatting.

2011-08-02  Eric Botcazou  <ebotcazou@adacore.com>

* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177094 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/aspects.ads
gcc/ada/sem_ch13.adb
gcc/ada/sem_ch13.ads
gcc/ada/sem_ch8.adb

index 65fb0dc..886bad5 100644 (file)
@@ -1,3 +1,14 @@
+2011-08-02  Robert Dewar  <dewar@adacore.com>
+
+       * sem_ch8.adb, aspects.ads: Minor reformatting.
+
+2011-08-02  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * 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  <moy@adacore.com>
 
        * exp_ch6.adb (Expand_N_Subprogram_Declaration): issue error in formal
index e2e7e6f..773bf49 100755 (executable)
@@ -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
index 59a1cb5..ac03bd9 100644 (file)
@@ -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
@@ -688,6 +698,25 @@ package body Sem_Ch13 is
       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;
       Ent    : 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
          <<Continue>>
             Next (Aspect);
       end loop;
-   end Analyze_Aspect_Specifications;
+   end Analyze_Non_Null_Aspect_Specifications;
 
    -----------------------
    -- Analyze_At_Clause --
index 80d44e6..a2726fd 100644 (file)
@@ -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
index 2472474..a883c4d 100644 (file)
@@ -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;