[cfe-dev] libtooling: how to get the list of include files for a translation unit

Wilhelm wilhelm.meier at fh-kl.de
Wed Jul 23 00:46:34 PDT 2014


Hi James,

Am 21.07.2014 um 20:11 schrieb James Dennett:
> On Mon, Jul 21, 2014 at 9:18 AM, Wilhelm <wilhelm.meier at fh-kl.de> wrote:
>> Hi all,
>>
>> I managed to write an RecursiveASTVisitor<> with libtooling.
>>
>> Now I want to get the list of header files included to form the actual
>> translation unit. I googled for a while now, but got no idea how to
>> retrieve this information.
>>
>> Any help?
> 
> One approach/starting point: If you provide an implementation of
> PPCallbacks you can override FileChanged.

thank you for this advice.

I'm using clang::ClangTool to run an ASTFrontendAction over the source
files. I looked around, but I have no idea how to set the PPCallbacks to
the Preprocessor.

Any help?

-- 
Wilhelm
w.meier at unix.net

-- 
Wilhelm
w.meier at unix.net



More information about the cfe-dev mailing list