aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2021-05-11 14:11:12 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2021-07-06 14:46:58 +0000
commitb1c4989d174cb22297a88f8873be95430ad62bcd (patch)
tree3cdf0a86000b31a03e0b5df12921774c2b41c181 /gcc
parentddbe7338f1ea50db4d39a925c6c530052ed288a4 (diff)
downloadgcc-b1c4989d174cb22297a88f8873be95430ad62bcd.zip
gcc-b1c4989d174cb22297a88f8873be95430ad62bcd.tar.gz
gcc-b1c4989d174cb22297a88f8873be95430ad62bcd.tar.bz2
[Ada] Replace a question mark comment with assertion
gcc/ada/ * lib.adb (Remove_Unit): Replace defensive code with an assertion. * par-load.adb (Load): Address a question mark in the comment.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/lib.adb7
-rw-r--r--gcc/ada/par-load.adb3
2 files changed, 4 insertions, 6 deletions
diff --git a/gcc/ada/lib.adb b/gcc/ada/lib.adb
index 44aa5c6..44a4af0 100644
--- a/gcc/ada/lib.adb
+++ b/gcc/ada/lib.adb
@@ -1174,10 +1174,9 @@ package body Lib is
procedure Remove_Unit (U : Unit_Number_Type) is
begin
- if U = Units.Last then
- Unit_Names.Set (Unit_Name (U), No_Unit);
- Units.Decrement_Last;
- end if;
+ pragma Assert (U = Units.Last);
+ Unit_Names.Set (Unit_Name (U), No_Unit);
+ Units.Decrement_Last;
end Remove_Unit;
----------------------------------
diff --git a/gcc/ada/par-load.adb b/gcc/ada/par-load.adb
index fe8fede..39c445e 100644
--- a/gcc/ada/par-load.adb
+++ b/gcc/ada/par-load.adb
@@ -234,8 +234,7 @@ begin
Error_Msg ("\\found unit $!", Loc);
end if;
- -- In both cases, remove the unit if it is the last unit (which it
- -- normally (always?) will be) so that it is out of the way later.
+ -- In both cases, remove the unit so that it is out of the way later
Remove_Unit (Cur_Unum);
end if;