From patchwork Mon Aug 29 10:42:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 112018 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 B0D84B6F8F for ; Mon, 29 Aug 2011 20:43:17 +1000 (EST) Received: (qmail 13758 invoked by alias); 29 Aug 2011 10:43:15 -0000 Received: (qmail 13747 invoked by uid 22791); 29 Aug 2011 10:43:14 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,TW_JL 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 10:42:58 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 406B52BB00E; Mon, 29 Aug 2011 06:42:58 -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 qJmcbbIHMrVC; Mon, 29 Aug 2011 06:42:58 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id 1D7042BB001; Mon, 29 Aug 2011 06:42:58 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id 0E79A3FEE8; Mon, 29 Aug 2011 06:42:58 -0400 (EDT) Date: Mon, 29 Aug 2011 06:42:58 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Tristan Gingold Subject: [Ada] Move remaining sjlj bits from a-except-2005.ads to a-exexpr.adb Message-ID: <20110829104258.GA21694@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 Little cleanup, no functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-29 Tristan Gingold * a-exexpr.adb, a-except-2005.ads (Jmpbuf_Address): Move to a-exexpr.adb (To_Jmpbuf_Address): Ditto (builtin_longjmp): Ditto Index: a-exexpr.adb =================================================================== --- a-exexpr.adb (revision 178155) +++ a-exexpr.adb (working copy) @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2009, 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- -- @@ -34,6 +34,8 @@ with System.Storage_Elements; use System.Storage_Elements; +with Ada.Unchecked_Conversion; + pragma Warnings (Off); -- Since several constructs give warnings in 3.14a1, including unreferenced -- variables and pragma Unreferenced itself. @@ -41,6 +43,20 @@ separate (Ada.Exceptions) package body Exception_Propagation is + -- Common binding to __builtin_longjmp for sjlj variants. + + -- The builtin expects a pointer type for the jmpbuf address argument, and + -- System.Address doesn't work because this is really an integer type. + + type Jmpbuf_Address is access Character; + + function To_Jmpbuf_Address is new + Ada.Unchecked_Conversion (System.Address, Jmpbuf_Address); + + procedure builtin_longjmp (buffer : Jmpbuf_Address; Flag : Integer); + pragma No_Return (builtin_longjmp); + pragma Import (Intrinsic, builtin_longjmp, "__builtin_longjmp"); + --------------------- -- Setup_Exception -- --------------------- Index: a-except-2005.ads =================================================================== --- a-except-2005.ads (revision 178155) +++ a-except-2005.ads (working copy) @@ -50,8 +50,6 @@ with System.Standard_Library; with System.Traceback_Entries; -with Ada.Unchecked_Conversion; - package Ada.Exceptions is pragma Warnings (Off); pragma Preelaborate_05; @@ -230,16 +228,13 @@ -- system to return here rather than to the original location. procedure Raise_From_Controlled_Operation - (X : Ada.Exceptions.Exception_Occurrence; - From_Abort : Boolean); + (X : Ada.Exceptions.Exception_Occurrence); pragma No_Return (Raise_From_Controlled_Operation); pragma Export (Ada, Raise_From_Controlled_Operation, "__gnat_raise_from_controlled_operation"); -- Raise Program_Error, providing information about X (an exception raised - -- during a controlled operation) in the exception message. However, if the - -- finalization was triggered by abort, keep aborting instead of raising - -- Program_Error. + -- during a controlled operation) in the exception message. procedure Reraise_Occurrence_Always (X : Exception_Occurrence); pragma No_Return (Reraise_Occurrence_Always); @@ -359,18 +354,4 @@ Tracebacks => (others => TBE.Null_TB_Entry), Private_Data => System.Null_Address); - -- Common binding to __builtin_longjmp for sjlj variants. - - -- The builtin expects a pointer type for the jmpbuf address argument, and - -- System.Address doesn't work because this is really an integer type. - - type Jmpbuf_Address is access Character; - - function To_Jmpbuf_Address is new - Ada.Unchecked_Conversion (System.Address, Jmpbuf_Address); - - procedure builtin_longjmp (buffer : Jmpbuf_Address; Flag : Integer); - pragma No_Return (builtin_longjmp); - pragma Import (Intrinsic, builtin_longjmp, "__builtin_longjmp"); - end Ada.Exceptions;