[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 10:21:15 PDT 2024


ian-twilightcoder wrote:

> > @ilya-biryukov can you check that this fixes your running out of source location space problem please?
> 
> Just tried it. The patch as is did not help. I've also tried changing the previous line to `getExistingFileInfo(, /*WantExternal=*/false)` and it didn't help either.
> 
> Changing from `if ((Role & ModuleMap::ExcludedHeader))` back to `if (!ModuleMap::isModular(Role))` does help, though, but that clearly leads to an incorrect behavior as far as the code is concerned.

Does it not help because `headerFileInfoModuleBitsMatchRole` is returning `false`? The previous code was doing `WantExternal=true` so I don't think we want `getExistingLocalFileInfo()` here? I think if we used `getExistingLocalFileInfo()`, we'd get `nullptr` back more often and fall down into the `getFileInfo()` case more often wouldn't we?

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


More information about the cfe-commits mailing list