[clang] [Clang] Flush minimization hints after writing (PR #151522)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 31 06:49:49 PDT 2025


https://github.com/ilya-biryukov created https://github.com/llvm/llvm-project/pull/151522

This helps to get well-formed output if Clang crashes after that point.

>From b922a24f7647e47dd8148e8cf980f66cce58282e Mon Sep 17 00:00:00 2001
From: Ilya Biryukov <ibiryukov at google.com>
Date: Thu, 31 Jul 2025 15:32:59 +0200
Subject: [PATCH] [Clang] Flush minimization hints after writing

This helps to get well-formed output if Clang crashes after that point.
---
 clang/lib/Frontend/FrontendAction.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp
index 1d82fc775b28a..cf081830c95bb 100644
--- a/clang/lib/Frontend/FrontendAction.cpp
+++ b/clang/lib/Frontend/FrontendAction.cpp
@@ -226,6 +226,8 @@ class DeserializedDeclsSourceRangePrinter : public ASTConsumer,
     }
     *OS << "  ]\n";
     *OS << "}\n";
+
+    OS->flush();
   }
 };
 



More information about the cfe-commits mailing list