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

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 26 17:36:38 PDT 2016


Author: kcc
Date: Wed Oct 26 19:36:38 2016
New Revision: 285262

URL: http://llvm.org/viewvc/llvm-project?rev=285262&view=rev
Log:
[libFuzzer] speculatively trying to fix the Mac build; second attempt

Modified:
    llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp
    llvm/trunk/lib/Fuzzer/FuzzerTracePC.h

Modified: llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp?rev=285262&r1=285261&r2=285262&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp Wed Oct 26 19:36:38 2016
@@ -262,7 +262,10 @@ void TracePC::HandleCmp(void *PC, T Arg1
   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);
 }
 

Modified: llvm/trunk/lib/Fuzzer/FuzzerTracePC.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerTracePC.h?rev=285262&r1=285261&r2=285262&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerTracePC.h (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerTracePC.h Wed Oct 26 19:36:38 2016
@@ -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];
 




More information about the llvm-commits mailing list