diff --git a/clang/include/clang/Basic/SourceManager.h b/clang/include/clang/Basic/SourceManager.h --- a/clang/include/clang/Basic/SourceManager.h +++ b/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. diff --git a/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp b/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp --- a/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp +++ b/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);