[PATCH] D53856: [analyzer] Put llvm.Conventions back in alpha

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 2 15:30:58 PDT 2018


NoQ added a comment.

In https://reviews.llvm.org/D53856#1285373, @rnkovacs wrote:

> In https://reviews.llvm.org/D53856#1280408, @Szelethus wrote:
>
> > In https://reviews.llvm.org/D53856#1279887, @NoQ wrote:
> >
> > > This might be also covered by @rnkovacs's string buffer escape checker - either already or eventually, it'll become just yet another string view API that the checker supports.
> >
> >
> > I thought about that too, adding some `StringRef` specific information to that checker makes more sense then essentially duplicating the logic. However, what @MTC mentioned about `ArrayRef<T>` would be a neat addition too, and maybe it isn't worth making `InnerPointerChecker` //that// general.
> >
> > @rnkovacs, any thoughts?
>
>
> I agree, adding `StringRef` support to the buffer escape checker around the time we add `string_view` will be great. Also, we named it `InnerPointerChecker` to allow for covering more general structures in the future, so I guess `ArrayRef`s may also be added eventually. Unfortunately, I have some other tasks to finish before getting to these, so I think this patch is fine now as-is.


I also agree that we should generally try harder to determine common logic behind checkers. Eg., `MallocChecker` and `StreamChecker` should be the same checker, or at least re-use a large chunk of common code that implements the overall idea of "one function produces a symbol, then another function consumes it, and the consuming function always needs to be called on that symbol, while the symbol should not be used in certain (almost all) manners after it is consumed".


Repository:
  rC Clang

https://reviews.llvm.org/D53856





More information about the cfe-commits mailing list