public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Avoid repeated calls in analysis of expression functions
@ 2021-07-09 12:37 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-07-09 12:37 UTC (permalink / raw)
  To: gcc-patches; +Cc: Piotr Trojanek

[-- Attachment #1: Type: text/plain, Size: 274 bytes --]

Code cleanup related to handing of static expression functions in
GNATprove; behaviour is unaffected.

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

gcc/ada/

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

[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 830 bytes --]

diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-09 12:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09 12:37 [Ada] Avoid repeated calls in analysis of expression functions Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).