summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerTracePC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerTracePC.cpp')
-rw-r--r--llvm/lib/Fuzzer/FuzzerTracePC.cpp23
1 files changed, 2 insertions, 21 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerTracePC.cpp b/llvm/lib/Fuzzer/FuzzerTracePC.cpp
index dc39eedb2f5..b66e7616b5f 100644
--- a/llvm/lib/Fuzzer/FuzzerTracePC.cpp
+++ b/llvm/lib/Fuzzer/FuzzerTracePC.cpp
@@ -30,19 +30,8 @@ TracePC TPC;
void TracePC::HandleTrace(uint32_t *Guard, uintptr_t PC) {
uint32_t Idx = *Guard;
if (!Idx) return;
- if (!PCs[Idx % kNumPCs])
- PCs[Idx % kNumPCs] = PC;
- uint8_t *CounterPtr = &Counters[Idx % kNumCounters];
- uint8_t Counter = *CounterPtr;
- if (UseCounters) {
- if (Counter < 128)
- *CounterPtr = Counter + 1;
- else
- *Guard = 0;
- } else {
- *CounterPtr = 1;
- *Guard = 0;
- }
+ PCs[Idx % kNumPCs] = PC;
+ Counters[Idx % kNumCounters]++;
}
size_t TracePC::GetTotalPCCoverage() {
@@ -70,14 +59,6 @@ void TracePC::PrintModuleInfo() {
Printf("\n");
}
-void TracePC::ResetGuards() {
- uint32_t N = 0;
- for (size_t M = 0; M < NumModules; M++)
- for (uint32_t *X = Modules[M].Start, *End = Modules[M].Stop; X < End; X++)
- *X = ++N;
- assert(N == NumGuards);
-}
-
size_t TracePC::FinalizeTrace(InputCorpus *C, size_t InputSize, bool Shrink) {
if (!UsingTracePcGuard()) return 0;
size_t Res = 0;
OpenPOWER on IntegriCloud