zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.
llvm-svn: 121120
Fix zeroExtend and signExtend to support empty sets, and to return the smallest
possible result set which contains the extension of each element in their
inputs. For example zext i8 [100, 10) to i16 is now [0, 256), not i16 [100, 10)
which contains 63446 members.
llvm-svn: 113187
- remove ashr which never worked.
- fix lshr and shl and add tests.
- remove dead function "intersect1Wrapped".
- add a new sub method to subtract ranges, with test.
llvm-svn: 110861
equality. Prefer EXPECT_EQ(foo, Full) over EXPECT_TRUE(foo.isFullSet()) because
the former will print out the contents of the constant range that failed.
llvm-svn: 81094
This can break when there are implicit conversions from types raw_ostream
understands but std::ostream doesn't, but it increases the number of cases that
Just Work.
llvm-svn: 81093
means that raw_ostream no longer has to #include <iosfwd>. Nothing in llvm
should use raw_os_ostream.h, but llvm-gcc and some unit tests do.
llvm-svn: 79886
all values belonging to the intersection will belong to the resulting range.
The former was inconsistent about that point (either way is fine, just pick
one.) This is part of PR4545.
llvm-svn: 76289
A full set is a constant range that represents any number. If you take the
umax of that and [5, 10) you end up with [5, INT_MAX] because the values less
than 5 would be umax's against a value which is at least 5.
llvm-svn: 75372
merge the new functionality and unittests into ConstantRange. Thanks to
Nick Lewycky for pointing out that it isn't necessary to have two separate
classes here.
llvm-svn: 75191
what ConstantRange does for unsigned integers. Factor out a
common base class for common functionality.
Add some new functions for performing arithmetic on constant
ranges. Some of these are currently just stubbed out with
conservative implementations.
Add unittests for ConstantRange and ConstantSignedRange.
llvm-svn: 75177