[libFuzzer] speculatively trying to fix the Mac build; second attempt

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285262 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Kostya Serebryany 2016-10-27 00:36:38 +00:00
parent eb87cccbef
commit 56a90b623f
2 changed files with 4 additions and 14 deletions

View File

@ -262,7 +262,10 @@ void TracePC::HandleCmp(void *PC, T Arg1, T Arg2) {
uint64_t ArgXor = Arg1 ^ Arg2;
uint64_t ArgDistance = __builtin_popcountl(ArgXor) + 1; // [1,65]
uintptr_t Idx = ((PCuint & 4095) + 1) * ArgDistance;
TORCInsert(ArgXor, Arg1, Arg2);
if (sizeof(T) == 4)
TORC4.Insert(ArgXor, Arg1, Arg2);
else if (sizeof(T) == 8)
TORC8.Insert(ArgXor, Arg1, Arg2);
HandleValueProfile(Idx);
}

View File

@ -107,19 +107,6 @@ private:
static const size_t kNumCounters = 1 << 14;
alignas(8) uint8_t Counters[kNumCounters];
void TORCInsert(size_t Idx, uint8_t Arg1, uint8_t Arg2) {
// Do nothing, too small to be interesting.
}
void TORCInsert(size_t Idx, uint16_t Arg1, uint16_t Arg2) {
// Do nothing, these don't usually hapen.
}
void TORCInsert(size_t Idx, uint32_t Arg1, uint32_t Arg2) {
TORC4.Insert(Idx, Arg1, Arg2);
}
void TORCInsert(size_t Idx, uint64_t Arg1, uint64_t Arg2) {
TORC8.Insert(Idx, Arg1, Arg2);
}
static const size_t kNumPCs = 1 << 24;
uintptr_t PCs[kNumPCs];