diff options
author | Kostya Serebryany <kcc@google.com> | 2015-02-19 18:45:37 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2015-02-19 18:45:37 +0000 |
commit | 016852c3963b43c22bc385859178cf132eee22f1 (patch) | |
tree | 8643b5f6e8b395bbf295a836c977b03d44518791 /llvm/lib/Fuzzer/FuzzerInternal.h | |
parent | 0897091730aa361d13a34495a0e81613e43c0bb6 (diff) | |
download | bcm5719-llvm-016852c3963b43c22bc385859178cf132eee22f1.tar.gz bcm5719-llvm-016852c3963b43c22bc385859178cf132eee22f1.zip |
[fuzzer] split main() into FuzzerDriver() that takes a callback as a parameter and a tiny main() in a separate file
llvm-svn: 229882
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerInternal.h')
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerInternal.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerInternal.h b/llvm/lib/Fuzzer/FuzzerInternal.h index 34752ff4944..bc18c551f59 100644 --- a/llvm/lib/Fuzzer/FuzzerInternal.h +++ b/llvm/lib/Fuzzer/FuzzerInternal.h @@ -17,6 +17,8 @@ #include <vector> #include <unordered_set> +#include "FuzzerInterface.h" + namespace fuzzer { typedef std::vector<uint8_t> Unit; using namespace std::chrono; @@ -51,7 +53,8 @@ class Fuzzer { size_t MaxNumberOfRuns = ULONG_MAX; std::string OutputCorpus; }; - Fuzzer(FuzzingOptions Options) : Options(Options) { + Fuzzer(UserCallback Callback, FuzzingOptions Options) + : Callback(Callback), Options(Options) { SetDeathCallback(); } void AddToCorpus(const Unit &U) { Corpus.push_back(U); } @@ -89,6 +92,7 @@ class Fuzzer { std::vector<Unit> Corpus; std::unordered_set<uintptr_t> FullCoverageSets; + UserCallback Callback; FuzzingOptions Options; system_clock::time_point ProcessStartTime = system_clock::now(); static system_clock::time_point UnitStartTime; |