mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
swift-module-digester: include unavailable variables with fixed layout order when checking ABI stability.
This commit is contained in:
@@ -1200,6 +1200,17 @@ SwiftDeclCollector::constructInitNode(ConstructorDecl *CD) {
|
||||
|
||||
bool swift::ide::api::
|
||||
SwiftDeclCollector::shouldIgnore(Decl *D, const Decl* Parent) {
|
||||
if (Ctx.checkingABI()) {
|
||||
if (auto *VD = dyn_cast<ValueDecl>(D)) {
|
||||
// Private vars with fixed binary orders can have ABI-impact, so we should
|
||||
// whitelist them if we're checking ABI.
|
||||
if (getFixedBinaryOrder(VD).hasValue())
|
||||
return false;
|
||||
// Typealias should have no impact on ABI.
|
||||
if (isa<TypeAliasDecl>(VD))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (D->isPrivateStdlibDecl(false))
|
||||
return true;
|
||||
if (AvailableAttr::isUnavailable(D))
|
||||
@@ -1209,18 +1220,10 @@ SwiftDeclCollector::shouldIgnore(Decl *D, const Decl* Parent) {
|
||||
if (auto VD = dyn_cast<ValueDecl>(D)) {
|
||||
if (VD->getBaseName().empty())
|
||||
return true;
|
||||
|
||||
// Exclude type alias decls because they should have no impact on ABI.
|
||||
if (isa<TypeAliasDecl>(VD) && Ctx.checkingABI())
|
||||
return true;
|
||||
switch (VD->getFormalAccess()) {
|
||||
case AccessLevel::Internal:
|
||||
case AccessLevel::Private:
|
||||
case AccessLevel::FilePrivate:
|
||||
// Private vars with fixed binary orders can have ABI-impact, so we should
|
||||
// whitelist them if we're checking ABI.
|
||||
if (Ctx.checkingABI() && getFixedBinaryOrder(VD).hasValue())
|
||||
break;
|
||||
return true;
|
||||
case AccessLevel::Public:
|
||||
case AccessLevel::Open:
|
||||
|
||||
Reference in New Issue
Block a user