[llvm-exegesis] Unbreak `--benchmarks-file=<f>`
authorRoman Lebedev <lebedev.ri@gmail.com>
Sun, 18 Dec 2022 00:44:13 +0000 (03:44 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Sun, 18 Dec 2022 00:50:10 +0000 (03:50 +0300)
commita3400191137e7c991b89ebe72211790dae1648a1
treef9b0f019aff91b9ef2cd362ea76d4309dbf75b8c
parentd22f050e15cb8c941d488d9674329db320ef1783
[llvm-exegesis] Unbreak `--benchmarks-file=<f>`

I'm absolutely flabbergasted by this.
I was absolutely sure this worked.
But apparently not.

When outputting to the file, we'd write a single `InstructionBenchmark`
to it, and then close the file. And for the next `InstructionBenchmark`,
we'd reopen the file, truncating it in process,
and thus the first `InstructionBenchmark` would be gone...
llvm/test/tools/llvm-exegesis/X86/latency/latency-LEA64_32r.s
llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
llvm/tools/llvm-exegesis/lib/BenchmarkResult.h
llvm/tools/llvm-exegesis/llvm-exegesis.cpp
llvm/unittests/tools/llvm-exegesis/Mips/BenchmarkResultTest.cpp
llvm/unittests/tools/llvm-exegesis/X86/BenchmarkResultTest.cpp