public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-5028] [Ada] Simplify building of entity occurrences
Date: Tue,  9 Nov 2021 09:46:30 +0000 (GMT)	[thread overview]
Message-ID: <20211109094630.CFB203858000@sourceware.org> (raw)

https://gcc.gnu.org/g:e93e554454d855231f257b3b95f4105b4da60cc0

commit r12-5028-ge93e554454d855231f257b3b95f4105b4da60cc0
Author: Piotr Trojanek <trojanek@adacore.com>
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


                 reply	other threads:[~2021-11-09  9:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211109094630.CFB203858000@sourceware.org \
    --to=pmderodat@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).