summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_intr.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-03 15:08:04 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-03 15:08:04 +0000
commitdd6889505bd001d3c6f0c02830031f9d3b7c683a (patch)
tree87091994956cdeda34009c2edcbcb3ab478bbce3 /gcc/ada/exp_intr.adb
parenta23aa1c190ff5e0a41a1c8affb2c51c9fe1a1919 (diff)
downloadgcc-dd6889505bd001d3c6f0c02830031f9d3b7c683a.tar.gz
2011-08-03 Javier Miranda <miranda@adacore.com>
* sem_prag.adb (Process_Interface_Name): Allow duplicated export names in Java since they are always enclosed in a namespace that differentiates them, and overloaded entities are supported by the VM. 2011-08-03 Ed Schonberg <schonberg@adacore.com> * checks.adb (Determine_Range): If a computed bound of an operation is outside the range of the base type of the expression, and overflow checks are enabled, the result is unknown and cannot be used for any subsequent constant folding. * sem_eval.adb (Compile_Time_Compare): if the bounds of one operand are unknown, so is the result of the comparison. 2011-08-03 Hristian Kirtchev <kirtchev@adacore.com> * a-except-2005.adb (Raise_From_Controlled_Operation): Add new formal From_Abort. When finalization was triggered by an abort, propagate Standard'Abort_Signal rather than Program_Error. * a-except-2005.ads (Raise_From_Controlled_Operation): Add new formal From_Abort. * a-except.adb (Raise_From_Controlled_Operation): Add new formal From_Abort. When finalization was triggered by an abort, propagate Standard'Abort_Signal rather than Program_Error. * a-except.ads:(Raise_From_Controlled_Operation): Add new formal From_Abort. * exp_ch7.adb:(Build_Adjust_Or_Finalize_Statements): New local variable Abort_Id. Update the calls to Build_Object_Declarations and Build_Raise_Statement to include Abort_Id. (Build_Adjust_Statements): New local variable Abort_Id. Update the calls to Build_Object_Declarations and Build_Raise_Statement to include Abort_Id. (Build_Finalize_Statements): New local variable Abort_Id. Update the calls to Build_Object_Declarations and Build_Raise_Statement to include Abort_Id. (Build_Components): Create an entity for Abort_Id when exceptions are allowed on the target. (Build_Finalizer): New local variable Abort_Id. (Build_Initialize_Statements): New local variable Abort_Id. Update the calls to Build_Object_Declarations and Build_Raise_Statement to include Abort_Id. (Build_Object_Declarations): Add new formal Abort_Id. Create the declaration of flag Abort_Id to preserve the original abort status before finalization code is executed. (Build_Raise_Statement): Add new formal Abort_Id. Pass Abort_Id to runtime routine Raise_From_Controlled_Operation. (Create_Finalizer): Update the call to Build_Raise_Statement to include Abort_Id. Update the call to Build_Object_Declarations to include Abort_Id. Update the layout of the finalizer body. (Make_Handler_For_Ctrl_Operation): Add an actual for From_Abort. (Process_Transient_Objects): New local variable Abort_Id. Remove the clunky code to create all flags and objects related to exception propagation and replace it with a call to Build_Object_Declarations. Update the call to Build_Raise_Statement to include Abort_Id. * exp_ch7.ads (Build_Object_Declarations): Moved from body to spec. Add new formal Abort_Id and associated comment on its use. (Build_Raise_Statement): Add new formal Abort_Id and associated comment on its use. * exp_intr.adb (Expand_Unc_Deallocation): New local variable Abort_Id. Remove the clunky code to create all flags and objects related to exception propagation and replace it with a call to Build_Object_Declarations. Update the call to Build_Raise_Statement. 2011-08-03 Eric Botcazou <ebotcazou@adacore.com> * s-tassta.adb: Fix minor typos. 2011-08-03 Robert Dewar <dewar@adacore.com> * rtsfind.ads, makeutl.ads, prj.ads, prj.adb, make.adb, lib-writ.adb, makeutl.adb, s-soflin.ads, clean.adb: Minor reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177283 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_intr.adb')
-rw-r--r--gcc/ada/exp_intr.adb67
1 files changed, 29 insertions, 38 deletions
diff --git a/gcc/ada/exp_intr.adb b/gcc/ada/exp_intr.adb
index c5c6181c68e..4edb9a6d68a 100644
--- a/gcc/ada/exp_intr.adb
+++ b/gcc/ada/exp_intr.adb
@@ -884,16 +884,15 @@ package body Exp_Intr is
Pool : constant Entity_Id := Associated_Storage_Pool (Rtyp);
Stmts : constant List_Id := New_List;
- Blk : Node_Id := Empty;
- Deref : Node_Id;
- Exc_Occ_Decl : Node_Id;
- Exc_Occ_Id : Entity_Id := Empty;
- Final_Code : List_Id;
- Free_Arg : Node_Id;
- Free_Node : Node_Id;
- Gen_Code : Node_Id;
- Raised_Decl : Node_Id;
- Raised_Id : Entity_Id := Empty;
+ Abort_Id : Entity_Id := Empty;
+ Blk : Node_Id := Empty;
+ Deref : Node_Id;
+ E_Id : Entity_Id := Empty;
+ Final_Code : List_Id;
+ Free_Arg : Node_Id;
+ Free_Node : Node_Id;
+ Gen_Code : Node_Id;
+ Raised_Id : Entity_Id := Empty;
Arg_Known_Non_Null : constant Boolean := Known_Non_Null (N);
-- This captures whether we know the argument to be non-null so that
@@ -942,38 +941,29 @@ package body Exp_Intr is
-- the later raise.
--
-- Generate:
- -- Raised : Boolean := False;
- -- Exc_Occ : Exception_Occurrence;
+ -- Abort : constant Boolean :=
+ -- Exception_Occurrence (Get_Current_Excep.all.all) =
+ -- Standard'Abort_Signal'Identity;
+ -- <or>
+ -- Abort : constant Boolean := False; -- no abort
+
+ -- E : Exception_Occurrence;
+ -- Raised : Boolean := False;
--
-- begin
-- [Deep_]Finalize (Obj);
-- exception
-- when others =>
-- Raised := True;
- -- Save_Occurrence (Exc_Occ, Get_Current_Excep.all.all);
+ -- Save_Occurrence (E, Get_Current_Excep.all.all);
-- end;
- Exc_Occ_Id := Make_Temporary (Loc, 'E');
- Raised_Id := Make_Temporary (Loc, 'R');
+ Abort_Id := Make_Temporary (Loc, 'A');
+ E_Id := Make_Temporary (Loc, 'E');
+ Raised_Id := Make_Temporary (Loc, 'R');
- Raised_Decl :=
- Make_Object_Declaration (Loc,
- Defining_Identifier => Raised_Id,
- Object_Definition =>
- New_Reference_To (Standard_Boolean, Loc),
- Expression =>
- New_Reference_To (Standard_False, Loc));
-
- Append_To (Stmts, Raised_Decl);
-
- Exc_Occ_Decl :=
- Make_Object_Declaration (Loc,
- Defining_Identifier => Exc_Occ_Id,
- Object_Definition =>
- New_Reference_To (RTE (RE_Exception_Occurrence), Loc));
- Set_No_Initialization (Exc_Occ_Decl);
-
- Append_To (Stmts, Exc_Occ_Decl);
+ Append_List_To (Stmts,
+ Build_Object_Declarations (Loc, Abort_Id, E_Id, Raised_Id));
Final_Code := New_List (
Make_Block_Statement (Loc,
@@ -997,7 +987,7 @@ package body Exp_Intr is
Name =>
New_Reference_To (RTE (RE_Save_Occurrence), Loc),
Parameter_Associations => New_List (
- New_Reference_To (Exc_Occ_Id, Loc),
+ New_Reference_To (E_Id, Loc),
Make_Explicit_Dereference (Loc,
Prefix =>
Make_Function_Call (Loc,
@@ -1243,14 +1233,15 @@ package body Exp_Intr is
--
-- Generate:
-- if Raised then
- -- Reraise_Occurrence (Exc_Occ); -- for .NET and
- -- -- restricted RTS
+ -- Reraise_Occurrence (E); -- for .NET and
+ -- -- restricted RTS
-- <or>
- -- Raise_From_Controlled_Operation (Exc_Occ); -- all other cases
+ -- Raise_From_Controlled_Operation (E, Abort); -- all other cases
-- end if;
if Present (Raised_Id) then
- Append_To (Stmts, Build_Raise_Statement (Loc, Exc_Occ_Id, Raised_Id));
+ Append_To (Stmts,
+ Build_Raise_Statement (Loc, Abort_Id, E_Id, Raised_Id));
end if;
-- If we know the argument is non-null, then make a block statement