I'm writing a tool that uses clang CompilerInstance and ParseAST to parse and rewrite a source file. What I find quite annoying is that if include paths are missing then the tool outputs an error that it can not find some include file, however the AST is still being built and my tool works just fine. What I would like to do is tell clang to not report an error when an include file is missing and to just parse the AST and let me rewrite the code in just that file.
Is there an example that shows how to do this?
My code is based on the CIrewriter.cpp example from github.https://github.com/loarabia/Clang-tutorial/blob/master/CIrewriter.cpp