[clang] [clang][modules] Adopt `FileEntryRef` in the `HeaderFileInfo` block in PCM files (PR #67383)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 26 15:18:21 PDT 2023


jansvoboda11 wrote:

> test case with multiple virtual entries to the same file that would now be serialized once?

If you're asking because of this:

> First, this patch removes the loop over FileManager::VirtualFileEntries. It's redundant, since all virtual file entries have a non-virtual/real counterpart that's already present in UIDToFiles.

then I should probably clarify that the number of file entries we serialize doesn't change. The loop I removed didn't do anything that would affect the output: it was overwriting existing entry in `UIDToFiles` with a `FileEntryRef` that degraded to the same `const FileEntry *`.

I could create a test that checks that we only serialize one entry for each UID if you think that adds value. But I would do that as either a prep or a follow-up patch, since this PR doesn't affect that.

I think that the only thing that makes sense to test is that we now serialize the most "`<`" name instead of whatever `getLastRef().getName()` used to resolve to.

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


More information about the cfe-commits mailing list