[PATCH] D47554: [analyzer] Check for dead/impossible status checks

George Karpenkov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 12 18:19:54 PDT 2018


george.karpenkov added subscribers: aaron.ballman, alexfh.
george.karpenkov added a comment.
Herald added a subscriber: mikhail.ramalho.

Getting there! Sorry for the delay. Would it be possible to rewrite the remaining imperative code using matchers?
👍 on defining your own matcher. However, that would probably need to go in a separate PR (with tests), @alexfh and @aaron.ballman can help with the review.



================
Comment at: lib/StaticAnalyzer/Checkers/DeadStatusChecker.cpp:33
+
+    const Expr *hasNullptr(const BinaryOperator *BO) const {
+      const Expr *ret = nullptr;
----------------
Could this be rewritten as a matcher instead? Surely there must be one comparing the literal to null?


Repository:
  rC Clang

https://reviews.llvm.org/D47554





More information about the cfe-commits mailing list