Author: Nico Weber
Date: 2020-03-31T19:32:55-04:00
New Revision: 7ea64ae3afe4ad98e6753b9f74b30019113f719c

URL: 
https://github.com/llvm/llvm-project/commit/7ea64ae3afe4ad98e6753b9f74b30019113f719c
DIFF: 
https://github.com/llvm/llvm-project/commit/7ea64ae3afe4ad98e6753b9f74b30019113f719c.diff

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

No intended behavior change.

Differential Revision: https://reviews.llvm.org/D77022

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp 
b/clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
index e4b720df6b11..0b8d100992a2 100644
--- a/clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
@@ -508,13 +508,7 @@ void NullabilityChecker::checkEvent(ImplicitNullDerefEvent 
Event) const {
 /// 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


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to