diff options
| author | Kostya Serebryany <kcc@google.com> | 2015-01-28 23:48:39 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2015-01-28 23:48:39 +0000 |
| commit | 265cf04f9c738f3be7a941d87eaee80d928be39e (patch) | |
| tree | b75dca4aea21f52a9af650086b596194f120dfab /llvm/lib/Fuzzer/FuzzerIO.cpp | |
| parent | 1689d3f732a410dd6a09961f0e8a9fbe0d62c4ac (diff) | |
| download | bcm5719-llvm-265cf04f9c738f3be7a941d87eaee80d928be39e.tar.gz bcm5719-llvm-265cf04f9c738f3be7a941d87eaee80d928be39e.zip | |
[fuzzer] add option -save_minimized_corpus
llvm-svn: 227395
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerIO.cpp')
| -rw-r--r-- | llvm/lib/Fuzzer/FuzzerIO.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerIO.cpp b/llvm/lib/Fuzzer/FuzzerIO.cpp index 172540c4603..4e0ac819218 100644 --- a/llvm/lib/Fuzzer/FuzzerIO.cpp +++ b/llvm/lib/Fuzzer/FuzzerIO.cpp @@ -13,7 +13,7 @@ #include <dirent.h> namespace fuzzer { -std::vector<std::string> ListFilesInDir(const std::string &Dir) { +static std::vector<std::string> ListFilesInDir(const std::string &Dir) { std::vector<std::string> V; DIR *D = opendir(Dir.c_str()); if (!D) return V; @@ -38,7 +38,12 @@ void WriteToFile(const Unit &U, const std::string &Path) { void ReadDirToVectorOfUnits(const char *Path, std::vector<Unit> *V) { for (auto &X : ListFilesInDir(Path)) - V->push_back(FileToVector(std::string(Path) + "/" + X)); + V->push_back(FileToVector(DirPlusFile(Path, X))); +} + +std::string DirPlusFile(const std::string &DirPath, + const std::string &FileName) { + return DirPath + "/" + FileName; } } // namespace fuzzer |

