[Ada] Remove redundant guard against an empty component list

Message ID 20211011133911.GA1518637@adacore.com
State New
Headers show
Series
  • [Ada] Remove redundant guard against an empty component list
Related show

Commit Message

Eric Gallager via Gcc-patches Oct. 11, 2021, 1:39 p.m.
There is no need to explicitly guard against an empty list where the
subsequent iteration with First/Next/Present works fine.

Cleanup related to expansion of aggregates in GNATprove mode; behaviour
is unaffected.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* exp_aggr.adb (Component_OK_For_Backend): Remove redundant
	guard.

Patch

diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -8547,10 +8547,6 @@  package body Exp_Aggr is
          Expr_Q : Node_Id;
 
       begin
-         if No (Comps) then
-            return True;
-         end if;
-
          C := First (Comps);
          while Present (C) loop