[cfe-dev] List of included header files

Benjamin Orgogozo benjamin.orgogozo at normalesup.org
Mon Aug 22 01:27:55 PDT 2011


Hello,

I'm currently writing a plugin which must parse a file to add a few
lines of code. I wrote an ASTConsumer and use rewriter to insert text
and it works great but now I would like to dump the whole rewriter
buffers in a unique file.
My problems is that when my input file has included headers (which may
need to be rewritten). Ideally, I would like, for all included header
files that has been rewritten, to replace the #include by the rewritten
text but I really don't know how to do it... In fact I don't even know
how to easily access the list of included files.

I'm pretty sure that it's quite an obvious question so answer should be
somewhere but I didn't find it. Any pointer to the solution is more than
welcome!

Thanks a lot,

-- 
 Benjamin Orgogozo



More information about the cfe-dev mailing list