[libFuzzer] extend the -fork=1 functionality. Still not fully usable, but good enough for the first unit test
llvm-svn: 353775
diff --git a/compiler-rt/lib/fuzzer/FuzzerIO.cpp b/compiler-rt/lib/fuzzer/FuzzerIO.cpp
index 1ff2293..a18fba7 100644
--- a/compiler-rt/lib/fuzzer/FuzzerIO.cpp
+++ b/compiler-rt/lib/fuzzer/FuzzerIO.cpp
@@ -125,4 +125,11 @@
fflush(OutputFile);
}
+void RmFilesInDir(const std::string &Path) {
+ Vector<std::string> Files;
+ ListFilesInDirRecursive(Path, 0, &Files, /*TopDir*/true);
+ for (auto &F : Files)
+ RemoveFile(F);
+}
+
} // namespace fuzzer