]> granicus.if.org Git - clang/commitdiff
[analyzer] Use getParentIgnoreParenCasts instead of doing it by hand.
authorJordan Rose <jordan_rose@apple.com>
Fri, 20 Sep 2013 16:51:50 +0000 (16:51 +0000)
committerJordan Rose <jordan_rose@apple.com>
Fri, 20 Sep 2013 16:51:50 +0000 (16:51 +0000)
Apart from being more compact and already implemented, this also handles the
case where the parent is null. (It does also ignore all casts, not just
implicit ones, but this is more efficient to test and in the case we care
about---a message in a PseudoObjectExpr---there should only be implicit casts
anyway.

This should fix our internal buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191094 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/CallEvent.cpp

index 4f8683f78538573779272bcbc3437d9d27572e77..64a4f8d69e2270a6f4fe5239a36f0896deeb7d8f 100644 (file)
@@ -688,9 +688,7 @@ ObjCMessageKind ObjCMethodCall::getMessageKind() const {
 
     // Find the parent, ignoring implicit casts.
     ParentMap &PM = getLocationContext()->getParentMap();
-    const Stmt *S = PM.getParent(getOriginExpr());
-    while (isa<ImplicitCastExpr>(S))
-      S = PM.getParent(S);
+    const Stmt *S = PM.getParentIgnoreParenCasts(getOriginExpr());
 
     // Check if parent is a PseudoObjectExpr.
     if (const PseudoObjectExpr *POE = dyn_cast_or_null<PseudoObjectExpr>(S)) {