aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2020-12-09 13:32:47 -0800
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2020-12-10 18:05:03 -0800
commit494aacd72c6a85a6d586fa58a8481e13b68acf24 (patch)
treeb4272ad8271af3b23ec5e571fa2da64f06199f7f
parent349d5c9cf79803187a2e1e2a080a8e460d03cf76 (diff)
downloadllvm-494aacd72c6a85a6d586fa58a8481e13b68acf24.zip
llvm-494aacd72c6a85a6d586fa58a8481e13b68acf24.tar.gz
llvm-494aacd72c6a85a6d586fa58a8481e13b68acf24.tar.bz2
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
-rw-r--r--clang/unittests/Tooling/RefactoringTest.cpp2
-rw-r--r--clang/unittests/Tooling/RewriterTestContext.h4
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 =