Commit c4250ab1 by Arnaud Charlet

[multiple changes]

2012-07-23  Arnaud Charlet  <charlet@adacore.com>

	* s-tasinf-linux.ads: Fix typo.

2012-07-23  Thomas Quinot  <quinot@adacore.com>

	* exp_ch7.adb, switch-m.adb, exp_ch3.adb, freeze.adb: Minor reformatting

2012-07-23  Ed Schonberg  <schonberg@adacore.com>

	* exp_ch5.adb (Expand_Iterator_Loop_Over_Array): If original
	loop carries an identifier, preserve it when rewriting it as a
	standard loop to validate exit statements that may reference
	that name in the body of the loop.

2012-07-23  Thomas Quinot  <quinot@adacore.com>

	* exp_ch9.adb: Minor code cleanup.

From-SVN: r189776
parent d7a44b14
2012-07-23 Arnaud Charlet <charlet@adacore.com>
* s-tasinf-linux.ads: Fix typo.
2012-07-23 Thomas Quinot <quinot@adacore.com>
* exp_ch7.adb, switch-m.adb, exp_ch3.adb, freeze.adb: Minor reformatting
2012-07-23 Ed Schonberg <schonberg@adacore.com>
* exp_ch5.adb (Expand_Iterator_Loop_Over_Array): If original
loop carries an identifier, preserve it when rewriting it as a
standard loop to validate exit statements that may reference
that name in the body of the loop.
2012-07-23 Thomas Quinot <quinot@adacore.com>
* exp_ch9.adb: Minor code cleanup.
2012-07-23 Ed Schonberg <schonberg@adacore.com> 2012-07-23 Ed Schonberg <schonberg@adacore.com>
* sem_ch4.adb (Analyze_Selected_Component): When checking for * sem_ch4.adb (Analyze_Selected_Component): When checking for
......
...@@ -635,7 +635,7 @@ package body Exp_Ch3 is ...@@ -635,7 +635,7 @@ package body Exp_Ch3 is
-- but it properly belongs with the array type declaration. However, if -- but it properly belongs with the array type declaration. However, if
-- the freeze node is for a subtype of a type declared in another unit -- the freeze node is for a subtype of a type declared in another unit
-- it seems preferable to use the freeze node as the source location of -- it seems preferable to use the freeze node as the source location of
-- of the init.proc. In any case this is preferable for gcov usage, and -- of the init proc. In any case this is preferable for gcov usage, and
-- the Sloc is not otherwise used by the compiler. -- the Sloc is not otherwise used by the compiler.
if In_Open_Scopes (Scope (A_Type)) then if In_Open_Scopes (Scope (A_Type)) then
......
...@@ -3204,6 +3204,13 @@ package body Exp_Ch5 is ...@@ -3204,6 +3204,13 @@ package body Exp_Ch5 is
Statements => Stats, Statements => Stats,
End_Label => Empty); End_Label => Empty);
-- If present, preserve identifier of loop, which can be used in
-- an exit statement in the body.
if Present (Identifier (N)) then
Set_Identifier (New_Loop, Relocate_Node (Identifier (N)));
end if;
-- Create the declarations for Iterator and cursor and insert them -- Create the declarations for Iterator and cursor and insert them
-- before the source loop. Given that the domain of iteration is -- before the source loop. Given that the domain of iteration is
-- already an entity, the iterator is just a renaming of that -- already an entity, the iterator is just a renaming of that
...@@ -3380,6 +3387,13 @@ package body Exp_Ch5 is ...@@ -3380,6 +3387,13 @@ package body Exp_Ch5 is
end loop; end loop;
end if; end if;
-- If original loop has a name, preserve it so it can be recognized by
-- an exit statement in the body of the rewritten loop.
if Present (Identifier (N)) then
Set_Identifier (Core_Loop, Relocate_Node (Identifier (N)));
end if;
Rewrite (N, Core_Loop); Rewrite (N, Core_Loop);
Analyze (N); Analyze (N);
end Expand_Iterator_Loop_Over_Array; end Expand_Iterator_Loop_Over_Array;
......
...@@ -4565,7 +4565,7 @@ package body Exp_Ch7 is ...@@ -4565,7 +4565,7 @@ package body Exp_Ch7 is
Build_Exception_Handler (Fin_Data)))); Build_Exception_Handler (Fin_Data))));
-- The single raise statement must be inserted after all the -- The single raise statement must be inserted after all the
-- finalization blocks. And we put everything into a wrapper -- finalization blocks, and we put everything into a wrapper
-- block to clearly expose the construct to the back-end. -- block to clearly expose the construct to the back-end.
if Present (Prev_Fin) then if Present (Prev_Fin) then
......
...@@ -10307,12 +10307,10 @@ package body Exp_Ch9 is ...@@ -10307,12 +10307,10 @@ package body Exp_Ch9 is
Proc : Node_Id) Proc : Node_Id)
is is
Astmt : constant Node_Id := Accept_Statement (Alt); Astmt : constant Node_Id := Accept_Statement (Alt);
Choices : List_Id;
Alt_Stats : List_Id; Alt_Stats : List_Id;
begin begin
Adjust_Condition (Condition (Alt)); Adjust_Condition (Condition (Alt));
Choices := New_List (Make_Integer_Literal (Loc, Index));
-- Accept with body -- Accept with body
...@@ -10354,7 +10352,7 @@ package body Exp_Ch9 is ...@@ -10354,7 +10352,7 @@ package body Exp_Ch9 is
Append_To (Alt_List, Append_To (Alt_List,
Make_Case_Statement_Alternative (Loc, Make_Case_Statement_Alternative (Loc,
Discrete_Choices => Choices, Discrete_Choices => New_List (Make_Integer_Literal (Loc, Index)),
Statements => Alt_Stats)); Statements => Alt_Stats));
end Process_Accept_Alternative; end Process_Accept_Alternative;
...@@ -10364,7 +10362,6 @@ package body Exp_Ch9 is ...@@ -10364,7 +10362,6 @@ package body Exp_Ch9 is
procedure Process_Delay_Alternative (Alt : Node_Id; Index : Int) is procedure Process_Delay_Alternative (Alt : Node_Id; Index : Int) is
Dloc : constant Source_Ptr := Sloc (Delay_Statement (Alt)); Dloc : constant Source_Ptr := Sloc (Delay_Statement (Alt));
Choices : List_Id;
Cond : Node_Id; Cond : Node_Id;
Delay_Alt : List_Id; Delay_Alt : List_Id;
...@@ -10478,11 +10475,10 @@ package body Exp_Ch9 is ...@@ -10478,11 +10475,10 @@ package body Exp_Ch9 is
Append_List (Statements (Alt), Delay_Alt_List); Append_List (Statements (Alt), Delay_Alt_List);
else else
Choices := New_List (Make_Integer_Literal (Loc, Index));
Append_To (Delay_Alt_List, Append_To (Delay_Alt_List,
Make_Case_Statement_Alternative (Loc, Make_Case_Statement_Alternative (Loc,
Discrete_Choices => Choices, Discrete_Choices => New_List (
Make_Integer_Literal (Loc, Index)),
Statements => Statements (Alt))); Statements => Statements (Alt)));
end if; end if;
......
...@@ -3027,9 +3027,9 @@ package body Freeze is ...@@ -3027,9 +3027,9 @@ package body Freeze is
end if; end if;
end; end;
-- Pre/Post conditions are implemented through a subprogram in -- Pre/post conditions are implemented through a subprogram in
-- the corresponding body, and therefore are not checked on an -- the corresponding body, and therefore are not checked on an
-- imported subprogram for which the body is not available. -- imported subprogram, for which the body is not available.
-- Could consider generating a wrapper to take care of this??? -- Could consider generating a wrapper to take care of this???
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2007-2009, Free Software Foundation, Inc. -- -- Copyright (C) 2007-2012, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -48,7 +48,7 @@ package System.Task_Info is ...@@ -48,7 +48,7 @@ package System.Task_Info is
pragma Elaborate_Body; pragma Elaborate_Body;
-- To ensure that a body is allowed -- To ensure that a body is allowed
-- Windows provides a way to define the ideal processor to use for a given -- Linux provides a way to define the ideal processor to use for a given
-- thread. The ideal processor is not necessarily the one that will be used -- thread. The ideal processor is not necessarily the one that will be used
-- by the OS but the OS will always try to schedule this thread to the -- by the OS but the OS will always try to schedule this thread to the
-- specified processor if it is available. -- specified processor if it is available.
......
...@@ -423,7 +423,7 @@ package body Switch.M is ...@@ -423,7 +423,7 @@ package body Switch.M is
return; return;
end if; end if;
-- -gnatn may be -gnatn, -gnatn1 or -gnat2 -- -gnatn may be -gnatn, -gnatn1, or -gnatn2
when 'n' => when 'n' =>
Last_Stored := First_Stored; Last_Stored := First_Stored;
......
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