[compiler-rt] 384ec7d - [NFC][sanitizer] DCHECKs in hot code
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 24 18:37:38 PDT 2021
Author: Vitaly Buka
Date: 2021-10-24T18:37:23-07:00
New Revision: 384ec7dc8c361574b86f5117c5e00fd6a005f680
URL: https://github.com/llvm/llvm-project/commit/384ec7dc8c361574b86f5117c5e00fd6a005f680
DIFF: https://github.com/llvm/llvm-project/commit/384ec7dc8c361574b86f5117c5e00fd6a005f680.diff
LOG: [NFC][sanitizer] DCHECKs in hot code
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_flat_map.h
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_flat_map.h b/compiler-rt/lib/sanitizer_common/sanitizer_flat_map.h
index a9055e1706ad..038ee24e6bd8 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_flat_map.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_flat_map.h
@@ -43,14 +43,12 @@ class FlatMap {
}
T &operator[](uptr idx) {
- CHECK_LT(idx, kSize);
- // FIXME: CHECK may be too expensive here.
+ DCHECK_LT(idx, kSize);
return map_[idx];
}
const T &operator[](uptr idx) const {
- CHECK_LT(idx, kSize);
- // FIXME: CHECK may be too expensive here.
+ DCHECK_LT(idx, kSize);
return map_[idx];
}
@@ -106,13 +104,13 @@ class TwoLevelMap {
}
const T &operator[](uptr idx) const {
- CHECK_LT(idx, kSize1 * kSize2);
+ DCHECK_LT(idx, kSize1 * kSize2);
T *map2 = GetOrCreate(idx / kSize2);
return *AddressSpaceView::Load(&map2[idx % kSize2]);
}
T &operator[](uptr idx) {
- CHECK_LT(idx, kSize1 * kSize2);
+ DCHECK_LT(idx, kSize1 * kSize2);
T *map2 = GetOrCreate(idx / kSize2);
return *AddressSpaceView::LoadWritable(&map2[idx % kSize2]);
}
@@ -123,7 +121,7 @@ class TwoLevelMap {
}
T *Get(uptr idx) const {
- CHECK_LT(idx, kSize1);
+ DCHECK_LT(idx, kSize1);
return reinterpret_cast<T *>(
atomic_load(&map1_[idx], memory_order_acquire));
}
More information about the llvm-commits
mailing list