Commit 2d56744e by Bob Duff Committed by Pierre-Marie de Rodat

[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
parent 5076fb18
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> 2019-08-12 Justin Squirek <squirek@adacore.com>
* libgnat/a-dhfina.adb, libgnat/a-dhfina.ads (Is_Simple_Name, * libgnat/a-dhfina.adb, libgnat/a-dhfina.ads (Is_Simple_Name,
......
...@@ -40,9 +40,5 @@ begin ...@@ -40,9 +40,5 @@ begin
-- The null exception is uniquely identified by the fact that the Id value -- The null exception is uniquely identified by the fact that the Id value
-- is null. No other exception occurrence can have a null Id. -- is null. No other exception occurrence can have a null Id.
if X.Id = Null_Id then return X.Id = Null_Id;
return True;
else
return False;
end if;
end Ada.Exceptions.Is_Null_Occurrence; end Ada.Exceptions.Is_Null_Occurrence;
...@@ -33,14 +33,8 @@ ...@@ -33,14 +33,8 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- This version of Ada.Exceptions fully supports Ada 95 and later language -- This is the default version of this package. We also have cert and zfp
-- versions. It is used in all situations except for the build of the -- versions.
-- 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.
pragma Polling (Off); pragma Polling (Off);
-- We must turn polling off for this unit, because otherwise we get -- We must turn polling off for this unit, because otherwise we get
...@@ -284,7 +278,7 @@ private ...@@ -284,7 +278,7 @@ private
-- Traceback array stored in exception occurrence -- Traceback array stored in exception occurrence
type Exception_Occurrence is record type Exception_Occurrence is record
Id : Exception_Id; Id : Exception_Id := Null_Id;
-- Exception_Identity for this exception occurrence -- Exception_Identity for this exception occurrence
Machine_Occurrence : System.Address; Machine_Occurrence : System.Address;
...@@ -336,14 +330,6 @@ private ...@@ -336,14 +330,6 @@ private
pragma Stream_Convert (Exception_Occurrence, String_To_EO, EO_To_String); pragma Stream_Convert (Exception_Occurrence, String_To_EO, EO_To_String);
-- Functions for implementing Exception_Occurrence stream attributes -- Functions for implementing Exception_Occurrence stream attributes
Null_Occurrence : constant Exception_Occurrence := ( Null_Occurrence : constant Exception_Occurrence := (others => <>);
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));
end Ada.Exceptions; end Ada.Exceptions;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment