aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib-xref.adb
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2005-09-05 09:55:30 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2005-09-05 09:55:30 +0200
commit5ec5b8c17167a5d831310bc80f42ae717998769a (patch)
treec874b7e54802e0374f0a07dfecdfa31566aa0ffe /gcc/ada/lib-xref.adb
parent8e4fe95d949971f4a1afc5072da5a80f4b28b2f0 (diff)
downloadgcc-5ec5b8c17167a5d831310bc80f42ae717998769a.zip
gcc-5ec5b8c17167a5d831310bc80f42ae717998769a.tar.gz
gcc-5ec5b8c17167a5d831310bc80f42ae717998769a.tar.bz2
lib-xref.adb (Output_Overridden_Op): Display information on overridden operation.
2005-09-01 Ed Schonberg <schonberg@adacore.com> Emmanuel Briot <briot@adacore.com> * lib-xref.adb (Output_Overridden_Op): Display information on overridden operation. * lib-xref.ads: Add documentation on overridden operations. * ali.ads (Xref_Entity_Record): Add support for storing the overriding information. * ali.adb (Get_Typeref): New subprogram. Adds support for parsing the overriding entity information. From-SVN: r103871
Diffstat (limited to 'gcc/ada/lib-xref.adb')
-rw-r--r--gcc/ada/lib-xref.adb42
1 files changed, 42 insertions, 0 deletions
diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb
index 1fc8b56..7260b0c 100644
--- a/gcc/ada/lib-xref.adb
+++ b/gcc/ada/lib-xref.adb
@@ -1172,6 +1172,10 @@ package body Lib.Xref is
-- the given source ptr in [file|line[...]] form. No output
-- if the given location is not a generic template reference.
+ procedure Output_Overridden_Op (Old_E : Entity_Id);
+ -- For a subprogram that is overriding, display information
+ -- about the inherited operation that it overrides.
+
-------------------------------
-- Output_Instantiation_Refs --
-------------------------------
@@ -1212,6 +1216,35 @@ package body Lib.Xref is
return;
end Output_Instantiation_Refs;
+ --------------------------
+ -- Output_Overridden_Op --
+ --------------------------
+
+ procedure Output_Overridden_Op (Old_E : Entity_Id) is
+ begin
+ if Present (Old_E)
+ and then Sloc (Old_E) /= Standard_Location
+ then
+ declare
+ Loc : constant Source_Ptr := Sloc (Old_E);
+ Par_Unit : constant Unit_Number_Type :=
+ Get_Source_Unit (Loc);
+ begin
+ Write_Info_Char ('<');
+
+ if Par_Unit /= Curxu then
+ Write_Info_Nat (Dependency_Num (Par_Unit));
+ Write_Info_Char ('|');
+ end if;
+
+ Write_Info_Nat (Int (Get_Logical_Line_Number (Loc)));
+ Write_Info_Char ('p');
+ Write_Info_Nat (Int (Get_Column_Number (Loc)));
+ Write_Info_Char ('>');
+ end;
+ end if;
+ end Output_Overridden_Op;
+
-- Start of processing for Output_One_Ref
begin
@@ -1661,6 +1694,15 @@ package body Lib.Xref is
end if;
end if;
+ -- If the entity is an overriding operation, write
+ -- info on operation that was overridden.
+
+ if Is_Subprogram (XE.Ent)
+ and then Is_Overriding_Operation (XE.Ent)
+ then
+ Output_Overridden_Op (Overridden_Operation (XE.Ent));
+ end if;
+
-- End of processing for entity output
Crloc := No_Location;