aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib-xref.adb
diff options
context:
space:
mode:
authorGeert Bosch <bosch@gcc.gnu.org>2001-12-17 22:00:59 +0100
committerGeert Bosch <bosch@gcc.gnu.org>2001-12-17 22:00:59 +0100
commitc1c22e7a703c6e1d638195f667c9f1ce72ef6de5 (patch)
tree425ca9a59ec19c276fa2119f9e7b007ba368384d /gcc/ada/lib-xref.adb
parent7eb7bb079d2fb0c22d9e31995a3ea8d812e5a042 (diff)
downloadgcc-c1c22e7a703c6e1d638195f667c9f1ce72ef6de5.zip
gcc-c1c22e7a703c6e1d638195f667c9f1ce72ef6de5.tar.gz
gcc-c1c22e7a703c6e1d638195f667c9f1ce72ef6de5.tar.bz2
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
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 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;