summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_bitvector.h
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2014-02-13 07:44:51 +0000
committerKostya Serebryany <kcc@google.com>2014-02-13 07:44:51 +0000
commit927771be78db63881cd45397155ab3eff9f15780 (patch)
tree7e807e19d5ea3a1518f47aff92a44f1fa08b6681 /lib/sanitizer_common/sanitizer_bitvector.h
parentd47031b9f0439a6adffbb8b1c81ce5898fda4469 (diff)
[sanitizer] more code for deadlock detector, nothing really works yet (except for small unit tests).
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201302 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_bitvector.h')
-rw-r--r--lib/sanitizer_common/sanitizer_bitvector.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_bitvector.h b/lib/sanitizer_common/sanitizer_bitvector.h
index 5f323ce63..da9082f0b 100644
--- a/lib/sanitizer_common/sanitizer_bitvector.h
+++ b/lib/sanitizer_common/sanitizer_bitvector.h
@@ -26,6 +26,7 @@ class BasicBitVector {
uptr size() const { return kSize; }
// No CTOR.
void clear() { bits_ = 0; }
+ void setAll() { bits_ = ~(basic_int_t)0; }
bool empty() const { return bits_ == 0; }
// Returns true if the bit has changed from 0 to 1.
bool setBit(uptr idx) {
@@ -85,6 +86,13 @@ class TwoLevelBitVector {
for (uptr i = 0; i < kLevel1Size; i++)
l1_[i].clear();
}
+ void setAll() {
+ for (uptr i0 = 0; i0 < kLevel1Size; i0++) {
+ l1_[i0].setAll();
+ for (uptr i1 = 0; i1 < BV::kSize; i1++)
+ l2_[i0][i1].setAll();
+ }
+ }
bool empty() {
for (uptr i = 0; i < kLevel1Size; i++)
if (!l1_[i].empty())