[llvm-exegesis] Improve error reporting in BenchmarkRunner.cpp

Followup to D74085.
Replace the use of `report_fatal_error()` with returning the error to
`llvm-exegesis.cpp` and handling it there.
To facilitate this, a new `Error` type has been added which is only used
to log errors to the yaml output.

Differential Revision: https://reviews.llvm.org/D74215
diff --git a/llvm/tools/llvm-exegesis/lib/Error.h b/llvm/tools/llvm-exegesis/lib/Error.h
index dc203c8..e5fa093 100644
--- a/llvm/tools/llvm-exegesis/lib/Error.h
+++ b/llvm/tools/llvm-exegesis/lib/Error.h
@@ -26,13 +26,29 @@
 class ClusteringError : public ErrorInfo<ClusteringError> {
 public:
   static char ID;
-  ClusteringError(const Twine&S) : Msg(S.str()) {}
+  ClusteringError(const Twine &S) : Msg(S.str()) {}
 
   void log(raw_ostream &OS) const override;
 
   std::error_code convertToErrorCode() const override;
+
 private:
-    std::string Msg;
+  std::string Msg;
+};
+
+// A class representing failures that happened during snippet execution.
+// Instead of terminating the program crashes are logged into the output.
+class SnippetCrash : public ErrorInfo<SnippetCrash> {
+public:
+  static char ID;
+  SnippetCrash(const Twine &S) : Msg(S.str()) {}
+
+  void log(raw_ostream &OS) const override;
+
+  std::error_code convertToErrorCode() const override;
+
+private:
+  std::string Msg;
 };
 
 } // namespace exegesis