[Lldb-commits] [clang] [lldb] Serialize `#pragma redefine_extname` into precompiled headers. (PR #186755)

via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 24 06:23:47 PDT 2026


================
@@ -6061,6 +6059,22 @@ ASTFileSignature ASTWriter::WriteASTCore(Sema *SemaPtr, StringRef isysroot,
     }
   }
 
+  // Write the set of #pragma redefine_extname'd, undeclared identifiers. We
+  // always write the entire table, since later PCH files in a PCH chain are
+  // only interested in the results at the end of the chain.
+  RecordData ExtnameUndeclaredIdentifiers;
+  if (SemaPtr) {
----------------
divVerent wrote:

Ah, good - if they don't propagate macros, they indeed also shouldn't propagate `redefine_extname` (or `#pragma once` state). And then we have no problem here either, because if both don't get propagated, everything is fine.

However, it seems like header _units_ do propagate macros, so we need this for them as well.

How do I distinguish the three in Clang code, so this is only skipped for header _modules_?

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


More information about the lldb-commits mailing list