aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2022-04-15 14:48:19 +0200
committerJan Svoboda <jan_svoboda@apple.com>2022-04-15 15:16:17 +0200
commit99b4874a53cf4cd39a164a63b5505baace825d7c (patch)
tree20dc308034edeeb21ad417d47cc62c56455ca733 /clang/lib/Frontend/CompilerInstance.cpp
parent9d98f58959b12b6ddab5ac10453e1464bb830e96 (diff)
downloadllvm-99b4874a53cf4cd39a164a63b5505baace825d7c.zip
llvm-99b4874a53cf4cd39a164a63b5505baace825d7c.tar.gz
llvm-99b4874a53cf4cd39a164a63b5505baace825d7c.tar.bz2
[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
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 2465a7e..bb89644 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;