[PATCH] D99500: [analyzer] Support allocClassWithName in OSObjectCStyleCast checker

Valeriy Savchenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 30 05:44:17 PDT 2021


vsavchenko added a comment.

In D99500#2657675 <https://reviews.llvm.org/D99500#2657675>, @NoQ wrote:

> LGTM! Thanks for formatting ^.^
>
> WDYT about a heuristic that literally matches the source code of the casted expression as plain text to see if it mentions the type? Like, regardless of `allocClassWithName()`, if it mentions the type it probably has something to do with that type.

This idea sounds good in general, but it feels like it can backfire in some cases.  As any regex-like solution, it will have ridiculous corner cases when the name of the type is too generic and can appear as a sub-word.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99500/new/

https://reviews.llvm.org/D99500



More information about the cfe-commits mailing list