APIDigester: Sort conformances when dumping sdk

See https://github.com/swiftlang/swift/pull/84193 for context.
This commit is contained in:
Anthony Latsis
2025-09-12 14:24:16 +01:00
parent f24f5de76e
commit e101d0aa58
4 changed files with 397 additions and 394 deletions

View File

@@ -1988,7 +1988,7 @@ SwiftDeclCollector::addConformancesToTypeDecl(SDKNodeDeclType *Root,
} else { } else {
// Avoid adding the same conformance twice. // Avoid adding the same conformance twice.
SmallPtrSet<ProtocolConformance*, 4> Seen; SmallPtrSet<ProtocolConformance*, 4> Seen;
for (auto &Conf: NTD->getAllConformances()) { for (auto &Conf: NTD->getAllConformances(/*sorted=*/true)) {
if (!Ctx.shouldIgnore(Conf->getProtocol()) && !Seen.count(Conf)) if (!Ctx.shouldIgnore(Conf->getProtocol()) && !Seen.count(Conf))
Root->addConformance(constructConformanceNode(Conf)); Root->addConformance(constructConformanceNode(Conf));
Seen.insert(Conf); Seen.insert(Conf);

View File

@@ -232,20 +232,6 @@
"Frozen" "Frozen"
], ],
"conformances": [ "conformances": [
{
"kind": "Conformance",
"name": "P1",
"printedName": "P1",
"usr": "s:4cake2P1P",
"mangledName": "$s4cake2P1P"
},
{
"kind": "Conformance",
"name": "Sendable",
"printedName": "Sendable",
"usr": "s:s8SendableP",
"mangledName": "$ss8SendableP"
},
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "BitwiseCopyable", "name": "BitwiseCopyable",
@@ -267,6 +253,13 @@
"usr": "s:s9EscapableP", "usr": "s:s9EscapableP",
"mangledName": "$ss9EscapableP" "mangledName": "$ss9EscapableP"
}, },
{
"kind": "Conformance",
"name": "Sendable",
"printedName": "Sendable",
"usr": "s:s8SendableP",
"mangledName": "$ss8SendableP"
},
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "SendableMetatype", "name": "SendableMetatype",
@@ -274,6 +267,13 @@
"usr": "s:s16SendableMetatypeP", "usr": "s:s16SendableMetatypeP",
"mangledName": "$ss16SendableMetatypeP" "mangledName": "$ss16SendableMetatypeP"
}, },
{
"kind": "Conformance",
"name": "P1",
"printedName": "P1",
"usr": "s:4cake2P1P",
"mangledName": "$s4cake2P1P"
},
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "P2", "name": "P2",
@@ -801,6 +801,13 @@
"enumRawTypeName": "Int", "enumRawTypeName": "Int",
"isEnumExhaustive": true, "isEnumExhaustive": true,
"conformances": [ "conformances": [
{
"kind": "Conformance",
"name": "Copyable",
"printedName": "Copyable",
"usr": "s:s8CopyableP",
"mangledName": "$ss8CopyableP"
},
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "Equatable", "name": "Equatable",
@@ -808,6 +815,13 @@
"usr": "s:SQ", "usr": "s:SQ",
"mangledName": "$sSQ" "mangledName": "$sSQ"
}, },
{
"kind": "Conformance",
"name": "Escapable",
"printedName": "Escapable",
"usr": "s:s9EscapableP",
"mangledName": "$ss9EscapableP"
},
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "Hashable", "name": "Hashable",
@@ -836,20 +850,6 @@
], ],
"usr": "s:SY", "usr": "s:SY",
"mangledName": "$sSY" "mangledName": "$sSY"
},
{
"kind": "Conformance",
"name": "Copyable",
"printedName": "Copyable",
"usr": "s:s8CopyableP",
"mangledName": "$ss8CopyableP"
},
{
"kind": "Conformance",
"name": "Escapable",
"printedName": "Escapable",
"usr": "s:s9EscapableP",
"mangledName": "$ss9EscapableP"
} }
] ]
}, },
@@ -1047,13 +1047,6 @@
"Frozen" "Frozen"
], ],
"conformances": [ "conformances": [
{
"kind": "Conformance",
"name": "Sendable",
"printedName": "Sendable",
"usr": "s:s8SendableP",
"mangledName": "$ss8SendableP"
},
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "BitwiseCopyable", "name": "BitwiseCopyable",
@@ -1075,6 +1068,13 @@
"usr": "s:s9EscapableP", "usr": "s:s9EscapableP",
"mangledName": "$ss9EscapableP" "mangledName": "$ss9EscapableP"
}, },
{
"kind": "Conformance",
"name": "Sendable",
"printedName": "Sendable",
"usr": "s:s8SendableP",
"mangledName": "$ss8SendableP"
},
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "SendableMetatype", "name": "SendableMetatype",
@@ -1998,24 +1998,10 @@
"conformances": [ "conformances": [
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "FixedWidthInteger", "name": "AdditiveArithmetic",
"printedName": "FixedWidthInteger", "printedName": "AdditiveArithmetic",
"usr": "s:s17FixedWidthIntegerP", "usr": "s:s18AdditiveArithmeticP",
"mangledName": "$ss17FixedWidthIntegerP" "mangledName": "$ss18AdditiveArithmeticP"
},
{
"kind": "Conformance",
"name": "SignedInteger",
"printedName": "SignedInteger",
"usr": "s:SZ",
"mangledName": "$sSZ"
},
{
"kind": "Conformance",
"name": "_ExpressibleByBuiltinIntegerLiteral",
"printedName": "_ExpressibleByBuiltinIntegerLiteral",
"usr": "s:s35_ExpressibleByBuiltinIntegerLiteralP",
"mangledName": "$ss35_ExpressibleByBuiltinIntegerLiteralP"
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
@@ -2041,39 +2027,45 @@
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "LosslessStringConvertible", "name": "BitwiseCopyable",
"printedName": "LosslessStringConvertible", "printedName": "BitwiseCopyable",
"usr": "s:s25LosslessStringConvertibleP", "usr": "s:s15BitwiseCopyableP",
"mangledName": "$ss25LosslessStringConvertibleP" "mangledName": "$ss15BitwiseCopyableP"
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "SignedNumeric", "name": "CVarArg",
"printedName": "SignedNumeric", "printedName": "CVarArg",
"usr": "s:s13SignedNumericP", "usr": "s:s7CVarArgP",
"mangledName": "$ss13SignedNumericP" "mangledName": "$ss7CVarArgP"
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "Numeric", "name": "CodingKeyRepresentable",
"printedName": "Numeric", "printedName": "CodingKeyRepresentable",
"children": [ "usr": "s:s22CodingKeyRepresentableP",
{ "mangledName": "$ss22CodingKeyRepresentableP"
"kind": "TypeWitness", },
"name": "Magnitude", {
"printedName": "Magnitude", "kind": "Conformance",
"children": [ "name": "Comparable",
{ "printedName": "Comparable",
"kind": "TypeNominal", "usr": "s:SL",
"name": "UInt", "mangledName": "$sSL"
"printedName": "Swift.UInt", },
"usr": "s:Su" {
} "kind": "Conformance",
] "name": "Copyable",
} "printedName": "Copyable",
], "usr": "s:s8CopyableP",
"usr": "s:Sj", "mangledName": "$ss8CopyableP"
"mangledName": "$sSj" },
{
"kind": "Conformance",
"name": "CustomReflectable",
"printedName": "CustomReflectable",
"usr": "s:s17CustomReflectableP",
"mangledName": "$ss17CustomReflectableP"
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
@@ -2084,32 +2076,31 @@
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "Strideable", "name": "Decodable",
"printedName": "Strideable", "printedName": "Decodable",
"children": [ "usr": "s:Se",
{ "mangledName": "$sSe"
"kind": "TypeWitness",
"name": "Stride",
"printedName": "Stride",
"children": [
{
"kind": "TypeNominal",
"name": "Int",
"printedName": "Swift.Int",
"usr": "s:Si"
}
]
}
],
"usr": "s:Sx",
"mangledName": "$sSx"
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "AdditiveArithmetic", "name": "Encodable",
"printedName": "AdditiveArithmetic", "printedName": "Encodable",
"usr": "s:s18AdditiveArithmeticP", "usr": "s:SE",
"mangledName": "$ss18AdditiveArithmeticP" "mangledName": "$sSE"
},
{
"kind": "Conformance",
"name": "Equatable",
"printedName": "Equatable",
"usr": "s:SQ",
"mangledName": "$sSQ"
},
{
"kind": "Conformance",
"name": "Escapable",
"printedName": "Escapable",
"usr": "s:s9EscapableP",
"mangledName": "$ss9EscapableP"
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
@@ -2135,80 +2126,10 @@
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "Comparable", "name": "FixedWidthInteger",
"printedName": "Comparable", "printedName": "FixedWidthInteger",
"usr": "s:SL", "usr": "s:s17FixedWidthIntegerP",
"mangledName": "$sSL" "mangledName": "$ss17FixedWidthIntegerP"
},
{
"kind": "Conformance",
"name": "Copyable",
"printedName": "Copyable",
"usr": "s:s8CopyableP",
"mangledName": "$ss8CopyableP"
},
{
"kind": "Conformance",
"name": "Escapable",
"printedName": "Escapable",
"usr": "s:s9EscapableP",
"mangledName": "$ss9EscapableP"
},
{
"kind": "Conformance",
"name": "P1",
"printedName": "P1",
"usr": "s:4cake2P1P",
"mangledName": "$s4cake2P1P"
},
{
"kind": "Conformance",
"name": "Encodable",
"printedName": "Encodable",
"usr": "s:SE",
"mangledName": "$sSE"
},
{
"kind": "Conformance",
"name": "Decodable",
"printedName": "Decodable",
"usr": "s:Se",
"mangledName": "$sSe"
},
{
"kind": "Conformance",
"name": "CodingKeyRepresentable",
"printedName": "CodingKeyRepresentable",
"usr": "s:s22CodingKeyRepresentableP",
"mangledName": "$ss22CodingKeyRepresentableP"
},
{
"kind": "Conformance",
"name": "CustomReflectable",
"printedName": "CustomReflectable",
"usr": "s:s17CustomReflectableP",
"mangledName": "$ss17CustomReflectableP"
},
{
"kind": "Conformance",
"name": "_CustomPlaygroundQuickLookable",
"printedName": "_CustomPlaygroundQuickLookable",
"usr": "s:s30_CustomPlaygroundQuickLookableP",
"mangledName": "$ss30_CustomPlaygroundQuickLookableP"
},
{
"kind": "Conformance",
"name": "MirrorPath",
"printedName": "MirrorPath",
"usr": "s:s10MirrorPathP",
"mangledName": "$ss10MirrorPathP"
},
{
"kind": "Conformance",
"name": "CVarArg",
"printedName": "CVarArg",
"usr": "s:s7CVarArgP",
"mangledName": "$ss7CVarArgP"
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
@@ -2219,31 +2140,39 @@
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "Equatable", "name": "LosslessStringConvertible",
"printedName": "Equatable", "printedName": "LosslessStringConvertible",
"usr": "s:SQ", "usr": "s:s25LosslessStringConvertibleP",
"mangledName": "$sSQ" "mangledName": "$ss25LosslessStringConvertibleP"
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "_HasCustomAnyHashableRepresentation", "name": "MirrorPath",
"printedName": "_HasCustomAnyHashableRepresentation", "printedName": "MirrorPath",
"usr": "s:s35_HasCustomAnyHashableRepresentationP", "usr": "s:s10MirrorPathP",
"mangledName": "$ss35_HasCustomAnyHashableRepresentationP" "mangledName": "$ss10MirrorPathP"
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "Sendable", "name": "Numeric",
"printedName": "Sendable", "printedName": "Numeric",
"usr": "s:s8SendableP", "children": [
"mangledName": "$ss8SendableP" {
}, "kind": "TypeWitness",
{ "name": "Magnitude",
"kind": "Conformance", "printedName": "Magnitude",
"name": "SendableMetatype", "children": [
"printedName": "SendableMetatype", {
"usr": "s:s16SendableMetatypeP", "kind": "TypeNominal",
"mangledName": "$ss16SendableMetatypeP" "name": "UInt",
"printedName": "Swift.UInt",
"usr": "s:Su"
}
]
}
],
"usr": "s:Sj",
"mangledName": "$sSj"
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
@@ -2347,10 +2276,81 @@
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "BitwiseCopyable", "name": "Sendable",
"printedName": "BitwiseCopyable", "printedName": "Sendable",
"usr": "s:s15BitwiseCopyableP", "usr": "s:s8SendableP",
"mangledName": "$ss15BitwiseCopyableP" "mangledName": "$ss8SendableP"
},
{
"kind": "Conformance",
"name": "SendableMetatype",
"printedName": "SendableMetatype",
"usr": "s:s16SendableMetatypeP",
"mangledName": "$ss16SendableMetatypeP"
},
{
"kind": "Conformance",
"name": "SignedInteger",
"printedName": "SignedInteger",
"usr": "s:SZ",
"mangledName": "$sSZ"
},
{
"kind": "Conformance",
"name": "SignedNumeric",
"printedName": "SignedNumeric",
"usr": "s:s13SignedNumericP",
"mangledName": "$ss13SignedNumericP"
},
{
"kind": "Conformance",
"name": "Strideable",
"printedName": "Strideable",
"children": [
{
"kind": "TypeWitness",
"name": "Stride",
"printedName": "Stride",
"children": [
{
"kind": "TypeNominal",
"name": "Int",
"printedName": "Swift.Int",
"usr": "s:Si"
}
]
}
],
"usr": "s:Sx",
"mangledName": "$sSx"
},
{
"kind": "Conformance",
"name": "_CustomPlaygroundQuickLookable",
"printedName": "_CustomPlaygroundQuickLookable",
"usr": "s:s30_CustomPlaygroundQuickLookableP",
"mangledName": "$ss30_CustomPlaygroundQuickLookableP"
},
{
"kind": "Conformance",
"name": "_ExpressibleByBuiltinIntegerLiteral",
"printedName": "_ExpressibleByBuiltinIntegerLiteral",
"usr": "s:s35_ExpressibleByBuiltinIntegerLiteralP",
"mangledName": "$ss35_ExpressibleByBuiltinIntegerLiteralP"
},
{
"kind": "Conformance",
"name": "_HasCustomAnyHashableRepresentation",
"printedName": "_HasCustomAnyHashableRepresentation",
"usr": "s:s35_HasCustomAnyHashableRepresentationP",
"mangledName": "$ss35_HasCustomAnyHashableRepresentationP"
},
{
"kind": "Conformance",
"name": "P1",
"printedName": "P1",
"usr": "s:4cake2P1P",
"mangledName": "$s4cake2P1P"
} }
] ]
} }

View File

@@ -237,20 +237,6 @@
"Frozen" "Frozen"
], ],
"conformances": [ "conformances": [
{
"kind": "Conformance",
"name": "P1",
"printedName": "P1",
"usr": "s:4cake2P1P",
"mangledName": "$s4cake2P1P"
},
{
"kind": "Conformance",
"name": "Sendable",
"printedName": "Sendable",
"usr": "s:s8SendableP",
"mangledName": "$ss8SendableP"
},
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "BitwiseCopyable", "name": "BitwiseCopyable",
@@ -272,6 +258,13 @@
"usr": "s:s9EscapableP", "usr": "s:s9EscapableP",
"mangledName": "$ss9EscapableP" "mangledName": "$ss9EscapableP"
}, },
{
"kind": "Conformance",
"name": "Sendable",
"printedName": "Sendable",
"usr": "s:s8SendableP",
"mangledName": "$ss8SendableP"
},
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "SendableMetatype", "name": "SendableMetatype",
@@ -279,6 +272,13 @@
"usr": "s:s16SendableMetatypeP", "usr": "s:s16SendableMetatypeP",
"mangledName": "$ss16SendableMetatypeP" "mangledName": "$ss16SendableMetatypeP"
}, },
{
"kind": "Conformance",
"name": "P1",
"printedName": "P1",
"usr": "s:4cake2P1P",
"mangledName": "$s4cake2P1P"
},
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "P2", "name": "P2",
@@ -814,6 +814,13 @@
"enumRawTypeName": "Int", "enumRawTypeName": "Int",
"isEnumExhaustive": true, "isEnumExhaustive": true,
"conformances": [ "conformances": [
{
"kind": "Conformance",
"name": "Copyable",
"printedName": "Copyable",
"usr": "s:s8CopyableP",
"mangledName": "$ss8CopyableP"
},
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "Equatable", "name": "Equatable",
@@ -821,6 +828,13 @@
"usr": "s:SQ", "usr": "s:SQ",
"mangledName": "$sSQ" "mangledName": "$sSQ"
}, },
{
"kind": "Conformance",
"name": "Escapable",
"printedName": "Escapable",
"usr": "s:s9EscapableP",
"mangledName": "$ss9EscapableP"
},
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "Hashable", "name": "Hashable",
@@ -849,20 +863,6 @@
], ],
"usr": "s:SY", "usr": "s:SY",
"mangledName": "$sSY" "mangledName": "$sSY"
},
{
"kind": "Conformance",
"name": "Copyable",
"printedName": "Copyable",
"usr": "s:s8CopyableP",
"mangledName": "$ss8CopyableP"
},
{
"kind": "Conformance",
"name": "Escapable",
"printedName": "Escapable",
"usr": "s:s9EscapableP",
"mangledName": "$ss9EscapableP"
} }
] ]
}, },
@@ -990,13 +990,6 @@
"Frozen" "Frozen"
], ],
"conformances": [ "conformances": [
{
"kind": "Conformance",
"name": "Sendable",
"printedName": "Sendable",
"usr": "s:s8SendableP",
"mangledName": "$ss8SendableP"
},
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "BitwiseCopyable", "name": "BitwiseCopyable",
@@ -1018,6 +1011,13 @@
"usr": "s:s9EscapableP", "usr": "s:s9EscapableP",
"mangledName": "$ss9EscapableP" "mangledName": "$ss9EscapableP"
}, },
{
"kind": "Conformance",
"name": "Sendable",
"printedName": "Sendable",
"usr": "s:s8SendableP",
"mangledName": "$ss8SendableP"
},
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "SendableMetatype", "name": "SendableMetatype",
@@ -1885,17 +1885,10 @@
"conformances": [ "conformances": [
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "FixedWidthInteger", "name": "AdditiveArithmetic",
"printedName": "FixedWidthInteger", "printedName": "AdditiveArithmetic",
"usr": "s:s17FixedWidthIntegerP", "usr": "s:s18AdditiveArithmeticP",
"mangledName": "$ss17FixedWidthIntegerP" "mangledName": "$ss18AdditiveArithmeticP"
},
{
"kind": "Conformance",
"name": "SignedInteger",
"printedName": "SignedInteger",
"usr": "s:SZ",
"mangledName": "$sSZ"
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
@@ -1921,46 +1914,45 @@
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "LosslessStringConvertible", "name": "BitwiseCopyable",
"printedName": "LosslessStringConvertible", "printedName": "BitwiseCopyable",
"usr": "s:s25LosslessStringConvertibleP", "usr": "s:s15BitwiseCopyableP",
"mangledName": "$ss25LosslessStringConvertibleP" "mangledName": "$ss15BitwiseCopyableP"
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "SignedNumeric", "name": "CVarArg",
"printedName": "SignedNumeric", "printedName": "CVarArg",
"usr": "s:s13SignedNumericP", "usr": "s:s7CVarArgP",
"mangledName": "$ss13SignedNumericP" "mangledName": "$ss7CVarArgP"
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "Numeric", "name": "CodingKeyRepresentable",
"printedName": "Numeric", "printedName": "CodingKeyRepresentable",
"children": [ "usr": "s:s22CodingKeyRepresentableP",
{ "mangledName": "$ss22CodingKeyRepresentableP"
"kind": "TypeWitness", },
"name": "Magnitude", {
"printedName": "Magnitude", "kind": "Conformance",
"children": [ "name": "Comparable",
{ "printedName": "Comparable",
"kind": "TypeNameAlias", "usr": "s:SL",
"name": "Magnitude", "mangledName": "$sSL"
"printedName": "Swift.Int.Magnitude", },
"children": [ {
{ "kind": "Conformance",
"kind": "TypeNominal", "name": "Copyable",
"name": "UInt", "printedName": "Copyable",
"printedName": "Swift.UInt", "usr": "s:s8CopyableP",
"usr": "s:Su" "mangledName": "$ss8CopyableP"
} },
] {
} "kind": "Conformance",
] "name": "CustomReflectable",
} "printedName": "CustomReflectable",
], "usr": "s:s17CustomReflectableP",
"usr": "s:Sj", "mangledName": "$ss17CustomReflectableP"
"mangledName": "$sSj"
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
@@ -1971,32 +1963,31 @@
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "Strideable", "name": "Decodable",
"printedName": "Strideable", "printedName": "Decodable",
"children": [ "usr": "s:Se",
{ "mangledName": "$sSe"
"kind": "TypeWitness",
"name": "Stride",
"printedName": "Stride",
"children": [
{
"kind": "TypeNominal",
"name": "Int",
"printedName": "Swift.Int",
"usr": "s:Si"
}
]
}
],
"usr": "s:Sx",
"mangledName": "$sSx"
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "AdditiveArithmetic", "name": "Encodable",
"printedName": "AdditiveArithmetic", "printedName": "Encodable",
"usr": "s:s18AdditiveArithmeticP", "usr": "s:SE",
"mangledName": "$ss18AdditiveArithmeticP" "mangledName": "$sSE"
},
{
"kind": "Conformance",
"name": "Equatable",
"printedName": "Equatable",
"usr": "s:SQ",
"mangledName": "$sSQ"
},
{
"kind": "Conformance",
"name": "Escapable",
"printedName": "Escapable",
"usr": "s:s9EscapableP",
"mangledName": "$ss9EscapableP"
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
@@ -2029,73 +2020,10 @@
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "Comparable", "name": "FixedWidthInteger",
"printedName": "Comparable", "printedName": "FixedWidthInteger",
"usr": "s:SL", "usr": "s:s17FixedWidthIntegerP",
"mangledName": "$sSL" "mangledName": "$ss17FixedWidthIntegerP"
},
{
"kind": "Conformance",
"name": "Copyable",
"printedName": "Copyable",
"usr": "s:s8CopyableP",
"mangledName": "$ss8CopyableP"
},
{
"kind": "Conformance",
"name": "Escapable",
"printedName": "Escapable",
"usr": "s:s9EscapableP",
"mangledName": "$ss9EscapableP"
},
{
"kind": "Conformance",
"name": "P1",
"printedName": "P1",
"usr": "s:4cake2P1P",
"mangledName": "$s4cake2P1P"
},
{
"kind": "Conformance",
"name": "Encodable",
"printedName": "Encodable",
"usr": "s:SE",
"mangledName": "$sSE"
},
{
"kind": "Conformance",
"name": "Decodable",
"printedName": "Decodable",
"usr": "s:Se",
"mangledName": "$sSe"
},
{
"kind": "Conformance",
"name": "CodingKeyRepresentable",
"printedName": "CodingKeyRepresentable",
"usr": "s:s22CodingKeyRepresentableP",
"mangledName": "$ss22CodingKeyRepresentableP"
},
{
"kind": "Conformance",
"name": "CustomReflectable",
"printedName": "CustomReflectable",
"usr": "s:s17CustomReflectableP",
"mangledName": "$ss17CustomReflectableP"
},
{
"kind": "Conformance",
"name": "MirrorPath",
"printedName": "MirrorPath",
"usr": "s:s10MirrorPathP",
"mangledName": "$ss10MirrorPathP"
},
{
"kind": "Conformance",
"name": "CVarArg",
"printedName": "CVarArg",
"usr": "s:s7CVarArgP",
"mangledName": "$ss7CVarArgP"
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
@@ -2106,24 +2034,46 @@
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "Equatable", "name": "LosslessStringConvertible",
"printedName": "Equatable", "printedName": "LosslessStringConvertible",
"usr": "s:SQ", "usr": "s:s25LosslessStringConvertibleP",
"mangledName": "$sSQ" "mangledName": "$ss25LosslessStringConvertibleP"
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "Sendable", "name": "MirrorPath",
"printedName": "Sendable", "printedName": "MirrorPath",
"usr": "s:s8SendableP", "usr": "s:s10MirrorPathP",
"mangledName": "$ss8SendableP" "mangledName": "$ss10MirrorPathP"
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "SendableMetatype", "name": "Numeric",
"printedName": "SendableMetatype", "printedName": "Numeric",
"usr": "s:s16SendableMetatypeP", "children": [
"mangledName": "$ss16SendableMetatypeP" {
"kind": "TypeWitness",
"name": "Magnitude",
"printedName": "Magnitude",
"children": [
{
"kind": "TypeNameAlias",
"name": "Magnitude",
"printedName": "Swift.Int.Magnitude",
"children": [
{
"kind": "TypeNominal",
"name": "UInt",
"printedName": "Swift.UInt",
"usr": "s:Su"
}
]
}
]
}
],
"usr": "s:Sj",
"mangledName": "$sSj"
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
@@ -2234,10 +2184,60 @@
}, },
{ {
"kind": "Conformance", "kind": "Conformance",
"name": "BitwiseCopyable", "name": "Sendable",
"printedName": "BitwiseCopyable", "printedName": "Sendable",
"usr": "s:s15BitwiseCopyableP", "usr": "s:s8SendableP",
"mangledName": "$ss15BitwiseCopyableP" "mangledName": "$ss8SendableP"
},
{
"kind": "Conformance",
"name": "SendableMetatype",
"printedName": "SendableMetatype",
"usr": "s:s16SendableMetatypeP",
"mangledName": "$ss16SendableMetatypeP"
},
{
"kind": "Conformance",
"name": "SignedInteger",
"printedName": "SignedInteger",
"usr": "s:SZ",
"mangledName": "$sSZ"
},
{
"kind": "Conformance",
"name": "SignedNumeric",
"printedName": "SignedNumeric",
"usr": "s:s13SignedNumericP",
"mangledName": "$ss13SignedNumericP"
},
{
"kind": "Conformance",
"name": "Strideable",
"printedName": "Strideable",
"children": [
{
"kind": "TypeWitness",
"name": "Stride",
"printedName": "Stride",
"children": [
{
"kind": "TypeNominal",
"name": "Int",
"printedName": "Swift.Int",
"usr": "s:Si"
}
]
}
],
"usr": "s:Sx",
"mangledName": "$sSx"
},
{
"kind": "Conformance",
"name": "P1",
"printedName": "P1",
"usr": "s:4cake2P1P",
"mangledName": "$s4cake2P1P"
} }
] ]
} }

View File

@@ -1,19 +1,22 @@
// REQUIRES: OS=macosx // REQUIRES: OS=macosx
// RUN: %empty-directory(%t.mod) // RUN: %empty-directory(%t.mod)
// RUN: %empty-directory(%t.sdk) // RUN: %empty-directory(%t.sdk)
// RUN: %empty-directory(%t.module-cache) // RUN: %empty-directory(%t.module-cache)
// RUN: %target-swift-frontend -disable-objc-attr-requires-foundation-module -emit-module -o %t.mod/cake.swiftmodule %S/Inputs/cake.swift -parse-as-library -I %S/Inputs/ClangCake %clang-importer-sdk-nosource // RUN: %target-swift-frontend -disable-objc-attr-requires-foundation-module -emit-module -o %t.mod/cake.swiftmodule %S/Inputs/cake.swift -parse-as-library -I %S/Inputs/ClangCake %clang-importer-sdk-nosource
// RUN: %api-digester -dump-sdk -module cake -o %t.dump.json -module-cache-path %t.module-cache -swift-only -I %t.mod -I %S/Inputs/ClangCake %clang-importer-sdk-nosource -avoid-tool-args // RUN: %api-digester -dump-sdk -module cake -o %t.dump.json -module-cache-path %t.module-cache -swift-only -I %t.mod -I %S/Inputs/ClangCake %clang-importer-sdk-nosource -avoid-tool-args
// RUN: diff -u %S/Outputs/cake.json %t.dump.json // RUN: diff -u %S/Outputs/dump-module/cake.json %t.dump.json
// RUN: %api-digester -dump-sdk -module cake -o %t.dump.json -module-cache-path %t.module-cache -swift-only -I %t.mod -abi -I %S/Inputs/ClangCake %clang-importer-sdk-nosource -avoid-tool-args // RUN: %api-digester -dump-sdk -module cake -o %t.dump.json -module-cache-path %t.module-cache -swift-only -I %t.mod -abi -I %S/Inputs/ClangCake %clang-importer-sdk-nosource -avoid-tool-args
// RUN: diff -u %S/Outputs/cake-abi.json %t.dump.json // RUN: diff -u %S/Outputs/dump-module/cake-abi.json %t.dump.json
// RUN: %api-digester -diagnose-sdk --input-paths %t.dump.json -input-paths %S/Outputs/cake.json
// RUN: %api-digester -diagnose-sdk --input-paths %t.dump.json -input-paths %S/Outputs/dump-module/cake.json
// Round-trip testing: // Round-trip testing:
// RUN: %api-digester -deserialize-sdk --input-paths %S/Outputs/cake.json -o %t.dump.json // RUN: %api-digester -deserialize-sdk --input-paths %S/Outputs/dump-module/cake.json -o %t.dump.json
// RUN: diff -u %S/Outputs/cake.json %t.dump.json // RUN: diff -u %S/Outputs/dump-module/cake.json %t.dump.json
// RUN: %api-digester -deserialize-sdk --input-paths %S/Outputs/cake-abi.json -o %t.dump.json // RUN: %api-digester -deserialize-sdk --input-paths %S/Outputs/dump-module/cake-abi.json -o %t.dump.json
// RUN: diff -u %S/Outputs/cake-abi.json %t.dump.json // RUN: diff -u %S/Outputs/dump-module/cake-abi.json %t.dump.json
// The input JSON files need to be modified when standard library declarations // The input JSON files need to be modified when standard library declarations
// are reordered. This is expected behavior and we simply shouldn't run the test // are reordered. This is expected behavior and we simply shouldn't run the test