libtooling: how to parse #include directive

Hi *,
I would like to match and then rewrite “#include” directives, is it possible via libtooling’s API ?
how can I use ASTMatcher for matching “#include” directives ?


Please take a look at this clang-tidy check which uses preprocessor callbacks instead of ASTMatchers.

It just reorders them, but you should be able to use it as template…