This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Tags out of gcc
- From: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- To: Adrian May <adrian dot alexander dot may at gmail dot com>
- Cc: gcc Mailing List <gcc at gcc dot gnu dot org>
- Date: Sun, 5 Oct 2014 19:08:24 +0200
- Subject: Re: Tags out of gcc
- Authentication-results: sourceware.org; auth=none
- References: <CAESRpQC1xRZuFGyzEPvJACq8+139HVM2+H5J7VgZVsZy=A0muQ at mail dot gmail dot com> <CAH6eHdSjcBnsS0CD7QfHZpYaCkE8MuhyM1DM=_GLM_8i5h5FTg at mail dot gmail dot com> <CAESRpQDwwqzh6cmvXueZOyZGbuACMSCRNAp8MF0OsGVK1=QJOQ at mail dot gmail dot com> <CAD-UbzFFcNvkP59XCSOevvt4CULpOL9MSY+NXPUBFwWXBBZfNA at mail dot gmail dot com>
On 5 October 2014 03:39, Adrian May <adrian.alexander.may@gmail.com> wrote:
> But it absolutely has to follow the preprocessor, so how do I do that?
> I'm a bit surprised about that being a problem cos when I look at
> preprocessor output it looks very convenient - I get one big file but
> it's full of clues as to where it all came from. Perhaps I have to
> hook those clues.
Precisely. The information is there. The only open question is how to
pass it to your plugin. See libcpp/macro.c and libcpp/include/cpplib.h
and look for "callback". Then check init_c_lex in c-family/c-lex.c to
see how the C/C++ FE uses them. Now you have to figure out which
plugin hook your plugin should handle in order to take control of the
callbacks before they are used. If nothing is early enough, you would
need to add a new hook. (At least, this is what I would try first,
perhaps there is even a better way).
Cheers,
Manuel.