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.


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.
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D92968: Fr... Duncan P. N. Exon Smith via Phabricator via cfe-commits
    • [PATCH] D9296... Jan Svoboda via Phabricator via cfe-commits
    • [PATCH] D9296... Duncan P. N. Exon Smith via Phabricator via cfe-commits

Reply via email to