Tooling: Migrate to FileEntryRef in clang::tooling::applyAllReplacements, NFC

Migrate to the `FileEntryRef` overload of `SourceManager::createFileID`.
This commit is contained in:
Duncan P. N. Exon Smith 2020-12-09 16:31:38 -08:00
parent 347e1f6213
commit 2ea8c69eff
1 changed files with 1 additions and 1 deletions

View File

@ -591,7 +591,7 @@ llvm::Expected<std::string> applyAllReplacements(StringRef Code,
Rewriter Rewrite(SourceMgr, LangOptions());
InMemoryFileSystem->addFile(
"<stdin>", 0, llvm::MemoryBuffer::getMemBuffer(Code, "<stdin>"));
FileID ID = SourceMgr.createFileID(*Files.getFile("<stdin>"),
FileID ID = SourceMgr.createFileID(*Files.getOptionalFileRef("<stdin>"),
SourceLocation(),
clang::SrcMgr::C_User);
for (auto I = Replaces.rbegin(), E = Replaces.rend(); I != E; ++I) {