File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -161,8 +161,13 @@ static TypeCode getTypeCodeForTypeClass(Type::TypeClass id) {
161
161
162
162
namespace {
163
163
164
- std::set<const FileEntry *> GetAffectingModuleMaps (const Preprocessor &PP,
165
- Module *RootModule) {
164
+ std::optional<std::set<const FileEntry *>>
165
+ GetAffectingModuleMaps (const Preprocessor &PP, Module *RootModule) {
166
+ // Without implicit module map search, there's no good reason to know about
167
+ // any module maps that are not affecting.
168
+ if (!PP.getHeaderSearchInfo ().getHeaderSearchOpts ().ImplicitModuleMaps )
169
+ return std::nullopt;
170
+
166
171
SmallVector<const Module *> ModulesToProcess{RootModule};
167
172
168
173
const HeaderSearch &HS = PP.getHeaderSearchInfo ();
@@ -4682,8 +4687,16 @@ void ASTWriter::computeNonAffectingInputFiles() {
4682
4687
if (!Cache->OrigEntry )
4683
4688
continue ;
4684
4689
4685
- if (!isModuleMap (File.getFileCharacteristic ()) ||
4686
- llvm::is_contained (AffectingModuleMaps, *Cache->OrigEntry ))
4690
+ // Don't prune anything other than module maps.
4691
+ if (!isModuleMap (File.getFileCharacteristic ()))
4692
+ continue ;
4693
+
4694
+ // Don't prune module maps if all are guaranteed to be affecting.
4695
+ if (!AffectingModuleMaps)
4696
+ continue ;
4697
+
4698
+ // Don't prune module maps that are affecting.
4699
+ if (llvm::is_contained (*AffectingModuleMaps, *Cache->OrigEntry ))
4687
4700
continue ;
4688
4701
4689
4702
IsSLocAffecting[I] = false ;
You can’t perform that action at this time.
0 commit comments