[cfe-dev] Tips for speeding analysis up?

David Blaikie dblaikie at gmail.com
Wed Oct 10 07:59:13 PDT 2012


In general, anything we can do at compile time is implemented as compiler
warnings (the caveat being that it must have a fairly low false positive
rate as well). In theory, the things hat are more stylistic (aka more false
positives/nonbugs) but still fast should go in a clanb plugin, but we don't
have an authoritative style checker plugin in the clang distribution at the
moment
------------------------------
From: Vedran Vukotic
Sent: 10/10/2012 1:55 AM
To: cfe-dev at cs.uiuc.edu
Cc: Gustavo Lopez
Subject: [cfe-dev] Tips for speeding analysis up?

   Hello,



I’m looking at Clang’s analyzer as a replacement for Split (that we’re
currently using) and it really looks nice and promising. However, due to a
relatively large code base the analysis takes really a lot of time (about
14 minutes compared to the 1 min for Splint) and it won’t be possible to
make the analysis every time a developer compile that code (as we did with
Splint).



The analysis provided by Clang is really nice and we can certainly run it
every few commits/hours/during the night, however I was looking if there is
a way to speed it up (even on cost of bugs found) a bit to also have it at
compilation time.



Right know, I made sure it’s compiled as a release (and not debug version)
and I also disabled deadstore, malloc and similar checks (I’ve noticed they
were a little bit slower than other checks), html reports and I’m running
it in the following way:



clang -cc1 -triple i386-pc-linux-gnu -analyze -disable-free
-disable-llvm-verifier -analyzer-checker=core -analyzer-output plist -w
-mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -target-cpu pentium4 -target-linker-version
2.18.50.0.9 -momit-leaf-frame-pointer -resource-dir ../lib/clang/3.2
-fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem
/usr/local/include -internal-isystem  ../lib/clang/3.2/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdebug-compilation-dir clang/rx2 -ferror-limit 3 -fmessage-length 115
-mstackrealign -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics



In this way it takes about 10 minutes to finish (still 10 times slower than
Splint) that’s still too much to run it every time the code is compiled :/



May I ask you if you might have any hints for speeding up the analysis a
little bit?



Thank you,



Vedran





------------------------------

This e-mail communication contains information that is confidential and may
also be privileged. It is intended for the exclusive use of the addressees.
If you are not the person or organization to whom it is addressed, you must
not copy, distribute or take any action in reliance upon it. If you
received this communication in error, please notify Septentrio nv
immediately [ telephone +32 [0] 16 300800 ]. Septentrio nv will not accept
liability for contractual commitments made by individuals employed by this
company outside the scope of our business.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121010/7324766b/attachment.html>


More information about the cfe-dev mailing list