Eric Botcazou wrote:
Is there no abstract interface that would shield *any*
front end from "differences in representation of source locations
between successive generations of the core compiler"? Certainly we
have made major changes in the GNAT representation without any change
at all in clients (except to take advantage of new features).

I don't think so, we'll have to devise in gigi.

It seems to me that clients should know nothing whatever about the
representation of source locations. The only invariant required by
the GNAT front end is that source locations fit in 32-bits (since
this accomodates up to 4 gigabytes of source in any one compilation,
that sounds enough for ever!)

The Ada compiler is a bit special because nearly all the diagnostics are issued by the front-end from its private internal representation. For the other compilers, especially the C family of compilers, there is no private internal representation since they essentially manipulate the tree IL directly.

Right, so it seems quite appropriate to have two representations for
source locations, one for the Ada tree, which is completely independent
of the tree IL, and one for the back end. That probably means that back
end messages will lose the generic instantiation information, but that's
not terrible.


Reply via email to