]> granicus.if.org Git - clang/commit
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)
commitdbb59f794229857ec4acc86f12f3f9172ec253f6
tree25a8129b9adbbe158f87e6d84c477f5c5fae9f51
parentca66650e21db892f1acb156d9f1d082591c0eaac
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372453 91177308-0d34-0410-b5e6-96231b3b80d8
docs/ReleaseNotes.rst
include/clang/AST/Expr.h
lib/AST/Expr.cpp
lib/Analysis/CFG.cpp
lib/Sema/SemaExpr.cpp
test/Analysis/array-struct-region.cpp
test/Sema/warn-overlap.c
test/SemaCXX/compare-cxx2a.cpp
test/SemaCXX/self-comparison.cpp