From ddbcc10b9e26b18f6a70e23d0611b9da75ffa52f Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 6 Sep 2023 10:35:54 -0700 Subject: [clang] NFCI: Adopt `SourceManager::getFileEntryRefForID()` This commit replaces some calls to the deprecated `FileEntry::getName()` with `FileEntryRef::getName()` by swapping current usages of `SourceManager::getFileEntryForID()` with `SourceManager::getFileEntryRefForID()`. This lowers the number of usages of the deprecated `FileEntry::getName()` from 95 to 50. --- clang/lib/Frontend/Rewrite/HTMLPrint.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Frontend/Rewrite/HTMLPrint.cpp') diff --git a/clang/lib/Frontend/Rewrite/HTMLPrint.cpp b/clang/lib/Frontend/Rewrite/HTMLPrint.cpp index 1388c2e..69baa8f 100644 --- a/clang/lib/Frontend/Rewrite/HTMLPrint.cpp +++ b/clang/lib/Frontend/Rewrite/HTMLPrint.cpp @@ -62,7 +62,7 @@ void HTMLPrinter::HandleTranslationUnit(ASTContext &Ctx) { // Format the file. FileID FID = R.getSourceMgr().getMainFileID(); - const FileEntry* Entry = R.getSourceMgr().getFileEntryForID(FID); + OptionalFileEntryRef Entry = R.getSourceMgr().getFileEntryRefForID(FID); StringRef Name; // In some cases, in particular the case where the input is from stdin, // there is no entry. Fall back to the memory buffer for a name in those -- cgit v1.1