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/ASTUnit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/Frontend/ASTUnit.cpp') diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index a4753f52..4e42028 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -1493,8 +1493,8 @@ StringRef ASTUnit::getMainFileName() const { } if (SourceMgr) { - if (const FileEntry * - FE = SourceMgr->getFileEntryForID(SourceMgr->getMainFileID())) + if (OptionalFileEntryRef FE = + SourceMgr->getFileEntryRefForID(SourceMgr->getMainFileID())) return FE->getName(); } -- cgit v1.1