summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch7.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-31 09:14:10 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-31 09:14:10 +0000
commitf4a453ad5147c2a28e59be8c41f7db9a75f5181c (patch)
treeb9b708390d471cfd292189c4bb21c4acb80c2cb2 /gcc/ada/exp_ch7.ads
parent5bfe95c7dfef79b7bfb6b9d8221283cb31f59901 (diff)
downloadgcc-f4a453ad5147c2a28e59be8c41f7db9a75f5181c.tar.gz
2011-08-31 Tristan Gingold <gingold@adacore.com>
* exp_ch7.ads, exp_ch7.adb (Finalization_Exception_Data): New type to hold variables between these following subprograms. (Build_Exception_Handler, Build_Object_Declarations, Build_Raise_Statement): Use the above type as parameter. Make the above adjustments. * exp_intr.adb (Expand_Unc_Deallocation): Adjust. 2011-08-31 Pascal Obry <obry@adacore.com> * projects.texi: Minor reformatting. 2011-08-31 Tristan Gingold <gingold@adacore.com> * s-ransee.ads, s-ransee.adb: Add system.random_seed unit. * s-rannum.adb (Reset): Use Get_Seed from s-ransee. 2011-08-31 Ed Schonberg <schonberg@adacore.com> * exp_ch5.adb: Minor code cleanup. * sem_ch5.adb (Analyze_Iteration_Scheme): Set ekind of loop variable to prevent cascaded errors. (Analyze_Loop_Statement): In semantics-only mode, introduce loop variable of an iterator specification in current scope. * sem_ch6.adb (Analyze_Return_Statement, Find_what_It_Apples_To): Skip postconditions on the stack, as they contain no return statements. 2011-08-31 Yannick Moy <moy@adacore.com> * exp_alfa.adb (Expand_Alfa_N_Package_Declaration, Expand_Alfa_N_Subprogram_Body): Remove useless procedures which simply call Qualify_Entity_Names. (Expand_Alfa): call Qualify_Entity_Names in more cases * lib-xref-alfa.adb: Take into account system package. * sem_prag.adb Take into account restrictions in Alfa mode, contrary to CodePeer mode in which we are interested in finding bugs even if compiler cannot compile source. * sem_util.adb, sem_util.ads (Unique_Entity): Take into account case of deferred constant. 2011-08-31 Gary Dismukes <dismukes@adacore.com> * sem_ch3.adb (Constrain_Concurrent): Retrieve Base_Type of the subtype denoted by the subtype mark to ensure getting the concurrent type in the case where the subtype mark denotes a private subtype of a concurrent type (needed when using -gnatc). (Process_Subtype): For the processing specific to type kinds, case on the Base_Type kind of the Subtype_Mark_Id, to handle cases where the subtype denotes a private subtype whose base type is nonprivate (needed for subtypes of private fulfilled by task types when compiling with -gnatc). 2011-08-31 Gary Dismukes <dismukes@adacore.com> * sem_disp.adb (Check_Dispatching_Operation): Bypass registration of late primitives that override interface operations when the full expander is not active, to avoid blowups in Register_Primitive when types don't have associated secondary dispatch tables. 2011-08-31 Yannick Moy <moy@adacore.com> * alfa_test.adb: Code clean up. 2011-08-31 Marc Sango <sango@adacore.com> * restrict.adb (Check_SPARK_Restriction): Change Comes_From_Source (N) by Comes_From_Source (Original_Node (N)) in order to treat also the nodes which have been rewritten. * sem_ch4.adb (Analyze_Explicit_Dereference, Analyze_Slice): Guard the explicit dereference and slice violation in spark mode on the nodes coming only from the source code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178365 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch7.ads')
-rw-r--r--gcc/ada/exp_ch7.ads55
1 files changed, 40 insertions, 15 deletions
diff --git a/gcc/ada/exp_ch7.ads b/gcc/ada/exp_ch7.ads
index dbebd8ae52a..8a0be81bac2 100644
--- a/gcc/ada/exp_ch7.ads
+++ b/gcc/ada/exp_ch7.ads
@@ -40,10 +40,39 @@ package Exp_Ch7 is
-- Create the procedures Deep_Initialize, Deep_Adjust and Deep_Finalize
-- that take care of finalization management at run-time.
- function Build_Exception_Handler
- (Loc : Source_Ptr;
+ -- Support of exceptions from user finalization procedures
+ --
+ -- There is a specific mechanism to handle these exceptions, continue
+ -- finalization and then raise PE.
+ -- This mechanism is used by this package but also by exp_intr for
+ -- Ada.Unchecked_Deallocation.
+ -- There are 3 subprograms to use this mechanism, and the type
+ -- Finalization_Exception_Data carries internal data between these
+ -- subprograms:
+ --
+ -- 1. Build_Object_Declaration: create the variables for the next two
+ -- subprograms.
+ -- 2. Build_Exception_Handler: create the exception handler for a call to
+ -- a user finalization procedure.
+ -- 3. Build_Raise_Stmt: create the code to potentially raise a PE exception
+ -- if am exception was raise in a user finalization procedure.
+ type Finalization_Exception_Data is record
+ Loc : Source_Ptr;
+ -- Sloc for the added nodes
+
+ Abort_Id : Entity_Id;
+ -- Boolean variable set to true if the finalization was triggered by
+ -- an abort.
+
E_Id : Entity_Id;
+ -- Variable containing the exception occurrence raised by user code
+
Raised_Id : Entity_Id;
+ -- Boolean variable set to true if an exception was raised in user code
+ end record;
+
+ function Build_Exception_Handler
+ (Data : Finalization_Exception_Data;
For_Library : Boolean := False) return Node_Id;
-- Subsidiary to Build_Finalizer, Make_Deep_Array_Body and Make_Deep_Record
-- _Body. Create an exception handler of the following form:
@@ -84,15 +113,14 @@ package Exp_Ch7 is
-- Build one controlling procedure when a late body overrides one of
-- the controlling operations.
- function Build_Object_Declarations
- (Loc : Source_Ptr;
- Abort_Id : Entity_Id;
- E_Id : Entity_Id;
- Raised_Id : Entity_Id;
- For_Package : Boolean := False) return List_Id;
- -- Subsidiary to Make_Deep_Array_Body and Make_Deep_Record_Body. Return a
- -- list containing the object declarations of boolean flag Abort_Id, the
- -- exception occurrence E_Id and boolean flag Raised_Id.
+ procedure Build_Object_Declarations
+ (Data : out Finalization_Exception_Data;
+ Decls : List_Id;
+ Loc : Source_Ptr;
+ For_Package : Boolean := False);
+ -- Subsidiary to Make_Deep_Array_Body and Make_Deep_Record_Body. Create the
+ -- list List containing the object declarations of boolean flag Abort_Id,
+ -- the exception occurrence E_Id and boolean flag Raised_Id.
--
-- Abort_Id : constant Boolean :=
-- Exception_Identity (Get_Current_Excep.all) =
@@ -104,10 +132,7 @@ package Exp_Ch7 is
-- Raised_Id : Boolean := False;
function Build_Raise_Statement
- (Loc : Source_Ptr;
- Abort_Id : Entity_Id;
- E_Id : Entity_Id;
- Raised_Id : Entity_Id) return Node_Id;
+ (Data : Finalization_Exception_Data) return Node_Id;
-- Subsidiary to routines Build_Finalizer, Make_Deep_Array_Body and Make_
-- Deep_Record_Body. Generate the following conditional raise statement:
--