aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2019-08-12 09:00:39 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-08-12 09:00:39 +0000
commit2d56744e3bfcf3cc27f4100b1903b2443d858f13 (patch)
tree4d3be3bc13d8b6cfa85f42fbfb85eedb8cd23123 /gcc
parent5076fb182e2f99b46dca619f7be8e6e158bc902f (diff)
downloadgcc-2d56744e3bfcf3cc27f4100b1903b2443d858f13.zip
gcc-2d56744e3bfcf3cc27f4100b1903b2443d858f13.tar.gz
gcc-2d56744e3bfcf3cc27f4100b1903b2443d858f13.tar.bz2
[Ada] Minor cleanups in exception handling
No change in behavior, so no test. 2019-08-12 Bob Duff <duff@adacore.com> gcc/ada/ * libgnat/a-except.ads: Update obsolete comment, still making clear that this is a variant. Add explicit default for Id component of Exception_Occurrence, because that value is used. Define Null_Occurrence less redundantly. * libgnat/a-einuoc.adb: Minor simplification of code. From-SVN: r274296
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog8
-rw-r--r--gcc/ada/libgnat/a-einuoc.adb6
-rw-r--r--gcc/ada/libgnat/a-except.ads22
3 files changed, 13 insertions, 23 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 244e917..351cc49 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,11 @@
+2019-08-12 Bob Duff <duff@adacore.com>
+
+ * libgnat/a-except.ads: Update obsolete comment, still making
+ clear that this is a variant. Add explicit default for Id
+ component of Exception_Occurrence, because that value is used.
+ Define Null_Occurrence less redundantly.
+ * libgnat/a-einuoc.adb: Minor simplification of code.
+
2019-08-12 Justin Squirek <squirek@adacore.com>
* libgnat/a-dhfina.adb, libgnat/a-dhfina.ads (Is_Simple_Name,
diff --git a/gcc/ada/libgnat/a-einuoc.adb b/gcc/ada/libgnat/a-einuoc.adb
index a949a16..77d6b8d 100644
--- a/gcc/ada/libgnat/a-einuoc.adb
+++ b/gcc/ada/libgnat/a-einuoc.adb
@@ -40,9 +40,5 @@ begin
-- The null exception is uniquely identified by the fact that the Id value
-- is null. No other exception occurrence can have a null Id.
- if X.Id = Null_Id then
- return True;
- else
- return False;
- end if;
+ return X.Id = Null_Id;
end Ada.Exceptions.Is_Null_Occurrence;
diff --git a/gcc/ada/libgnat/a-except.ads b/gcc/ada/libgnat/a-except.ads
index 60ff5db..4f70769 100644
--- a/gcc/ada/libgnat/a-except.ads
+++ b/gcc/ada/libgnat/a-except.ads
@@ -33,14 +33,8 @@
-- --
------------------------------------------------------------------------------
--- This version of Ada.Exceptions fully supports Ada 95 and later language
--- versions. It is used in all situations except for the build of the
--- compiler and other basic tools. For these latter builds, we use an
--- Ada 95-only version.
-
--- The reason for this splitting off of a separate version is to support
--- older bootstrap compilers that do not support Ada 2005 features, and
--- Ada.Exceptions is part of the compiler sources.
+-- This is the default version of this package. We also have cert and zfp
+-- versions.
pragma Polling (Off);
-- We must turn polling off for this unit, because otherwise we get
@@ -284,7 +278,7 @@ private
-- Traceback array stored in exception occurrence
type Exception_Occurrence is record
- Id : Exception_Id;
+ Id : Exception_Id := Null_Id;
-- Exception_Identity for this exception occurrence
Machine_Occurrence : System.Address;
@@ -336,14 +330,6 @@ private
pragma Stream_Convert (Exception_Occurrence, String_To_EO, EO_To_String);
-- Functions for implementing Exception_Occurrence stream attributes
- Null_Occurrence : constant Exception_Occurrence := (
- Id => null,
- Machine_Occurrence => System.Null_Address,
- Msg_Length => 0,
- Msg => (others => ' '),
- Exception_Raised => False,
- Pid => 0,
- Num_Tracebacks => 0,
- Tracebacks => (others => TBE.Null_TB_Entry));
+ Null_Occurrence : constant Exception_Occurrence := (others => <>);
end Ada.Exceptions;