mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Fix overly conservative fingerprint bug & fix tests.
This commit is contained in:
@@ -79,6 +79,14 @@ void AbstractSourceFileDepGraphFactory::addAUsedDecl(
|
||||
const DependencyKey &defKey, const DependencyKey &useKey) {
|
||||
auto *defNode =
|
||||
g.findExistingNodeOrCreateIfNew(defKey, None, false /* = !isProvides */);
|
||||
// If the depended-upon node is defined in this file, then don't
|
||||
// create an arc to the user, when the user is the whole file.
|
||||
// Otherwise, if the defNode's type-body fingerprint changes,
|
||||
// the whole file will be marked as dirty, losing the benefit of the
|
||||
// fingerprint.
|
||||
if (defNode->getIsProvides() &&
|
||||
useKey.getKind() == NodeKind::sourceFileProvide)
|
||||
return;
|
||||
auto nullableUse = g.findExistingNode(useKey);
|
||||
assert(nullableUse.isNonNull() && "Use must be an already-added provides");
|
||||
auto *useNode = nullableUse.get();
|
||||
|
||||
Reference in New Issue
Block a user