public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5028] [Ada] Simplify building of entity occurrences
@ 2021-11-09  9:46 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-11-09  9:46 UTC (permalink / raw)
  To: gcc-cvs

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


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

only message in thread, other threads:[~2021-11-09  9:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-09  9:46 [gcc r12-5028] [Ada] Simplify building of entity occurrences Pierre-Marie de Rodat

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