[clang] [clang][modules] Adopt `FileEntryRef` in the `HeaderFileInfo` block in PCM files (PR #67383)
Ben Langmuir via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 26 15:45:16 PDT 2023
================
@@ -612,24 +612,21 @@ FileManager::getNoncachedStatValue(StringRef Path,
}
void FileManager::GetUniqueIDMapping(
- SmallVectorImpl<const FileEntry *> &UIDToFiles) const {
+ SmallVectorImpl<OptionalFileEntryRef> &UIDToFiles) const {
UIDToFiles.clear();
UIDToFiles.resize(NextFileUID);
- // Map file entries
- for (llvm::StringMap<llvm::ErrorOr<FileEntryRef::MapValue>,
- llvm::BumpPtrAllocator>::const_iterator
- FE = SeenFileEntries.begin(),
- FEEnd = SeenFileEntries.end();
- FE != FEEnd; ++FE)
- if (llvm::ErrorOr<FileEntryRef::MapValue> Entry = FE->getValue()) {
- if (const auto *FE = Entry->V.dyn_cast<FileEntry *>())
- UIDToFiles[FE->getUID()] = FE;
- }
-
- // Map virtual file entries
- for (const auto &VFE : VirtualFileEntries)
- UIDToFiles[VFE->getUID()] = VFE;
+ for (const auto &Entry : SeenFileEntries) {
+ // Only return existing non-virtual files.
----------------
benlangmuir wrote:
"virtual" is an overloaded term here; maybe "VFS-mapped"?
https://github.com/llvm/llvm-project/pull/67383
More information about the cfe-commits
mailing list