[llvm-exegesis] Fix unhandled error.

Summary: Fixing an unhandled error when calling writeYaml.

Reviewers: courbet

Subscribers: tschuett, llvm-commits

Differential Revision: https://reviews.llvm.org/D48022

llvm-svn: 334405
diff --git a/llvm/tools/llvm-exegesis/llvm-exegesis.cpp b/llvm/tools/llvm-exegesis/llvm-exegesis.cpp
index 4a3fe35..687469d 100644
--- a/llvm/tools/llvm-exegesis/llvm-exegesis.cpp
+++ b/llvm/tools/llvm-exegesis/llvm-exegesis.cpp
@@ -148,7 +148,7 @@
   std::vector<InstructionBenchmark> Results = ExitOnErr(Runner->run(
       GetOpcodeOrDie(State.getInstrInfo()), Filter, NumRepetitions));
   for (InstructionBenchmark &Result : Results)
-    Result.writeYaml(Context, BenchmarkFile);
+    ExitOnErr(Result.writeYaml(Context, BenchmarkFile));
 
   exegesis::pfm::pfmTerminate();
 }