Ordinary patch for PR1255.
[oota-llvm.git] / include / llvm / ConstantRangesSet.h
index 2d3ee8bafafe733eccd6770aad986487df43af34..a3f082f822874be41d2253fc40ff15ca0e8f642c 100644 (file)
@@ -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.