[PATCH] D63915: [analyzer] ReturnValueChecker: Model the guaranteed boolean return value of function calls

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 1 18:24:29 PDT 2019


NoQ added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/ReturnValueChecker.cpp:82
+
+        Out << '\'' << Name << "' always returns "
+            << (*Value ? "true" : "false");
----------------
Charusso wrote:
> NoQ wrote:
> > Let's mention the class name as well! Maybe even the fully qualified namespace.
> The class::call part would be tricky, because you need to hook what do you have in the CallDescription. It could be done with the decl-matching part, but then you have to rewrite the CallDescriptionMap interface as `lookup(), key(), value()`, so you could use the hooked info everywhere. It would require too much overhead for a print.
Just use `CXXMethodDecl::getParent()`.


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

https://reviews.llvm.org/D63915





More information about the cfe-commits mailing list