[prev in list] [next in list] [prev in thread] [next in thread]
List: cfe-commits
Subject: [clang] 7ea64ae - [analyzer] Use IgnoreImpCasts() instead of reimplementing it.
From: Nico Weber via cfe-commits <cfe-commits () lists ! llvm ! org>
Date: 2020-03-31 23:33:10
Message-ID: 5e83d336.1c69fb81.1e3bf.126b () mx ! google ! com
[Download RAW message or body]
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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic