Tooling: Migrate some tests to FileEntryRef, NFC

Migrate to the `FileEntryRef` overload of `SourceManager::createFileID`
(using `FileManager::getOptionalFileRef`) in RefactoringTest.cpp and
RewriterTestContext.h.

No functionality change.

Differential Revision: https://reviews.llvm.org/D92967
This commit is contained in:
Duncan P. N. Exon Smith 2020-12-09 13:32:47 -08:00
parent 349d5c9cf7
commit 494aacd72c
2 changed files with 3 additions and 3 deletions

View File

@ -608,7 +608,7 @@ public:
llvm::raw_fd_ostream OutStream(FD, true);
OutStream << Content;
OutStream.close();
auto File = Context.Files.getFile(Path);
auto File = Context.Files.getOptionalFileRef(Path);
assert(File);
StringRef Found =

View File

@ -70,7 +70,7 @@ class RewriterTestContext {
llvm::MemoryBuffer::getMemBuffer(Content);
InMemoryFileSystem->addFile(Name, 0, std::move(Source));
auto Entry = Files.getFile(Name);
auto Entry = Files.getOptionalFileRef(Name);
assert(Entry);
return Sources.createFileID(*Entry, SourceLocation(), SrcMgr::C_User);
}
@ -87,7 +87,7 @@ class RewriterTestContext {
llvm::raw_fd_ostream OutStream(FD, true);
OutStream << Content;
OutStream.close();
auto File = Files.getFile(Path);
auto File = Files.getOptionalFileRef(Path);
assert(File);
StringRef Found =