From patchwork Mon Aug 29 12:46:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 112035 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 1A733B6F92 for ; Mon, 29 Aug 2011 22:46:56 +1000 (EST) Received: (qmail 8170 invoked by alias); 29 Aug 2011 12:46:54 -0000 Received: (qmail 8161 invoked by uid 22791); 29 Aug 2011 12:46:53 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 29 Aug 2011 12:46:21 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id CB0F72BB08A; Mon, 29 Aug 2011 08:46:20 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id TMJ8MgnT2-tI; Mon, 29 Aug 2011 08:46:20 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id 7A6142BB07F; Mon, 29 Aug 2011 08:46:20 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id 790D392BF6; Mon, 29 Aug 2011 08:46:20 -0400 (EDT) Date: Mon, 29 Aug 2011 08:46:20 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Tristan Gingold Subject: [Ada] Internal cleanup in Ada.Exceptions. Message-ID: <20110829124620.GA25413@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org The procedure Setup_Exception did nothing and is now removed. No functionnal change. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-29 Tristan Gingold * a-exexpr.adb (Setup_Exception): Removed. * a-exexpr-gcc.adb (Setup_Exception): Removed. * a-except.adb (Exception_Propagation): Removed. * a-except-2005.adb (Setup_Exception): Removed. (Reraise): Remove call to Setup_Exception. (Reraise_Occurrence): Ditto. (Reraise_Occurrence_Always): Ditto. (Reraise_Occurrence_No_Defer): Ditto. (Transfer_Occurrence): Ditto. * a-exexda.adb (Set_Exception_C_Msg): Remove call to Setup_Exception. (Set_Exception_Msg): Ditto. Index: a-exexpr.adb =================================================================== --- a-exexpr.adb (revision 178197) +++ a-exexpr.adb (working copy) @@ -57,24 +57,6 @@ pragma No_Return (builtin_longjmp); pragma Import (Intrinsic, builtin_longjmp, "__builtin_longjmp"); - --------------------- - -- Setup_Exception -- - --------------------- - - procedure Setup_Exception - (Excep : EOA; - Current : EOA; - Reraised : Boolean := False) - is - pragma Unreferenced (Excep, Current, Reraised); - begin - -- In the GNAT-SJLJ case this "stack" only exists implicitly, by way of - -- local occurrence declarations together with save/restore operations - -- generated by the front-end, and this routine has nothing to do. - - null; - end Setup_Exception; - ------------------------- -- Propagate_Exception -- ------------------------- Index: a-exexpr-gcc.adb =================================================================== --- a-exexpr-gcc.adb (revision 178213) +++ a-exexpr-gcc.adb (working copy) @@ -322,29 +322,6 @@ return URC_NO_REASON; end CleanupUnwind_Handler; - --------------------- - -- Setup_Exception -- - --------------------- - - -- In the GCC-EH implementation of the propagation scheme, this - -- subprogram should be understood as: Setup the exception occurrence - -- stack headed at Current for a forthcoming raise of Excep. - - procedure Setup_Exception - (Excep : EOA; - Current : EOA; - Reraised : Boolean := False) - is - pragma Unreferenced (Excep, Current, Reraised); - - begin - -- In the GNAT-SJLJ case this "stack" only exists implicitly, by way of - -- local occurrence declarations together with save/restore operations - -- generated by the front-end, and this routine has nothing to do. - - null; - end Setup_Exception; - ------------------------- -- Setup_Current_Excep -- ------------------------- Index: a-except.adb =================================================================== --- a-except.adb (revision 178206) +++ a-except.adb (working copy) @@ -209,16 +209,6 @@ end Exception_Traces; - package Exception_Propagation is - - procedure Setup_Exception - (Excep : EOA; - Current : EOA; - Reraised : Boolean := False); - -- Dummy routine used to share a-exexda.adb, do nothing - - end Exception_Propagation; - package Stream_Attributes is -------------------------------- @@ -677,22 +667,6 @@ -- This package can be easily dummied out if we do not want the basic -- support for exception messages (such as in Ada 83). - package body Exception_Propagation is - - procedure Setup_Exception - (Excep : EOA; - Current : EOA; - Reraised : Boolean := False) - is - pragma Warnings (Off, Excep); - pragma Warnings (Off, Current); - pragma Warnings (Off, Reraised); - begin - null; - end Setup_Exception; - - end Exception_Propagation; - ---------------------- -- Exception_Traces -- ---------------------- Index: a-except-2005.adb =================================================================== --- a-except-2005.adb (revision 178206) +++ a-except-2005.adb (working copy) @@ -239,22 +239,6 @@ -- Exception propagation routines -- ------------------------------------ - procedure Setup_Exception - (Excep : EOA; - Current : EOA; - Reraised : Boolean := False); - -- Perform the necessary operations to prepare the propagation of Excep - -- in a task where Current is the current occurrence. Excep is assumed - -- to be a valid (non null) pointer. - -- - -- This should be called before any (re-)setting of the current - -- occurrence. Any such (re-)setting shall take care *not* to clobber - -- the Private_Data component. - -- - -- Having Current provided as an argument (instead of retrieving it via - -- Get_Current_Excep internally) is required to allow one task to setup - -- an exception for another task, which is used by Transfer_Occurrence. - procedure Propagate_Exception (E : Exception_Id; From_Signal_Handler : Boolean); @@ -1025,8 +1009,6 @@ Excep : constant EOA := Get_Current_Excep.all; begin - Exception_Propagation.Setup_Exception (Excep, Excep); - Excep.Exception_Raised := False; Excep.Id := E; Excep.Num_Tracebacks := 0; @@ -1284,7 +1266,6 @@ if not ZCX_By_Default then Abort_Defer.all; end if; - Exception_Propagation.Setup_Exception (Excep, Excep, Reraised => True); Raise_Current_Excep (Excep.Id); end Reraise; @@ -1299,8 +1280,6 @@ Abort_Defer.all; end if; - Exception_Propagation.Setup_Exception - (X'Unrestricted_Access, Get_Current_Excep.all, Reraised => True); Save_Occurrence_No_Private (Get_Current_Excep.all.all, X); Raise_Current_Excep (X.Id); end if; @@ -1316,8 +1295,6 @@ Abort_Defer.all; end if; - Exception_Propagation.Setup_Exception - (X'Unrestricted_Access, Get_Current_Excep.all, Reraised => True); Save_Occurrence_No_Private (Get_Current_Excep.all.all, X); Raise_Current_Excep (X.Id); end Reraise_Occurrence_Always; @@ -1328,8 +1305,6 @@ procedure Reraise_Occurrence_No_Defer (X : Exception_Occurrence) is begin - Exception_Propagation.Setup_Exception - (X'Unrestricted_Access, Get_Current_Excep.all, Reraised => True); Save_Occurrence_No_Private (Get_Current_Excep.all.all, X); Raise_Current_Excep (X.Id); end Reraise_Occurrence_No_Defer; @@ -1384,13 +1359,6 @@ Source : Exception_Occurrence) is begin - -- Setup Target as an exception to be propagated in the calling task - -- (rendezvous-wise), taking care not to clobber the associated private - -- data. Target is expected to be a pointer to the calling task's - -- fixed TSD occurrence, which is very different from Get_Current_Excep - -- here because this subprogram is called from the called task. - - Exception_Propagation.Setup_Exception (Target, Target); Save_Occurrence_No_Private (Target.all, Source); end Transfer_Occurrence; Index: a-exexda.adb =================================================================== --- a-exexda.adb (revision 178155) +++ a-exexda.adb (working copy) @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2011, 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- -- @@ -612,7 +612,6 @@ -- Start of processing for Set_Exception_C_Msg begin - Exception_Propagation.Setup_Exception (Excep, Excep); Excep.Exception_Raised := False; Excep.Id := Id; Excep.Num_Tracebacks := 0; @@ -663,7 +662,6 @@ Excep : constant EOA := Get_Current_Excep.all; begin - Exception_Propagation.Setup_Exception (Excep, Excep); Excep.Exception_Raised := False; Excep.Msg_Length := Len; Excep.Msg (1 .. Len) := Message (First .. First + Len - 1);