Skip to content

Commit 897bd3c

Browse files
committed
swift-module-digester: non-final methods in fixed-layout classes no longer have fixed orders. rdar://46617463
1 parent 9eb1a70 commit 897bd3c

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

test/api-digester/Outputs/Cake-abi.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,11 @@ cake1: Var GlobalVarChangedToLet changes from var to let
5757
/* Fixed-layout Type changes */
5858
cake1: EnumElement FrozenKind.Fixed in a non-resilient type changes position from 1 to 2
5959
cake1: EnumElement FrozenKind.Rigid in a non-resilient type changes position from 2 to 1
60-
cake1: Func _NoResilientClass.FuncPositionChange0() in a non-resilient type changes position from 0 to 2
61-
cake1: Func _NoResilientClass.NoLongerFinalFunc() is now a non-final instance function
6260
cake1: Var fixedLayoutStruct.a in a non-resilient type changes position from 1 to 0
6361
cake1: Var fixedLayoutStruct.b in a non-resilient type changes position from 0 to 1
6462
cake1: Var fixedLayoutStruct2.BecomeFixedBinaryOrder is now a stored property
6563
cake1: Var fixedLayoutStruct2.NoLongerWithFixedBinaryOrder is no longer a stored property
6664
cake2: EnumElement FrozenKind.AddedCase is added to a non-resilient type
67-
cake2: Func _NoResilientClass.FuncPositionChange2() is added to a non-resilient type
6865
cake2: Var fixedLayoutStruct.c is added to a non-resilient type
6966
cake2: Var fixedLayoutStruct.lazy_d.storage is added to a non-resilient type
7067

test/api-digester/Outputs/cake-abi.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@
212212
"usr": "s:4cake2C1C4foo1yyFZ",
213213
"moduleName": "cake",
214214
"static": true,
215-
"fixedbinaryorder": 0,
216215
"funcSelfKind": "NonMutating"
217216
},
218217
{

tools/swift-api-digester/ModuleAnalyzerNodes.cpp

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,30 +1073,17 @@ Optional<uint8_t> SDKContext::getFixedBinaryOrder(ValueDecl *VD) const {
10731073
}
10741074
return false;
10751075
};
1076-
// The relative order of non-final instance functions matters for non-resilient
1077-
// class.
1078-
auto isNonfinalFunc = [](Decl *M) {
1079-
if (auto *FD = dyn_cast<FuncDecl>(M)) {
1080-
return !isa<AccessorDecl>(FD) && !FD->isFinal();
1081-
}
1082-
return false;
1083-
};
1076+
10841077
switch (NTD->getKind()) {
10851078
case DeclKind::Enum: {
10861079
return getSimilarMemberCount(NTD, VD, [](Decl *M) {
10871080
return isa<EnumElementDecl>(M);
10881081
});
10891082
}
1083+
case DeclKind::Class:
10901084
case DeclKind::Struct: {
10911085
return getSimilarMemberCount(NTD, VD, isStored);
10921086
}
1093-
case DeclKind::Class: {
1094-
if (auto count = getSimilarMemberCount(NTD, VD, isStored)) {
1095-
return count;
1096-
} else {
1097-
return getSimilarMemberCount(NTD, VD, isNonfinalFunc);
1098-
}
1099-
}
11001087
default:
11011088
llvm_unreachable("bad nominal type kind.");
11021089
}

0 commit comments

Comments
 (0)