mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
swift-module-digester: non-final methods in fixed-layout classes no longer have fixed orders. rdar://46617463
This commit is contained in:
@@ -1073,30 +1073,17 @@ Optional<uint8_t> SDKContext::getFixedBinaryOrder(ValueDecl *VD) const {
|
||||
}
|
||||
return false;
|
||||
};
|
||||
// The relative order of non-final instance functions matters for non-resilient
|
||||
// class.
|
||||
auto isNonfinalFunc = [](Decl *M) {
|
||||
if (auto *FD = dyn_cast<FuncDecl>(M)) {
|
||||
return !isa<AccessorDecl>(FD) && !FD->isFinal();
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
switch (NTD->getKind()) {
|
||||
case DeclKind::Enum: {
|
||||
return getSimilarMemberCount(NTD, VD, [](Decl *M) {
|
||||
return isa<EnumElementDecl>(M);
|
||||
});
|
||||
}
|
||||
case DeclKind::Class:
|
||||
case DeclKind::Struct: {
|
||||
return getSimilarMemberCount(NTD, VD, isStored);
|
||||
}
|
||||
case DeclKind::Class: {
|
||||
if (auto count = getSimilarMemberCount(NTD, VD, isStored)) {
|
||||
return count;
|
||||
} else {
|
||||
return getSimilarMemberCount(NTD, VD, isNonfinalFunc);
|
||||
}
|
||||
}
|
||||
default:
|
||||
llvm_unreachable("bad nominal type kind.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user