mirror of
https://github.com/intel/llvm.git
synced 2026-02-07 07:39:11 +08:00
ModuleManager: Simplify lookupModuleFile by only setting the out parameter once, NFC
Differential Revision: https://reviews.llvm.org/D89835
This commit is contained in:
@@ -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()) ||
|
||||
|
||||
Reference in New Issue
Block a user