diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2020-10-20 18:53:51 -0400 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2020-10-28 19:04:22 -0400 |
commit | 946406aebce298725b07097934cb39b1e5bee656 (patch) | |
tree | 613ccb3d73c0d169726d41cd3e7460c480914d40 /clang/lib/Serialization/ModuleManager.cpp | |
parent | f719fd7adee10c037554117f4492917ee3f5282f (diff) | |
download | llvm-946406aebce298725b07097934cb39b1e5bee656.zip llvm-946406aebce298725b07097934cb39b1e5bee656.tar.gz llvm-946406aebce298725b07097934cb39b1e5bee656.tar.bz2 |
ModuleManager: Simplify lookupModuleFile by only setting the out parameter once, NFC
Differential Revision: https://reviews.llvm.org/D89835
Diffstat (limited to 'clang/lib/Serialization/ModuleManager.cpp')
-rw-r--r-- | clang/lib/Serialization/ModuleManager.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/clang/lib/Serialization/ModuleManager.cpp b/clang/lib/Serialization/ModuleManager.cpp index 542e75e..2c65c0b 100644 --- a/clang/lib/Serialization/ModuleManager.cpp +++ b/clang/lib/Serialization/ModuleManager.cpp @@ -462,19 +462,17 @@ bool ModuleManager::lookupModuleFile(StringRef FileName, off_t ExpectedSize, time_t ExpectedModTime, const FileEntry *&File) { - if (FileName == "-") { - File = nullptr; + File = nullptr; + if (FileName == "-") return false; - } // Open the file immediately to ensure there is no race between stat'ing and // opening the file. auto FileOrErr = FileMgr.getFile(FileName, /*OpenFile=*/true, /*CacheFailure=*/false); - if (!FileOrErr) { - File = nullptr; + if (!FileOrErr) return false; - } + File = *FileOrErr; if ((ExpectedSize && ExpectedSize != File->getSize()) || |