[PATCH] D30691: [analyzer] Support for naive cross translational unit analysis

Zoltán Gera via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 15 06:16:29 PST 2017

gerazo added a comment.

In https://reviews.llvm.org/D30691#954740, @george.karpenkov wrote:

> I've tried using the patch, and I got blocked at the following: CTU options are only exposed when one goes through `analyze-build` frontend, which requires `compile_commands.json` to be present. I've used `libear` to generate `compile_commands.json`, but the generated JSON does not contain the `command` field, which causes `@require` before `run` to die (also, due to the passing style this error was unnecessarily difficult to debug).
>  So could you write a short documentation somewhere how all pieces fit together? What entry point should be used, what should people do who don't have a build system-generated `compile_commands.json`etc. etc.

Basically this patch does not change the way scan-build-py is working. So you can either create a compile_commands.json using intercept-build and than use analyze-build to use the result. Or you can do the two together using scan-build. We only offer the CTU functionality in analyze-build, because CTU needs multiple runs anyway, so on the spot build action capture and analyze is not possible with CTU. The general usage of scan-build-py is written in clang/tools/scan-build-py/README.md


More information about the cfe-commits mailing list