[PATCH] D123853: [clang] NFCI: Use DirectoryEntryRef in FrontendAction::BeginSourceFile()
Jan Svoboda via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 15 06:52:38 PDT 2022
jansvoboda11 created this revision.
jansvoboda11 added reviewers: dexonsmith, bnbarham.
Herald added a project: All.
jansvoboda11 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
This patch removes use of the deprecated `DirectoryEntry::getName()` from `FrontendAction::BeginSourceFile()`.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D123853
Files:
clang/lib/Frontend/FrontendAction.cpp
Index: clang/lib/Frontend/FrontendAction.cpp
===================================================================
--- clang/lib/Frontend/FrontendAction.cpp
+++ clang/lib/Frontend/FrontendAction.cpp
@@ -761,10 +761,10 @@
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),
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123853.423087.patch
Type: text/x-patch
Size: 900 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220415/598648fd/attachment.bin>
More information about the cfe-commits
mailing list