[cfe-dev] speed up clang build after modifying checker code of static analyzer
Lou Wynn via cfe-dev
cfe-dev at lists.llvm.org
Tue Sep 18 17:41:56 PDT 2018
Hi,
I'm writing my first clang static analyzer checker. I wrote the scaffold
code to add the checker into clang. But every time when I change the
checker implementation code, the build process after generating the
checker object file is very slow. It's over 4 minutes in my laptop,
which has the i7-6820HQ four core CPU and 32G memory. The generated
clang binary is over 2G. The affected artifacts are as follows:
---------------------
Scanning dependencies of target clangStaticAnalyzerCheckers
[ 95%] Building CXX object
tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/clangStaticAnalyzerCheckers.dir/IntegerOverflowChecker.cpp.o
[ 95%] Linking CXX static library
../../../../../lib/libclangStaticAnalyzerCheckers.a
[ 98%] Built target clangStaticAnalyzerCheckers
[ 98%] Linking CXX executable ../../../../bin/arcmt-test
[ 98%] Linking CXX executable ../../../../bin/clang-check
[ 98%] Linking CXX executable ../../../../bin/clang
[ 98%] Linking CXX shared library ../../../../lib/libclang.so
[ 98%] Built target arcmt-test <--- this seems to take the most time
[ 98%] Built target libclang
[ 98%] Linking CXX executable ../../../../bin/c-arcmt-test
[ 98%] Linking CXX executable ../../../../bin/c-index-test
[ 98%] Built target c-arcmt-test
[ 98%] Built target clang-check
[ 98%] Built target clang
[100%] Built target c-index-test
real 4m23.014s
user 8m4.032s
sys 0m51.992s
---------------------
How can I speed up the build process so that I don't have to wait for
almost 4.5 minute for a single change in the implementation code? I only
work on the checker of the static analyzer.
--
Thanks,
Lou
More information about the cfe-dev
mailing list