fix double output printing in parallel mode
ostream flush wasn't in the right place
MODIFY
tv/tv.cpp
tv/tv.cpp
@@ -195,7 +195,6 @@ struct TVLegacyPass final : public llvm::ModulePass {
}
if (parallelMgr) {
- out_file.flush();
auto [pid, osp, index] = parallelMgr->limitedFork();
if (pid == -1) {

MODIFY
util/parallel.cpp
util/parallel.cpp
@@ -71,6 +71,8 @@ std::tuple<pid_t, std::ostream *, int> parallel::limitedFork() {
if (index % 100 == 0)
emitOutput();
+ out_file.flush();
+
// this is how the child will send results back to the parent
if (pipe(newKid.pipe) < 0)
return {-1, nullptr, -1};

fix double output printing in parallel mode
ostream flush wasn't in the right place