[cfe-dev] [clang-tidy] Addition info in YAML report

Alexander Kornienko via cfe-dev cfe-dev at lists.llvm.org
Thu Jan 14 02:50:15 PST 2016


Could you send the patch via LLVM Phabricator
<http://llvm.org/docs/Phabricator.html>, please? It's the preferred way to
send clang-tidy patches.

On Thu, Jan 14, 2016 at 10:46 AM, Ilia Gromov <ilia.gromov at oracle.com>
wrote:

> I made a *patch* which adds check ID and filed a bug [
> https://llvm.org/bugs/show_bug.cgi?id=26132 ] (See the patch there).
> I hope it can be reviewed and applied soon, because it will be really
> useful to be able to group and filter results after clang-tidy did his work.
>
> Thanks,
> Ilia Gromov
>
> On 12/22/2015 11:51 AM, Manuel Klimek wrote:
>
> Adding the check id sounds like a useful feature.
>
> On Mon, Dec 21, 2015, 1:44 PM Ilia Gromov via cfe-dev <
> cfe-dev at lists.llvm.org> wrote:
>
>> Hi,
>>
>> clang-tidy saves a YAML report when the option '-export-fixes=...> is
>> used.
>>
>> ---
>> MainSourceFile:  ''
>> Replacements:
>>    - FilePath:        /home/ilia/clang/sandbox/main.cpp
>>      Offset:          388
>>      Length:          8
>>      ReplacementText: '// TODO(ilia): '
>> ...
>>
>> This information is sufficient to apply generated replacements later.
>> However, there is no information about a check which had found this
>> warning.
>>
>> Is there a way to know check ID for this replacement?
>>
>>
>> PS:
>> In clang-modernize this problem was solved with a workaround:
>> When in "serialize-replacements" mode, clang-modernize can't inspect
>> sources more than for 1 check ID.
>> So, when I run
>>
>>      ./clang-modernize -serialize-replacements
>> -serialize-dir=/tmp/modernize/add-override112233 /tmp/source.cpp
>>
>> I'm sure that a YAML file in /tmp/modernize/add-override112233 is for
>> "add-override" check.Repeat this for all 6 checks and, as a result, you
>> can group replacements by check ID.
>> clang-tidy allows to specify any number of check IDs when saving to
>> YAML. And it has way more checks than 6. So, this workaround won't work
>> well in case of clang-tidy
>>
>> --
>>
>> Thanks,
>> Ilia Gromov
>> _______________________________________________
>> 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/20160114/bd892121/attachment.html>


More information about the cfe-dev mailing list