diff options
author | Chris Lattner <sabre@nondot.org> | 2002-09-03 01:05:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-09-03 01:05:31 +0000 |
commit | 625ea21205d1fb6f175e22477f55dd485b7c65c4 (patch) | |
tree | 66460bcabc5d6b5478efde840fb11fc4ba681b76 /include/llvm/Support | |
parent | eaee9e131779613572913b6ada3d230176530e11 (diff) | |
download | external_llvm-625ea21205d1fb6f175e22477f55dd485b7c65c4.zip external_llvm-625ea21205d1fb6f175e22477f55dd485b7c65c4.tar.gz external_llvm-625ea21205d1fb6f175e22477f55dd485b7c65c4.tar.bz2 |
Implement operator== and != for ranges
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3571 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support')
-rw-r--r-- | include/llvm/Support/ConstantRange.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/Support/ConstantRange.h b/include/llvm/Support/ConstantRange.h index 553fd16..58fa91f 100644 --- a/include/llvm/Support/ConstantRange.h +++ b/include/llvm/Support/ConstantRange.h @@ -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 |