Operator lookups may be private (non-cascading) dependencies.

This helps reduce the impact when touching a file that, say,
defines a custom ==.

Swift SVN r23718
This commit is contained in:
Jordan Rose
2014-12-05 02:24:35 +00:00
parent a4318845cc
commit 9abf77d59a
5 changed files with 33 additions and 14 deletions

View File

@@ -1131,16 +1131,16 @@ Module::lookup##Kind##Operator(Identifier name, SourceLoc loc) { \
return result ? *result : nullptr; \
} \
Kind##OperatorDecl * \
SourceFile::lookup##Kind##Operator(Identifier name, SourceLoc loc) { \
SourceFile::lookup##Kind##Operator(Identifier name, bool isNonPrivate, \
SourceLoc loc) { \
auto result = lookupOperatorDeclForName(*this, loc, name, true, \
&SourceFile::Kind##Operators); \
/* FIXME: Track whether this is a private use or not. */ \
if (!result.hasValue()) \
return nullptr; \
if (ReferencedNames) {\
if (!result.getValue() || \
result.getValue()->getDeclContext()->getModuleScopeContext() != this) {\
ReferencedNames->addTopLevelName(name, true); \
ReferencedNames->addTopLevelName(name, isNonPrivate); \
} \
} \
if (!result.getValue()) { \