]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Tue, 15 May 2012 09:46:19 +0000 (11:46 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 15 May 2012 09:46:19 +0000 (11:46 +0200)
2012-05-15  Tristan Gingold  <gingold@adacore.com>

* 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  <quinot@adacore.com>

* exp_ch4.adb (Rewrite_Coextension): Use Insert_Action to
insert temporary variable decl at the proper place in the tree.

From-SVN: r187513

gcc/ada/ChangeLog
gcc/ada/exp_ch4.adb
gcc/ada/exp_ch7.adb
gcc/ada/exp_ch7.ads
gcc/ada/s-soflin.adb
gcc/ada/s-soflin.ads

index 8f936b678f9b72d096e986d1ac26fd4788fc82db..5fd1ca03f50803abdb056b1ed6b217e20133ee15 100644 (file)
@@ -1,3 +1,15 @@
+2012-05-15  Tristan Gingold  <gingold@adacore.com>
+
+       * 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  <quinot@adacore.com>
+
+       * 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  <kirtchev@adacore.com>
 
        * g-calend.adb (Split_At_Locale): New routine.
index 02a733cee8897332354d7824574b9338a17a9839..03ab119823b39dad2db54a25c54ace36b9a32a1c 100644 (file)
@@ -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),
index 238469ce79cb80dbef7e9e619b17b2df164e60f0..b42c2341d7a21900c71e9e9a31a2860b5f349d43 100644 (file)
@@ -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
index 244936c7e16bfb5bb3b85c33fbab4bdb4d3e0cb2..2cb42657bd410a89d40f8503fea30da678e1d172 100644 (file)
@@ -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.
index ca3df4ae544941c7129209799b2e383cdd3e59e9..6367cacd9101778b2f5dc6bd70d5632a3cba58cc 100644 (file)
@@ -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;
 
index 01dc1737d5f7f758767020107eea6819a5e61053..2592bd1eeb79c122bc33d3db4681793ce4aa3df2 100644 (file)
@@ -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.