This is the mail archive of the
mailing list for the GCC project.
Re: [patch] diagnostics branch
> This seems like one of those cases where you would ideally want the FE
> to have a lot more tree nodes, and in particular have
> location-carrying nodes for constants and variable references
> (separate from declarations).
> That's a lot more work though.
Indeed (that's what the GNAT fe does), although in practice, setting more
EXPR_LOCATION on nodes which currently don't have one (or an incorrect one)
does a pretty good job.
I've done similar changes in a local patch to be able to generate
xref information out of the C front-end, and this works reasonably well,
although this work isn't complete yet. I'm planning to update this work
once the diagnostics branch is merged BTW, since many of the changes are
very similar, so no need to duplicate work or confuse things.