[cfe-dev] clang-tidy slow without --

Hongping Lim via cfe-dev cfe-dev at lists.llvm.org
Fri Jan 22 19:42:34 PST 2016


I have managed to build a release version of clang-tidy on my Mac, and
checked that it is optimized with --version.

~/llvm-build/bin/clang-tidy --version
LLVM (http://llvm.org/):
LLVM version 3.8.0svn
Optimized build.
Built Jan 15 2016 (13:18:26).
Default target: x86_64-apple-darwin15.0.0
Host CPU: broadwell


I am working with an Objective-C project in Xcode, and have managed to
generate the required compile_commands.json file using xcodebuild/xcpretty,
and am able to run it.

When I run it on a single file that has 2700 lines with just the
compile_commands.json file (stripped down to just one command), it takes
clang-tidy around 23 seconds to complete.

~/llvm-build/bin/clang-tidy MyFile.m
...
Suppressed 719 warnings (719 in non-user code).
Use -header-filter=.* to display errors from all non-system headers.

If I run the same command with "--", then it is much faster.
~/llvm-build/bin/clang-tidy MyFile.m --
...
Suppressed 6 warnings (6 in non-user code).
Use -header-filter=.* to display errors from all non-system headers.



It seems the difference is that with --, some header files aren't
processed? If I am just interested in errors in the specific file I am
running on, is using -- the right thing to do?

Thanks,
Hongping
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160122/ae31a7f0/attachment.html>


More information about the cfe-dev mailing list