diff options
author | Ben Langmuir <blangmuir@apple.com> | 2023-05-08 15:59:51 -0700 |
---|---|---|
committer | Ben Langmuir <blangmuir@apple.com> | 2023-05-09 13:02:36 -0700 |
commit | 5984ea216d2acbe5613b0af06ea27ef395ca9904 (patch) | |
tree | 2286c3de9542e6009d5923ffb017ef392ce04c0a /clang/lib/Lex/HeaderSearch.cpp | |
parent | bb6a1eb003320cdfd4a5887ad2cd8577275c2f95 (diff) | |
download | llvm-5984ea216d2acbe5613b0af06ea27ef395ca9904.zip llvm-5984ea216d2acbe5613b0af06ea27ef395ca9904.tar.gz llvm-5984ea216d2acbe5613b0af06ea27ef395ca9904.tar.bz2 |
[clang] Prevent creation of new submodules in ASTWriter
Avoid inferring new submodules for headers in ASTWriter's collection of
affecting modulemap files, since we don't want to pick up dependencies
that didn't actually exist during parsing.
rdar://109112624
Differential Revision: https://reviews.llvm.org/D150151
Diffstat (limited to 'clang/lib/Lex/HeaderSearch.cpp')
-rw-r--r-- | clang/lib/Lex/HeaderSearch.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index 5a7357a..a650bbe 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -1565,13 +1565,14 @@ HeaderSearch::findModuleForHeader(const FileEntry *File, bool AllowTextual, } ArrayRef<ModuleMap::KnownHeader> -HeaderSearch::findAllModulesForHeader(const FileEntry *File) const { +HeaderSearch::findAllModulesForHeader(const FileEntry *File, + bool AllowCreation) 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); + return ModMap.findAllModulesForHeader(File, AllowCreation); } static bool suggestModule(HeaderSearch &HS, const FileEntry *File, |