[clang] [clang] Store the Input PCH Path Using Absolute Paths in a PCH (PR #178781)

Qiongsi Wu via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 30 09:51:47 PST 2026


================
@@ -1752,7 +1752,10 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, StringRef isysroot) {
   Record.push_back(PPOpts.UsePredefines);
   // Detailed record is important since it is used for the module cache hash.
   Record.push_back(PPOpts.DetailedRecord);
-  AddString(PPOpts.ImplicitPCHInclude, Record);
+  if (PPOpts.ImplicitPCHInclude.empty())
+    AddString(PPOpts.ImplicitPCHInclude, Record);
----------------
qiongsiwu wrote:

> Why is that bad?

I think it is making the common case slower/more complex to cover an edge case which we can handle explicitly. I don't feel too strongly about it, and adding that logic is not too much work, so if you disagree with my reasoning, I will add the code to handle the empty path case in `AddPath`. 

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


More information about the cfe-commits mailing list