[cfe-dev] clang-tidy slow without --
Hongping Lim via cfe-dev
cfe-dev at lists.llvm.org
Fri Jan 22 20:06:03 PST 2016
Actually it seems "--" without anything after just means to not have any
compile options at all?
I went through the options in my compile_command.json file, and it seems
this isysroot option is what is causing the command to be slow for this
particular source file. If I remove it then the command runs quickly.
-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk
However, with the same compile options including the above isysroot option,
running on another source file that I have which is 2200 lines, and
causes 735 warnings in non-user code as well, clang-tidy takes less than
one second.
Thanks,
Hongping
On Fri, Jan 22, 2016 at 7:42 PM, Hongping Lim <hongping.lim at gmail.com>
wrote:
> 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/19cc2d33/attachment.html>
More information about the cfe-dev
mailing list