[llvm-commits] CVS: llvm/include/llvm/Support/ConstantRange.h

Reid Spencer reid at x10sys.com
Wed Feb 28 09:36:41 PST 2007



Changes in directory llvm/include/llvm/Support:

ConstantRange.h updated: 1.15 -> 1.16
---
Log message:

For PR1205: http://llvm.org/PR1205 :
Convert ConstantRange class to use APInt internally as its value type for
the constant range, instead of ConstantInt.


---
Diffs of the changes:  (+10 -4)

 ConstantRange.h |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)


Index: llvm/include/llvm/Support/ConstantRange.h
diff -u llvm/include/llvm/Support/ConstantRange.h:1.15 llvm/include/llvm/Support/ConstantRange.h:1.16
--- llvm/include/llvm/Support/ConstantRange.h:1.15	Sat Feb 10 18:58:49 2007
+++ llvm/include/llvm/Support/ConstantRange.h	Wed Feb 28 11:36:23 2007
@@ -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 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 @@
   ///
   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 @@
 
   /// 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 @@
 
   /// 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.
   ///






More information about the llvm-commits mailing list