Add a new isSignWrappedSet() method to ConstantRange.

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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113187 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky
2010-09-06 23:52:49 +00:00
parent c5cebeb3cb
commit 32cda119ef
3 changed files with 42 additions and 7 deletions
+5
View File
@@ -92,6 +92,11 @@ public:
///
bool isWrappedSet() const;
/// isSignWrappedSet - Return true if this set wraps around the INT_MIN of
/// its bitwidth, for example: i8 [120, 140).
///
bool isSignWrappedSet() const;
/// contains - Return true if the specified value is in the set.
///
bool contains(const APInt &Val) const;