summaryrefslogtreecommitdiff
path: root/gcc/ada/lib-xref.adb
diff options
context:
space:
mode:
authorbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-11 22:50:45 +0000
committerbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-11 22:50:45 +0000
commit95a5c38ed22b3b3c3d1d7746f32453035b116cf7 (patch)
treeb4ff6b95bcd0d7b38300eb8065cd673c688596c6 /gcc/ada/lib-xref.adb
parent3d236665245a6e17df6ffef3509fb709120b3a00 (diff)
downloadgcc-95a5c38ed22b3b3c3d1d7746f32453035b116cf7.tar.gz
* 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 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47901 138bc75d-0d04-0410-961f-82ee72b054a4
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 4367eb1720b..c49866f4af2 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);