[clang] b1e5b28 - [clang][lex] NFCI: Use FileEntryRef in Sema::CodeCompleteIncludedFile
Jan Svoboda via cfe-commits
cfe-commits at lists.llvm.org
Tue May 30 13:54:19 PDT 2023
Author: Jan Svoboda
Date: 2023-05-30T13:54:06-07:00
New Revision: b1e5b28b8c4d8af294906ee27a62b28079d3f337
URL: https://github.com/llvm/llvm-project/commit/b1e5b28b8c4d8af294906ee27a62b28079d3f337
DIFF: https://github.com/llvm/llvm-project/commit/b1e5b28b8c4d8af294906ee27a62b28079d3f337.diff
LOG: [clang][lex] NFCI: Use FileEntryRef in Sema::CodeCompleteIncludedFile
This patch replaces some calls to the deprecated `DirectoryEntry::getName()` with calls to `DirectoryEntryRef::getName()` in SemaCodeComplete.cpp.
Depends on D127654.
Reviewed By: bnbarham
Differential Revision: https://reviews.llvm.org/D127658
Added:
Modified:
clang/lib/Sema/SemaCodeComplete.cpp
Removed:
################################################################################
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index 22d8b5eb44e8d..8c166570265c1 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -10055,12 +10055,12 @@ void Sema::CodeCompleteIncludedFile(llvm::StringRef Dir, bool Angled) {
// header maps are not (currently) enumerable.
break;
case DirectoryLookup::LT_NormalDir:
- AddFilesFromIncludeDir(IncludeDir.getDir()->getName(), IsSystem,
+ AddFilesFromIncludeDir(IncludeDir.getDirRef()->getName(), IsSystem,
DirectoryLookup::LT_NormalDir);
break;
case DirectoryLookup::LT_Framework:
- AddFilesFromIncludeDir(IncludeDir.getFrameworkDir()->getName(), IsSystem,
- DirectoryLookup::LT_Framework);
+ AddFilesFromIncludeDir(IncludeDir.getFrameworkDirRef()->getName(),
+ IsSystem, DirectoryLookup::LT_Framework);
break;
}
};
@@ -10072,9 +10072,8 @@ void Sema::CodeCompleteIncludedFile(llvm::StringRef Dir, bool Angled) {
using llvm::make_range;
if (!Angled) {
// The current directory is on the include path for "quoted" includes.
- const FileEntry *CurFile = PP.getCurrentFileLexer()->getFileEntry();
- if (CurFile && CurFile->getDir())
- AddFilesFromIncludeDir(CurFile->getDir()->getName(), false,
+ if (auto CurFile = PP.getCurrentFileLexer()->getFileEntry())
+ AddFilesFromIncludeDir(CurFile->getDir().getName(), false,
DirectoryLookup::LT_NormalDir);
for (const auto &D : make_range(S.quoted_dir_begin(), S.quoted_dir_end()))
AddFilesFromDirLookup(D, false);
More information about the cfe-commits
mailing list