diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2019-05-07 09:21:13 +0000 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2019-05-07 09:21:13 +0000 |
commit | 724a68f372c0c70eba3f8972c573aaa295a7b3d8 (patch) | |
tree | 0bea02732b4e40fb86162df17fbc5af890c15701 | |
parent | 79ea85c6afb56534e77adb908e9f553c319f30c0 (diff) | |
download | bcm5719-llvm-724a68f372c0c70eba3f8972c573aaa295a7b3d8.tar.gz bcm5719-llvm-724a68f372c0c70eba3f8972c573aaa295a7b3d8.zip |
[llvm-exegesis] InstructionBenchmark::writeYamlTo(): don't forget to flush()
This *APPEARS* to fix a *very* infuriating issue of Yaml's being corrupted,
partially written, truncated. Or at least i'm not seeing the issue
on a new benchmark sweep.
The issue is somewhat rare, happens maybe once in 1000 benchmarks.
Which means there are up to hundreds of broken benchmarks
for a full x86 sweep in a single mode.
llvm-svn: 360124
-rw-r--r-- | llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp index 84ef7ac0f27..a352eabcd6d 100644 --- a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp +++ b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp @@ -9,6 +9,7 @@ #include "BenchmarkResult.h" #include "BenchmarkRunner.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/ScopeExit.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/bit.h" @@ -374,6 +375,7 @@ InstructionBenchmark::readYamls(const LLVMState &State, llvm::Error InstructionBenchmark::writeYamlTo(const LLVMState &State, llvm::raw_ostream &OS) { + auto Cleanup = make_scope_exit([&] { OS.flush(); }); llvm::yaml::Output Yout(OS, nullptr /*Ctx*/, 200 /*WrapColumn*/); YamlContext Context(State); Yout.beginDocuments(); |