[clang] 99b4874 - [clang] NFCI: Use DirectoryEntryRef in collectIncludePCH
Jan Svoboda via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 15 06:16:27 PDT 2022
Author: Jan Svoboda
Date: 2022-04-15T15:16:17+02:00
New Revision: 99b4874a53cf4cd39a164a63b5505baace825d7c
URL: https://github.com/llvm/llvm-project/commit/99b4874a53cf4cd39a164a63b5505baace825d7c
DIFF: https://github.com/llvm/llvm-project/commit/99b4874a53cf4cd39a164a63b5505baace825d7c.diff
LOG: [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
Added:
Modified:
clang/lib/Frontend/CompilerInstance.cpp
Removed:
################################################################################
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 2465a7e2453be..bb896449b621f 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;
More information about the cfe-commits
mailing list