Skip to content

Commit

Permalink
[clang] NFCI: Use DirectoryEntryRef in PrecompiledPreamble
Browse files Browse the repository at this point in the history
This removes some uses of the deprecated `DirectoryEntry::getName()`.
  • Loading branch information
jansvoboda11 committed May 31, 2023
1 parent 6587d9d commit 54e4772
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions clang/lib/Frontend/PrecompiledPreamble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,16 @@ class MissingFileCollector : public PPCallbacks {

// Reconstruct the filenames that would satisfy this directive...
llvm::SmallString<256> Buf;
auto NotFoundRelativeTo = [&](const DirectoryEntry *DE) {
Buf = DE->getName();
auto NotFoundRelativeTo = [&](DirectoryEntryRef DE) {
Buf = DE.getName();
llvm::sys::path::append(Buf, FileName);
llvm::sys::path::remove_dots(Buf, /*remove_dot_dot=*/true);
Out.insert(Buf);
};
// ...relative to the including file.
if (!IsAngled) {
if (const FileEntry *IncludingFile =
SM.getFileEntryForID(SM.getFileID(IncludeTok.getLocation())))
if (OptionalFileEntryRef IncludingFile =
SM.getFileEntryRefForID(SM.getFileID(IncludeTok.getLocation())))
if (IncludingFile->getDir())
NotFoundRelativeTo(IncludingFile->getDir());
}
Expand All @@ -132,7 +132,7 @@ class MissingFileCollector : public PPCallbacks {
Search.search_dir_end())) {
// No support for frameworks or header maps yet.
if (Dir.isNormalDir())
NotFoundRelativeTo(Dir.getDir());
NotFoundRelativeTo(*Dir.getDirRef());
}
}
};
Expand Down

0 comments on commit 54e4772

Please sign in to comment.