diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-02-28 17:36:23 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-02-28 17:36:23 +0000 |
commit | 663e711dc235cae94eb50abb1c0571fd0b3a6a35 (patch) | |
tree | c949fcf870d8391360aa846b29b15741e8ebceb8 /include/llvm/Support/ConstantRange.h | |
parent | 94900774ad65d69274d564bac027d56a5801c7e2 (diff) |
For PR1205:
Convert ConstantRange class to use APInt internally as its value type for
the constant range, instead of ConstantInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34745 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/ConstantRange.h')
-rw-r--r-- | include/llvm/Support/ConstantRange.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/include/llvm/Support/ConstantRange.h b/include/llvm/Support/ConstantRange.h index 2e032903ff..65b17f5f67 100644 --- a/include/llvm/Support/ConstantRange.h +++ b/include/llvm/Support/ConstantRange.h @@ -30,6 +30,7 @@ #ifndef LLVM_SUPPORT_CONSTANT_RANGE_H #define LLVM_SUPPORT_CONSTANT_RANGE_H +#include "llvm/ADT/APInt.h" #include "llvm/Support/DataTypes.h" #include "llvm/Support/Streams.h" #include <iosfwd> @@ -40,7 +41,9 @@ class ConstantInt; class Type; class ConstantRange { - ConstantInt *Lower, *Upper; + APInt Lower, Upper; + static ConstantRange intersect1Wrapped(const ConstantRange &LHS, + const ConstantRange &RHS, bool sign); public: /// Initialize a full (the default) or empty set for the specified type. /// @@ -56,6 +59,9 @@ class ConstantRange { /// ConstantRange(Constant *Lower, Constant *Upper); + /// @brief Initialize a range of values explicitly. + ConstantRange(const APInt& Lower, const APInt& Upper); + /// Initialize a set of values that all satisfy the predicate with C. The /// predicate should be either an ICmpInst::Predicate or FCmpInst::Predicate /// value. @@ -64,11 +70,11 @@ class ConstantRange { /// getLower - Return the lower value for this range... /// - ConstantInt *getLower() const { return Lower; } + ConstantInt *getLower() const; /// getUpper - Return the upper value for this range... /// - ConstantInt *getUpper() const { return Upper; } + ConstantInt *getUpper() const; /// getType - Return the LLVM data type of this range. /// @@ -105,7 +111,7 @@ class ConstantRange { /// getSetSize - Return the number of elements in this set. /// - uint64_t getSetSize() const; + APInt getSetSize() const; /// operator== - Return true if this range is equal to another range. /// |