Skip to content

Commit

Permalink
[clang][lex] NFCI: Use FileEntryRef in Sema::CodeCompleteIncludedFile
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jansvoboda11 committed May 30, 2023
1 parent 32d6f3c commit b1e5b28
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions clang/lib/Sema/SemaCodeComplete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
};
Expand All @@ -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);
Expand Down

0 comments on commit b1e5b28

Please sign in to comment.