[diagnostics-branch] use precise locations in C front-end

Tom Tromey tromey@redhat.com
Fri Dec 12 21:59:00 GMT 2008

>>>>> "Chris" == Chris Lattner <clattner@apple.com> writes:

Chris> Ah ok, so you'll end up with tree nodes that have locations from the
Chris> source code but that don't correspond to the source?

The existence of clang makes me think you already have come up with
answers for the questions you're asking.  IMO, describing your
preferred approach would help...

Chris> Here's a simple example: fold(x-x) -> 0.  What is the source location
Chris> of the INTEGER_CST?

My answer here would be the location of the operator.

Note that Joseph's 4.5 patches mean that the C FE will no longer fold
so aggressively.  So, this sort of oddity will be more rare -- it will
be restricted to errors issued after the FE.


More information about the Gcc-patches mailing list