diff options
author | Kostya Serebryany <kcc@google.com> | 2015-10-02 22:00:32 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2015-10-02 22:00:32 +0000 |
commit | 65d0a1458fb9a77d98cb974df556ae8830a00969 (patch) | |
tree | fc1e7a16a80c4175e3ba87b68bf7f337840d81e6 /llvm/lib/Fuzzer/FuzzerLoop.cpp | |
parent | ed3476b79f8aa9ac1e8a5fa821b28daf01c75c28 (diff) | |
download | bcm5719-llvm-65d0a1458fb9a77d98cb974df556ae8830a00969.tar.gz bcm5719-llvm-65d0a1458fb9a77d98cb974df556ae8830a00969.zip |
[libFuzzer] remove experimental flag and functionality
llvm-svn: 249194
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerLoop.cpp')
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerLoop.cpp | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerLoop.cpp b/llvm/lib/Fuzzer/FuzzerLoop.cpp index 6e04868fd40..62a47bf0581 100644 --- a/llvm/lib/Fuzzer/FuzzerLoop.cpp +++ b/llvm/lib/Fuzzer/FuzzerLoop.cpp @@ -156,11 +156,7 @@ void Fuzzer::ShuffleAndMinimize() { size_t Fuzzer::RunOne(const Unit &U) { UnitStartTime = system_clock::now(); TotalNumberOfRuns++; - size_t Res = 0; - if (Options.UseFullCoverageSet) - Res = RunOneMaximizeFullCoverageSet(U); - else - Res = RunOneMaximizeTotalCoverage(U); + size_t Res = RunOneMaximizeTotalCoverage(U); auto UnitStopTime = system_clock::now(); auto TimeOfUnit = duration_cast<seconds>(UnitStopTime - UnitStartTime).count(); @@ -183,14 +179,6 @@ void Fuzzer::RunOneAndUpdateCorpus(Unit &U) { ReportNewCoverage(RunOne(U), U); } -static uintptr_t HashOfArrayOfPCs(uintptr_t *PCs, uintptr_t NumPCs) { - uintptr_t Res = 0; - for (uintptr_t i = 0; i < NumPCs; i++) { - Res = (Res + PCs[i]) * 7; - } - return Res; -} - Unit Fuzzer::SubstituteTokens(const Unit &U) const { Unit Res; for (auto Idx : U) { @@ -214,22 +202,6 @@ void Fuzzer::ExecuteCallback(const Unit &U) { } } -// Experimental. -// Fuly reset the current coverage state, run a single unit, -// compute a hash function from the full coverage set, -// return non-zero if the hash value is new. -// This produces tons of new units and as is it's only suitable for small tests, -// e.g. test/FullCoverageSetTest.cpp. FIXME: make it scale. -size_t Fuzzer::RunOneMaximizeFullCoverageSet(const Unit &U) { - __sanitizer_reset_coverage(); - ExecuteCallback(U); - uintptr_t *PCs; - uintptr_t NumPCs =__sanitizer_get_coverage_guards(&PCs); - if (FullCoverageSets.insert(HashOfArrayOfPCs(PCs, NumPCs)).second) - return FullCoverageSets.size(); - return 0; -} - size_t Fuzzer::RunOneMaximizeTotalCoverage(const Unit &U) { size_t NumCounters = __sanitizer_get_number_of_counters(); if (Options.UseCounters) { |