aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib-xref.adb
diff options
context:
space:
mode:
authorGeert Bosch <bosch@gcc.gnu.org>2001-12-11 23:50:45 +0100
committerGeert Bosch <bosch@gcc.gnu.org>2001-12-11 23:50:45 +0100
commit0873bafcaa07ec24cc51e2bced0458252b5d028e (patch)
treeb4ff6b95bcd0d7b38300eb8065cd673c688596c6 /gcc/ada/lib-xref.adb
parent81217be921244ece2f9246bd4ed3991ba71ed68b (diff)
downloadgcc-0873bafcaa07ec24cc51e2bced0458252b5d028e.zip
gcc-0873bafcaa07ec24cc51e2bced0458252b5d028e.tar.gz
gcc-0873bafcaa07ec24cc51e2bced0458252b5d028e.tar.bz2
lib-xref.adb (Output_Refs): Don't output type references outside the main unit if...
* lib-xref.adb (Output_Refs): Don't output type references outside the main unit if they are not otherwise referenced. * sem_attr.adb (Analyze_attribute, case Address and Size): Simplify code and diagnose additional illegal uses * sem_util.adb (Is_Object_Reference): An indexed component is an object only if the prefix is. * g-diopit.adb: Initial version. * g-diopit.ads: Initial version. * g-dirope.adb: (Expand_Path): Avoid use of Unbounded_String (Find, Wildcard_Iterator): Moved to child package Iteration * Makefile.in: Added g-diopit.o to GNATRTL_NONTASKING_OBJS * sem_attr.adb: Minor reformatting From-SVN: r47901
Diffstat (limited to 'gcc/ada/lib-xref.adb')
-rw-r--r--gcc/ada/lib-xref.adb10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb
index 4367eb1..c49866f 100644
--- a/gcc/ada/lib-xref.adb
+++ b/gcc/ada/lib-xref.adb
@@ -751,7 +751,7 @@ package body Lib.Xref is
if Sloc (Tref) = Standard_Location then
- -- For now, output only if speial -gnatdM flag set
+ -- For now, output only if special -gnatdM flag set
exit when not Debug_Flag_MM;
@@ -769,6 +769,14 @@ package body Lib.Xref is
exit when not (Debug_Flag_MM or else Left = '<');
+ -- Do not output type reference if referenced
+ -- entity is not in the main unit and is itself
+ -- not referenced, since otherwise the reference
+ -- will dangle.
+
+ exit when not Referenced (Tref)
+ and then not In_Extended_Main_Source_Unit (Tref);
+
-- Output the reference
Write_Info_Char (Left);