Skip to content

Commit

Permalink
More renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
aschwaighofer committed Oct 14, 2020
1 parent 96a0d0e commit a725955
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
5 changes: 3 additions & 2 deletions lib/AST/ModuleNameLookup.cpp
Expand Up @@ -145,7 +145,7 @@ void ModuleNameLookup<LookupStrategy>::lookupInModule(

const size_t initialCount = decls.size();
size_t currentCount = decls.size();
bool includeInlineable = options & NL_IncludeUsableFromInline;
bool includeUsableFromInline = options & NL_IncludeUsableFromInline;

auto updateNewDecls = [&](const DeclContext *moduleScopeContext) {
if (decls.size() == currentCount)
Expand All @@ -157,7 +157,8 @@ void ModuleNameLookup<LookupStrategy>::lookupInModule(
if (resolutionKind == ResolutionKind::TypesOnly && !isa<TypeDecl>(VD))
return true;
if (respectAccessControl &&
!VD->isAccessibleFrom(moduleScopeContext, false, includeInlineable))
!VD->isAccessibleFrom(moduleScopeContext, false,
includeUsableFromInline))
return true;
return false;
});
Expand Down
5 changes: 3 additions & 2 deletions lib/AST/NameLookup.cpp
Expand Up @@ -1502,8 +1502,9 @@ static bool isAcceptableLookupResult(const DeclContext *dc,
// Check access.
if (!(options & NL_IgnoreAccessControl) &&
!dc->getASTContext().isAccessControlDisabled()) {
bool allowInlinable = options & NL_IncludeUsableFromInline;
return decl->isAccessibleFrom(dc, /*forConformance*/ false, allowInlinable);
bool allowUsableFromInline = options & NL_IncludeUsableFromInline;
return decl->isAccessibleFrom(dc, /*forConformance*/ false,
allowUsableFromInline);
}

return true;
Expand Down
4 changes: 2 additions & 2 deletions lib/Sema/TypeCheckDecl.cpp
Expand Up @@ -2190,7 +2190,7 @@ static Type validateParameterType(ParamDecl *decl) {
options |= TypeResolutionFlags::Direct;

if (dc->isInSpecializeExtensionContext())
options |= TypeResolutionFlags::AllowInlinable;
options |= TypeResolutionFlags::AllowUsableFromInline;

const auto resolution =
TypeResolution::forInterface(dc, options, unboundTyOpener);
Expand Down Expand Up @@ -2727,7 +2727,7 @@ ExtendedTypeRequest::evaluate(Evaluator &eval, ExtensionDecl *ext) const {
// Compute the extended type.
TypeResolutionOptions options(TypeResolverContext::ExtensionBinding);
if (ext->isInSpecializeExtensionContext())
options |= TypeResolutionFlags::AllowInlinable;
options |= TypeResolutionFlags::AllowUsableFromInline;
const auto resolution = TypeResolution::forStructural(
ext->getDeclContext(), options,
[](auto unboundTy) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Sema/TypeCheckGeneric.cpp
Expand Up @@ -905,7 +905,7 @@ RequirementRequest::evaluate(Evaluator &evaluator,
// Figure out the type resolution.
auto options = TypeResolutionOptions(TypeResolverContext::GenericRequirement);
if (owner.dc->isInSpecializeExtensionContext())
options |= TypeResolutionFlags::AllowInlinable;
options |= TypeResolutionFlags::AllowUsableFromInline;
Optional<TypeResolution> resolution;
switch (stage) {
case TypeResolutionStage::Structural:
Expand Down
4 changes: 2 additions & 2 deletions lib/Sema/TypeCheckType.cpp
Expand Up @@ -1322,7 +1322,7 @@ static Type resolveTopLevelIdentTypeComponent(TypeResolution resolution,
}

NameLookupOptions lookupOptions = defaultUnqualifiedLookupOptions;
if (options.contains(TypeResolutionFlags::AllowInlinable))
if (options.contains(TypeResolutionFlags::AllowUsableFromInline))
lookupOptions |= NameLookupFlags::IncludeUsableFromInline;
auto globals = TypeChecker::lookupUnqualifiedType(DC, id, comp->getLoc(),
lookupOptions);
Expand Down Expand Up @@ -1526,7 +1526,7 @@ static Type resolveNestedIdentTypeComponent(TypeResolution resolution,

// Look for member types with the given name.
NameLookupOptions lookupOptions = defaultMemberLookupOptions;
if (options.contains(TypeResolutionFlags::AllowInlinable))
if (options.contains(TypeResolutionFlags::AllowUsableFromInline))
lookupOptions |= NameLookupFlags::IncludeUsableFromInline;
LookupTypeResult memberTypes;
if (parentTy->mayHaveMembers())
Expand Down
2 changes: 1 addition & 1 deletion lib/Sema/TypeCheckType.h
Expand Up @@ -66,7 +66,7 @@ enum class TypeResolutionFlags : uint16_t {
AllowModule = 1 << 9,

/// Make internal @usableFromInline and @inlinable decls visible.
AllowInlinable = 1 << 10,
AllowUsableFromInline = 1 << 10,
};

/// Type resolution contexts that require special handling.
Expand Down

0 comments on commit a725955

Please sign in to comment.