Found a weird case with clang 8.1.0's ccc-analyzer tool that causes it to slow down immensely when using designated array initialization syntax.
$ ./deps/scanbuild/checker-279/libexec/ccc-analyzer --version
Apple LLVM version 8.1.0 (clang-802.0.38)
Target: x86_64-apple-darwin16.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
The C file uses two defines to control behavior:
STACKY_MULT
is a multipler used to build a stack-allocated arrayGOTTA_GO_FAST
is used to control whether to use the problematic initialization syntax
As an example, this compiles quickly:
$ time ./deps/scanbuild/checker-279/libexec/ccc-analyzer --std=c11 -DSTACKY_MULT=8 -DGOTTA_GO_FAST ccc_analyzer_hates_me.c -o ccc_analyzer_hates_me.o
real 0m0.142s
user 0m0.075s
sys 0m0.034s
Whereas this does not:
$ time ./deps/scanbuild/checker-279/libexec/ccc-analyzer --std=c11 -DSTACKY_MULT=8 ccc_analyzer_hates_me.c -o ccc_analyzer_hates_me.o
real 0m4.835s
user 0m4.746s
sys 0m0.047s
Furthermore, doubling the STACKY_MULT
define seems to have a greater-than-linear relationship with time.
-DSTACKY_MULT=2
real 0m0.380s
user 0m0.312s
sys 0m0.035s
-DSTACKY_MULT=4
real 0m1.216s
user 0m1.145s
sys 0m0.038s
-DSTACKY_MULT=8
real 0m4.679s
user 0m4.601s
sys 0m0.042s
-DSTACKY_MULT=16
real 0m18.767s
user 0m18.663s
sys 0m0.065s