[Ada] Reuse First_Actual in Address_Value
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 17 Mar 2021 16:21:48 +0000 (17:21 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 18 Jun 2021 08:36:50 +0000 (04:36 -0400)
gcc/ada/

* sem_util.adb (Address_Value): Simplify.

gcc/ada/sem_util.adb

index a66a024..9849071 100644 (file)
@@ -1007,11 +1007,7 @@ package body Sem_Util is
            and then Is_Entity_Name (Name (Expr))
            and then Is_RTE (Entity (Name (Expr)), RE_To_Address)
          then
-            Expr := First (Parameter_Associations (Expr));
-
-            if Nkind (Expr) = N_Parameter_Association then
-               Expr := Explicit_Actual_Parameter (Expr);
-            end if;
+            Expr := First_Actual (Expr);
 
          --  We finally have the real expression