[cfe-dev] How to perform parallel static analysis in scan-build?

E Feng via cfe-dev cfe-dev at lists.llvm.org
Tue Jun 28 12:44:10 PDT 2016


Thank you very much, Devin. You are right: using make -jN does make static
analyzer to run in parallel too. -Eric

Devin Coughlin <dcoughlin at apple.com> wrote:

>
> > E Feng via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> >
> > I understand the "make -j10" makes the build phase parallel. However,
> how do I make the static analysis/html report generation phase parallel as
> well? Is there such an option in scan-build to do that? I searched the
> scan-build documentation but could not find such an option. It seems by
> default, scan-build performs static analysis/html report generation phase
> in serial mode.
>
> Using make -jN is enough to cause the static analyzer to run in parallel
> as well. This is because scan-build uses environment variable interposition
> to replace CC with its own script that pretends to be the compiler. The
> script first builds each source file with the real compiler and then
> immediately analyzes it. This means that if ‘make' calls the compiler in
> parallel on a given set of translation units (which it does with -jN) then
> the static analyzer will also analyze those translation units in parallel.
>
> For example, when using scan-build to analyze openssl-1.0.0d with ‘make
> -j10’ I see between 4 and 11 analysis processes running concurrently with
> ‘ps’.
>
> Devin
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160628/d3ae2e3e/attachment.html>


More information about the cfe-dev mailing list