]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Wed, 2 Jan 2013 10:47:02 +0000 (11:47 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 2 Jan 2013 10:47:02 +0000 (11:47 +0100)
2013-01-02  Thomas Quinot  <quinot@adacore.com>

* par_sco.adb (Traverse_Declarations_Or_Statement): Function
form, returning value of Current_Dominant upon exit, for chaining
purposes.
(Traverse_Declarations_Or_Statement.Traverse_One, case
N_Block_Statement): First statement is dominated by last declaration.
(Traverse_Subprogram_Or_Task_Body): Ditto.
(Traverse_Package_Declaration): First private
declaration is dominated by last visible declaration.
(Traverse_Sync_Definition): Ditto.

2013-01-02  Thomas Quinot  <quinot@adacore.com>

* gnat_rm.texi: Restrict the requirement for Scalar_Storage_Order
matching Bit_Order to record types only, since array types do not
have a Bit_Order.

2013-01-02  Vincent Celier  <celier@adacore.com>

* gnat_ugn.texi: Remove documentation of -gnateO, which is an
internal switch.
* usage.adb: Indicate that -gnateO is an internal switch.

From-SVN: r194794

gcc/ada/ChangeLog
gcc/ada/gnat_rm.texi
gcc/ada/gnat_ugn.texi
gcc/ada/par_sco.adb
gcc/ada/usage.adb

index 15f39e18424e7a5ab5606688036e875e169ba97d..fd9f0e6427af81fe093a5d3453e9192e1b4bfb13 100644 (file)
@@ -1,3 +1,27 @@
+2013-01-02  Thomas Quinot  <quinot@adacore.com>
+
+       * par_sco.adb (Traverse_Declarations_Or_Statement): Function
+       form, returning value of Current_Dominant upon exit, for chaining
+       purposes.
+       (Traverse_Declarations_Or_Statement.Traverse_One, case
+       N_Block_Statement): First statement is dominated by last declaration.
+       (Traverse_Subprogram_Or_Task_Body): Ditto.
+       (Traverse_Package_Declaration): First private
+       declaration is dominated by last visible declaration.
+       (Traverse_Sync_Definition): Ditto.
+
+2013-01-02  Thomas Quinot  <quinot@adacore.com>
+
+       * gnat_rm.texi: Restrict the requirement for Scalar_Storage_Order
+       matching Bit_Order to record types only, since array types do not
+       have a Bit_Order.
+
+2013-01-02  Vincent Celier  <celier@adacore.com>
+
+       * gnat_ugn.texi: Remove documentation of -gnateO, which is an
+       internal switch.
+       * usage.adb: Indicate that -gnateO is an internal switch.
+
 2013-01-02  Thomas Quinot  <quinot@adacore.com>
 
        * par_sco.adb: Add SCO generation for task types and single
index 1e54eb0abff2ccb510c6f199c4b23f8bb1fef660..0a89386af57238a7a343b065fb17245a845f3e6e 100644 (file)
@@ -6846,13 +6846,13 @@ that make up scalar components are ordered within S. Other properties are
 as for standard representation attribute @code{Bit_Order}, as defined by
 Ada RM 13.5.3(4). The default is @code{System.Default_Bit_Order}.
 
-If @code{@var{S}'Scalar_Storage_Order} is specified explicitly, it shall be
-equal to @code{@var{S}'Bit_Order}. Note: This means that if a
-@code{Scalar_Storage_Order} attribute definition clause is not confirming,
-then the type's @code{Bit_Order} shall be specified explicitly and set to
-the same value.
+For a record type @var{S}, if @code{@var{S}'Scalar_Storage_Order} is
+specified explicitly, it shall be equal to @code{@var{S}'Bit_Order}. Note:
+This means that if a @code{Scalar_Storage_Order} attribute definition
+clause is not confirming, then the type's @code{Bit_Order} shall be
+specified explicitly and set to the same value.
 
-If a component of S has itself a record or array type, then it shall also
+If a component of @var{S} has itself a record or array type, then it shall also
 have a @code{Scalar_Storage_Order} attribute definition clause. In addition,
 if the component does not start on a byte boundary, then the scalar storage
 order specified for S and for the nested component type shall be identical.
@@ -6864,10 +6864,11 @@ A confirming @code{Scalar_Storage_Order} attribute definition clause (i.e.
 with a value equal to @code{System.Default_Bit_Order}) has no effect.
 
 If the opposite storage order is specified, then whenever the value of
-a scalar component of S is read, the storage elements of the enclosing
-machine scalar are first reversed (before retrieving the component value,
-possibly applying some shift and mask operatings on the enclosing machine
-scalar), and the opposite operation is done for writes.
+a scalar component of an object of type @var{S} is read, the storage
+elements of the enclosing machine scalar are first reversed (before
+retrieving the component value, possibly applying some shift and mask
+operatings on the enclosing machine scalar), and the opposite operation
+is done for writes.
 
 In that case, the restrictions set forth in 13.5.1(10.3/2) for scalar components
 are relaxed. Instead, the following rules apply:
index 8b983257be3c62d967abd5540f585f43de5b34ac..d96a724df6d4b5392be69bd00bdf41f71e996cb2 100644 (file)
@@ -4242,10 +4242,6 @@ Specify a mapping file
 @end ifclear
 (@pxref{Units to Sources Mapping Files}).
 
-@item -gnateO=@var{path}
-@cindex @option{-gnateO} (@command{gcc})
-Specify a path for the object files.
-
 @item -gnatep=@var{file}
 @cindex @option{-gnatep} (@command{gcc})
 Specify a preprocessing data file
index c272d027bc0baa203c47f230e5f1a4835486a31f..d1361fdac12fbe93595e2c688b120a9954f67cac 100644 (file)
@@ -154,6 +154,13 @@ package body Par_SCO is
    --  Process L, a list of statements or declarations dominated by D.
    --  If P is present, it is processed as though it had been prepended to L.
 
+   function Traverse_Declarations_Or_Statements
+     (L : List_Id;
+      D : Dominant_Info := No_Dominant;
+      P : Node_Id       := Empty) return Dominant_Info;
+   --  Same as above, and returns dominant information corresponding to the
+   --  last node with SCO in L.
+
    --  The following Traverse_* routines perform appropriate calls to
    --  Traverse_Declarations_Or_Statements to traverse specific node kinds
 
@@ -1024,8 +1031,7 @@ package body Par_SCO is
       --  original source occurrence of the pragma.
 
       if not (Generate_SCO
-               and then
-                 In_Extended_Main_Source_Unit (Cunit_Entity (Current_Sem_Unit))
+               and then In_Extended_Main_Source_Unit (Loc)
                and then not (In_Instance or In_Inlined_Body))
       then
          return;
@@ -1183,6 +1189,17 @@ package body Par_SCO is
      (L : List_Id;
       D : Dominant_Info := No_Dominant;
       P : Node_Id       := Empty)
+   is
+      Discard_Dom : Dominant_Info;
+      pragma Warnings (Off, Discard_Dom);
+   begin
+      Discard_Dom := Traverse_Declarations_Or_Statements (L, D, P);
+   end Traverse_Declarations_Or_Statements;
+
+   function Traverse_Declarations_Or_Statements
+     (L : List_Id;
+      D : Dominant_Info := No_Dominant;
+      P : Node_Id       := Empty) return Dominant_Info
    is
       Current_Dominant : Dominant_Info := D;
       --  Dominance information for the current basic block
@@ -1441,6 +1458,9 @@ package body Par_SCO is
                --  entry since Set_SCO_Pragma_Enabled will be called when
                --  analyzing actual checks, possibly in other units).
 
+               --  Pre/post can have checks in client units too because of
+               --  inheritance, so should they be moved here???
+
                when Aspect_Predicate         |
                     Aspect_Static_Predicate  |
                     Aspect_Dynamic_Predicate |
@@ -1587,9 +1607,14 @@ package body Par_SCO is
 
             when N_Block_Statement =>
                Set_Statement_Entry;
-               Traverse_Declarations_Or_Statements
-                 (L => Declarations (N),
-                  D => Current_Dominant);
+
+               --  The first statement in the handled sequence of statements
+               --  is dominated by the elaboration of the last declaration.
+
+               Current_Dominant := Traverse_Declarations_Or_Statements
+                                     (L => Declarations (N),
+                                      D => Current_Dominant);
+
                Traverse_Handled_Statement_Sequence
                  (N => Handled_Statement_Sequence (N),
                   D => Current_Dominant);
@@ -1916,6 +1941,9 @@ package body Par_SCO is
                         Process_Decisions_Defer (Expression (Arg), 'P');
                         Typ := 'p';
 
+                        --  Pre/postconditions can be inherited so SCO should
+                        --  never be deactivated???
+
                      when Name_Debug =>
                         if Present (Arg) and then Present (Next (Arg)) then
 
@@ -1934,6 +1962,10 @@ package body Par_SCO is
                      --  for any embedded expressions, and the pragma is
                      --  never disabled.
 
+                     --  Should generate P decisions (not X) for assertion
+                     --  related pragmas: [Type_]Invariant,
+                     --  [{Static,Dynamic}_]Predicate???
+
                      when others =>
                         Process_Decisions_Defer (N, 'X');
                         Typ := 'P';
@@ -2053,6 +2085,8 @@ package body Par_SCO is
       if Present (P) or else Is_Non_Empty_List (L) then
          Set_Statement_Entry;
       end if;
+
+      return Current_Dominant;
    end Traverse_Declarations_Or_Statements;
 
    ------------------------------------------
@@ -2100,9 +2134,15 @@ package body Par_SCO is
    ---------------------------
 
    procedure Traverse_Package_Body (N : Node_Id) is
+      Dom : Dominant_Info;
    begin
-      Traverse_Declarations_Or_Statements (Declarations (N));
-      Traverse_Handled_Statement_Sequence (Handled_Statement_Sequence (N));
+      --  The first statement in the handled sequence of statements is
+      --  dominated by the elaboration of the last declaration.
+
+      Dom := Traverse_Declarations_Or_Statements (Declarations (N));
+
+      Traverse_Handled_Statement_Sequence
+        (Handled_Statement_Sequence (N), Dom);
    end Traverse_Package_Body;
 
    ----------------------------------
@@ -2111,9 +2151,13 @@ package body Par_SCO is
 
    procedure Traverse_Package_Declaration (N : Node_Id) is
       Spec : constant Node_Id := Specification (N);
+      Dom  : Dominant_Info;
    begin
-      Traverse_Declarations_Or_Statements (Visible_Declarations (Spec));
-      Traverse_Declarations_Or_Statements (Private_Declarations (Spec));
+      --  The first private declaration is dominated by the last visible
+      --  declaration.
+
+      Dom := Traverse_Declarations_Or_Statements (Visible_Declarations (Spec));
+      Traverse_Declarations_Or_Statements (Private_Declarations (Spec), Dom);
    end Traverse_Package_Declaration;
 
    ------------------------------
@@ -2145,19 +2189,13 @@ package body Par_SCO is
 
       Vis_Decl := Visible_Declarations (Sync_Def);
 
-      Traverse_Declarations_Or_Statements
-        (L => Vis_Decl,
-         D => Dom_Info);
+      Dom_Info := Traverse_Declarations_Or_Statements
+                    (L => Vis_Decl,
+                     D => Dom_Info);
 
       --  If visible declarations are present, the first private declaration
       --  is dominated by the last visible declaration.
 
-      --  This is incorrect if Last (Vis_Decl) does not generate a SCO???
-
-      if not Is_Empty_List (Vis_Decl) then
-         Dom_Info.N := Last (Vis_Decl);
-      end if;
-
       Traverse_Declarations_Or_Statements
         (L => Private_Declarations (Sync_Def),
          D => Dom_Info);
@@ -2171,9 +2209,18 @@ package body Par_SCO is
      (N : Node_Id;
       D : Dominant_Info := No_Dominant)
    is
+      Decls    : constant List_Id := Declarations (N);
+      Dom_Info : Dominant_Info := D;
    begin
-      Traverse_Declarations_Or_Statements (Declarations (N), D);
-      Traverse_Handled_Statement_Sequence (Handled_Statement_Sequence (N), D);
+      --  If declarations are present, the first statement is dominated by the
+      --  last declaration.
+
+      Dom_Info := Traverse_Declarations_Or_Statements
+                    (L => Decls, D => Dom_Info);
+
+      Traverse_Handled_Statement_Sequence
+        (N => Handled_Statement_Sequence (N),
+         D => Dom_Info);
    end Traverse_Subprogram_Or_Task_Body;
 
 end Par_SCO;
index 030239da13826fd10d088c2e70936dfbe3f432c1..180e44ebf3e05bf90a46cf6fe8c343eddd3f6cf7 100644 (file)
@@ -225,7 +225,7 @@ begin
    --  Line for -gnateO=?
 
    Write_Switch_Char ("eO=?");
-   Write_Line ("Specify an object path file");
+   Write_Line ("Specify an object path file (internal switch)");
 
    --  Line for -gnatep switch