Skip to content
Snippets Groups Projects
Commit ab6be7a6 authored by Richard Smith's avatar Richard Smith
Browse files

Clean up handling of reading module files from stdin. Don't bother trying to

look for a corresponding file, since we're not going to read it anyway.

No observable behavior change (though we now avoid pointlessly trying to stat
or open a file named "-").


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280436 91177308-0d34-0410-b5e6-96231b3b80d8
parent d8b89053
No related branches found
No related tags found
No related merge requests found
...@@ -408,13 +408,16 @@ bool ModuleManager::lookupModuleFile(StringRef FileName, ...@@ -408,13 +408,16 @@ bool ModuleManager::lookupModuleFile(StringRef FileName,
off_t ExpectedSize, off_t ExpectedSize,
time_t ExpectedModTime, time_t ExpectedModTime,
const FileEntry *&File) { const FileEntry *&File) {
if (FileName == "-") {
File = nullptr;
return false;
}
// Open the file immediately to ensure there is no race between stat'ing and // Open the file immediately to ensure there is no race between stat'ing and
// opening the file. // opening the file.
File = FileMgr.getFile(FileName, /*openFile=*/true, /*cacheFailure=*/false); File = FileMgr.getFile(FileName, /*openFile=*/true, /*cacheFailure=*/false);
if (!File)
if (!File && FileName != "-") {
return false; return false;
}
if ((ExpectedSize && ExpectedSize != File->getSize()) || if ((ExpectedSize && ExpectedSize != File->getSize()) ||
(ExpectedModTime && ExpectedModTime != File->getModificationTime())) (ExpectedModTime && ExpectedModTime != File->getModificationTime()))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment