[clang] [clang][modules] HeaderSearch::MarkFileModuleHeader creates extra HeaderFileInfo, breaks PCM reuse (PR #89005)

Ian Anderson via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 17 13:07:37 PDT 2024


ian-twilightcoder wrote:

> Also note that `ASTWriter` uses this logic in couple of places to avoid serializing unrelated headers:
> 
> ```c++
> if (!HFI || (HFI->isModuleHeader && !HFI->isCompilingModuleHeader))
>   continue;
> ```
> 
> Since textual headers from other modules have `isModuleHeader=false` and `isCompilingModuleHeader=false` after #83660 we always serialize them, even if we just implicitly found their module map and never entered them. I didn't check how this patch interacts with that logic, just wanted to surface this.

#83660 _shouldn't_ affect that logic. `isModuleHeader` and `isCompilingModuleHeader` _should_ always have the same values after that change. It's supposed to just add an extra `isTextualModuleHeader` without changing any of the other bits.

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


More information about the cfe-commits mailing list