diff options
| author | Kostya Serebryany <kcc@google.com> | 2015-10-22 22:50:47 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2015-10-22 22:50:47 +0000 |
| commit | 007c9b25f4c9d076a4e445622a8400380fddcdf8 (patch) | |
| tree | 018d35d00f1713bcfb226b6103e2f8ca8bd23295 /llvm/lib/Fuzzer/FuzzerInternal.h | |
| parent | bf568a6b8f105a5d3b6cf709fe36fe6d6576b514 (diff) | |
| download | bcm5719-llvm-007c9b25f4c9d076a4e445622a8400380fddcdf8.tar.gz bcm5719-llvm-007c9b25f4c9d076a4e445622a8400380fddcdf8.zip | |
[libFuzzer] refactoring the code that checks the coverage. NFC
llvm-svn: 251074
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerInternal.h')
| -rw-r--r-- | llvm/lib/Fuzzer/FuzzerInternal.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerInternal.h b/llvm/lib/Fuzzer/FuzzerInternal.h index a57cd113553..85f86158373 100644 --- a/llvm/lib/Fuzzer/FuzzerInternal.h +++ b/llvm/lib/Fuzzer/FuzzerInternal.h @@ -123,11 +123,9 @@ class Fuzzer { private: void AlarmCallback(); void MutateAndTestOne(Unit *U); - void ReportNewCoverage(size_t NewCoverage, const Unit &U); - size_t RunOne(const Unit &U); + void ReportNewCoverage(const Unit &U); + bool RunOne(const Unit &U); void RunOneAndUpdateCorpus(Unit &U); - size_t RunOneMaximizeTotalCoverage(const Unit &U); - size_t RunOneMaximizeCoveragePairs(const Unit &U); void WriteToOutputCorpus(const Unit &U); void WriteUnitToFileWithPrefix(const Unit &U, const char *Prefix); void PrintStats(const char *Where, size_t Cov, const char *End = "\n"); @@ -135,6 +133,11 @@ class Fuzzer { void SyncCorpus(); + size_t RecordBlockCoverage(); + void PrepareCoverageBeforeRun(); + bool CheckCoverageAfterRun(); + + // Trace-based fuzzing: we run a unit with some kind of tracing // enabled and record potentially useful mutations. Then // We apply these mutations one by one to the unit and run it again. @@ -172,6 +175,7 @@ class Fuzzer { system_clock::time_point UnitStartTime; long TimeOfLongestUnitInSeconds = 0; long EpochOfLastReadOfOutputCorpus = 0; + size_t LastRecordedBlockCoverage = 0; }; class SimpleUserSuppliedFuzzer: public UserSuppliedFuzzer { |

