diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-12-08 22:57:11 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-12-08 22:57:11 +0000 |
commit | a5370fb82c8e2f9e7676a78677d2730b2512a082 (patch) | |
tree | 198e499794479eb4b3479f06d330d79ca0f19b27 /llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp | |
parent | ffb1132e52f1bba733305116db82eec86dbe4736 (diff) | |
download | bcm5719-llvm-a5370fb82c8e2f9e7676a78677d2730b2512a082.tar.gz bcm5719-llvm-a5370fb82c8e2f9e7676a78677d2730b2512a082.zip |
Unify implementation of our two different flavours of -Wtautological-compare,
and fold together into a single function.
In so doing, fix a handful of remaining bugs where we would report false
positives or false negatives if we promote a signed value to an unsigned type
for the comparison.
This re-commits r320122 and r320124, minus two changes:
* Comparisons between a constant and a non-constant expression of enumeration
type never warn, not even if the constant is out of range. We should be
warning about the creation of such a constant, not about its use.
* We do not use more precise bit-widths for comparisons against bit-fields.
The more precise diagnostics probably are the right thing, but we should
consider moving them under their own warning flag.
Other than the refactoring, this patch should only change the behavior for the
buggy cases (where the warnings didn't take into account that promotion from
signed to unsigned can leave a range of inaccessible values in the middle of
the promoted type).
llvm-svn: 320211
Diffstat (limited to 'llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp')
0 files changed, 0 insertions, 0 deletions