[PATCH] D92967: Tooling: Migrate RewriterTestContext to FileEntryRef, NFC
Duncan P. N. Exon Smith via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 9 13:34:28 PST 2020
dexonsmith created this revision.
dexonsmith added reviewers: jansvoboda11, arphaman.
Herald added a subscriber: ributzka.
dexonsmith requested review of this revision.
Herald added a project: clang.
Migrate to the `FileEntryRef` overload of `SourceManager::createFileID`
(using `FileManager::getOptionalFileRef` in `RewriterTestContext`s two
`create*File` functions.
No functionality change.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D92967
Files:
clang/unittests/Tooling/RewriterTestContext.h
Index: clang/unittests/Tooling/RewriterTestContext.h
===================================================================
--- clang/unittests/Tooling/RewriterTestContext.h
+++ clang/unittests/Tooling/RewriterTestContext.h
@@ -70,7 +70,7 @@
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 @@
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 =
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92967.310639.patch
Type: text/x-patch
Size: 792 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201209/9f979fe7/attachment.bin>
More information about the cfe-commits
mailing list