From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id CFB203858000; Tue, 9 Nov 2021 09:46:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CFB203858000 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Pierre-Marie de Rodat To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-5028] [Ada] Simplify building of entity occurrences X-Act-Checkin: gcc X-Git-Author: Piotr Trojanek X-Git-Refname: refs/heads/master X-Git-Oldrev: 0803fd245a35c4b465cdefff20364f0f6e9f6fa7 X-Git-Newrev: e93e554454d855231f257b3b95f4105b4da60cc0 Message-Id: <20211109094630.CFB203858000@sourceware.org> Date: Tue, 9 Nov 2021 09:46:30 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2021 09:46:30 -0000 https://gcc.gnu.org/g:e93e554454d855231f257b3b95f4105b4da60cc0 commit r12-5028-ge93e554454d855231f257b3b95f4105b4da60cc0 Author: Piotr Trojanek Date: Wed Oct 27 16:34:20 2021 +0200 [Ada] Simplify building of entity occurrences gcc/ada/ * tbuild.adb (New_Occurrence_Of): Simplify by reusing Make_Identifier. Diff: --- gcc/ada/tbuild.adb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gcc/ada/tbuild.adb b/gcc/ada/tbuild.adb index 4d9c1c410fd..bcd77c7fd0f 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