aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/FileEntry.cpp
AgeCommit message (Collapse)AuthorFilesLines
2020-12-23Basic: Add native support for stdin to SourceManager and FileManagerDuncan P. N. Exon Smith1-0/+1
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. Differential Revision: https://reviews.llvm.org/D93148
2020-12-10Basic: Initialize FileEntry's fields inline, almost NFCDuncan P. N. Exon Smith1-1/+1
Initialize most of FileEntry's fields inline (all the ones that can be). The only functionality change is to avoid leaving some fields uninitialized.
2020-10-28Split out llvm/Support/FileSystem/UniqueID.h and clang/Basic/FileEntry.h, NFCDuncan P. N. Exon Smith1-0/+23
Split `FileEntry` and `FileEntryRef` out into a new file `clang/Basic/FileEntry.h`. This allows current users of a forward-declared `FileEntry` to transition to `FileEntryRef` without adding more includers of `FileManager.h`. Also split `UniqueID` out to llvm/Support/FileSystem/UniqueID.h, so `FileEntry.h` doesn't need to include all of `FileSystem.h` for just that type. Differential Revision: https://reviews.llvm.org/D89761