From: Duncan P. N. Exon Smith Date: Wed, 9 Dec 2020 21:32:47 +0000 (-0800) Subject: Tooling: Migrate some tests to FileEntryRef, NFC X-Git-Tag: llvmorg-13-init~3695 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=494aacd72c6a85a6d586fa58a8481e13b68acf24;p=platform%2Fupstream%2Fllvm.git 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 --- 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 =