]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lib-xref.adb (Generate_Definition, [...]): Treat the internal entity created for...
authorEd Schonberg <schonberg@adacore.com>
Tue, 15 Nov 2005 14:00:18 +0000 (15:00 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 15 Nov 2005 14:00:18 +0000 (15:00 +0100)
2005-11-14  Ed Schonberg  <schonberg@adacore.com>

* lib-xref.adb (Generate_Definition, Generate_Reference): Treat the
internal entity created for the declaration of a child subprogram body
with no spec as coming from source, to generate proper cross-reference
information.

From-SVN: r106988

gcc/ada/lib-xref.adb

index 7260b0cdcc4d4955116321bda5e642b92853e5b5..1d0c8cbdc09e1798e274dd7bbe02b73878d2aa73 100644 (file)
@@ -111,8 +111,13 @@ package body Lib.Xref is
       if Opt.Xref_Active
 
          --  Definition must come from source
+         --  We make an exception for subprogram child units that have no
+         --  spec. For these we generate a subprogram declaration for library
+         --  use, and the corresponding entity does not come from source.
+         --  Nevertheless, all references will be attached to it and we have
+         --  to treat is as coming from user code.
 
-         and then Comes_From_Source (E)
+         and then (Comes_From_Source (E) or else Is_Child_Unit (E))
 
          --  And must have a reasonable source location that is not
          --  within an instance (all entities in instances are ignored)
@@ -518,6 +523,14 @@ package body Lib.Xref is
                end if;
             end loop;
 
+         --  The internally created defining entity for a child subprogram
+         --  that has no previous spec has valid references.
+
+         elsif Is_Overloadable (E)
+           and then Is_Child_Unit (E)
+         then
+            Ent := E;
+
          --  Record components of discriminated subtypes or derived types
          --  must be treated as references to the original component.