aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2012-05-15 11:46:19 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2012-05-15 11:46:19 +0200
commite5a222431f2c38c283040296d398a95e47708b0d (patch)
tree9fedcb7157eb950243aa5bc85a2679e28d69abe8
parent5277d0b7109e67d3dd582f5b832723ed8e008cb1 (diff)
downloadgcc-e5a222431f2c38c283040296d398a95e47708b0d.zip
gcc-e5a222431f2c38c283040296d398a95e47708b0d.tar.gz
gcc-e5a222431f2c38c283040296d398a95e47708b0d.tar.bz2
[multiple changes]
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
-rw-r--r--gcc/ada/ChangeLog12
-rw-r--r--gcc/ada/exp_ch4.adb21
-rw-r--r--gcc/ada/exp_ch7.adb35
-rw-r--r--gcc/ada/exp_ch7.ads2
-rw-r--r--gcc/ada/s-soflin.adb8
-rw-r--r--gcc/ada/s-soflin.ads2
6 files changed, 39 insertions, 41 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 8f936b6..5fd1ca0 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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.
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 02a733c..03ab119 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 238469c..b42c234 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 244936c..2cb4265 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 ca3df4a..6367cac 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 01dc173..2592bd1 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.