diff options
author | Owen Anderson <resistor@mac.com> | 2010-08-07 00:42:06 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2010-08-07 00:42:06 +0000 |
commit | 634bab148cacc8cc8647172056c26c8bc3f60a65 (patch) | |
tree | 8c075cc7f9db8bd3bce5ffd49e1c9c5687965900 /lib/Support/ConstantRange.cpp | |
parent | 95102149362cd76c700b80dd1d1c618cc7f333db (diff) |
Add a convenience constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110493 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/ConstantRange.cpp')
-rw-r--r-- | lib/Support/ConstantRange.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Support/ConstantRange.cpp b/lib/Support/ConstantRange.cpp index 2746f7aaaa..fb0442823c 100644 --- a/lib/Support/ConstantRange.cpp +++ b/lib/Support/ConstantRange.cpp @@ -21,6 +21,7 @@ // //===----------------------------------------------------------------------===// +#include "llvm/Constants.h" #include "llvm/Support/ConstantRange.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" @@ -39,6 +40,8 @@ ConstantRange::ConstantRange(uint32_t BitWidth, bool Full) { /// Initialize a range to hold the single specified value. /// ConstantRange::ConstantRange(const APInt & V) : Lower(V), Upper(V + 1) {} +ConstantRange::ConstantRange(const ConstantInt *V) + : Lower(V->getValue()), Upper(V->getValue() + 1) {} ConstantRange::ConstantRange(const APInt &L, const APInt &U) : Lower(L), Upper(U) { |