I looked into the second problem from
  http://gcc.gnu.org/ml/gcc/2009-08/msg00475.html ,

> 2) The 'X' lines in the ALI files are not what they should be.
> This is due to the fact that Lib.Xref.Generate_(Definition|Reference) is
> called during semantic analysis. However, when I discover that a
> tree was already built for a main unit by a previous compilation,
> Sem is not redone for that tree. [...]

and I see two possible solutions:

1) Extend Lib.Xref.Generate_Reference, Sem_Util.Process_End_Label
and others for the case "not In_Extended_Main_Source_Unit" in multi
source compilation mode to buffer the generated references for possible
later consumption by the main unit for which they are intended.
If the main unit is not part of the main units given in the multi source
compile job then the buffered data can be discarded.

2) Determine an ordering of the main units such that main units with
little or no dependencies precede main units that depend on them.
Submit units to semantic analysis in the determined order.

Both approaches seem quite heavy.
Solution 2 looks more elegant to me. OTOH this would require a
separate analysis of the with clauses prior to invoking Sem proper.

Oliver



Reply via email to