From c4250ab16bc898d9995a804afa2bcf9523f0cd83 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Mon, 23 Jul 2012 10:32:33 +0200 Subject: [PATCH] [multiple changes] 2012-07-23 Arnaud Charlet * s-tasinf-linux.ads: Fix typo. 2012-07-23 Thomas Quinot * exp_ch7.adb, switch-m.adb, exp_ch3.adb, freeze.adb: Minor reformatting 2012-07-23 Ed Schonberg * 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 * exp_ch9.adb: Minor code cleanup. From-SVN: r189776 --- gcc/ada/ChangeLog | 19 +++++++++++++++++++ gcc/ada/exp_ch3.adb | 2 +- gcc/ada/exp_ch5.adb | 14 ++++++++++++++ gcc/ada/exp_ch7.adb | 2 +- gcc/ada/exp_ch9.adb | 10 +++------- gcc/ada/freeze.adb | 4 ++-- gcc/ada/s-tasinf-linux.ads | 4 ++-- gcc/ada/switch-m.adb | 2 +- 8 files changed, 43 insertions(+), 14 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a25e8e15505..88460007169 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,22 @@ +2012-07-23 Arnaud Charlet + + * s-tasinf-linux.ads: Fix typo. + +2012-07-23 Thomas Quinot + + * exp_ch7.adb, switch-m.adb, exp_ch3.adb, freeze.adb: Minor reformatting + +2012-07-23 Ed Schonberg + + * 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 + + * exp_ch9.adb: Minor code cleanup. + 2012-07-23 Ed Schonberg * sem_ch4.adb (Analyze_Selected_Component): When checking for diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 91c883322ab..066b37d1775 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -635,7 +635,7 @@ package body Exp_Ch3 is -- 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 -- 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. if In_Open_Scopes (Scope (A_Type)) then diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index 43a1c75cdbe..a1aaa37363e 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -3204,6 +3204,13 @@ package body Exp_Ch5 is Statements => Stats, 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 -- before the source loop. Given that the domain of iteration is -- already an entity, the iterator is just a renaming of that @@ -3380,6 +3387,13 @@ package body Exp_Ch5 is end loop; 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); Analyze (N); end Expand_Iterator_Loop_Over_Array; diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 6483c7e339d..17ad11cc173 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -4565,7 +4565,7 @@ package body Exp_Ch7 is Build_Exception_Handler (Fin_Data)))); -- 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. if Present (Prev_Fin) then diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index c8a3094c320..a8bca192a82 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -10307,12 +10307,10 @@ package body Exp_Ch9 is Proc : Node_Id) is Astmt : constant Node_Id := Accept_Statement (Alt); - Choices : List_Id; Alt_Stats : List_Id; begin Adjust_Condition (Condition (Alt)); - Choices := New_List (Make_Integer_Literal (Loc, Index)); -- Accept with body @@ -10354,7 +10352,7 @@ package body Exp_Ch9 is Append_To (Alt_List, Make_Case_Statement_Alternative (Loc, - Discrete_Choices => Choices, + Discrete_Choices => New_List (Make_Integer_Literal (Loc, Index)), Statements => Alt_Stats)); end Process_Accept_Alternative; @@ -10364,7 +10362,6 @@ package body Exp_Ch9 is procedure Process_Delay_Alternative (Alt : Node_Id; Index : Int) is Dloc : constant Source_Ptr := Sloc (Delay_Statement (Alt)); - Choices : List_Id; Cond : Node_Id; Delay_Alt : List_Id; @@ -10478,11 +10475,10 @@ package body Exp_Ch9 is Append_List (Statements (Alt), Delay_Alt_List); else - Choices := New_List (Make_Integer_Literal (Loc, Index)); - Append_To (Delay_Alt_List, Make_Case_Statement_Alternative (Loc, - Discrete_Choices => Choices, + Discrete_Choices => New_List ( + Make_Integer_Literal (Loc, Index)), Statements => Statements (Alt))); end if; diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index a65f0b17e19..14856432ca9 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -3027,9 +3027,9 @@ package body Freeze is end if; 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 - -- 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??? diff --git a/gcc/ada/s-tasinf-linux.ads b/gcc/ada/s-tasinf-linux.ads index db274f89f52..b789dd1cf60 100644 --- a/gcc/ada/s-tasinf-linux.ads +++ b/gcc/ada/s-tasinf-linux.ads @@ -6,7 +6,7 @@ -- -- -- 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 -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -48,7 +48,7 @@ package System.Task_Info is pragma Elaborate_Body; -- 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 -- by the OS but the OS will always try to schedule this thread to the -- specified processor if it is available. diff --git a/gcc/ada/switch-m.adb b/gcc/ada/switch-m.adb index 81211db0f3c..d082c905f86 100644 --- a/gcc/ada/switch-m.adb +++ b/gcc/ada/switch-m.adb @@ -423,7 +423,7 @@ package body Switch.M is return; end if; - -- -gnatn may be -gnatn, -gnatn1 or -gnat2 + -- -gnatn may be -gnatn, -gnatn1, or -gnatn2 when 'n' => Last_Stored := First_Stored;