@@ -300,16 +300,15 @@ void DirectLookupRequest::writeDependencySink(
300
300
301
301
void LookupInModuleRequest::writeDependencySink (
302
302
evaluator::DependencyCollector &reqTracker, QualifiedLookupResult l) const {
303
- auto *module = std::get<0 >(getStorage ());
303
+ auto *DC = std::get<0 >(getStorage ());
304
304
auto member = std::get<1 >(getStorage ());
305
- auto *DC = std::get<4 >(getStorage ());
306
305
307
- // Decline to record lookups outside our module.
308
- if (!DC->getParentSourceFile () ||
309
- module ->getParentModule () != DC->getParentModule ()) {
310
- return ;
306
+ // Decline to record lookups if the module in question has no incremental
307
+ // dependency information available.
308
+ auto *module = DC->getParentModule ();
309
+ if (module ->isMainModule () || module ->hasIncrementalInfo ()) {
310
+ reqTracker.addTopLevelName (member.getBaseName ());
311
311
}
312
- reqTracker.addTopLevelName (member.getBaseName ());
313
312
}
314
313
315
314
// ----------------------------------------------------------------------------//
@@ -343,16 +342,14 @@ swift::extractNearestSourceLoc(const LookupConformanceDescriptor &desc) {
343
342
344
343
void ModuleQualifiedLookupRequest::writeDependencySink (
345
344
evaluator::DependencyCollector &reqTracker, QualifiedLookupResult l) const {
346
- auto *DC = std::get<0 >(getStorage ());
347
345
auto *module = std::get<1 >(getStorage ());
348
346
auto member = std::get<2 >(getStorage ());
349
347
350
- // Decline to record lookups outside our module.
351
- if (!DC-> getParentSourceFile () ||
352
- module != DC-> getModuleScopeContext ()-> getParentModule ()) {
353
- return ;
348
+ // Decline to record lookups if the module in question has no incremental
349
+ // dependency information available.
350
+ if ( module -> isMainModule () || module -> hasIncrementalInfo ()) {
351
+ reqTracker. addTopLevelName (member. getBaseName ()) ;
354
352
}
355
- reqTracker.addTopLevelName (member.getBaseName ());
356
353
}
357
354
358
355
// ----------------------------------------------------------------------------//
@@ -370,16 +367,13 @@ void LookupConformanceInModuleRequest::writeDependencySink(
370
367
if (!Adoptee)
371
368
return ;
372
369
373
- auto source = reqTracker.getRecorder ().getActiveDependencySourceOrNull ();
374
- if (source.isNull ())
375
- return ;
376
-
377
- // Decline to record conformances defined outside of the active module.
370
+ // Decline to record lookups if the module in question has no incremental
371
+ // dependency information available.
378
372
auto *conformance = lookupResult.getConcrete ();
379
- if (source. get ( )->getParentModule () !=
380
- conformance-> getDeclContext ()-> getParentModule ())
381
- return ;
382
- reqTracker. addPotentialMember (Adoptee);
373
+ auto * module = conformance-> getDeclContext ( )->getParentModule ();
374
+ if ( module -> isMainModule () || module -> hasIncrementalInfo ()) {
375
+ reqTracker. addPotentialMember (Adoptee) ;
376
+ }
383
377
}
384
378
385
379
// ----------------------------------------------------------------------------//
0 commit comments