[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 19 15:41:23 PDT 2024


sam-mccall wrote:

> Is this a pre-existing issue, or did my patch change to make "each textual header gets a `HFI`"?

My best understanding that your patch gave textual headers`HFI`s when the module map was loaded, rather than when the header was included. This shouldn't have mattered, but for the latent pre-existing bug: this caused the modulemap to be "affecting" and thus serialized. (Fixed by this patch)

Your patch changed an early-bailout condition in `markFileModuleHeader` (1426) from `if !ModularHeader` to `if ExcludedHeader`, so now we carry on further in case of textual headers.
The next line calls `getExistingFileInfo` which is probably fine, and then bails out if `ModularHeader` (1430). But with textual headers, we keep going. Finally on line 1433 we call `getFileInfo` and the `HFI` is forced to exist.

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


More information about the cfe-commits mailing list