Skip to content

Commit

Permalink
[clang] NFCI: Use DirectoryEntryRef in collectIncludePCH
Browse files Browse the repository at this point in the history
This patch removes use of the deprecated `DirectoryEntry::getName()` from `collectIncludePCH` by using `{File,Directory}EntryRef` instead.

Reviewed By: bnbarham

Differential Revision: https://reviews.llvm.org/D123769
  • Loading branch information
jansvoboda11 committed Apr 15, 2022
1 parent 9d98f58 commit 99b4874
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clang/lib/Frontend/CompilerInstance.cpp
Expand Up @@ -232,15 +232,15 @@ static void collectIncludePCH(CompilerInstance &CI,

StringRef PCHInclude = PPOpts.ImplicitPCHInclude;
FileManager &FileMgr = CI.getFileManager();
auto PCHDir = FileMgr.getDirectory(PCHInclude);
auto PCHDir = FileMgr.getOptionalDirectoryRef(PCHInclude);
if (!PCHDir) {
MDC->addFile(PCHInclude);
return;
}

std::error_code EC;
SmallString<128> DirNative;
llvm::sys::path::native((*PCHDir)->getName(), DirNative);
llvm::sys::path::native(PCHDir->getName(), DirNative);
llvm::vfs::FileSystem &FS = FileMgr.getVirtualFileSystem();
SimpleASTReaderListener Validator(CI.getPreprocessor());
for (llvm::vfs::directory_iterator Dir = FS.dir_begin(DirNative, EC), DirEnd;
Expand Down

0 comments on commit 99b4874

Please sign in to comment.