]> granicus.if.org Git - clang/commit
[analyzer] Check all conditions in a chained if against each other.
authorJordan Rose <jordan_rose@apple.com>
Tue, 11 Mar 2014 16:52:29 +0000 (16:52 +0000)
committerJordan Rose <jordan_rose@apple.com>
Tue, 11 Mar 2014 16:52:29 +0000 (16:52 +0000)
commit22cc9b0c3b3413d3b8e81ef06415560c8a5e795e
tree0a31cf486865c5879d9b8f74dfeacdbaf76ae0ac
parent0c1843b3dac3db7325213632b75ccb30b6f2134c
[analyzer] Check all conditions in a chained if against each other.

Like the binary operator check of r201702, this actually checks the
condition of every if in a chain against every other condition, an
O(N^2) operation. In most cases N should be small enough to make this
practical, and checking all cases like this makes it much more likely
to catch a copy-paste error within the same series of branches.

Part of IdenticalExprChecker; patch by Daniel Fahlgren!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203585 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/IdenticalExprChecker.cpp
test/Analysis/identical-expressions.cpp