+
+ -- Display list of sources in the closure (except predefined
+ -- sources) if -R was used.
+
+ if List_Closure then
+ if not Zero_Formatting then
+ Write_Eol;
+ Write_Str ("REFERENCED SOURCES");
+ Write_Eol;
+ end if;
+
+ for J in reverse Elab_Order.First .. Elab_Order.Last loop
+
+ -- Do not include the sources of the runtime
+
+ if not Is_Internal_File_Name
+ (Units.Table (Elab_Order.Table (J)).Sfile)
+ then
+ if not Zero_Formatting then
+ Write_Str (" ");
+ end if;
+
+ Write_Str
+ (Get_Name_String
+ (Units.Table (Elab_Order.Table (J)).Sfile));
+ Write_Eol;
+ end if;
+ end loop;
+
+ -- Subunits do not appear in the elaboration table because they
+ -- are subsumed by their parent units, but we need to list them
+ -- for other tools. For now they are listed after other files,
+ -- rather than right after their parent, since there is no easy
+ -- link between the elaboration table and the ALIs table ???
+ -- Note also that subunits may appear repeatedly in the list,
+ -- if the parent unit appears in the context of several units
+ -- in the closure.
+
+ for J in Sdep.First .. Sdep.Last loop
+ if Sdep.Table (J).Subunit_Name /= No_Name
+ and then not Is_Internal_File_Name (Sdep.Table (J).Sfile)
+ then
+ if not Zero_Formatting then
+ Write_Str (" ");
+ end if;
+
+ Write_Str (Get_Name_String (Sdep.Table (J).Sfile));
+ Write_Eol;
+ end if;
+ end loop;
+
+ if not Zero_Formatting then
+ Write_Eol;
+ end if;
+ end if;