OSDN Git Service

2009-04-29 Ed Schonberg <schonberg@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 29 Apr 2009 13:22:02 +0000 (13:22 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 29 Apr 2009 13:22:02 +0000 (13:22 +0000)
* lib-xref.adb (Output_Overridden_Op): Follow several levels of
derivation when necessary, to find the user-subprogram that is actally
being overridden.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146964 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/lib-xref.adb

index d51fddb..7bddd60 100644 (file)
@@ -1,3 +1,9 @@
+2009-04-29  Ed Schonberg  <schonberg@adacore.com>
+
+       * lib-xref.adb (Output_Overridden_Op): Follow several levels of
+       derivation when necessary, to find the user-subprogram that is actally
+       being overridden.
+
 2009-04-29  Robert Dewar  <dewar@adacore.com>
 
        * sem_util.adb (May_Be_Lvalue): Fix cases involving indexed/selected
index c2e1c59..0e45e2e 100644 (file)
@@ -1696,8 +1696,20 @@ package body Lib.Xref is
                   if No (Old_E) then
                      return;
 
+                  --  Follow alias chain if one is present
+
                   elsif Present (Alias (Old_E)) then
+
+                     --  The subprogram may have been implicitly inherited
+                     --  through several levels of derivation, so find the
+                     --  ultimate (source) ancestor.
+
                      Op := Alias (Old_E);
+                     while Present (Alias (Op)) loop
+                        Op := Alias (Op);
+                     end loop;
+
+                  --  Normal case of no alias present
 
                   else
                      Op := Old_E;