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 {
// Avoid adding the same conformance twice.
SmallPtrSet<ProtocolConformance*, 4> Seen;
for (auto &Conf: NTD->getAllConformances()) {
for (auto &Conf: NTD->getAllConformances(/*sorted=*/true)) {
if (!Ctx.shouldIgnore(Conf->getProtocol()) && !Seen.count(Conf))
Root->addConformance(constructConformanceNode(Conf));
Seen.insert(Conf);

View File

@@ -232,20 +232,6 @@
"Frozen"
],
"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",
"name": "BitwiseCopyable",
@@ -267,6 +253,13 @@
"usr": "s:s9EscapableP",
"mangledName": "$ss9EscapableP"
},
{
"kind": "Conformance",
"name": "Sendable",
"printedName": "Sendable",
"usr": "s:s8SendableP",
"mangledName": "$ss8SendableP"
},
{
"kind": "Conformance",
"name": "SendableMetatype",
@@ -274,6 +267,13 @@
"usr": "s:s16SendableMetatypeP",
"mangledName": "$ss16SendableMetatypeP"
},
{
"kind": "Conformance",
"name": "P1",
"printedName": "P1",
"usr": "s:4cake2P1P",
"mangledName": "$s4cake2P1P"
},
{
"kind": "Conformance",
"name": "P2",
@@ -801,6 +801,13 @@
"enumRawTypeName": "Int",
"isEnumExhaustive": true,
"conformances": [
{
"kind": "Conformance",
"name": "Copyable",
"printedName": "Copyable",
"usr": "s:s8CopyableP",
"mangledName": "$ss8CopyableP"
},
{
"kind": "Conformance",
"name": "Equatable",
@@ -808,6 +815,13 @@
"usr": "s:SQ",
"mangledName": "$sSQ"
},
{
"kind": "Conformance",
"name": "Escapable",
"printedName": "Escapable",
"usr": "s:s9EscapableP",
"mangledName": "$ss9EscapableP"
},
{
"kind": "Conformance",
"name": "Hashable",
@@ -836,20 +850,6 @@
],
"usr": "s:SY",
"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"
],
"conformances": [
{
"kind": "Conformance",
"name": "Sendable",
"printedName": "Sendable",
"usr": "s:s8SendableP",
"mangledName": "$ss8SendableP"
},
{
"kind": "Conformance",
"name": "BitwiseCopyable",
@@ -1075,6 +1068,13 @@
"usr": "s:s9EscapableP",
"mangledName": "$ss9EscapableP"
},
{
"kind": "Conformance",
"name": "Sendable",
"printedName": "Sendable",
"usr": "s:s8SendableP",
"mangledName": "$ss8SendableP"
},
{
"kind": "Conformance",
"name": "SendableMetatype",
@@ -1998,24 +1998,10 @@
"conformances": [
{
"kind": "Conformance",
"name": "FixedWidthInteger",
"printedName": "FixedWidthInteger",
"usr": "s:s17FixedWidthIntegerP",
"mangledName": "$ss17FixedWidthIntegerP"
},
{
"kind": "Conformance",
"name": "SignedInteger",
"printedName": "SignedInteger",
"usr": "s:SZ",
"mangledName": "$sSZ"
},
{
"kind": "Conformance",
"name": "_ExpressibleByBuiltinIntegerLiteral",
"printedName": "_ExpressibleByBuiltinIntegerLiteral",
"usr": "s:s35_ExpressibleByBuiltinIntegerLiteralP",
"mangledName": "$ss35_ExpressibleByBuiltinIntegerLiteralP"
"name": "AdditiveArithmetic",
"printedName": "AdditiveArithmetic",
"usr": "s:s18AdditiveArithmeticP",
"mangledName": "$ss18AdditiveArithmeticP"
},
{
"kind": "Conformance",
@@ -2041,39 +2027,45 @@
},
{
"kind": "Conformance",
"name": "LosslessStringConvertible",
"printedName": "LosslessStringConvertible",
"usr": "s:s25LosslessStringConvertibleP",
"mangledName": "$ss25LosslessStringConvertibleP"
"name": "BitwiseCopyable",
"printedName": "BitwiseCopyable",
"usr": "s:s15BitwiseCopyableP",
"mangledName": "$ss15BitwiseCopyableP"
},
{
"kind": "Conformance",
"name": "SignedNumeric",
"printedName": "SignedNumeric",
"usr": "s:s13SignedNumericP",
"mangledName": "$ss13SignedNumericP"
"name": "CVarArg",
"printedName": "CVarArg",
"usr": "s:s7CVarArgP",
"mangledName": "$ss7CVarArgP"
},
{
"kind": "Conformance",
"name": "Numeric",
"printedName": "Numeric",
"children": [
"name": "CodingKeyRepresentable",
"printedName": "CodingKeyRepresentable",
"usr": "s:s22CodingKeyRepresentableP",
"mangledName": "$ss22CodingKeyRepresentableP"
},
{
"kind": "TypeWitness",
"name": "Magnitude",
"printedName": "Magnitude",
"children": [
"kind": "Conformance",
"name": "Comparable",
"printedName": "Comparable",
"usr": "s:SL",
"mangledName": "$sSL"
},
{
"kind": "TypeNominal",
"name": "UInt",
"printedName": "Swift.UInt",
"usr": "s:Su"
}
]
}
],
"usr": "s:Sj",
"mangledName": "$sSj"
"kind": "Conformance",
"name": "Copyable",
"printedName": "Copyable",
"usr": "s:s8CopyableP",
"mangledName": "$ss8CopyableP"
},
{
"kind": "Conformance",
"name": "CustomReflectable",
"printedName": "CustomReflectable",
"usr": "s:s17CustomReflectableP",
"mangledName": "$ss17CustomReflectableP"
},
{
"kind": "Conformance",
@@ -2084,32 +2076,31 @@
},
{
"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"
"name": "Decodable",
"printedName": "Decodable",
"usr": "s:Se",
"mangledName": "$sSe"
},
{
"kind": "Conformance",
"name": "AdditiveArithmetic",
"printedName": "AdditiveArithmetic",
"usr": "s:s18AdditiveArithmeticP",
"mangledName": "$ss18AdditiveArithmeticP"
"name": "Encodable",
"printedName": "Encodable",
"usr": "s:SE",
"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",
@@ -2135,80 +2126,10 @@
},
{
"kind": "Conformance",
"name": "Comparable",
"printedName": "Comparable",
"usr": "s:SL",
"mangledName": "$sSL"
},
{
"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"
"name": "FixedWidthInteger",
"printedName": "FixedWidthInteger",
"usr": "s:s17FixedWidthIntegerP",
"mangledName": "$ss17FixedWidthIntegerP"
},
{
"kind": "Conformance",
@@ -2219,31 +2140,39 @@
},
{
"kind": "Conformance",
"name": "Equatable",
"printedName": "Equatable",
"usr": "s:SQ",
"mangledName": "$sSQ"
"name": "LosslessStringConvertible",
"printedName": "LosslessStringConvertible",
"usr": "s:s25LosslessStringConvertibleP",
"mangledName": "$ss25LosslessStringConvertibleP"
},
{
"kind": "Conformance",
"name": "_HasCustomAnyHashableRepresentation",
"printedName": "_HasCustomAnyHashableRepresentation",
"usr": "s:s35_HasCustomAnyHashableRepresentationP",
"mangledName": "$ss35_HasCustomAnyHashableRepresentationP"
"name": "MirrorPath",
"printedName": "MirrorPath",
"usr": "s:s10MirrorPathP",
"mangledName": "$ss10MirrorPathP"
},
{
"kind": "Conformance",
"name": "Sendable",
"printedName": "Sendable",
"usr": "s:s8SendableP",
"mangledName": "$ss8SendableP"
},
"name": "Numeric",
"printedName": "Numeric",
"children": [
{
"kind": "Conformance",
"name": "SendableMetatype",
"printedName": "SendableMetatype",
"usr": "s:s16SendableMetatypeP",
"mangledName": "$ss16SendableMetatypeP"
"kind": "TypeWitness",
"name": "Magnitude",
"printedName": "Magnitude",
"children": [
{
"kind": "TypeNominal",
"name": "UInt",
"printedName": "Swift.UInt",
"usr": "s:Su"
}
]
}
],
"usr": "s:Sj",
"mangledName": "$sSj"
},
{
"kind": "Conformance",
@@ -2347,10 +2276,81 @@
},
{
"kind": "Conformance",
"name": "BitwiseCopyable",
"printedName": "BitwiseCopyable",
"usr": "s:s15BitwiseCopyableP",
"mangledName": "$ss15BitwiseCopyableP"
"name": "Sendable",
"printedName": "Sendable",
"usr": "s:s8SendableP",
"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"
],
"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",
"name": "BitwiseCopyable",
@@ -272,6 +258,13 @@
"usr": "s:s9EscapableP",
"mangledName": "$ss9EscapableP"
},
{
"kind": "Conformance",
"name": "Sendable",
"printedName": "Sendable",
"usr": "s:s8SendableP",
"mangledName": "$ss8SendableP"
},
{
"kind": "Conformance",
"name": "SendableMetatype",
@@ -279,6 +272,13 @@
"usr": "s:s16SendableMetatypeP",
"mangledName": "$ss16SendableMetatypeP"
},
{
"kind": "Conformance",
"name": "P1",
"printedName": "P1",
"usr": "s:4cake2P1P",
"mangledName": "$s4cake2P1P"
},
{
"kind": "Conformance",
"name": "P2",
@@ -814,6 +814,13 @@
"enumRawTypeName": "Int",
"isEnumExhaustive": true,
"conformances": [
{
"kind": "Conformance",
"name": "Copyable",
"printedName": "Copyable",
"usr": "s:s8CopyableP",
"mangledName": "$ss8CopyableP"
},
{
"kind": "Conformance",
"name": "Equatable",
@@ -821,6 +828,13 @@
"usr": "s:SQ",
"mangledName": "$sSQ"
},
{
"kind": "Conformance",
"name": "Escapable",
"printedName": "Escapable",
"usr": "s:s9EscapableP",
"mangledName": "$ss9EscapableP"
},
{
"kind": "Conformance",
"name": "Hashable",
@@ -849,20 +863,6 @@
],
"usr": "s:SY",
"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"
],
"conformances": [
{
"kind": "Conformance",
"name": "Sendable",
"printedName": "Sendable",
"usr": "s:s8SendableP",
"mangledName": "$ss8SendableP"
},
{
"kind": "Conformance",
"name": "BitwiseCopyable",
@@ -1018,6 +1011,13 @@
"usr": "s:s9EscapableP",
"mangledName": "$ss9EscapableP"
},
{
"kind": "Conformance",
"name": "Sendable",
"printedName": "Sendable",
"usr": "s:s8SendableP",
"mangledName": "$ss8SendableP"
},
{
"kind": "Conformance",
"name": "SendableMetatype",
@@ -1885,17 +1885,10 @@
"conformances": [
{
"kind": "Conformance",
"name": "FixedWidthInteger",
"printedName": "FixedWidthInteger",
"usr": "s:s17FixedWidthIntegerP",
"mangledName": "$ss17FixedWidthIntegerP"
},
{
"kind": "Conformance",
"name": "SignedInteger",
"printedName": "SignedInteger",
"usr": "s:SZ",
"mangledName": "$sSZ"
"name": "AdditiveArithmetic",
"printedName": "AdditiveArithmetic",
"usr": "s:s18AdditiveArithmeticP",
"mangledName": "$ss18AdditiveArithmeticP"
},
{
"kind": "Conformance",
@@ -1921,46 +1914,45 @@
},
{
"kind": "Conformance",
"name": "LosslessStringConvertible",
"printedName": "LosslessStringConvertible",
"usr": "s:s25LosslessStringConvertibleP",
"mangledName": "$ss25LosslessStringConvertibleP"
"name": "BitwiseCopyable",
"printedName": "BitwiseCopyable",
"usr": "s:s15BitwiseCopyableP",
"mangledName": "$ss15BitwiseCopyableP"
},
{
"kind": "Conformance",
"name": "SignedNumeric",
"printedName": "SignedNumeric",
"usr": "s:s13SignedNumericP",
"mangledName": "$ss13SignedNumericP"
"name": "CVarArg",
"printedName": "CVarArg",
"usr": "s:s7CVarArgP",
"mangledName": "$ss7CVarArgP"
},
{
"kind": "Conformance",
"name": "Numeric",
"printedName": "Numeric",
"children": [
"name": "CodingKeyRepresentable",
"printedName": "CodingKeyRepresentable",
"usr": "s:s22CodingKeyRepresentableP",
"mangledName": "$ss22CodingKeyRepresentableP"
},
{
"kind": "TypeWitness",
"name": "Magnitude",
"printedName": "Magnitude",
"children": [
"kind": "Conformance",
"name": "Comparable",
"printedName": "Comparable",
"usr": "s:SL",
"mangledName": "$sSL"
},
{
"kind": "TypeNameAlias",
"name": "Magnitude",
"printedName": "Swift.Int.Magnitude",
"children": [
"kind": "Conformance",
"name": "Copyable",
"printedName": "Copyable",
"usr": "s:s8CopyableP",
"mangledName": "$ss8CopyableP"
},
{
"kind": "TypeNominal",
"name": "UInt",
"printedName": "Swift.UInt",
"usr": "s:Su"
}
]
}
]
}
],
"usr": "s:Sj",
"mangledName": "$sSj"
"kind": "Conformance",
"name": "CustomReflectable",
"printedName": "CustomReflectable",
"usr": "s:s17CustomReflectableP",
"mangledName": "$ss17CustomReflectableP"
},
{
"kind": "Conformance",
@@ -1971,32 +1963,31 @@
},
{
"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"
"name": "Decodable",
"printedName": "Decodable",
"usr": "s:Se",
"mangledName": "$sSe"
},
{
"kind": "Conformance",
"name": "AdditiveArithmetic",
"printedName": "AdditiveArithmetic",
"usr": "s:s18AdditiveArithmeticP",
"mangledName": "$ss18AdditiveArithmeticP"
"name": "Encodable",
"printedName": "Encodable",
"usr": "s:SE",
"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",
@@ -2029,73 +2020,10 @@
},
{
"kind": "Conformance",
"name": "Comparable",
"printedName": "Comparable",
"usr": "s:SL",
"mangledName": "$sSL"
},
{
"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"
"name": "FixedWidthInteger",
"printedName": "FixedWidthInteger",
"usr": "s:s17FixedWidthIntegerP",
"mangledName": "$ss17FixedWidthIntegerP"
},
{
"kind": "Conformance",
@@ -2106,24 +2034,46 @@
},
{
"kind": "Conformance",
"name": "Equatable",
"printedName": "Equatable",
"usr": "s:SQ",
"mangledName": "$sSQ"
"name": "LosslessStringConvertible",
"printedName": "LosslessStringConvertible",
"usr": "s:s25LosslessStringConvertibleP",
"mangledName": "$ss25LosslessStringConvertibleP"
},
{
"kind": "Conformance",
"name": "Sendable",
"printedName": "Sendable",
"usr": "s:s8SendableP",
"mangledName": "$ss8SendableP"
"name": "MirrorPath",
"printedName": "MirrorPath",
"usr": "s:s10MirrorPathP",
"mangledName": "$ss10MirrorPathP"
},
{
"kind": "Conformance",
"name": "SendableMetatype",
"printedName": "SendableMetatype",
"usr": "s:s16SendableMetatypeP",
"mangledName": "$ss16SendableMetatypeP"
"name": "Numeric",
"printedName": "Numeric",
"children": [
{
"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",
@@ -2234,10 +2184,60 @@
},
{
"kind": "Conformance",
"name": "BitwiseCopyable",
"printedName": "BitwiseCopyable",
"usr": "s:s15BitwiseCopyableP",
"mangledName": "$ss15BitwiseCopyableP"
"name": "Sendable",
"printedName": "Sendable",
"usr": "s:s8SendableP",
"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
// RUN: %empty-directory(%t.mod)
// RUN: %empty-directory(%t.sdk)
// 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: %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: diff -u %S/Outputs/cake-abi.json %t.dump.json
// RUN: %api-digester -diagnose-sdk --input-paths %t.dump.json -input-paths %S/Outputs/cake.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/dump-module/cake.json
// Round-trip testing:
// RUN: %api-digester -deserialize-sdk --input-paths %S/Outputs/cake.json -o %t.dump.json
// RUN: diff -u %S/Outputs/cake.json %t.dump.json
// RUN: %api-digester -deserialize-sdk --input-paths %S/Outputs/cake-abi.json -o %t.dump.json
// RUN: diff -u %S/Outputs/cake-abi.json %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/dump-module/cake.json %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/dump-module/cake-abi.json %t.dump.json
// 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