From: Arnaud Charlet Date: Tue, 15 May 2012 09:46:19 +0000 (+0200) Subject: [multiple changes] X-Git-Tag: misc/gccgo-go1_1_2~2899 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e5a222431f2c38c283040296d398a95e47708b0d;p=thirdparty%2Fgcc.git [multiple changes] 2012-05-15 Tristan Gingold * s-soflin.ads, s-soflin.adb (Save_Library_Occurrence): Parameter E is now of type Exception_Occurrence_Access. * exp_ch7.ads, exp_ch7.adb (Build_Exception_Handler): Adjust generated call to Save_Library_Occurrence. 2012-05-15 Thomas Quinot * exp_ch4.adb (Rewrite_Coextension): Use Insert_Action to insert temporary variable decl at the proper place in the tree. From-SVN: r187513 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 8f936b678f9b..5fd1ca03f508 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,15 @@ +2012-05-15 Tristan Gingold + + * s-soflin.ads, s-soflin.adb (Save_Library_Occurrence): Parameter + E is now of type Exception_Occurrence_Access. + * exp_ch7.ads, exp_ch7.adb (Build_Exception_Handler): Adjust generated + call to Save_Library_Occurrence. + +2012-05-15 Thomas Quinot + + * exp_ch4.adb (Rewrite_Coextension): Use Insert_Action to + insert temporary variable decl at the proper place in the tree. + 2012-05-15 Hristian Kirtchev * g-calend.adb (Split_At_Locale): New routine. diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 02a733cee889..03ab119823b3 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -3424,9 +3424,8 @@ package body Exp_Ch4 is ------------------------- procedure Rewrite_Coextension (N : Node_Id) is - Temp_Id : constant Node_Id := Make_Temporary (Loc, 'C'); - Temp_Decl : Node_Id; - Insert_Nod : Node_Id; + Temp_Id : constant Node_Id := Make_Temporary (Loc, 'C'); + Temp_Decl : Node_Id; begin -- Generate: @@ -3442,21 +3441,7 @@ package body Exp_Ch4 is Set_Expression (Temp_Decl, Expression (Expression (N))); end if; - -- Find the proper insertion node for the declaration - - Insert_Nod := Parent (N); - while Present (Insert_Nod) loop - exit when - Nkind (Insert_Nod) in N_Statement_Other_Than_Procedure_Call - or else Nkind (Insert_Nod) = N_Procedure_Call_Statement - or else Nkind (Insert_Nod) in N_Declaration; - - Insert_Nod := Parent (Insert_Nod); - end loop; - - Insert_Before (Insert_Nod, Temp_Decl); - Analyze (Temp_Decl); - + Insert_Action (N, Temp_Decl); Rewrite (N, Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Temp_Id, Loc), diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 238469ce79cb..b42c2341d7a2 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -716,40 +716,43 @@ package body Exp_Ch7 is is Actuals : List_Id; Proc_To_Call : Entity_Id; + Except : Node_Id; begin pragma Assert (Present (Data.E_Id)); pragma Assert (Present (Data.Raised_Id)); -- Generate: - -- Get_Current_Excep.all.all - - Actuals := New_List ( - Make_Explicit_Dereference (Data.Loc, - Prefix => - Make_Function_Call (Data.Loc, - Name => - Make_Explicit_Dereference (Data.Loc, - Prefix => - New_Reference_To (RTE (RE_Get_Current_Excep), - Data.Loc))))); - - if For_Library and then not Restricted_Profile then - Proc_To_Call := RTE (RE_Save_Library_Occurrence); + -- Get_Current_Excep.all + + Except := + Make_Function_Call (Data.Loc, + Name => + Make_Explicit_Dereference (Data.Loc, + Prefix => + New_Reference_To (RTE (RE_Get_Current_Excep), Data.Loc))); + + if For_Library and not Restricted_Profile then + Proc_To_Call := RTE (RE_Save_Library_Occurrence); + Actuals := New_List (Except); else Proc_To_Call := RTE (RE_Save_Occurrence); - Prepend_To (Actuals, New_Reference_To (Data.E_Id, Data.Loc)); + Actuals := + New_List + (New_Reference_To (Data.E_Id, Data.Loc), + Make_Explicit_Dereference (Data.Loc, Except)); end if; -- Generate: + -- when others => -- if not Raised_Id then -- Raised_Id := True; -- Save_Occurrence (E_Id, Get_Current_Excep.all.all); -- or - -- Save_Library_Occurrence (Get_Current_Excep.all.all); + -- Save_Library_Occurrence (Get_Current_Excep.all); -- end if; return diff --git a/gcc/ada/exp_ch7.ads b/gcc/ada/exp_ch7.ads index 244936c7e16b..2cb42657bd41 100644 --- a/gcc/ada/exp_ch7.ads +++ b/gcc/ada/exp_ch7.ads @@ -89,7 +89,7 @@ package Exp_Ch7 is -- when others => -- if not Raised_Id then -- Raised_Id := True; - -- Save_Library_Occurrence (Get_Current_Excep.all.all); + -- Save_Library_Occurrence (Get_Current_Excep.all); -- end if; -- -- E_Id denotes the defining identifier of a local exception occurrence. diff --git a/gcc/ada/s-soflin.adb b/gcc/ada/s-soflin.adb index ca3df4ae5449..6367cacd9101 100644 --- a/gcc/ada/s-soflin.adb +++ b/gcc/ada/s-soflin.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-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- -- @@ -223,13 +223,11 @@ package body System.Soft_Links is -- Save_Library_Occurrence -- ----------------------------- - procedure Save_Library_Occurrence - (E : Ada.Exceptions.Exception_Occurrence) - is + procedure Save_Library_Occurrence (E : EOA) is begin if not Library_Exception_Set then Library_Exception_Set := True; - Ada.Exceptions.Save_Occurrence (Library_Exception, E); + Ada.Exceptions.Save_Occurrence (Library_Exception, E.all); end if; end Save_Library_Occurrence; diff --git a/gcc/ada/s-soflin.ads b/gcc/ada/s-soflin.ads index 01dc1737d5f7..2592bd1eeb79 100644 --- a/gcc/ada/s-soflin.ads +++ b/gcc/ada/s-soflin.ads @@ -310,7 +310,7 @@ package System.Soft_Links is -- See the body of Tailored_Exception_Traceback in Ada.Exceptions for -- a more detailed description of the potential problems. - procedure Save_Library_Occurrence (E : Ada.Exceptions.Exception_Occurrence); + procedure Save_Library_Occurrence (E : EOA); -- When invoked, this routine saves an exception occurrence into a hidden -- reference. Subsequent calls will have no effect.