summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-02-12 18:50:03 +0000
committerTed Kremenek <kremenek@apple.com>2011-02-12 18:50:03 +0000
commitc059798756b4ffca77a209178dbcc1850a62b4a0 (patch)
tree64af786b931962cc384349656e37f1bc3e030155 /clang/lib
parent210ce0feb50becca2f2ef619175b2e905c435598 (diff)
downloadbcm5719-llvm-c059798756b4ffca77a209178dbcc1850a62b4a0.tar.gz
bcm5719-llvm-c059798756b4ffca77a209178dbcc1850a62b4a0.zip
Teach the IdempotentOperations checker to ignore property setters.
llvm-svn: 125443
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp
index 633648ec6c2..7f64f8e2c40 100644
--- a/clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp
@@ -357,8 +357,15 @@ void IdempotentOperationChecker::PostVisitBinaryOperator(
const BinaryOperator *B) {
// Add the ExplodedNode we just visited
BinaryOperatorData &Data = hash[B];
- assert(isa<BinaryOperator>(cast<StmtPoint>(C.getPredecessor()
- ->getLocation()).getStmt()));
+
+ const Stmt *predStmt
+ = cast<StmtPoint>(C.getPredecessor()->getLocation()).getStmt();
+
+ // Ignore implicit calls to setters.
+ if (isa<ObjCPropertyRefExpr>(predStmt))
+ return;
+
+ assert(isa<BinaryOperator>(predStmt));
Data.explodedNodes.Add(C.getPredecessor());
}
OpenPOWER on IntegriCloud