From 99b4874a53cf4cd39a164a63b5505baace825d7c Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Fri, 15 Apr 2022 14:48:19 +0200 Subject: [PATCH] [clang] NFCI: Use DirectoryEntryRef in collectIncludePCH 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 --- clang/lib/Frontend/CompilerInstance.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 2465a7e2453bed..bb896449b621f8 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -232,7 +232,7 @@ 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; @@ -240,7 +240,7 @@ static void collectIncludePCH(CompilerInstance &CI, 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;