aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/a-except-2005.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-06 09:14:55 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-06 09:14:55 +0000
commit32c07c22100b9a6f342e6a5825ac36b1b72d036b (patch)
treecba8eae2edc131dbad1e78e6ab2c7326e84a7ed9 /gcc/ada/a-except-2005.ads
parentd0ffe2aedefd62bf73b61b1e2cfd699434edbe9a (diff)
2007-04-06 Robert Dewar <dewar@adacore.com>
* 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
Diffstat (limited to 'gcc/ada/a-except-2005.ads')
-rw-r--r--gcc/ada/a-except-2005.ads26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ada/a-except-2005.ads b/gcc/ada/a-except-2005.ads
index fd42ab79cd4..f42d094ae05 100644
--- a/gcc/ada/a-except-2005.ads
+++ b/gcc/ada/a-except-2005.ads
@@ -139,6 +139,23 @@ package Ada.Exceptions is
(Source : Exception_Occurrence)
return Exception_Occurrence_Access;
+ -- Ada 2005 (AI-438): The language revision introduces the
+ -- following subprograms and attribute definitions. We do not
+ -- provide them explicitly; instead, the corresponding stream
+ -- attributes are made available through a pragma Stream_Convert
+ -- in the private part of this package.
+
+ -- procedure Read_Exception_Occurrence
+ -- (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
+ -- Item : out Exception_Occurrence);
+
+ -- procedure Write_Exception_Occurrence
+ -- (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
+ -- Item : Exception_Occurrence);
+
+ -- for Exception_Occurrence'Read use Read_Exception_Occurrence;
+ -- for Exception_Occurrence'Write use Write_Exception_Occurrence;
+
private
package SSL renames System.Standard_Library;
package SP renames System.Parameters;
@@ -192,6 +209,15 @@ private
-- private barrier, so we can place this function in the private part
-- where the compiler can find it, but the spec is unchanged.)
+ procedure Local_Raise (Excep : Exception_Id);
+ pragma Export (Ada, Local_Raise);
+ -- This is a dummy routine, used only by the debugger for the purpose of
+ -- logging local raise statements that were transformed into a direct goto
+ -- to the handler code. The compiler in this case generates:
+ --
+ -- Local_Raise (exception_id);
+ -- goto Handler
+
procedure Raise_Exception_Always (E : Exception_Id; Message : String := "");
pragma No_Return (Raise_Exception_Always);
pragma Export (Ada, Raise_Exception_Always, "__gnat_raise_exception");