mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Excise "Accessibility" from the compiler (2/3)
"Accessibility" has a different meaning for app developers, so we've already deliberately excised it from our diagnostics in favor of terms like "access control" and "access level". Do the same in the compiler now that we aren't constantly pulling things into the release branch. This commit changes the 'Accessibility' enum to be named 'AccessLevel'.
This commit is contained in:
@@ -88,7 +88,7 @@ void BuiltinUnit::LookupCache::lookupValue(
|
||||
/*genericparams*/nullptr,
|
||||
const_cast<BuiltinUnit*>(&M));
|
||||
TAD->setUnderlyingType(Ty);
|
||||
TAD->setAccess(Accessibility::Public);
|
||||
TAD->setAccess(AccessLevel::Public);
|
||||
Entry = TAD;
|
||||
}
|
||||
}
|
||||
@@ -350,7 +350,7 @@ ModuleDecl::ModuleDecl(Identifier name, ASTContext &ctx)
|
||||
ctx.addDestructorCleanup(*this);
|
||||
setImplicit();
|
||||
setInterfaceType(ModuleType::get(this));
|
||||
setAccess(Accessibility::Public);
|
||||
setAccess(AccessLevel::Public);
|
||||
}
|
||||
|
||||
void ModuleDecl::addFile(FileUnit &newFile) {
|
||||
@@ -451,14 +451,14 @@ void ModuleDecl::lookupMember(SmallVectorImpl<ValueDecl*> &results,
|
||||
} else if (privateDiscriminator.empty()) {
|
||||
auto newEnd = std::remove_if(results.begin()+oldSize, results.end(),
|
||||
[](const ValueDecl *VD) -> bool {
|
||||
return VD->getFormalAccess() <= Accessibility::FilePrivate;
|
||||
return VD->getFormalAccess() <= AccessLevel::FilePrivate;
|
||||
});
|
||||
results.erase(newEnd, results.end());
|
||||
|
||||
} else {
|
||||
auto newEnd = std::remove_if(results.begin()+oldSize, results.end(),
|
||||
[=](const ValueDecl *VD) -> bool {
|
||||
if (VD->getFormalAccess() > Accessibility::FilePrivate)
|
||||
if (VD->getFormalAccess() > AccessLevel::FilePrivate)
|
||||
return true;
|
||||
auto enclosingFile =
|
||||
cast<FileUnit>(VD->getDeclContext()->getModuleScopeContext());
|
||||
|
||||
Reference in New Issue
Block a user