diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2023-12-09 00:43:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-08 15:43:00 -0800 |
commit | 8615ead9a6d37e6353df1b652aadebe71ec6c242 (patch) | |
tree | 09296954ac1e9a4cfd1ba298556a92f08d52157d /clang/lib/Serialization/GlobalModuleIndex.cpp | |
parent | 18f0da26b292341f84f91d4ce731b046315cd0a1 (diff) | |
download | llvm-8615ead9a6d37e6353df1b652aadebe71ec6c242.zip llvm-8615ead9a6d37e6353df1b652aadebe71ec6c242.tar.gz llvm-8615ead9a6d37e6353df1b652aadebe71ec6c242.tar.bz2 |
[clang] NFCI: Make `ModuleFile::File` non-optional (#74892)
AFAICT, `ModuleFile::File` can be `std::nullopt` only for PCM files
loaded from the standard input. This patch starts setting that variable
to `FileManager::getSTDIN()` in that case, which makes it possible to
remove the optionality, and also simplifies code that actually reads the
file.
This is part of an effort to get rid of
`Optional{File,Directory}EntryRefDegradesTo{File,Directory}EntryPtr`.
Diffstat (limited to 'clang/lib/Serialization/GlobalModuleIndex.cpp')
-rw-r--r-- | clang/lib/Serialization/GlobalModuleIndex.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Serialization/GlobalModuleIndex.cpp b/clang/lib/Serialization/GlobalModuleIndex.cpp index fb80a19..dd4fc3e0 100644 --- a/clang/lib/Serialization/GlobalModuleIndex.cpp +++ b/clang/lib/Serialization/GlobalModuleIndex.cpp @@ -342,8 +342,8 @@ bool GlobalModuleIndex::loadedModuleFile(ModuleFile *File) { // If the size and modification time match what we expected, record this // module file. bool Failed = true; - if (File->File->getSize() == Info.Size && - File->File->getModificationTime() == Info.ModTime) { + if (File->File.getSize() == Info.Size && + File->File.getModificationTime() == Info.ModTime) { Info.File = File; ModulesByFile[File] = Known->second; |