summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-10-01 20:34:04 +0000
committerAnna Zaks <ganna@apple.com>2012-10-01 20:34:04 +0000
commit97c7ce33680253d0344d41c073d6a1b8ca360283 (patch)
tree3398a4b743a1e3260fadd9fbf24fd976a89babae /clang/lib/StaticAnalyzer
parentbfacf17b8b99f2c6d51bf570a11d6e6a5d3a2a39 (diff)
downloadbcm5719-llvm-97c7ce33680253d0344d41c073d6a1b8ca360283.tar.gz
bcm5719-llvm-97c7ce33680253d0344d41c073d6a1b8ca360283.zip
Move isObjCSelf into Expr.
llvm-svn: 164966
Diffstat (limited to 'clang/lib/StaticAnalyzer')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp
index 5f944038242..a88b6368e82 100644
--- a/clang/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp
@@ -90,8 +90,6 @@ class IvarInvalidationChecker :
/// Statement visitor, which walks the method body and flags the ivars
/// referenced in it (either directly or via property).
class MethodCrawler : public ConstStmtVisitor<MethodCrawler> {
- const ObjCMethodDecl *EnclosingMethod;
-
/// The set of Ivars which need to be invalidated.
IvarSet &IVars;
@@ -138,15 +136,13 @@ class IvarInvalidationChecker :
void check(const Expr *E);
public:
- MethodCrawler(const ObjCMethodDecl *InMeth,
- IvarSet &InIVars,
+ MethodCrawler(IvarSet &InIVars,
bool &InCalledAnotherInvalidationMethod,
const MethToIvarMapTy &InPropertySetterToIvarMap,
const MethToIvarMapTy &InPropertyGetterToIvarMap,
const PropToIvarMapTy &InPropertyToIvarMap,
ASTContext &InCtx)
- : EnclosingMethod(InMeth),
- IVars(InIVars),
+ : IVars(InIVars),
CalledAnotherInvalidationMethod(InCalledAnotherInvalidationMethod),
PropertySetterToIvarMap(InPropertySetterToIvarMap),
PropertyGetterToIvarMap(InPropertyGetterToIvarMap),
@@ -363,7 +359,7 @@ void IvarInvalidationChecker::checkASTDecl(const ObjCMethodDecl *D,
// Check which ivars have been invalidated in the method body.
bool CalledAnotherInvalidationMethod = false;
- MethodCrawler(D, Ivars,
+ MethodCrawler(Ivars,
CalledAnotherInvalidationMethod,
PropSetterToIvarMap,
PropGetterToIvarMap,
@@ -518,12 +514,9 @@ void IvarInvalidationChecker::MethodCrawler::VisitObjCMessageExpr(
// Stop if we are calling '[self invalidate]'.
if (Receiver && isInvalidationMethod(MD))
- if (const DeclRefExpr *RD =
- dyn_cast<DeclRefExpr>(Receiver->IgnoreParenCasts())) {
- if (RD->getDecl() == EnclosingMethod->getSelfDecl()) {
- CalledAnotherInvalidationMethod = true;
- return;
- }
+ if (Receiver->isObjCSelfExpr()) {
+ CalledAnotherInvalidationMethod = true;
+ return;
}
// Check if we call a setter and set the property to 'nil'.
OpenPOWER on IntegriCloud