[PATCH] D93148: Basic: Add native support for stdin to SourceManager and FileManager

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 18 16:31:56 PST 2020


arphaman accepted this revision.
arphaman added a comment.
This revision is now accepted and ready to land.

Nice, it looks cleaner than the override of file contents that was used before. Left one NIT comment



================
Comment at: clang/lib/Basic/FileManager.cpp:352
+
+  STDIN = getVirtualFileRef("<stdin>", Content->getBufferSize(), 0);
+  FileEntry &FE = const_cast<FileEntry &>(STDIN->getFileEntry());
----------------
NIT: It might be better to replace the hardcoded string literal to `Content->getBufferIdentifier()`, just in case it changes in the future.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93148/new/

https://reviews.llvm.org/D93148



More information about the cfe-commits mailing list