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>
* libgnat/a-dhfina.adb, libgnat/a-dhfina.ads (Is_Simple_Name,
......
......@@ -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;
......@@ -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;
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