From 494aacd72c6a85a6d586fa58a8481e13b68acf24 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Wed, 9 Dec 2020 13:32:47 -0800 Subject: [PATCH] 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 --- clang/unittests/Tooling/RefactoringTest.cpp | 2 +- clang/unittests/Tooling/RewriterTestContext.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clang/unittests/Tooling/RefactoringTest.cpp b/clang/unittests/Tooling/RefactoringTest.cpp index 97a26a7..d239aba 100644 --- a/clang/unittests/Tooling/RefactoringTest.cpp +++ b/clang/unittests/Tooling/RefactoringTest.cpp @@ -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 = diff --git a/clang/unittests/Tooling/RewriterTestContext.h b/clang/unittests/Tooling/RewriterTestContext.h index ae2d2ba..a618ebd 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 = -- 2.7.4