mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Sema] Evaluate SPI groups for all decls, not only public ones
Remove the fast path skipping evaluating SPI groups for non-public decls. This knowledge is still required to allow the use of SPI types in the signatures of `@usableFromInline` declarations and in internal properties of structs in non library evolution compilation. rdar://68530659 rdar://68527580
This commit is contained in:
@@ -2049,10 +2049,8 @@ bool Decl::isSPI() const {
|
||||
}
|
||||
|
||||
ArrayRef<Identifier> Decl::getSPIGroups() const {
|
||||
if (auto vd = dyn_cast<ValueDecl>(this)) {
|
||||
if (vd->getFormalAccess() < AccessLevel::Public)
|
||||
return ArrayRef<Identifier>();
|
||||
} else if (!isa<ExtensionDecl>(this))
|
||||
if (!isa<ValueDecl>(this) &&
|
||||
!isa<ExtensionDecl>(this))
|
||||
return ArrayRef<Identifier>();
|
||||
|
||||
return evaluateOrDefault(getASTContext().evaluator,
|
||||
@@ -2063,10 +2061,8 @@ ArrayRef<Identifier> Decl::getSPIGroups() const {
|
||||
llvm::ArrayRef<Identifier>
|
||||
SPIGroupsRequest::evaluate(Evaluator &evaluator, const Decl *decl) const {
|
||||
// Applies only to public ValueDecls and ExtensionDecls.
|
||||
if (auto vd = dyn_cast<ValueDecl>(decl))
|
||||
assert(vd->getFormalAccess() >= AccessLevel::Public);
|
||||
else
|
||||
assert(isa<ExtensionDecl>(decl));
|
||||
assert (isa<ValueDecl>(decl) ||
|
||||
isa<ExtensionDecl>(decl));
|
||||
|
||||
// First, look for local attributes.
|
||||
llvm::SetVector<Identifier> spiGroups;
|
||||
|
||||
Reference in New Issue
Block a user