[Ada] Simplify detection of delayed aggregates

Message ID 20211011133916.GA1518675@adacore.com
State New
Headers show
  • [Ada] Simplify detection of delayed aggregates
Related show

Commit Message

Eric Gallager via Gcc-patches Oct. 11, 2021, 1:39 p.m.
Replace IF with a single RETURN statement. Cleanup related to expansion
of aggregates in GNATprove mode; semantics is unaffected.

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


	* exp_aggr.adb (Is_Delayed_Aggregate): Simplify.


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
@@ -8978,11 +8978,8 @@  package body Exp_Aggr is
          Kind := Nkind (Node);
       end if;
-      if Kind not in N_Aggregate | N_Extension_Aggregate then
-         return False;
-      else
-         return Expansion_Delayed (Node);
-      end if;
+      return Kind in N_Aggregate | N_Extension_Aggregate
+        and then Expansion_Delayed (Node);
    end Is_Delayed_Aggregate;