[PATCH] D90053: Serialization: Change InputFile to use FileEntryRef and add getVirtualFileRef, NFC

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 23 08:49:41 PDT 2020


dexonsmith created this revision.
dexonsmith added reviewers: arphaman, JDevlieghere, teemperor.
Herald added a subscriber: ributzka.
dexonsmith requested review of this revision.

Change the `InputFile` class to store a `MaybeFileEntryRef` instead of
`FileEntry*`. This paged in a few API changes:

- Added `FileManager::getVirtualFileRef`, and converted `getVirtualFile` to a wrapper of it.
- Added `{Maybe,}FileEntryRef::getMapEntry`, which gives access to the underlying `StringMapEntry*` pointer, to enable clients (`InputFile`) to store a `FileEntryRef` in a `PointerIntPair`.
- Updated `SourceManager::bypassFileContentsOverride` to take `FileEntryRef` and return `MaybeFileEntry` (`ASTReader::getInputFile` is the only caller).


https://reviews.llvm.org/D90053

Files:
  clang/include/clang/Basic/FileEntry.h
  clang/include/clang/Basic/FileManager.h
  clang/include/clang/Basic/SourceManager.h
  clang/include/clang/Serialization/ModuleFile.h
  clang/lib/Basic/FileManager.cpp
  clang/lib/Basic/SourceManager.cpp
  clang/lib/Serialization/ASTReader.cpp
  clang/unittests/Basic/FileEntryTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90053.300314.patch
Type: text/x-patch
Size: 10297 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201023/789bba27/attachment.bin>


More information about the cfe-commits mailing list