diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2023-05-30 21:24:51 -0700 |
---|---|---|
committer | Jan Svoboda <jan_svoboda@apple.com> | 2023-05-30 21:42:01 -0700 |
commit | 3473f728b36e21d322f141e576377c20a02c9aad (patch) | |
tree | 3278ce83dac82e61a6adaca4e7c08e6accdb5de8 /clang/lib/Frontend/FrontendAction.cpp | |
parent | 9bd3ff8bf9e05e7bf95a4a068aa3b50813a93975 (diff) | |
download | llvm-3473f728b36e21d322f141e576377c20a02c9aad.zip llvm-3473f728b36e21d322f141e576377c20a02c9aad.tar.gz llvm-3473f728b36e21d322f141e576377c20a02c9aad.tar.bz2 |
[clang][lex] NFCI: Use DirectoryEntryRef in HeaderSearch::LookupFile
This patch changes the argument type to `HeaderSearch::LookupFile()` from `const DirectoryEntry *` to `DirectoryEntryRef` in order to remove some calls to the deprecated `DirectoryEntry::getName()`.
Depends on D127660.
Reviewed By: bnbarham, benlangmuir
Differential Revision: https://reviews.llvm.org/D127663
Diffstat (limited to 'clang/lib/Frontend/FrontendAction.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendAction.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index c589387..cfac2f8 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -825,11 +825,9 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, "trying to build a header unit without a Pre-processor?"); HeaderSearch &HS = CI.getPreprocessor().getHeaderSearchInfo(); // Relative searches begin from CWD. - const DirectoryEntry *Dir = nullptr; - if (auto DirOrErr = CI.getFileManager().getDirectory(".")) - Dir = *DirOrErr; - SmallVector<std::pair<const FileEntry *, const DirectoryEntry *>, 1> CWD; - CWD.push_back({nullptr, Dir}); + auto Dir = CI.getFileManager().getOptionalDirectoryRef("."); + SmallVector<std::pair<const FileEntry *, DirectoryEntryRef>, 1> CWD; + CWD.push_back({nullptr, *Dir}); OptionalFileEntryRef FE = HS.LookupFile(FileName, SourceLocation(), /*Angled*/ Input.getKind().getHeaderUnitKind() == |