summaryrefslogtreecommitdiff
path: root/gcc/ada/lib-xref.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-05 07:55:30 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-05 07:55:30 +0000
commit4b0d05543a4c26571080f1154fb4584933d892a3 (patch)
treec874b7e54802e0374f0a07dfecdfa31566aa0ffe /gcc/ada/lib-xref.adb
parent528a6b60e12138771fa33d6587bddfd0efabe6e3 (diff)
downloadgcc-4b0d05543a4c26571080f1154fb4584933d892a3.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103871 138bc75d-0d04-0410-961f-82ee72b054a4
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 1fc8b565f3e..7260b0cdcc4 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;