[compiler-rt] r313406 - [libFuzzer] minor refactoring, NFC
Kostya Serebryany via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 15 15:10:36 PDT 2017
Author: kcc
Date: Fri Sep 15 15:10:36 2017
New Revision: 313406
URL: http://llvm.org/viewvc/llvm-project?rev=313406&view=rev
Log:
[libFuzzer] minor refactoring, NFC
Modified:
compiler-rt/trunk/lib/fuzzer/FuzzerDriver.cpp
compiler-rt/trunk/lib/fuzzer/FuzzerMerge.cpp
compiler-rt/trunk/lib/fuzzer/FuzzerTracePC.h
Modified: compiler-rt/trunk/lib/fuzzer/FuzzerDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/FuzzerDriver.cpp?rev=313406&r1=313405&r2=313406&view=diff
==============================================================================
--- compiler-rt/trunk/lib/fuzzer/FuzzerDriver.cpp (original)
+++ compiler-rt/trunk/lib/fuzzer/FuzzerDriver.cpp Fri Sep 15 15:10:36 2017
@@ -471,9 +471,8 @@ int AnalyzeDictionary(Fuzzer *F, const V
// Get coverage for the testcase without modifications.
F->ExecuteCallback(C.data(), C.size());
InitialFeatures.clear();
- TPC.CollectFeatures([&](size_t Feature) -> bool {
+ TPC.CollectFeatures([&](size_t Feature) {
InitialFeatures.push_back(Feature);
- return true;
});
for (size_t i = 0; i < Dict.size(); ++i) {
@@ -498,9 +497,8 @@ int AnalyzeDictionary(Fuzzer *F, const V
// Get coverage for testcase with masked occurrences of dictionary unit.
F->ExecuteCallback(Data.data(), Data.size());
ModifiedFeatures.clear();
- TPC.CollectFeatures([&](size_t Feature) -> bool {
+ TPC.CollectFeatures([&](size_t Feature) {
ModifiedFeatures.push_back(Feature);
- return true;
});
if (InitialFeatures == ModifiedFeatures)
Modified: compiler-rt/trunk/lib/fuzzer/FuzzerMerge.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/FuzzerMerge.cpp?rev=313406&r1=313405&r2=313406&view=diff
==============================================================================
--- compiler-rt/trunk/lib/fuzzer/FuzzerMerge.cpp (original)
+++ compiler-rt/trunk/lib/fuzzer/FuzzerMerge.cpp Fri Sep 15 15:10:36 2017
@@ -241,10 +241,9 @@ void Fuzzer::CrashResistantMergeInternal
// So it makes no sense to record all features for all files, instead we
// only record features that were not seen before.
Set<size_t> UniqFeatures;
- TPC.CollectFeatures([&](size_t Feature) -> bool {
+ TPC.CollectFeatures([&](size_t Feature) {
if (AllFeatures.insert(Feature).second)
UniqFeatures.insert(Feature);
- return true;
});
// Show stats.
if (!(TotalNumberOfRuns & (TotalNumberOfRuns - 1)))
Modified: compiler-rt/trunk/lib/fuzzer/FuzzerTracePC.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/FuzzerTracePC.h?rev=313406&r1=313405&r2=313406&view=diff
==============================================================================
--- compiler-rt/trunk/lib/fuzzer/FuzzerTracePC.h (original)
+++ compiler-rt/trunk/lib/fuzzer/FuzzerTracePC.h Fri Sep 15 15:10:36 2017
@@ -208,7 +208,7 @@ unsigned CounterToFeature(T Counter) {
return Bit;
}
-template <class Callback> // bool Callback(size_t Feature)
+template <class Callback> // void Callback(size_t Feature)
ATTRIBUTE_NO_SANITIZE_ADDRESS
__attribute__((noinline))
void TracePC::CollectFeatures(Callback HandleFeature) const {
More information about the llvm-commits
mailing list