aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2020-12-04 12:30:48 -0800
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2020-12-09 13:28:29 -0800
commita5c89bb02195a97aa71a4033336d9864098c764f (patch)
tree267774eaef87778fa14304e71582312d5d31e2a3 /clang/lib/Frontend
parent8b23b3ab3aea28b91e5aa48f29fe9eb1828515a3 (diff)
downloadllvm-a5c89bb02195a97aa71a4033336d9864098c764f.zip
llvm-a5c89bb02195a97aa71a4033336d9864098c764f.tar.gz
llvm-a5c89bb02195a97aa71a4033336d9864098c764f.tar.bz2
Frontend: Migrate to FileEntryRef in CompilerInstance::InitializeSourceManager, NFC
Use `FileManager::getVirtualFileRef` to get the virtual file for stdin, and add an overload of `SourceManager::overrideFileContents` that takes a `FileEntryRef`, migrating `CompilerInstance::InitializeSourceManager`. Differential Revision: https://reviews.llvm.org/D92680
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index fa3d50a..92e5208 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -891,8 +891,8 @@ bool CompilerInstance::InitializeSourceManager(const FrontendInputFile &Input,
}
std::unique_ptr<llvm::MemoryBuffer> SB = std::move(SBOrErr.get());
- const FileEntry *File = FileMgr.getVirtualFile(SB->getBufferIdentifier(),
- SB->getBufferSize(), 0);
+ FileEntryRef File = FileMgr.getVirtualFileRef(SB->getBufferIdentifier(),
+ SB->getBufferSize(), 0);
SourceMgr.setMainFileID(
SourceMgr.createFileID(File, SourceLocation(), Kind));
SourceMgr.overrideFileContents(File, std::move(SB));