[PATCH] D77022: [analyzer] Use IgnoreImpCasts() instead of reimplementing it.

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 31 16:35:26 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG7ea64ae3afe4: [analyzer] Use IgnoreImpCasts() instead of reimplementing it. (authored by thakis).
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77022

Files:
  clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp


Index: clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
===================================================================
--- clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
+++ clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
@@ -508,13 +508,7 @@
 /// return expressions of ObjC types when the return type of the function or
 /// method is non-null but the express is not.
 static const Expr *lookThroughImplicitCasts(const Expr *E) {
-  assert(E);
-
-  while (auto *ICE = dyn_cast<ImplicitCastExpr>(E)) {
-    E = ICE->getSubExpr();
-  }
-
-  return E;
+  return E->IgnoreImpCasts();
 }
 
 /// This method check when nullable pointer or null value is returned from a


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77022.254043.patch
Type: text/x-patch
Size: 696 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200331/8d4a5031/attachment.bin>


More information about the cfe-commits mailing list