summaryrefslogtreecommitdiff
path: root/include/llvm/Support/ConstantRange.h
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2007-04-07 15:41:33 +0000
committerNick Lewycky <nicholas@mxc.ca>2007-04-07 15:41:33 +0000
commite32157c6098ee7536315e9793eed98d21bf71fd0 (patch)
tree9845f84301447c9a35a9c84b73dbf01189fc2c43 /include/llvm/Support/ConstantRange.h
parent8aaa40610cb327ff4568cf839a6b2d7c18aaa89b (diff)
downloadllvm-e32157c6098ee7536315e9793eed98d21bf71fd0.tar.gz
llvm-e32157c6098ee7536315e9793eed98d21bf71fd0.tar.bz2
llvm-e32157c6098ee7536315e9793eed98d21bf71fd0.tar.xz
Add signExtend to ConstantRange, to complement zeroExtend and truncate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35733 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/ConstantRange.h')
-rw-r--r--include/llvm/Support/ConstantRange.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Support/ConstantRange.h b/include/llvm/Support/ConstantRange.h
index 05859b4111..020fb095ec 100644
--- a/include/llvm/Support/ConstantRange.h
+++ b/include/llvm/Support/ConstantRange.h
@@ -157,6 +157,12 @@ class ConstantRange {
/// zero extended to BitWidth.
ConstantRange zeroExtend(uint32_t BitWidth) const;
+ /// signExtend - Return a new range in the specified integer type, which must
+ /// be strictly larger than the current type. The returned range will
+ /// correspond to the possible range of values if the source range had been
+ /// sign extended to BitWidth.
+ ConstantRange signExtend(uint32_t BitWidth) const;
+
/// truncate - Return a new range in the specified integer type, which must be
/// strictly smaller than the current type. The returned range will
/// correspond to the possible range of values if the source range had been