diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2022-04-20 18:55:58 +0200 |
---|---|---|
committer | Jan Svoboda <jan_svoboda@apple.com> | 2022-04-20 19:01:02 +0200 |
commit | f43ce5199df328c0acd3bc1d56d481b22d681ca8 (patch) | |
tree | 3e33f9f28ceb052f7b76df8d7c09a9554681bde5 /clang/lib/Lex/HeaderSearch.cpp | |
parent | ba118f30676d44025885f422e29fe853a84495f8 (diff) | |
download | llvm-f43ce5199df328c0acd3bc1d56d481b22d681ca8.zip llvm-f43ce5199df328c0acd3bc1d56d481b22d681ca8.tar.gz llvm-f43ce5199df328c0acd3bc1d56d481b22d681ca8.tar.bz2 |
[clang][lex] NFCI: Use DirectoryEntryRef in FrameworkCacheEntry
This patch changes the member of `FrameworkCacheEntry` from `const DirectoryEntry *` to `Optional<DirectoryEntryRef>` in order to remove uses of the deprecated `DirectoryEntry::getName()`.
Reviewed By: bnbarham
Differential Revision: https://reviews.llvm.org/D123854
Diffstat (limited to 'clang/lib/Lex/HeaderSearch.cpp')
-rw-r--r-- | clang/lib/Lex/HeaderSearch.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index bc5dfae..d53a360 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -582,7 +582,7 @@ Optional<FileEntryRef> DirectoryLookup::DoFrameworkLookup( HS.LookupFrameworkCache(Filename.substr(0, SlashPos)); // If it is known and in some other directory, fail. - if (CacheEntry.Directory && CacheEntry.Directory != getFrameworkDir()) + if (CacheEntry.Directory && CacheEntry.Directory != getFrameworkDirRef()) return None; // Otherwise, construct the path to this framework dir. @@ -611,7 +611,7 @@ Optional<FileEntryRef> DirectoryLookup::DoFrameworkLookup( // Otherwise, if it does, remember that this is the right direntry for this // framework. - CacheEntry.Directory = getFrameworkDir(); + CacheEntry.Directory = getFrameworkDirRef(); // If this is a user search directory, check if the framework has been // user-specified as a system framework. @@ -626,7 +626,7 @@ Optional<FileEntryRef> DirectoryLookup::DoFrameworkLookup( // Set out flags. InUserSpecifiedSystemFramework = CacheEntry.IsUserSpecifiedSystemFramework; - IsFrameworkFound = CacheEntry.Directory; + IsFrameworkFound = CacheEntry.Directory.hasValue(); if (RelativePath) { RelativePath->clear(); @@ -1184,13 +1184,13 @@ Optional<FileEntryRef> HeaderSearch::LookupSubframeworkHeader( ++NumSubFrameworkLookups; // If the framework dir doesn't exist, we fail. - auto Dir = FileMgr.getDirectory(FrameworkName); + auto Dir = FileMgr.getOptionalDirectoryRef(FrameworkName); if (!Dir) return None; // Otherwise, if it does, remember that this is the right direntry for this // framework. - CacheLookup.second.Directory = *Dir; + CacheLookup.second.Directory = Dir; } |