[index] Avoid using getSatisfiedProtocolRequirements() when indexing the stdlib.

This is quite expensive and not worth the cost for indexing purposes of system modules.
This commit is contained in:
Argyrios Kyrtzidis
2017-01-31 21:13:40 -08:00
parent 1d2aa8dcbd
commit 9dc03b4442

View File

@@ -569,9 +569,13 @@ bool IndexSwiftASTWalker::startEntityDecl(ValueDecl *D) {
if (addRelation(Info, (SymbolRoleSet) SymbolRole::RelationOverrideOf, Overridden))
return false;
}
for (auto Conf : D->getSatisfiedProtocolRequirements()) {
if (addRelation(Info, (SymbolRoleSet) SymbolRole::RelationOverrideOf, Conf))
return false;
// FIXME: This is quite expensive and not worth the cost for indexing purposes
// of system modules. Revisit if this becomes more efficient.
if (!isSystemModule) {
for (auto Conf : D->getSatisfiedProtocolRequirements()) {
if (addRelation(Info, (SymbolRoleSet) SymbolRole::RelationOverrideOf, Conf))
return false;
}
}
if (auto Parent = getParentDecl()) {