[PATCH] D92699: Frontend: Migrate to FileEntryRef in VerifyDiagnosticConsumer.cpp, NFC

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 9 11:51:59 PST 2020


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG82789228c653: Frontend: Migrate to FileEntryRef in VerifyDiagnosticConsumer.cpp, NFC (authored by dexonsmith).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92699/new/

https://reviews.llvm.org/D92699

Files:
  clang/include/clang/Basic/SourceManager.h
  clang/lib/Frontend/VerifyDiagnosticConsumer.cpp


Index: clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
===================================================================
--- clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
+++ clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
@@ -554,10 +554,9 @@
             continue;
           }
 
-          const FileEntry *FE = &File->getFileEntry();
-          FileID FID = SM.translateFile(FE);
+          FileID FID = SM.translateFile(*File);
           if (FID.isInvalid())
-            FID = SM.createFileID(FE, Pos, SrcMgr::C_User);
+            FID = SM.createFileID(*File, Pos, SrcMgr::C_User);
 
           if (PH.Next(Line) && Line > 0)
             ExpectedLoc = SM.translateLineCol(FID, Line, 1);
Index: clang/include/clang/Basic/SourceManager.h
===================================================================
--- clang/include/clang/Basic/SourceManager.h
+++ clang/include/clang/Basic/SourceManager.h
@@ -1582,6 +1582,9 @@
   /// If the source file is included multiple times, the FileID will be the
   /// first inclusion.
   FileID translateFile(const FileEntry *SourceFile) const;
+  FileID translateFile(FileEntryRef SourceFile) const {
+    return translateFile(&SourceFile.getFileEntry());
+  }
 
   /// Get the source location in \p FID for the given line:col.
   /// Returns null location if \p FID is not a file SLocEntry.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92699.310601.patch
Type: text/x-patch
Size: 1340 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201209/e3add73e/attachment.bin>


More information about the cfe-commits mailing list