diff --git a/lib/Conversion/SCFToCalyx/SCFToCalyx.cpp b/lib/Conversion/SCFToCalyx/SCFToCalyx.cpp index 1759a7a72290..c7350dc6aecc 100644 --- a/lib/Conversion/SCFToCalyx/SCFToCalyx.cpp +++ b/lib/Conversion/SCFToCalyx/SCFToCalyx.cpp @@ -310,8 +310,9 @@ class BuildOpGroups : public calyx::FuncOpPartialLoweringPattern { if (outFile.is_open()) { llvm::raw_os_ostream llvmOut(outFile); - llvm::json::OStream JOS(llvmOut, 2); - JOS.value(getState().getExtMemData()); + llvm::json::OStream jsonOS(llvmOut, 2); + jsonOS.value(getState().getExtMemData()); + jsonOS.flush(); outFile.close(); } else llvm::errs() << "Unable to open file for writing\n";