diff options
Diffstat (limited to 'include/llvm/Support')
-rw-r--r-- | include/llvm/Support/ConstantRangesSet.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/llvm/Support/ConstantRangesSet.h b/include/llvm/Support/ConstantRangesSet.h index 2d3ee8b..a3f082f 100644 --- a/include/llvm/Support/ConstantRangesSet.h +++ b/include/llvm/Support/ConstantRangesSet.h @@ -48,8 +48,15 @@ class ConstantRangesSet { Constant *Array; public: + bool IsWide; + // implicit - ConstantRangesSet(Constant *V) : Array(V) {} + ConstantRangesSet(Constant *V) : Array(V) { + ArrayType *ArrTy = cast<ArrayType>(Array->getType()); + VectorType *VecTy = cast<VectorType>(ArrTy->getElementType()); + IntegerType *IntTy = cast<IntegerType>(VecTy->getElementType()); + IsWide = IntTy->getBitWidth() > 64; + } operator Constant*() { return Array; } operator const Constant*() const { return Array; } @@ -230,6 +237,13 @@ public: return cast<ArrayType>(Array->getType())->getNumElements(); } + bool isWideNumberFormat() const { return IsWide; } + + bool isSingleNumber(unsigned idx) const { + Constant *CV = Array->getAggregateElement(idx); + return cast<VectorType>(CV->getType())->getNumElements() == 1; + } + /// Returns set the size, that equals number of all values + sizes of all /// ranges. /// Ranges set is considered as flat numbers collection. |