diff options
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerIO.cpp')
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerIO.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerIO.cpp b/llvm/lib/Fuzzer/FuzzerIO.cpp index 4e0ac81..224808c 100644 --- a/llvm/lib/Fuzzer/FuzzerIO.cpp +++ b/llvm/lib/Fuzzer/FuzzerIO.cpp @@ -9,6 +9,8 @@ // IO functions. //===----------------------------------------------------------------------===// #include "FuzzerInternal.h" +#include <iostream> +#include <iterator> #include <fstream> #include <dirent.h> namespace fuzzer { @@ -31,6 +33,12 @@ Unit FileToVector(const std::string &Path) { std::istreambuf_iterator<char>()); } +void CopyFileToErr(const std::string &Path) { + std::ifstream T(Path); + std::copy(std::istreambuf_iterator<char>(T), std::istreambuf_iterator<char>(), + std::ostream_iterator<char>(std::cerr, "")); +} + void WriteToFile(const Unit &U, const std::string &Path) { std::ofstream OF(Path); OF.write((const char*)U.data(), U.size()); |