diff options
| author | Kostya Serebryany <kcc@google.com> | 2016-02-17 19:42:34 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2016-02-17 19:42:34 +0000 |
| commit | cfbcf9097daa86021035af5059fe1d9b8674ec8d (patch) | |
| tree | df3b76d02b22d6368ac5595cb8ddacf178b0874e /llvm/lib/Fuzzer/FuzzerIO.cpp | |
| parent | 54831a842e5717a86bb8287a5219de7452eaf5e0 (diff) | |
| download | bcm5719-llvm-cfbcf9097daa86021035af5059fe1d9b8674ec8d.tar.gz bcm5719-llvm-cfbcf9097daa86021035af5059fe1d9b8674ec8d.zip | |
[libFuzzer] don't timeout when loading the corpus. Be a bit more verbose when loading large corpus.
llvm-svn: 261143
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerIO.cpp')
| -rw-r--r-- | llvm/lib/Fuzzer/FuzzerIO.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerIO.cpp b/llvm/lib/Fuzzer/FuzzerIO.cpp index 9df6837442c..5cc589a9ec1 100644 --- a/llvm/lib/Fuzzer/FuzzerIO.cpp +++ b/llvm/lib/Fuzzer/FuzzerIO.cpp @@ -86,9 +86,13 @@ void WriteToFile(const Unit &U, const std::string &Path) { void ReadDirToVectorOfUnits(const char *Path, std::vector<Unit> *V, long *Epoch) { long E = Epoch ? *Epoch : 0; - for (auto &X : ListFilesInDir(Path, Epoch)) { + auto Files = ListFilesInDir(Path, Epoch); + for (size_t i = 0; i < Files.size(); i++) { + auto &X = Files[i]; auto FilePath = DirPlusFile(Path, X); if (Epoch && GetEpoch(FilePath) < E) continue; + if ((i % 1000) == 0 && i) + Printf("Loaded %zd/%zd files from %s\n", i, Files.size(), Path); V->push_back(FileToVector(FilePath)); } } |

