[cfe-dev] [clang-tidy] Some possible contributions

Piotr Dziwinski via cfe-dev cfe-dev at lists.llvm.org
Tue Dec 15 15:00:17 PST 2015


On 15/12/15 21:10, Richard via cfe-dev wrote:
> [Please reply *only* to the list and do not include my email directly
> in the To: or Cc: of your reply; otherwise I will not see your reply.
> Thanks.]
>
> In article <56708712.6050402 at gmail.com>,
>      Piotr Dziwinski via cfe-dev <cfe-dev at lists.llvm.org> writes:
>
>> Thanks, I could use your code. My checker only handles local variables
>> declared in functions so that parser or transformer doesn't have to work
>> for globals necessarily.
> I remember now that I was looking into this for a check that would
> split a multiple variable declaration into multiple single variable
> declarations.
>
> This would simplify your job of localizing variable declarations if
> you could depend on each variable declaration being a single variable
> declaration instead of a multiple variable declaration.
>
> With the suggestion made by Firat Kasmis, I should be able to write
> this check now, which would handle globals and struct/class fields.
>
> Thoughts?

Well, taking the assumption that all variable declarations are single 
declarations would simplify my localizing variables checker a great deal 
and make issue #1 obsolete.

On the other hand, I worry about the decreased usability from the user's 
point of view.
He would have to first run the checker that splits multiple 
declarations, applying its fixes everywhere.
Only then, as a second step, he would be able to run the localizing 
variables checker, and use its fixes.

I'm not sure if we want to go in that direction. As far as I know, so 
far there aren't any checkers that make such assumptions, generating 
such implicit dependencies.

Best regards,
Piotr Dziwinski



More information about the cfe-dev mailing list