]> granicus.if.org Git - clang/commit
[analyzer] Extend IdenticalExprChecker to check logical and bitwise expressions.
authorJordan Rose <jordan_rose@apple.com>
Wed, 19 Feb 2014 17:44:16 +0000 (17:44 +0000)
committerJordan Rose <jordan_rose@apple.com>
Wed, 19 Feb 2014 17:44:16 +0000 (17:44 +0000)
commit2eae2903cfa0c5bf185b0ff8b90b5c95a0bc2f9e
tree0254457ebbc27b79fdab1b2e8eab6103d99277d6
parentf460d79f9854763df2377f0909ab2999aa78d013
[analyzer] Extend IdenticalExprChecker to check logical and bitwise expressions.

IdenticalExprChecker now warns if any expressions in a logical or bitwise
chain (&&, ||, &, |, or ^) are the same. Unlike the previous patch, this
actually checks all subexpressions against each other (an O(N^2) operation,
but N is likely to be small).

Patch by Daniel Fahlgren!

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