diff --git a/clang/unittests/Tooling/RefactoringTest.cpp b/clang/unittests/Tooling/RefactoringTest.cpp index 97a26a71deec..d239aba31d1d 100644 --- a/clang/unittests/Tooling/RefactoringTest.cpp +++ b/clang/unittests/Tooling/RefactoringTest.cpp @@ -608,7 +608,7 @@ class FlushRewrittenFilesTest : public ::testing::Test { 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 = diff --git a/clang/unittests/Tooling/RewriterTestContext.h b/clang/unittests/Tooling/RewriterTestContext.h index ae2d2baa0fdc..a618ebd3a865 100644 --- a/clang/unittests/Tooling/RewriterTestContext.h +++ b/clang/unittests/Tooling/RewriterTestContext.h @@ -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 =