Commit dd2d73a7 by Arnaud Charlet

[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
parent 7130729a
2013-01-02 Thomas Quinot <quinot@adacore.com> 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 * par_sco.adb: Add SCO generation for task types and single
task declarations. task declarations.
* get_scos.adb: When adding an instance table entry for a * get_scos.adb: When adding an instance table entry for a
......
...@@ -6846,13 +6846,13 @@ that make up scalar components are ordered within S. Other properties are ...@@ -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 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}. 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 For a record type @var{S}, if @code{@var{S}'Scalar_Storage_Order} is
equal to @code{@var{S}'Bit_Order}. Note: This means that if a specified explicitly, it shall be equal to @code{@var{S}'Bit_Order}. Note:
@code{Scalar_Storage_Order} attribute definition clause is not confirming, This means that if a @code{Scalar_Storage_Order} attribute definition
then the type's @code{Bit_Order} shall be specified explicitly and set to clause is not confirming, then the type's @code{Bit_Order} shall be
the same value. 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, 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 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. 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. ...@@ -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. 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 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 a scalar component of an object of type @var{S} is read, the storage
machine scalar are first reversed (before retrieving the component value, elements of the enclosing machine scalar are first reversed (before
possibly applying some shift and mask operatings on the enclosing machine retrieving the component value, possibly applying some shift and mask
scalar), and the opposite operation is done for writes. 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 In that case, the restrictions set forth in 13.5.1(10.3/2) for scalar components
are relaxed. Instead, the following rules apply: are relaxed. Instead, the following rules apply:
......
...@@ -4242,10 +4242,6 @@ Specify a mapping file ...@@ -4242,10 +4242,6 @@ Specify a mapping file
@end ifclear @end ifclear
(@pxref{Units to Sources Mapping Files}). (@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} @item -gnatep=@var{file}
@cindex @option{-gnatep} (@command{gcc}) @cindex @option{-gnatep} (@command{gcc})
Specify a preprocessing data file Specify a preprocessing data file
...@@ -154,6 +154,13 @@ package body Par_SCO is ...@@ -154,6 +154,13 @@ package body Par_SCO is
-- Process L, a list of statements or declarations dominated by D. -- 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. -- 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 -- The following Traverse_* routines perform appropriate calls to
-- Traverse_Declarations_Or_Statements to traverse specific node kinds -- Traverse_Declarations_Or_Statements to traverse specific node kinds
...@@ -1024,8 +1031,7 @@ package body Par_SCO is ...@@ -1024,8 +1031,7 @@ package body Par_SCO is
-- original source occurrence of the pragma. -- original source occurrence of the pragma.
if not (Generate_SCO if not (Generate_SCO
and then and then In_Extended_Main_Source_Unit (Loc)
In_Extended_Main_Source_Unit (Cunit_Entity (Current_Sem_Unit))
and then not (In_Instance or In_Inlined_Body)) and then not (In_Instance or In_Inlined_Body))
then then
return; return;
...@@ -1184,6 +1190,17 @@ package body Par_SCO is ...@@ -1184,6 +1190,17 @@ package body Par_SCO is
D : Dominant_Info := No_Dominant; D : Dominant_Info := No_Dominant;
P : Node_Id := Empty) P : Node_Id := Empty)
is 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; Current_Dominant : Dominant_Info := D;
-- Dominance information for the current basic block -- Dominance information for the current basic block
...@@ -1441,6 +1458,9 @@ package body Par_SCO is ...@@ -1441,6 +1458,9 @@ package body Par_SCO is
-- entry since Set_SCO_Pragma_Enabled will be called when -- entry since Set_SCO_Pragma_Enabled will be called when
-- analyzing actual checks, possibly in other units). -- 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 | when Aspect_Predicate |
Aspect_Static_Predicate | Aspect_Static_Predicate |
Aspect_Dynamic_Predicate | Aspect_Dynamic_Predicate |
...@@ -1587,9 +1607,14 @@ package body Par_SCO is ...@@ -1587,9 +1607,14 @@ package body Par_SCO is
when N_Block_Statement => when N_Block_Statement =>
Set_Statement_Entry; Set_Statement_Entry;
Traverse_Declarations_Or_Statements
(L => Declarations (N), -- The first statement in the handled sequence of statements
D => Current_Dominant); -- 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 Traverse_Handled_Statement_Sequence
(N => Handled_Statement_Sequence (N), (N => Handled_Statement_Sequence (N),
D => Current_Dominant); D => Current_Dominant);
...@@ -1916,6 +1941,9 @@ package body Par_SCO is ...@@ -1916,6 +1941,9 @@ package body Par_SCO is
Process_Decisions_Defer (Expression (Arg), 'P'); Process_Decisions_Defer (Expression (Arg), 'P');
Typ := 'p'; Typ := 'p';
-- Pre/postconditions can be inherited so SCO should
-- never be deactivated???
when Name_Debug => when Name_Debug =>
if Present (Arg) and then Present (Next (Arg)) then if Present (Arg) and then Present (Next (Arg)) then
...@@ -1934,6 +1962,10 @@ package body Par_SCO is ...@@ -1934,6 +1962,10 @@ package body Par_SCO is
-- for any embedded expressions, and the pragma is -- for any embedded expressions, and the pragma is
-- never disabled. -- never disabled.
-- Should generate P decisions (not X) for assertion
-- related pragmas: [Type_]Invariant,
-- [{Static,Dynamic}_]Predicate???
when others => when others =>
Process_Decisions_Defer (N, 'X'); Process_Decisions_Defer (N, 'X');
Typ := 'P'; Typ := 'P';
...@@ -2053,6 +2085,8 @@ package body Par_SCO is ...@@ -2053,6 +2085,8 @@ package body Par_SCO is
if Present (P) or else Is_Non_Empty_List (L) then if Present (P) or else Is_Non_Empty_List (L) then
Set_Statement_Entry; Set_Statement_Entry;
end if; end if;
return Current_Dominant;
end Traverse_Declarations_Or_Statements; end Traverse_Declarations_Or_Statements;
------------------------------------------ ------------------------------------------
...@@ -2100,9 +2134,15 @@ package body Par_SCO is ...@@ -2100,9 +2134,15 @@ package body Par_SCO is
--------------------------- ---------------------------
procedure Traverse_Package_Body (N : Node_Id) is procedure Traverse_Package_Body (N : Node_Id) is
Dom : Dominant_Info;
begin begin
Traverse_Declarations_Or_Statements (Declarations (N)); -- The first statement in the handled sequence of statements is
Traverse_Handled_Statement_Sequence (Handled_Statement_Sequence (N)); -- 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; end Traverse_Package_Body;
---------------------------------- ----------------------------------
...@@ -2111,9 +2151,13 @@ package body Par_SCO is ...@@ -2111,9 +2151,13 @@ package body Par_SCO is
procedure Traverse_Package_Declaration (N : Node_Id) is procedure Traverse_Package_Declaration (N : Node_Id) is
Spec : constant Node_Id := Specification (N); Spec : constant Node_Id := Specification (N);
Dom : Dominant_Info;
begin begin
Traverse_Declarations_Or_Statements (Visible_Declarations (Spec)); -- The first private declaration is dominated by the last visible
Traverse_Declarations_Or_Statements (Private_Declarations (Spec)); -- declaration.
Dom := Traverse_Declarations_Or_Statements (Visible_Declarations (Spec));
Traverse_Declarations_Or_Statements (Private_Declarations (Spec), Dom);
end Traverse_Package_Declaration; end Traverse_Package_Declaration;
------------------------------ ------------------------------
...@@ -2145,19 +2189,13 @@ package body Par_SCO is ...@@ -2145,19 +2189,13 @@ package body Par_SCO is
Vis_Decl := Visible_Declarations (Sync_Def); Vis_Decl := Visible_Declarations (Sync_Def);
Traverse_Declarations_Or_Statements Dom_Info := Traverse_Declarations_Or_Statements
(L => Vis_Decl, (L => Vis_Decl,
D => Dom_Info); D => Dom_Info);
-- If visible declarations are present, the first private declaration -- If visible declarations are present, the first private declaration
-- is dominated by the last visible 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 Traverse_Declarations_Or_Statements
(L => Private_Declarations (Sync_Def), (L => Private_Declarations (Sync_Def),
D => Dom_Info); D => Dom_Info);
...@@ -2171,9 +2209,18 @@ package body Par_SCO is ...@@ -2171,9 +2209,18 @@ package body Par_SCO is
(N : Node_Id; (N : Node_Id;
D : Dominant_Info := No_Dominant) D : Dominant_Info := No_Dominant)
is is
Decls : constant List_Id := Declarations (N);
Dom_Info : Dominant_Info := D;
begin begin
Traverse_Declarations_Or_Statements (Declarations (N), D); -- If declarations are present, the first statement is dominated by the
Traverse_Handled_Statement_Sequence (Handled_Statement_Sequence (N), D); -- 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 Traverse_Subprogram_Or_Task_Body;
end Par_SCO; end Par_SCO;
...@@ -225,7 +225,7 @@ begin ...@@ -225,7 +225,7 @@ begin
-- Line for -gnateO=? -- Line for -gnateO=?
Write_Switch_Char ("eO=?"); Write_Switch_Char ("eO=?");
Write_Line ("Specify an object path file"); Write_Line ("Specify an object path file (internal switch)");
-- Line for -gnatep switch -- Line for -gnatep switch
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment