[lib/Fuzzer] on crash print the contents of the crashy input as base64

llvm-svn: 236548
diff --git a/llvm/lib/Fuzzer/FuzzerIO.cpp b/llvm/lib/Fuzzer/FuzzerIO.cpp
index ef23d42..81f37aa 100644
--- a/llvm/lib/Fuzzer/FuzzerIO.cpp
+++ b/llvm/lib/Fuzzer/FuzzerIO.cpp
@@ -60,4 +60,9 @@
   return DirPath + "/" + FileName;
 }
 
+void PrintFileAsBase64(const std::string &Path) {
+  std::string Cmd = "base64 -w 0 < " + Path + "; echo";
+  system(Cmd.c_str());
+}
+
 }  // namespace fuzzer