]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Avoid repeated calls in analysis of expression functions
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 28 May 2021 12:53:21 +0000 (14:53 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 9 Jul 2021 12:35:24 +0000 (12:35 +0000)
gcc/ada/

* sem_ch6.adb (Analyze_Expression_Function): Use Orig_N variable
instead of repeated calls to Original_Node.

gcc/ada/sem_ch6.adb

index 6bc72d65bf6e789a10a6666acc421f47726dd0f9..ed76808ec76538b65f59e100d14e35955bf81948 100644 (file)
@@ -561,7 +561,7 @@ package body Sem_Ch6 is
                   Push_Scope (Def_Id);
                   Install_Formals (Def_Id);
                   Preanalyze_Formal_Expression (Expr, Typ);
-                  Check_Limited_Return (Original_Node (N), Expr, Typ);
+                  Check_Limited_Return (Orig_N, Expr, Typ);
                   End_Scope;
                end if;
 
@@ -630,7 +630,7 @@ package body Sem_Ch6 is
          Check_Dynamically_Tagged_Expression
            (Expr        => Expr,
             Typ         => Etype (Def_Id),
-            Related_Nod => Original_Node (N));
+            Related_Nod => Orig_N);
       end if;
 
       --  We must enforce checks for unreferenced formals in our newly