a-except.adb, [...] (Reraise_Library_Exception_If_Any): New.
authorArnaud Charlet <charlet@adacore.com>
Tue, 15 May 2012 09:42:01 +0000 (09:42 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 15 May 2012 09:42:01 +0000 (11:42 +0200)
2012-05-15  Arnaud Charlet  <charlet@adacore.com>

* a-except.adb, a-except.ads (Reraise_Library_Exception_If_Any): New.
Mark this unit preelaborate.
* s-soflin.ads: Make package Preelaborate.

From-SVN: r187511

gcc/ada/ChangeLog
gcc/ada/a-except.adb
gcc/ada/a-except.ads
gcc/ada/s-soflin.ads

index 2c2baa4..8d5355f 100644 (file)
@@ -1,3 +1,9 @@
+2012-05-15  Arnaud Charlet  <charlet@adacore.com>
+
+       * a-except.adb, a-except.ads (Reraise_Library_Exception_If_Any): New.
+       Mark this unit preelaborate.
+       * s-soflin.ads: Make package Preelaborate.
+
 2012-05-15  Robert Dewar  <dewar@adacore.com>
 
        * s-osprim-mingw.adb, sem_eval.adb, a-calend-vms.ads: Minor reformatting
index f34d497..fc144bb 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2011, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2012, 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- --
@@ -1175,6 +1175,19 @@ package body Ada.Exceptions is
       Raise_Current_Excep (Excep.Id);
    end Reraise;
 
+   --------------------------------------
+   -- Reraise_Library_Exception_If_Any --
+   --------------------------------------
+
+   procedure Reraise_Library_Exception_If_Any is
+      LE : Exception_Occurrence;
+   begin
+      if Library_Exception_Set then
+         LE := Library_Exception;
+         Raise_From_Controlled_Operation (LE);
+      end if;
+   end Reraise_Library_Exception_If_Any;
+
    ------------------------
    -- Reraise_Occurrence --
    ------------------------
index d7c14ba..a77df93 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2011, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2012, Free Software Foundation, Inc.         --
 --                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -35,7 +35,8 @@
 
 --  This version of Ada.Exceptions is a full Ada 95 version. It omits Ada 2005
 --  features such as the additional definitions of Exception_Name returning
---  Wide_[Wide_]String.
+--  Wide_[Wide_]String. If differs from the 95 version only in that it is
+--  declared Preelaborate (see declaration below for why this is done).
 
 --  It is used for building the compiler and the basic tools, since these
 --  builds may be done with bootstrap compilers that cannot handle these
@@ -56,12 +57,10 @@ with System.Standard_Library;
 with System.Traceback_Entries;
 
 package Ada.Exceptions is
-   pragma Warnings (Off);
-   pragma Preelaborate_05;
-   pragma Warnings (On);
-   --  We make this preelaborable in Ada 2005 mode. If we did not do this, then
-   --  run time units used by the compiler (e.g. s-soflin.ads) would run
-   --  into trouble. Conformance is not an issue, since this version is used
+   pragma Preelaborate;
+   --  We make this preelaborable. If we did not do this, then run time units
+   --  used by the compiler (e.g. s-soflin.ads) would run into trouble.
+   --  Conformance with Ada 95 is not an issue, since this version is used
    --  only by the compiler.
 
    type Exception_Id is private;
@@ -207,6 +206,13 @@ private
    --  Raise Program_Error, providing information about X (an exception raised
    --  during a controlled operation) in the exception message.
 
+   procedure Reraise_Library_Exception_If_Any;
+   pragma Export
+     (Ada, Reraise_Library_Exception_If_Any,
+           "__gnat_reraise_library_exception_if_any");
+   --  If there was an exception raised during library-level finalization,
+   --  reraise the exception.
+
    procedure Reraise_Occurrence_Always (X : Exception_Occurrence);
    pragma No_Return (Reraise_Occurrence_Always);
    --  This differs from Raise_Occurrence only in that the caller guarantees
index 701b3bc..01dc173 100644 (file)
@@ -43,7 +43,7 @@ with Ada.Exceptions;
 with System.Stack_Checking;
 
 package System.Soft_Links is
-   pragma Preelaborate_05;
+   pragma Preelaborate;
 
    subtype EOA is Ada.Exceptions.Exception_Occurrence_Access;
    subtype EO is Ada.Exceptions.Exception_Occurrence;