From 07d063700048982b4c62d6b3460d22d88e11a3ea Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Sat, 7 Aug 2010 00:42:06 +0000 Subject: Add a convenience constructor. llvm-svn: 110493 --- llvm/lib/Support/ConstantRange.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/Support/ConstantRange.cpp') diff --git a/llvm/lib/Support/ConstantRange.cpp b/llvm/lib/Support/ConstantRange.cpp index 2746f7aaaa5..fb0442823c4 100644 --- a/llvm/lib/Support/ConstantRange.cpp +++ b/llvm/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) { -- cgit v1.2.3