Add an all() method to BitVector, for testing whether all bits are set.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114830 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2010-09-27 15:48:37 +00:00
parent 4c6809d8e3
commit fab4c9e9df
4 changed files with 27 additions and 0 deletions
+6
View File
@@ -127,6 +127,12 @@ public:
return false;
}
/// all - Returns true if all bits are set.
bool all() const {
// TODO: Optimize this.
return count() == size();
}
/// none - Returns true if none of the bits are set.
bool none() const {
return !any();