Skip to content

Commit 639fb1d

Browse files
authored
Merge pull request #19564 from nkcsgexi/remove-alias-abi
swift-module-digester: exclude TypeAliasDecl entirely when checking ABI stability.
2 parents aface46 + 67c7d37 commit 639fb1d

File tree

3 files changed

+5
-36
lines changed

3 files changed

+5
-36
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ cake1: Protocol P3 has generic signature change from <τ_0_0 : P1, τ_0_0 : P2>
77

88
/* Removed Decls */
99
cake1: AssociatedType RequiementChanges.removedType has been removed
10+
cake1: Class C3 has been removed
1011
cake1: Constructor Somestruct2.init(_:) has been removed
1112
cake1: Constructor fixedLayoutStruct.init(b:a:) has been removed
1213
cake1: Func C4.foo() has been removed

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

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -503,24 +503,6 @@
503503
}
504504
]
505505
},
506-
{
507-
"kind": "TypeAlias",
508-
"name": "RawValue",
509-
"printedName": "RawValue",
510-
"declKind": "TypeAlias",
511-
"usr": "s:4cake6NumberO8RawValuea",
512-
"location": "",
513-
"moduleName": "cake",
514-
"implicit": true,
515-
"children": [
516-
{
517-
"kind": "TypeNominal",
518-
"name": "Int",
519-
"printedName": "Int",
520-
"usr": "s:Si"
521-
}
522-
]
523-
},
524506
{
525507
"kind": "Var",
526508
"name": "hashValue",
@@ -1001,24 +983,6 @@
1001983
]
1002984
}
1003985
]
1004-
},
1005-
{
1006-
"kind": "TypeAlias",
1007-
"name": "NonReqAlias",
1008-
"printedName": "NonReqAlias",
1009-
"declKind": "TypeAlias",
1010-
"usr": "s:4cake21ProWithAssociatedTypePAAE11NonReqAliasa",
1011-
"location": "",
1012-
"moduleName": "cake",
1013-
"genericSig": "<τ_0_0 where τ_0_0 : ProWithAssociatedType>",
1014-
"children": [
1015-
{
1016-
"kind": "TypeNominal",
1017-
"name": "Int",
1018-
"printedName": "Int",
1019-
"usr": "s:Si"
1020-
}
1021-
]
1022986
}
1023987
]
1024988
},

tools/swift-api-digester/ModuleAnalyzerNodes.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,6 +1158,10 @@ SwiftDeclCollector::shouldIgnore(Decl *D, const Decl* Parent) {
11581158
return true;
11591159
if (VD->getBaseName().empty())
11601160
return true;
1161+
1162+
// Exclude type alias decls because they should have no impact on ABI.
1163+
if (isa<TypeAliasDecl>(VD) && Ctx.checkingABI())
1164+
return true;
11611165
switch (VD->getFormalAccess()) {
11621166
case AccessLevel::Internal:
11631167
case AccessLevel::Private:

0 commit comments

Comments
 (0)