This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] initial location support for C parser
- From: Arnaud Charlet <charlet at adacore dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: joseph at codesourcery dot com, lopezibanez at gmail dot com, gcc-patches at gcc dot gnu dot org, jason at redhat dot com, Arnaud Charlet <charlet at adacore dot com>
- Date: Sat, 23 Aug 2008 09:22:16 +0200
- Subject: Re: [patch] initial location support for C parser
- References: <20080822215202.GA13803@redhat.com>
> Here is a patch/RFC before I go any further.
Thanks for putting me in the loop BTW.
> My plan here is to make all the build* routines in the parser take a
> location, and fix everything else accordingly, eventually getting rid of
> input_location. Arnaud and Manuel are tackling similar tasks, I hope we
> can work in tandem.
Indeed, this seems to go as a complementary (or possibly partly overlapping).
This means that I should probably start sending my patches soon as well.
Note that if people feel this is not a good time to commit such patches, maybe
we should consider starting a branch (just a thought).
> With this initial patch I noticed that to come up with suitable tests
> for all this, I would have to basically write an entire ISO C
> comformance test, something which is perhaps beyond the scope of my
> work. I would like to fix existing tests as I go, and perhaps add new
> ones when it is obvious how to add new tests. Sometimes I noticed it
> was incredibly hard to contrive a test for a particular location we were
> setting. I hope we can come to a middle ground here-- I doubt I have
> the time, desire, or inclination to write an entire comformance suite.
Right.
Note that a better way to check line and column information may be to use some
kind of tree dump pass and check the result against e.g. a baseline.
For instance, I am working on generating relatively complete xref source
information, so using this xref dump could be a good basis for checking
line and column numbers generated by the front-ends in a pretty exhaustive
way.
Arno