[Ada] Simplify building of entity occurrences

gcc/ada/

	* tbuild.adb (New_Occurrence_Of): Simplify by reusing
	Make_Identifier.
This commit is contained in:
Piotr Trojanek 2021-10-27 16:34:20 +02:00 committed by Pierre-Marie de Rodat
parent 0803fd245a
commit e93e554454
1 changed files with 2 additions and 3 deletions

View File

@ -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