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

Hongping Lim via cfe-dev cfe-dev at lists.llvm.org
Mon Jan 25 12:43:23 PST 2016


It seems the time might be spent running the analyzer, which is reported to
be slower than compilation (http://clang-analyzer.llvm.org/ ).

For now, I am using -clang-analyzer-* to disable these checks.

Thanks,
Hongping


On Sun, Jan 24, 2016 at 9:16 AM, Hongping Lim <hongping.lim at gmail.com>
wrote:

> 1. If you don't have the right isysroot, you probably get actual compiler
>> errors, and clang-tidy checks will not run
>> 2. It might be that the transitive closure of includes is just very large
>> when the TU takes long to process, but that'd need some more detailed
>> benchmarking
>>
>
> Thanks for the reply.
>
> Is there some way to list the headers processed, and how much time they
> incur?
>
> I tried copying all the #imports used by the file that takes a longer time
> into the file that takes less time, and the amount of time taken didn't
> change. It seems the actual code used in the source file might also affect
> which header files are processed?
>
> Thanks,
> Hongping
>
>
> On Sun, Jan 24, 2016 at 1:23 AM, Manuel Klimek <klimek at google.com> wrote:
>
>>
>>
>> On Sat, Jan 23, 2016 at 5:06 AM Hongping Lim via cfe-dev <
>> cfe-dev at lists.llvm.org> wrote:
>>
>>> 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.
>>>
>>
>> 1. If you don't have the right isysroot, you probably get actual compiler
>> errors, and clang-tidy checks will not run
>> 2. It might be that the transitive closure of includes is just very large
>> when the TU takes long to process, but that'd need some more detailed
>> benchmarking
>>
>>
>>>
>>> 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
>>>>
>>>>
>>> _______________________________________________
>>> cfe-dev mailing list
>>> cfe-dev at lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160125/f443a749/attachment.html>


More information about the cfe-dev mailing list