summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerValueBitMap.h
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2017-01-27 00:09:59 +0000
committerKostya Serebryany <kcc@google.com>2017-01-27 00:09:59 +0000
commit7f058972ee9245519e8aefa7405a2cb702d27ac4 (patch)
tree78c7b6b4863c01661066b1d96a33e0f23b8d7d2f /llvm/lib/Fuzzer/FuzzerValueBitMap.h
parent8f713190e779f093f3d180e7ed0122879464a3fe (diff)
downloadbcm5719-llvm-7f058972ee9245519e8aefa7405a2cb702d27ac4.tar.gz
bcm5719-llvm-7f058972ee9245519e8aefa7405a2cb702d27ac4.zip
[libFuzzer] simplify the value profile code and disable asan/msan on it
llvm-svn: 293236
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerValueBitMap.h')
-rw-r--r--llvm/lib/Fuzzer/FuzzerValueBitMap.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerValueBitMap.h b/llvm/lib/Fuzzer/FuzzerValueBitMap.h
index 0692acd13ee..22e06641fa1 100644
--- a/llvm/lib/Fuzzer/FuzzerValueBitMap.h
+++ b/llvm/lib/Fuzzer/FuzzerValueBitMap.h
@@ -19,7 +19,7 @@ namespace fuzzer {
// A bit map containing kMapSizeInWords bits.
struct ValueBitMap {
static const size_t kMapSizeInBits = 65371; // Prime.
- static const size_t kMapSizeInBitsAligned = 65536; // 2^16
+ static const size_t kMapSizeInBitsAligned = 1 << 16; // 2^16
static const size_t kBitsInWord = (sizeof(uintptr_t) * 8);
static const size_t kMapSizeInWords = kMapSizeInBitsAligned / kBitsInWord;
public:
@@ -29,6 +29,7 @@ struct ValueBitMap {
// Computes a hash function of Value and sets the corresponding bit.
// Returns true if the bit was changed from 0 to 1.
+ ATTRIBUTE_NO_SANITIZE_ALL
inline bool AddValue(uintptr_t Value) {
uintptr_t Idx = Value < kMapSizeInBits ? Value : Value % kMapSizeInBits;
uintptr_t WordIdx = Idx / kBitsInWord;
@@ -69,6 +70,7 @@ struct ValueBitMap {
}
template <class Callback>
+ ATTRIBUTE_NO_SANITIZE_ALL
void ForEach(Callback CB) {
for (size_t i = 0; i < kMapSizeInWords; i++)
if (uintptr_t M = Map[i])
OpenPOWER on IntegriCloud