forked from OSchip/llvm-project
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:
parent
349d5c9cf7
commit
494aacd72c
|
@ -608,7 +608,7 @@ public:
|
||||||
llvm::raw_fd_ostream OutStream(FD, true);
|
llvm::raw_fd_ostream OutStream(FD, true);
|
||||||
OutStream << Content;
|
OutStream << Content;
|
||||||
OutStream.close();
|
OutStream.close();
|
||||||
auto File = Context.Files.getFile(Path);
|
auto File = Context.Files.getOptionalFileRef(Path);
|
||||||
assert(File);
|
assert(File);
|
||||||
|
|
||||||
StringRef Found =
|
StringRef Found =
|
||||||
|
|
|
@ -70,7 +70,7 @@ class RewriterTestContext {
|
||||||
llvm::MemoryBuffer::getMemBuffer(Content);
|
llvm::MemoryBuffer::getMemBuffer(Content);
|
||||||
InMemoryFileSystem->addFile(Name, 0, std::move(Source));
|
InMemoryFileSystem->addFile(Name, 0, std::move(Source));
|
||||||
|
|
||||||
auto Entry = Files.getFile(Name);
|
auto Entry = Files.getOptionalFileRef(Name);
|
||||||
assert(Entry);
|
assert(Entry);
|
||||||
return Sources.createFileID(*Entry, SourceLocation(), SrcMgr::C_User);
|
return Sources.createFileID(*Entry, SourceLocation(), SrcMgr::C_User);
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ class RewriterTestContext {
|
||||||
llvm::raw_fd_ostream OutStream(FD, true);
|
llvm::raw_fd_ostream OutStream(FD, true);
|
||||||
OutStream << Content;
|
OutStream << Content;
|
||||||
OutStream.close();
|
OutStream.close();
|
||||||
auto File = Files.getFile(Path);
|
auto File = Files.getOptionalFileRef(Path);
|
||||||
assert(File);
|
assert(File);
|
||||||
|
|
||||||
StringRef Found =
|
StringRef Found =
|
||||||
|
|
Loading…
Reference in New Issue