[libFuzzer] don't timeout when loading the corpus. Be a bit more verbose when loading large corpus.
llvm-svn: 261143
diff --git a/llvm/lib/Fuzzer/FuzzerIO.cpp b/llvm/lib/Fuzzer/FuzzerIO.cpp
index 9df6837..5cc589a 100644
--- a/llvm/lib/Fuzzer/FuzzerIO.cpp
+++ b/llvm/lib/Fuzzer/FuzzerIO.cpp
@@ -86,9 +86,13 @@
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));
}
}