[COMMITTED] ada: Use idiomatic construct in Expand_N_Package_Body
Checks
Commit Message
From: Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* exp_ch7.adb (Expand_N_Package_Body): Call Defining_Entity to get
the entity of the body.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/exp_ch7.adb | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
@@ -5262,16 +5262,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;