Serialization: Change InputFile to use FileEntryRef and add getVirtualFileRef, NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 22 Oct 2020 03:38:12 +0000 (23:38 -0400)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 30 Nov 2020 22:04:48 +0000 (14:04 -0800)
commitac40a2d8f16b8a8c68fc811d67f647740e965cb8
treea1abc18b93bd7bf85a608ead3e4677bb2bd5744e
parent9615890db576721fbd73ae77d81d39435e83b4b4
Serialization: Change InputFile to use FileEntryRef and add getVirtualFileRef, NFC

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

- Added `FileManager::getVirtualFileRef`, and converted `getVirtualFile`
  to a wrapper of it.
- Updated `SourceManager::bypassFileContentsOverride` to take
  `FileEntryRef` and return `Optional<FileEntryRef>`
  (`ASTReader::getInputFile` is the only caller).

Differential Revision: https://reviews.llvm.org/D90053
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