summaryrefslogtreecommitdiff
path: root/gcc/ada/lib-xref.adb
diff options
context:
space:
mode:
authorbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-17 21:00:59 +0000
committerbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-17 21:00:59 +0000
commit8880be8571f9ef03b3cd47702aa15d31f4c0dad3 (patch)
tree425ca9a59ec19c276fa2119f9e7b007ba368384d /gcc/ada/lib-xref.adb
parent303e829182e62008667899110e4f22831d1c419d (diff)
downloadgcc-8880be8571f9ef03b3cd47702aa15d31f4c0dad3.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48125 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/lib-xref.adb')
-rw-r--r--gcc/ada/lib-xref.adb53
1 files changed, 52 insertions, 1 deletions
diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb
index 931e02fda75..06397c74fce 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;