Commit e5a22243 by Arnaud Charlet

[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
parent 5277d0b7
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.
......
......@@ -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),
......
......@@ -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
......
......@@ -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.
......
......@@ -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;
......
......@@ -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.
......
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