mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Remove UnqualifiedLookupFlags::KnownPrivate
This commit is contained in:
@@ -215,18 +215,16 @@ public:
|
||||
};
|
||||
|
||||
enum class UnqualifiedLookupFlags {
|
||||
/// This lookup is known to not affect downstream files.
|
||||
KnownPrivate = 0x01,
|
||||
/// This lookup should only return types.
|
||||
TypeLookup = 0x02,
|
||||
TypeLookup = 1 << 0,
|
||||
/// This lookup should consider declarations within protocols to which the
|
||||
/// context type conforms.
|
||||
AllowProtocolMembers = 0x04,
|
||||
AllowProtocolMembers = 1 << 2,
|
||||
/// Don't check access when doing lookup into a type.
|
||||
IgnoreAccessControl = 0x08,
|
||||
IgnoreAccessControl = 1 << 3,
|
||||
/// This lookup should include results from outside the innermost scope with
|
||||
/// results.
|
||||
IncludeOuterResults = 0x10,
|
||||
IncludeOuterResults = 1 << 4,
|
||||
};
|
||||
|
||||
using UnqualifiedLookupOptions = OptionSet<UnqualifiedLookupFlags>;
|
||||
|
||||
@@ -119,7 +119,6 @@ void swift::simple_display(llvm::raw_ostream &out,
|
||||
{UnqualifiedLookupFlags::AllowProtocolMembers, "AllowProtocolMembers"},
|
||||
{UnqualifiedLookupFlags::IgnoreAccessControl, "IgnoreAccessControl"},
|
||||
{UnqualifiedLookupFlags::IncludeOuterResults, "IncludeOuterResults"},
|
||||
{UnqualifiedLookupFlags::KnownPrivate, "KnownPrivate"},
|
||||
{UnqualifiedLookupFlags::TypeLookup, "TypeLookup"},
|
||||
};
|
||||
|
||||
|
||||
@@ -439,11 +439,7 @@ evaluator::DependencySource UnqualifiedLookupRequest::readDependencySource(
|
||||
// with the existing scheme, but the existing scheme is totally ad-hoc. We
|
||||
// should remove this flag and ensure that non-cascading qualified lookups
|
||||
// occur in the right contexts instead.
|
||||
auto scope = evaluator::DependencyScope::Cascading;
|
||||
if (desc.Options.contains(UnqualifiedLookupFlags::KnownPrivate)) {
|
||||
scope = evaluator::DependencyScope::Private;
|
||||
}
|
||||
return {desc.DC->getParentSourceFile(), scope};
|
||||
return {desc.DC->getParentSourceFile(), evaluator::DependencyScope::Cascading};
|
||||
}
|
||||
|
||||
void UnqualifiedLookupRequest::writeDependencySink(
|
||||
|
||||
@@ -7291,7 +7291,6 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyMemberConstraint(
|
||||
DeclNameRef(param->getName()),
|
||||
paramDecl->getDeclContext()->getParentSourceFile(),
|
||||
SourceLoc(),
|
||||
UnqualifiedLookupFlags::KnownPrivate |
|
||||
UnqualifiedLookupFlags::TypeLookup);
|
||||
auto lookup = evaluateOrDefault(
|
||||
Context.evaluator, UnqualifiedLookupRequest{descriptor}, {});
|
||||
|
||||
@@ -655,8 +655,7 @@ static void diagSyntacticUseRestrictions(const Expr *E, const DeclContext *DC,
|
||||
|
||||
DeclContext *topLevelContext = DC->getModuleScopeContext();
|
||||
auto descriptor = UnqualifiedLookupDescriptor(
|
||||
DeclNameRef(VD->getBaseName()), topLevelContext, SourceLoc(),
|
||||
UnqualifiedLookupFlags::KnownPrivate);
|
||||
DeclNameRef(VD->getBaseName()), topLevelContext, SourceLoc());
|
||||
auto lookup = evaluateOrDefault(Ctx.evaluator,
|
||||
UnqualifiedLookupRequest{descriptor}, {});
|
||||
|
||||
|
||||
@@ -207,8 +207,6 @@ namespace {
|
||||
static UnqualifiedLookupOptions
|
||||
convertToUnqualifiedLookupOptions(NameLookupOptions options) {
|
||||
UnqualifiedLookupOptions newOptions = UnqualifiedLookupFlags::AllowProtocolMembers;
|
||||
if (options.contains(NameLookupFlags::KnownPrivate))
|
||||
newOptions |= UnqualifiedLookupFlags::KnownPrivate;
|
||||
if (options.contains(NameLookupFlags::IgnoreAccessControl))
|
||||
newOptions |= UnqualifiedLookupFlags::IgnoreAccessControl;
|
||||
if (options.contains(NameLookupFlags::IncludeOuterResults))
|
||||
@@ -312,8 +310,6 @@ LookupResult TypeChecker::lookupMember(DeclContext *dc,
|
||||
|
||||
LookupResult result;
|
||||
NLOptions subOptions = (NL_QualifiedDefault | NL_ProtocolMembers);
|
||||
if (options.contains(NameLookupFlags::KnownPrivate))
|
||||
subOptions |= NL_KnownNonCascadingDependency;
|
||||
if (options.contains(NameLookupFlags::IgnoreAccessControl))
|
||||
subOptions |= NL_IgnoreAccessControl;
|
||||
|
||||
@@ -388,8 +384,6 @@ LookupTypeResult TypeChecker::lookupMemberType(DeclContext *dc,
|
||||
SmallVector<ValueDecl *, 4> decls;
|
||||
NLOptions subOptions = (NL_QualifiedDefault | NL_OnlyTypes | NL_ProtocolMembers);
|
||||
|
||||
if (options.contains(NameLookupFlags::KnownPrivate))
|
||||
subOptions |= NL_KnownNonCascadingDependency;
|
||||
if (options.contains(NameLookupFlags::IgnoreAccessControl))
|
||||
subOptions |= NL_IgnoreAccessControl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user