diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/ScalarEvolution.h | 4 | ||||
-rw-r--r-- | include/llvm/Support/ConstantRange.h | 15 |
2 files changed, 13 insertions, 6 deletions
diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h index 4aac284..b950ca4 100644 --- a/include/llvm/Analysis/ScalarEvolution.h +++ b/include/llvm/Analysis/ScalarEvolution.h @@ -85,6 +85,10 @@ namespace llvm { /// virtual const Type *getType() const = 0; + /// getBitWidth - Get the bit width of the type, if it has one, 0 otherwise. + /// + uint32_t getBitWidth() const; + /// replaceSymbolicValuesWithConcrete - If this SCEV internally references /// the symbolic value "Sym", construct and return a new SCEV that produces /// the same value, but which uses the concrete value Conc instead of the diff --git a/include/llvm/Support/ConstantRange.h b/include/llvm/Support/ConstantRange.h index b7e9818..ae36f42 100644 --- a/include/llvm/Support/ConstantRange.h +++ b/include/llvm/Support/ConstantRange.h @@ -37,7 +37,6 @@ namespace llvm { class Constant; -class ConstantInt; class Type; class ConstantRange { @@ -66,11 +65,11 @@ class ConstantRange { /// getLower - Return the lower value for this range... /// - ConstantInt *getLower() const; + const APInt &getLower() const { return Lower; } /// getUpper - Return the upper value for this range... /// - ConstantInt *getUpper() const; + const APInt &getUpper() const { return Upper; } /// getType - Return the LLVM data type of this range. /// @@ -94,12 +93,16 @@ class ConstantRange { /// The isSigned parameter indicates whether the comparisons should be /// performed as if the values are signed or not. /// - bool contains(ConstantInt *Val, bool isSigned) const; + bool contains(const APInt &Val, bool isSigned) const; /// getSingleElement - If this set contains a single element, return it, /// otherwise return null. /// - ConstantInt *getSingleElement() const; + const APInt *getSingleElement() const { + if (Upper == Lower + 1) + return &Lower; + return 0; + } /// isSingleElement - Return true if this set contains exactly one member. /// @@ -120,7 +123,7 @@ class ConstantRange { /// subtract - Subtract the specified constant from the endpoints of this /// constant range. - ConstantRange subtract(ConstantInt *CI) const; + ConstantRange subtract(const APInt &CI) const; /// intersectWith - Return the range that results from the intersection of /// this range with another range. The resultant range is pruned as much as |