[PATCH] D92968: Frontend: Migrate to FileEntryRef in TextDiagnosticTest, NFC
Duncan P. N. Exon Smith via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 11 17:07:18 PST 2020
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa60043219907: Frontend: Migrate to FileEntryRef in TextDiagnosticTest, NFC (authored by dexonsmith).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92968/new/
https://reviews.llvm.org/D92968
Files:
clang/unittests/Frontend/TextDiagnosticTest.cpp
Index: clang/unittests/Frontend/TextDiagnosticTest.cpp
===================================================================
--- clang/unittests/Frontend/TextDiagnosticTest.cpp
+++ clang/unittests/Frontend/TextDiagnosticTest.cpp
@@ -46,7 +46,7 @@
// Create a dummy file with some contents to produce a test SourceLocation.
const llvm::StringRef file_path = "main.cpp";
const llvm::StringRef main_file_contents = "some\nsource\ncode\n";
- const clang::FileEntry &fe = *FileMgr.getVirtualFile(
+ const clang::FileEntryRef fe = FileMgr.getVirtualFileRef(
file_path,
/*Size=*/static_cast<off_t>(main_file_contents.size()),
/*ModificationTime=*/0);
@@ -55,11 +55,11 @@
buffer.append(main_file_contents.begin(), main_file_contents.end());
auto file_contents = std::make_unique<llvm::SmallVectorMemoryBuffer>(
std::move(buffer), file_path);
- SrcMgr.overrideFileContents(&fe, std::move(file_contents));
+ SrcMgr.overrideFileContents(fe, std::move(file_contents));
// Create the actual file id and use it as the main file.
clang::FileID fid =
- SrcMgr.createFileID(&fe, SourceLocation(), clang::SrcMgr::C_User);
+ SrcMgr.createFileID(fe, SourceLocation(), clang::SrcMgr::C_User);
SrcMgr.setMainFileID(fid);
// Create the source location for the test diagnostic.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92968.311339.patch
Type: text/x-patch
Size: 1325 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201212/a6bb8de4/attachment.bin>
More information about the cfe-commits
mailing list