[all-commits] [llvm/llvm-project] 3ee43a: Basic: Add native support for stdin to SourceManag...

Duncan P. N. Exon Smith via All-commits all-commits at lists.llvm.org
Wed Dec 23 15:38:04 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3ee43adfb20d5dc56b7043b314bd22f457c55483
      https://github.com/llvm/llvm-project/commit/3ee43adfb20d5dc56b7043b314bd22f457c55483
  Author: Duncan P. N. Exon Smith <dexonsmith at apple.com>
  Date:   2020-12-23 (Wed, 23 Dec 2020)

  Changed paths:
    M clang/include/clang/Basic/FileEntry.h
    M clang/include/clang/Basic/FileManager.h
    M clang/lib/Basic/FileEntry.cpp
    M clang/lib/Basic/FileManager.cpp
    M clang/lib/Basic/SourceManager.cpp
    M clang/lib/Frontend/CompilerInstance.cpp

  Log Message:
  -----------
  Basic: Add native support for stdin to SourceManager and FileManager

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




More information about the All-commits mailing list