From 32c07c22100b9a6f342e6a5825ac36b1b72d036b Mon Sep 17 00:00:00 2001 From: charlet Date: Fri, 6 Apr 2007 09:14:55 +0000 Subject: 2007-04-06 Robert Dewar * a-except.adb, a-except.ads, a-except-2005.ads, a-except-2005.adb (Local_Raise): New dummy procedure called when a raise is converted to a local goto. Used for debugger to detect that the exception is raised. * debug.adb: Document new d.g flag (expand local raise statements to gotos even if pragma Restriction (No_Exception_Propagation) is not set) * exp_sel.adb: Use Make_Implicit_Exception_Handler * exp_ch11.adb (Expand_Exception_Handlers): Use new flag -gnatw.x to suppress warnings for unused handlers. (Warn_If_No_Propagation): Use new flag -gnatw.x to suppress warnings for raise statements not handled locally. (Get_RT_Exception_Entity): New function (Get_Local_Call_Entity): New function (Find_Local_Handler): New function (Warn_If_No_Propagation): New procedure (Expand_At_End_Handler): Call Make_Implicit_Handler (Expand_Exception_Handlers): Major additions to deal with local handlers (Expand_N_Raise_Constraint_Error, Expand_N_Raise_Program_Error, Expand_N_Raise_Storage_Error, (Expand_N_Raise_Statement): Add handling for local raise * exp_ch11.ads (Get_RT_Exception_Entity): New function (Get_Local_Call_Entity): New function * gnatbind.adb (Restriction_List): Add No_Exception_Propagation to list of restrictions that the binder will never suggest adding. * par-ch11.adb (P_Exception_Handler): Set Local_Raise_Statements field to No_Elist. * restrict.adb (Check_Restricted_Unit): GNAT.Current_Exception may not be with'ed in the presence of pragma Restriction (No_Exception_Propagation). * sem.adb (Analyze): Add entries for N_Push and N_Pop nodes * sem_ch11.adb (Analyze_Exception_Handler): If there is a choice parameter, then the handler is not a suitable target for a local raise, and this is a violation of restriction No_Exception_Propagation. (Analyze_Handled_Statements): Analyze choice parameters in exception handlers before analyzing statement sequence (needed for proper detection of local raise statements). (Analyze_Raise_Statement): Reraise statement is a violation of the No_Exception_Propagation restriction. * s-rident.ads: Add new restriction No_Exception_Propagation * tbuild.ads, tbuild.adb (Make_Implicit_Exception_Handler): New function, like Make_Exception_Handler but sets Local_Raise_Statements to No_List. (Add_Unique_Serial_Number): Deal with case where this is called during processing of configuration pragmas. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123541 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/tbuild.ads | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'gcc/ada/tbuild.ads') diff --git a/gcc/ada/tbuild.ads b/gcc/ada/tbuild.ads index 4ffedaf7c8d..67fe5a1d153 100644 --- a/gcc/ada/tbuild.ads +++ b/gcc/ada/tbuild.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2006, 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- -- @@ -74,6 +74,17 @@ package Tbuild is -- Create an access to the Dispatch Table by using the Tag field -- of a tagged record : Acc_Dt (Rec.tag).all + function Make_Implicit_Exception_Handler + (Sloc : Source_Ptr; + Choice_Parameter : Node_Id := Empty; + Exception_Choices : List_Id; + Statements : List_Id) return Node_Id; + pragma Inline (Make_Implicit_Exception_Handler); + -- This is just like Make_Exception_Handler, except that it also sets the + -- Local_Raise_Statements field to No_Elist, ensuring that it is properly + -- initialized. This should always be used when creating exception handlers + -- as part of the expansion. + function Make_Implicit_If_Statement (Node : Node_Id; Condition : Node_Id; -- cgit v1.2.1