summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-15 14:00:18 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-15 14:00:18 +0000
commit1eef213866546f6cc149afb0f01bf59af761a0c5 (patch)
tree9ff736e010bc59488bea5f8e018982814f60f62f
parent6e60a0f084e6e9d477b60f12a204180ed65a745e (diff)
downloadppe42-gcc-1eef213866546f6cc149afb0f01bf59af761a0c5.tar.gz
ppe42-gcc-1eef213866546f6cc149afb0f01bf59af761a0c5.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106988 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/lib-xref.adb15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb
index 7260b0cdcc4..1d0c8cbdc09 100644
--- a/gcc/ada/lib-xref.adb
+++ b/gcc/ada/lib-xref.adb
@@ -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.
OpenPOWER on IntegriCloud