Implement operator== and != for ranges
authorChris Lattner <sabre@nondot.org>
Tue, 3 Sep 2002 01:05:31 +0000 (01:05 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 3 Sep 2002 01:05:31 +0000 (01:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3571 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/ConstantRange.h

index 553fd166c7685f069aaf9663d1877658544ab2a8..58fa91f282caeb7e99035d23de972ffbdb90b6cc 100644 (file)
@@ -78,6 +78,15 @@ class ConstantRange {
   ///
   uint64_t getSetSize() const;
 
+  /// operator== - Return true if this range is equal to another range.
+  ///
+  bool operator==(const ConstantRange &CR) const {
+    return Lower == CR.Lower && Upper == CR.Upper;
+  }
+  bool operator!=(const ConstantRange &CR) const {
+    return !operator==(CR);
+  }
+
   /// intersect - Return the range that results from the intersection of this
   /// range with another range.  The resultant range is pruned as much as
   /// possible, but there may be cases where elements are included that are in