Skip to content

Commit 9dc03b4

Browse files
committed
[index] Avoid using getSatisfiedProtocolRequirements() when indexing the stdlib.
This is quite expensive and not worth the cost for indexing purposes of system modules.
1 parent 1d2aa8d commit 9dc03b4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/Index/Index.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,9 +569,13 @@ bool IndexSwiftASTWalker::startEntityDecl(ValueDecl *D) {
569569
if (addRelation(Info, (SymbolRoleSet) SymbolRole::RelationOverrideOf, Overridden))
570570
return false;
571571
}
572-
for (auto Conf : D->getSatisfiedProtocolRequirements()) {
573-
if (addRelation(Info, (SymbolRoleSet) SymbolRole::RelationOverrideOf, Conf))
574-
return false;
572+
// FIXME: This is quite expensive and not worth the cost for indexing purposes
573+
// of system modules. Revisit if this becomes more efficient.
574+
if (!isSystemModule) {
575+
for (auto Conf : D->getSatisfiedProtocolRequirements()) {
576+
if (addRelation(Info, (SymbolRoleSet) SymbolRole::RelationOverrideOf, Conf))
577+
return false;
578+
}
575579
}
576580

577581
if (auto Parent = getParentDecl()) {

0 commit comments

Comments
 (0)