summaryrefslogtreecommitdiff
path: root/include/llvm/Support/ConstantRange.h
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2009-11-09 15:36:28 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2009-11-09 15:36:28 +0000
commit95a3be0ba44e96308c65c28ee859acc36149ddd8 (patch)
tree1eaf3e241f96d3c2a582f94c1d3a0f6837bf9587 /include/llvm/Support/ConstantRange.h
parent43cca695a81ddc4a8a1f98d959047ba16edc3d72 (diff)
downloadllvm-95a3be0ba44e96308c65c28ee859acc36149ddd8.tar.gz
llvm-95a3be0ba44e96308c65c28ee859acc36149ddd8.tar.bz2
llvm-95a3be0ba44e96308c65c28ee859acc36149ddd8.tar.xz
add zextOrTrunc and sextOrTrunc methods, that are similar to the ones in APInt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86549 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/ConstantRange.h')
-rw-r--r--include/llvm/Support/ConstantRange.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/Support/ConstantRange.h b/include/llvm/Support/ConstantRange.h
index 3846d46dd3..438ec143e8 100644
--- a/include/llvm/Support/ConstantRange.h
+++ b/include/llvm/Support/ConstantRange.h
@@ -187,6 +187,14 @@ public:
/// truncated to the specified type.
ConstantRange truncate(uint32_t BitWidth) const;
+ /// zextOrTrunc - make this range have the bit width given by \p BitWidth. The
+ /// value is zero extended, truncated, or left alone to make it that width.
+ ConstantRange zextOrTrunc(uint32_t BitWidth) const;
+
+ /// sextOrTrunc - make this range have the bit width given by \p BitWidth. The
+ /// value is sign extended, truncated, or left alone to make it that width.
+ ConstantRange sextOrTrunc(uint32_t BitWidth) const;
+
/// add - Return a new range representing the possible values resulting
/// from an addition of a value in this range and a value in Other.
ConstantRange add(const ConstantRange &Other) const;