[PATCH] D32906: [Analyzer] Iterator Checker - Part 10: Support for iterators passed as parameter

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 5 07:57:58 PDT 2017


NoQ added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp:711
 
+void IteratorChecker::checkBeginFunction(CheckerContext &C) const {
+  // Copy state of iterator arguments to iterator parameters
----------------
takuto.ikuta wrote:
> Can we use `const CheckerContext &C` here?
That's a checker callback called by the engine, not much we can change in its signature. Additionally, the `addTransition` method we use is sufficiently non-`const`, and that's the whole point of passing the checker context in every callback.

Anyway, `CheckerContext` is mostly a utility and is short-lived, and it doesn't make much sense to think of it as const.


https://reviews.llvm.org/D32906





More information about the cfe-commits mailing list