Merge and improve code that detects same value in comparisons.
authorRichard Trieu <rtrieu@google.com>
Sat, 21 Sep 2019 03:02:26 +0000 (03:02 +0000)
committerRichard Trieu <rtrieu@google.com>
Sat, 21 Sep 2019 03:02:26 +0000 (03:02 +0000)
commit4c05de8c1d157f4b5e0091a52dbbcce7242ee485
treeb6e3b77c1a45ceba4db1501f5c90cc0f7c155891
parent27a8039171817a38f76adf51793f0d22f84dd78e
Merge and improve code that detects same value in comparisons.

-Wtautological-overlap-compare and self-comparison from -Wtautological-compare
relay on detecting the same operand in different locations.  Previously, each
warning had it's own operand checker.  Now, both are merged together into
one function that each can call.  The function also now looks through member
access and array accesses.

Differential Revision: https://reviews.llvm.org/D66045

llvm-svn: 372453
clang/docs/ReleaseNotes.rst
clang/include/clang/AST/Expr.h
clang/lib/AST/Expr.cpp
clang/lib/Analysis/CFG.cpp
clang/lib/Sema/SemaExpr.cpp
clang/test/Analysis/array-struct-region.cpp
clang/test/Sema/warn-overlap.c
clang/test/SemaCXX/compare-cxx2a.cpp
clang/test/SemaCXX/self-comparison.cpp