diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2020-11-03 08:33:06 -0500 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2020-12-02 17:14:27 -0800 |
commit | 3b18a594c7717a328c33b9c1eba675e9f4bd367c (patch) | |
tree | db4fe92c6ccf6eb2f94f6eb5e1c50c1c5a4bdfe6 /clang/lib/Basic/FileManager.cpp | |
parent | dd2054d38a848a75fe84fb68d9c3a97e5ade6753 (diff) | |
download | llvm-3b18a594c7717a328c33b9c1eba675e9f4bd367c.zip llvm-3b18a594c7717a328c33b9c1eba675e9f4bd367c.tar.gz llvm-3b18a594c7717a328c33b9c1eba675e9f4bd367c.tar.bz2 |
Frontend: Sink named pipe logic from CompilerInstance down to FileManager
Remove compilicated logic from CompilerInstance::InitializeSourceManager
to deal with named pipes, updating FileManager::getBufferForFile to
handle it in a more straightforward way. The existing test at
clang/test/Misc/dev-fd-fs.c covers the new behaviour (just like it did
the old behaviour).
Differential Revision: https://reviews.llvm.org/D90733
Diffstat (limited to 'clang/lib/Basic/FileManager.cpp')
-rw-r--r-- | clang/lib/Basic/FileManager.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp index c0d3685..f3afe6d 100644 --- a/clang/lib/Basic/FileManager.cpp +++ b/clang/lib/Basic/FileManager.cpp @@ -489,7 +489,7 @@ FileManager::getBufferForFile(const FileEntry *Entry, bool isVolatile, uint64_t FileSize = Entry->getSize(); // If there's a high enough chance that the file have changed since we // got its size, force a stat before opening it. - if (isVolatile) + if (isVolatile || Entry->isNamedPipe()) FileSize = -1; StringRef Filename = Entry->getName(); |