[PATCH] D62688: [Analyzer] Iterator Checkers - Model `empty()` method of containers

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 31 01:30:42 PDT 2019

Szelethus added a comment.

In D62688#1606096 <https://reviews.llvm.org/D62688#1606096>, @baloghadamsoftware wrote:

> In D62688#1549574 <https://reviews.llvm.org/D62688#1549574>, @Szelethus wrote:
> > Hmm, an idea just popped into my head. I'm not sure whether we have a single checker that does so much complicated (and totally awesome) modeling as `IteratorChecker`.  What do you think about a debug checker similar to `debug.ExprInspection`, like `debug.IteratorInspection`?
> Good idea! However, I would do it in a way that we can reuse our existing debug functions in the tests:
>   template <typename Iter> long clang_iterator_position(const Iter&);
>   template <typename Iter, typename Cont> const Cont& clang_iterator_container(const Iter&);
>   template <typename Iter> long clang_container_begin(const Iter&);
>   template <typename Iter> long clang_container_end(const Iter&);
> Then we can nest calls for these functions into call of `clang_analyzer_dump()`, `clang_analyzer_eval()`, `clang_analyzer_denote()` etc.

Sounds awesome! I personally struggle a bit with these patches because the problem is so complex, I think this would help with reviewing tremendously.

  rC Clang



More information about the cfe-commits mailing list