From 0873bafcaa07ec24cc51e2bced0458252b5d028e Mon Sep 17 00:00:00 2001 From: Geert Bosch Date: Tue, 11 Dec 2001 23:50:45 +0100 Subject: 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 --- gcc/ada/lib-xref.adb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'gcc/ada/lib-xref.adb') 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); -- cgit v1.1