From: Piotr Trojanek Date: Wed, 27 Oct 2021 14:34:20 +0000 (+0200) Subject: [Ada] Simplify building of entity occurrences X-Git-Tag: basepoints/gcc-13~3285 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e93e554454d855231f257b3b95f4105b4da60cc0;p=thirdparty%2Fgcc.git [Ada] Simplify building of entity occurrences gcc/ada/ * tbuild.adb (New_Occurrence_Of): Simplify by reusing Make_Identifier. --- diff --git a/gcc/ada/tbuild.adb b/gcc/ada/tbuild.adb index 4d9c1c410fd6..bcd77c7fd0f3 100644 --- a/gcc/ada/tbuild.adb +++ b/gcc/ada/tbuild.adb @@ -699,11 +699,10 @@ package body Tbuild is Loc : Source_Ptr) return Node_Id is pragma Assert (Present (Def_Id) and then Nkind (Def_Id) in N_Entity); - Occurrence : Node_Id; + Occurrence : constant Node_Id := + Make_Identifier (Loc, Chars (Def_Id)); begin - Occurrence := New_Node (N_Identifier, Loc); - Set_Chars (Occurrence, Chars (Def_Id)); Set_Entity (Occurrence, Def_Id); if Is_Type (Def_Id) then