diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2023-05-30 22:58:49 -0700 |
---|---|---|
committer | Jan Svoboda <jan_svoboda@apple.com> | 2023-06-01 10:11:26 -0700 |
commit | 2e1ec4c737f93925e29e4037e758b940c6fef448 (patch) | |
tree | 2082852d1bf0ce8e547e060068ad53077625f2fa /clang/lib/Lex/ModuleMap.cpp | |
parent | f09729042d8f99e1b896f6a04ebf6f842f6cc7ad (diff) | |
download | llvm-2e1ec4c737f93925e29e4037e758b940c6fef448.zip llvm-2e1ec4c737f93925e29e4037e758b940c6fef448.tar.gz llvm-2e1ec4c737f93925e29e4037e758b940c6fef448.tar.bz2 |
[clang] NFCI: Split `HeaderSearch::findAllModulesForHeader()`
This mimics the `ModuleMap` API and enables D151854, where the `AllowCreation = true` function needs `FileEntryRef` but `AllowCreation = false` functions is happy with plain `FileEntry`. No functional change intended.
Reviewed By: benlangmuir
Differential Revision: https://reviews.llvm.org/D151853
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r-- | clang/lib/Lex/ModuleMap.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index 93f770f..7fc810f 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -684,12 +684,12 @@ ModuleMap::findOrCreateModuleForHeaderInUmbrellaDir(const FileEntry *File) { } ArrayRef<ModuleMap::KnownHeader> -ModuleMap::findAllModulesForHeader(const FileEntry *File, bool AllowCreation) { +ModuleMap::findAllModulesForHeader(const FileEntry *File) { HeadersMap::iterator Known = findKnownHeader(File); if (Known != Headers.end()) return Known->second; - if (AllowCreation && findOrCreateModuleForHeaderInUmbrellaDir(File)) + if (findOrCreateModuleForHeaderInUmbrellaDir(File)) return Headers.find(File)->second; return std::nullopt; |