HomePhabricator

[analyzer] Improved RangeSet::Negate support of unsigned ranges

Authored by ASDenysPetrov on Apr 9 2020, 6:20 AM.

Description

[analyzer] Improved RangeSet::Negate support of unsigned ranges

Summary:
This fixes https://bugs.llvm.org/show_bug.cgi?id=41588
RangeSet Negate function shall handle unsigned ranges as well as signed ones.
RangeSet getRangeForMinusSymbol function shall use wider variety of ranges, not only concrete value ranges.
RangeSet Intersect functions shall not produce assertions.

Changes:
Improved safety of RangeSet::Intersect function. Added isEmpty() check to prevent an assertion.
Added support of handling unsigned ranges to RangeSet::Negate and RangeSet::getRangeForMinusSymbol.
Extended RangeSet::getRangeForMinusSymbol to return not only range sets with single value [n,n], but with wide ranges [n,m].
Added unit test for Negate function.
Added regression tests for unsigned values.

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

Details

Committed
ASDenysPetrovMay 25 2020, 8:52 AM
Differential Revision
D77802: [analyzer] Improved RangeSet::Negate support of unsigned ranges
Parents
rG7c298c104bfe: [PGO] Fix computation of function Hash
Branches
Unknown
Tags
Unknown