aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2013-01-02 11:47:02 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2013-01-02 11:47:02 +0100
commitdd2d73a747b1e0ba00d9f1aa79be5ac8b087d6ce (patch)
tree474777b594f86d5dc1f359034215a058ba971515
parent7130729aa07512f6349dc85d86454cdb6c152b38 (diff)
downloadgcc-dd2d73a747b1e0ba00d9f1aa79be5ac8b087d6ce.zip
gcc-dd2d73a747b1e0ba00d9f1aa79be5ac8b087d6ce.tar.gz
gcc-dd2d73a747b1e0ba00d9f1aa79be5ac8b087d6ce.tar.bz2
[multiple changes]
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
-rw-r--r--gcc/ada/ChangeLog24
-rw-r--r--gcc/ada/gnat_rm.texi21
-rw-r--r--gcc/ada/gnat_ugn.texi4
-rw-r--r--gcc/ada/par_sco.adb87
-rw-r--r--gcc/ada/usage.adb2
5 files changed, 103 insertions, 35 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 15f39e1..fd9f0e6 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,29 @@
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
task declarations.
* get_scos.adb: When adding an instance table entry for a
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index 1e54eb0..0a89386 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -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:
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index 8b98325..d96a724 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -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
diff --git a/gcc/ada/par_sco.adb b/gcc/ada/par_sco.adb
index c272d02..d1361fd 100644
--- a/gcc/ada/par_sco.adb
+++ b/gcc/ada/par_sco.adb
@@ -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;
@@ -1184,6 +1190,17 @@ package body Par_SCO is
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;
diff --git a/gcc/ada/usage.adb b/gcc/ada/usage.adb
index 030239d..180e44e 100644
--- a/gcc/ada/usage.adb
+++ b/gcc/ada/usage.adb
@@ -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