[clang] [clang-tools-extra] [clang][Serialization] Serialize DiagStateOnPushStack to fix pragma d… (PR #190420)

via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 6 14:38:43 PDT 2026


brandonxin wrote:

Thanks for the feedback @ArcsinX 

`#pragma pack(push/pop)` actually already has its stack serialized through PCH (`WritePackPragmaOptions`/`ALIGN_PACK_PRAGMA_OPTIONS`), so it shouldn't have the same issue. If it does, it's a different bug with a different root cause. Excluding pragmas from the preamble would work but has a significant downside, any file starting with `#pragma clang diagnostic push` (which is quite common for suppressing warnings) would lose preamble optimization entirely. That seems like a heavy trade-off for what is a straightforward serialization gap.

https://github.com/llvm/llvm-project/pull/190420


More information about the cfe-commits mailing list