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/HeaderSearch.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/HeaderSearch.cpp')
-rw-r--r-- | clang/lib/Lex/HeaderSearch.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index 16d64be..0ee61aa 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -1570,14 +1570,23 @@ HeaderSearch::findModuleForHeader(const FileEntry *File, bool AllowTextual, } ArrayRef<ModuleMap::KnownHeader> -HeaderSearch::findAllModulesForHeader(const FileEntry *File, - bool AllowCreation) const { +HeaderSearch::findAllModulesForHeader(const FileEntry *File) const { if (ExternalSource) { // Make sure the external source has handled header info about this file, // which includes whether the file is part of a module. (void)getExistingFileInfo(File); } - return ModMap.findAllModulesForHeader(File, AllowCreation); + return ModMap.findAllModulesForHeader(File); +} + +ArrayRef<ModuleMap::KnownHeader> +HeaderSearch::findResolvedModulesForHeader(const FileEntry *File) const { + if (ExternalSource) { + // Make sure the external source has handled header info about this file, + // which includes whether the file is part of a module. + (void)getExistingFileInfo(File); + } + return ModMap.findResolvedModulesForHeader(File); } static bool suggestModule(HeaderSearch &HS, const FileEntry *File, |