[PATCH] D93148: Basic: Add native support for stdin to SourceManager and FileManager
Duncan P. N. Exon Smith via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 11 17:04:30 PST 2020
dexonsmith created this revision.
dexonsmith added reviewers: arphaman, JDevlieghere, jansvoboda11.
Herald added a subscriber: ributzka.
dexonsmith requested review of this revision.
Herald added a project: clang.
Add support for stdin to SourceManager and FileManager. Adds
FileManager::getSTDIN, which adds a FileEntryRef for `<stdin>` and reads
the MemoryBuffer, which is stored as `FileEntry::Content`.
Eventually the other buffers in `ContentCache` will sink to here as well
- we probably usually want to load/save a MemoryBuffer eagerly -- but
it's happening early for stdin to get rid of
CompilerInstance::InitializeSourceManager's final call to
`SourceManager::overrideFileContents`.
clang/test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.export/p1.cpp
relies on building a module from stdin; supporting that requires setting
ContentCache::BufferOverridden.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D93148
Files:
clang/include/clang/Basic/FileEntry.h
clang/include/clang/Basic/FileManager.h
clang/lib/Basic/FileEntry.cpp
clang/lib/Basic/FileManager.cpp
clang/lib/Basic/SourceManager.cpp
clang/lib/Frontend/CompilerInstance.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93148.311338.patch
Type: text/x-patch
Size: 6918 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201212/61cf07e3/attachment.bin>
More information about the cfe-commits
mailing list