[fuzzer] make multi-process execution more verbose; fix mutation to actually respect mutation depth and to never produce empty units

llvm-svn: 228170
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 @@
               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());