From ba118f30676d44025885f422e29fe853a84495f8 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 20 Apr 2022 18:54:36 +0200 Subject: [PATCH] [clang] NFCI: Use DirectoryEntryRef in FrontendAction::BeginSourceFile() This patch removes use of the deprecated `DirectoryEntry::getName()` from `FrontendAction::BeginSourceFile()`. Reviewed By: bnbarham Differential Revision: https://reviews.llvm.org/D123853 --- clang/lib/Frontend/FrontendAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index 45245f3f0fef..68c70dda12b9 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -761,10 +761,10 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, PreprocessorOptions &PPOpts = CI.getPreprocessorOpts(); StringRef PCHInclude = PPOpts.ImplicitPCHInclude; std::string SpecificModuleCachePath = CI.getSpecificModuleCachePath(); - if (auto PCHDir = FileMgr.getDirectory(PCHInclude)) { + if (auto PCHDir = FileMgr.getOptionalDirectoryRef(PCHInclude)) { std::error_code EC; SmallString<128> DirNative; - llvm::sys::path::native((*PCHDir)->getName(), DirNative); + llvm::sys::path::native(PCHDir->getName(), DirNative); bool Found = false; llvm::vfs::FileSystem &FS = FileMgr.getVirtualFileSystem(); for (llvm::vfs::directory_iterator Dir = FS.dir_begin(DirNative, EC),