public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-7857] ada: Use idiomatic construct in Expand_N_Package_Body
@ 2023-09-27  8:24 Eric Botcazou
  0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2023-09-27  8:24 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:6f6e2d62bbe2a84dada2bace2688f6599502eb0b

commit r13-7857-g6f6e2d62bbe2a84dada2bace2688f6599502eb0b
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Fri Feb 10 11:15:15 2023 +0100

    ada: Use idiomatic construct in Expand_N_Package_Body
    
    gcc/ada/
    
            * exp_ch7.adb (Expand_N_Package_Body): Call Defining_Entity to get
            the entity of the body.

Diff:
---
 gcc/ada/exp_ch7.adb | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb
index 7ea39f7ba16..6f9cb16a38f 100644
--- a/gcc/ada/exp_ch7.adb
+++ b/gcc/ada/exp_ch7.adb
@@ -5241,16 +5241,7 @@ package body Exp_Ch7 is
             Fin_Id      => Fin_Id);
 
          if Present (Fin_Id) then
-            declare
-               Body_Ent : Node_Id := Defining_Unit_Name (N);
-
-            begin
-               if Nkind (Body_Ent) = N_Defining_Program_Unit_Name then
-                  Body_Ent := Defining_Identifier (Body_Ent);
-               end if;
-
-               Set_Finalizer (Body_Ent, Fin_Id);
-            end;
+            Set_Finalizer (Defining_Entity (N), Fin_Id);
          end if;
       end if;
    end Expand_N_Package_Body;

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

only message in thread, other threads:[~2023-09-27  8:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-27  8:24 [gcc r13-7857] ada: Use idiomatic construct in Expand_N_Package_Body Eric Botcazou

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).