[clang] [llvm] [clang][Modules][Serialization] Avoid serializing duplicate source location entries for shared input files (PR #209795)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 17 01:36:39 PDT 2026


================
@@ -6152,6 +6196,9 @@ ASTFileSignature ASTWriter::WriteASTCore(Sema *SemaPtr, StringRef isysroot,
 
   // Write the control block
   WriteControlBlock(*PP, isysroot);
+  // Import locations in the control block must remain local, so start rewriting
+  // only after it has been written.
+  ControlBlockWritten = true;
----------------
ChuanqiXu9 wrote:

nit: shouldn't we do this in WriteControlBlock?

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


More information about the cfe-commits mailing list