@@ -680,12 +680,10 @@ class SourceFileDepGraphConstructor {
680
680
for (const auto &contextNameFingerprint : contextNameFingerprints) {
681
681
auto p = g.findExistingNodePairOrCreateAndAddIfNew (
682
682
kind, contextNameFingerprint);
683
- // When we don't have a fingerprint yet, must rebuild every provider when
684
- // interfaceHash changes. So when interface (i.e. interface hash) of
685
- // sourceFile changes, every provides is dirty. And since we don't know
686
- // what happened, dirtyness might affect the interface.
687
- if (!p.getInterface ()->getFingerprint ().hasValue ())
688
- g.addArc (g.getSourceFileNodePair ().getInterface (), p.getInterface ());
683
+ // Since the current type fingerprints only include tokens in the body,
684
+ // when the interface hash changes, it is possible that the type in the
685
+ // file has changed.
686
+ g.addArc (g.getSourceFileNodePair ().getInterface (), p.getInterface ());
689
687
}
690
688
}
691
689
@@ -809,8 +807,15 @@ bool swift::fine_grained_dependencies::emitReferenceDependencies(
809
807
// that may have been there. No error handling -- this is just a nicety, it
810
808
// doesn't matter if it fails.
811
809
llvm::sys::fs::rename (outputPath, outputPath + " ~" );
810
+ // Since, when fingerprints are enabled,
811
+ // the parser diverts token hashing into per-body fingerprints
812
+ // before it can know if a difference is in a private type,
813
+ // in order to be able to test the changed fingerprints
814
+ // we force the inclusion of private declarations when fingerprints
815
+ // are enabled.
812
816
const bool includeIntrafileDeps =
813
- SF->getASTContext ().LangOpts .FineGrainedDependenciesIncludeIntrafileOnes ;
817
+ SF->getASTContext ().LangOpts .FineGrainedDependenciesIncludeIntrafileOnes ||
818
+ SF->getASTContext ().LangOpts .EnableTypeFingerprints ;
814
819
const bool hadCompilationError = SF->getASTContext ().hadError ();
815
820
auto gc = SourceFileDepGraphConstructor::forSourceFile (
816
821
SF, depTracker, outputPath, includeIntrafileDeps, hadCompilationError);
0 commit comments