[compiler-rt] eff6b36 - [NFC][sanitizer] Add constexpr to FlatMap::size
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 10 22:24:06 PDT 2021
Author: Vitaly Buka
Date: 2021-10-10T22:23:48-07:00
New Revision: eff6b369bfadd69b077c85ccb6de929ad35e5975
URL: https://github.com/llvm/llvm-project/commit/eff6b369bfadd69b077c85ccb6de929ad35e5975
DIFF: https://github.com/llvm/llvm-project/commit/eff6b369bfadd69b077c85ccb6de929ad35e5975.diff
LOG: [NFC][sanitizer] Add constexpr to FlatMap::size
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 0b3b5d4f8aa1..6940c6607d3c 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_flat_map.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_flat_map.h
@@ -36,6 +36,8 @@ class FlatMap {
internal_memset(map_, 0, sizeof(map_));
}
+ constexpr uptr size() const { return kSize; }
+
void set(uptr idx, u8 val) {
CHECK_LT(idx, kSize);
CHECK_EQ(0U, map_[idx]);
@@ -75,9 +77,9 @@ class TwoLevelMap {
}
}
- uptr size() const { return kSize1 * kSize2; }
- uptr size1() const { return kSize1; }
- uptr size2() const { return kSize2; }
+ constexpr uptr size() const { return kSize1 * kSize2; }
+ constexpr uptr size1() const { return kSize1; }
+ constexpr uptr size2() const { return kSize2; }
void set(uptr idx, u8 val) {
CHECK_LT(idx, kSize1 * kSize2);
More information about the llvm-commits
mailing list