[cfe-dev] Attempting compile after a clang-tidy invocation

Stephen Kelly via cfe-dev cfe-dev at lists.llvm.org
Tue May 8 09:06:18 PDT 2018


Hi,

I'm writing some tools with clang-tidy using AST matchers.

I'm storing the changes in yamls files. It would be useful to try to
compile the result after doing that storage.

I think the way to do that is:

After handleErrors in clangtidy.cpp,

* Create an in-memory filesystem containing buffers for each of the files
changed in the replacements.
* Create an overlay filesystem combining the real filesystem and my in
memory one.
* Apply the replacements with applyAllReplacements in the normal way.
* Compile in the normal way with the same args.

I think I can create the virtual filesystem, but I'm not sure how to create
the compiler invocation with the correct args. Do I need to go back to the
compiledb and filter out the args etc?

Is there some simple way to do this that I'm missing?

Thanks,

Stephen.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180508/090ad099/attachment.html>


More information about the cfe-dev mailing list