From c1c22e7a703c6e1d638195f667c9f1ce72ef6de5 Mon Sep 17 00:00:00 2001 From: Geert Bosch Date: Mon, 17 Dec 2001 22:00:59 +0100 Subject: ali.adb: Type reference does not reset current file. * ali.adb: Type reference does not reset current file. * ali.adb: Recognize and scan renaming reference * ali.ads: Add spec for storing renaming references. * lib-xref.ads: Add documentation for handling of renaming references * lib-xref.adb: Implement output of renaming reference. * checks.adb: (Determine_Range): Document local variables (Determine_Range): Make sure Hbound is initialized. It looks as though there could be a real problem here with an uninitialized reference to Hbound, but no actual example of failure has been found. * g-socket.ads: Fix comment of Shutdown_Socket and Close_Socket. These functions should not fail silently because if they are called twice, this probably means that there is a race condition in the user program. Anyway, this behaviour is consistent with the rest of this unit. When an error occurs, an exception is raised with the error message as exception message. From-SVN: r48125 --- gcc/ada/lib-xref.adb | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) (limited to 'gcc/ada/lib-xref.adb') diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb index 931e02f..06397c7 100644 --- a/gcc/ada/lib-xref.adb +++ b/gcc/ada/lib-xref.adb @@ -449,6 +449,9 @@ package body Lib.Xref is Tref : Entity_Id; -- Type reference + Rref : Node_Id; + -- Renaming reference + Trunit : Unit_Number_Type; -- Unit number for type reference @@ -730,7 +733,51 @@ package body Lib.Xref is end loop; end if; - -- Output type reference if any + -- See if we have a renaming reference + + if Is_Object (XE.Ent) + and then Present (Renamed_Object (XE.Ent)) + then + Rref := Renamed_Object (XE.Ent); + + elsif Is_Overloadable (XE.Ent) + and then Nkind (Parent (Declaration_Node (XE.Ent))) = + N_Subprogram_Renaming_Declaration + then + Rref := Name (Parent (Declaration_Node (XE.Ent))); + + elsif Ekind (XE.Ent) = E_Package + and then Nkind (Declaration_Node (XE.Ent)) = + N_Package_Renaming_Declaration + then + Rref := Name (Declaration_Node (XE.Ent)); + + else + Rref := Empty; + end if; + + if Present (Rref) then + if Nkind (Rref) = N_Expanded_Name then + Rref := Selector_Name (Rref); + end if; + + if Nkind (Rref) /= N_Identifier then + Rref := Empty; + end if; + end if; + + -- Write out renaming reference if we have one + + if Debug_Flag_MM and then Present (Rref) then + Write_Info_Char ('='); + Write_Info_Nat + (Int (Get_Logical_Line_Number (Sloc (Rref)))); + Write_Info_Char (':'); + Write_Info_Nat + (Int (Get_Column_Number (Sloc (Rref)))); + end if; + + -- See if we have a type reference Tref := XE.Ent; Left := '{'; @@ -807,6 +854,8 @@ package body Lib.Xref is exit when No (Tref) or else Tref = Sav; + -- Here we have a type reference to output + -- Case of standard entity, output name if Sloc (Tref) = Standard_Location then @@ -863,6 +912,8 @@ package body Lib.Xref is end if; end loop; + -- End of processing for entity output + Curru := Curxu; Crloc := No_Location; end if; -- cgit v1.1