diff --git a/lib/APIDigester/ModuleAnalyzerNodes.cpp b/lib/APIDigester/ModuleAnalyzerNodes.cpp index c794e7b322dcb..8ede7cfb0cbd7 100644 --- a/lib/APIDigester/ModuleAnalyzerNodes.cpp +++ b/lib/APIDigester/ModuleAnalyzerNodes.cpp @@ -1988,7 +1988,7 @@ SwiftDeclCollector::addConformancesToTypeDecl(SDKNodeDeclType *Root, } else { // Avoid adding the same conformance twice. SmallPtrSet 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); diff --git a/test/api-digester/Outputs/cake-abi.json b/test/api-digester/Outputs/dump-module/cake-abi.json similarity index 100% rename from test/api-digester/Outputs/cake-abi.json rename to test/api-digester/Outputs/dump-module/cake-abi.json index a1697144c7a31..3dc45f9312fce 100644 --- a/test/api-digester/Outputs/cake-abi.json +++ b/test/api-digester/Outputs/dump-module/cake-abi.json @@ -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,97 +2027,24 @@ }, { "kind": "Conformance", - "name": "LosslessStringConvertible", - "printedName": "LosslessStringConvertible", - "usr": "s:s25LosslessStringConvertibleP", - "mangledName": "$ss25LosslessStringConvertibleP" - }, - { - "kind": "Conformance", - "name": "SignedNumeric", - "printedName": "SignedNumeric", - "usr": "s:s13SignedNumericP", - "mangledName": "$ss13SignedNumericP" - }, - { - "kind": "Conformance", - "name": "Numeric", - "printedName": "Numeric", - "children": [ - { - "kind": "TypeWitness", - "name": "Magnitude", - "printedName": "Magnitude", - "children": [ - { - "kind": "TypeNominal", - "name": "UInt", - "printedName": "Swift.UInt", - "usr": "s:Su" - } - ] - } - ], - "usr": "s:Sj", - "mangledName": "$sSj" - }, - { - "kind": "Conformance", - "name": "CustomStringConvertible", - "printedName": "CustomStringConvertible", - "usr": "s:s23CustomStringConvertibleP", - "mangledName": "$ss23CustomStringConvertibleP" - }, - { - "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": "BitwiseCopyable", + "printedName": "BitwiseCopyable", + "usr": "s:s15BitwiseCopyableP", + "mangledName": "$ss15BitwiseCopyableP" }, { "kind": "Conformance", - "name": "AdditiveArithmetic", - "printedName": "AdditiveArithmetic", - "usr": "s:s18AdditiveArithmeticP", - "mangledName": "$ss18AdditiveArithmeticP" + "name": "CVarArg", + "printedName": "CVarArg", + "usr": "s:s7CVarArgP", + "mangledName": "$ss7CVarArgP" }, { "kind": "Conformance", - "name": "ExpressibleByIntegerLiteral", - "printedName": "ExpressibleByIntegerLiteral", - "children": [ - { - "kind": "TypeWitness", - "name": "IntegerLiteralType", - "printedName": "IntegerLiteralType", - "children": [ - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" - } - ] - } - ], - "usr": "s:s27ExpressibleByIntegerLiteralP", - "mangledName": "$ss27ExpressibleByIntegerLiteralP" + "name": "CodingKeyRepresentable", + "printedName": "CodingKeyRepresentable", + "usr": "s:s22CodingKeyRepresentableP", + "mangledName": "$ss22CodingKeyRepresentableP" }, { "kind": "Conformance", @@ -2149,24 +2062,17 @@ }, { "kind": "Conformance", - "name": "Escapable", - "printedName": "Escapable", - "usr": "s:s9EscapableP", - "mangledName": "$ss9EscapableP" - }, - { - "kind": "Conformance", - "name": "P1", - "printedName": "P1", - "usr": "s:4cake2P1P", - "mangledName": "$s4cake2P1P" + "name": "CustomReflectable", + "printedName": "CustomReflectable", + "usr": "s:s17CustomReflectableP", + "mangledName": "$ss17CustomReflectableP" }, { "kind": "Conformance", - "name": "Encodable", - "printedName": "Encodable", - "usr": "s:SE", - "mangledName": "$sSE" + "name": "CustomStringConvertible", + "printedName": "CustomStringConvertible", + "usr": "s:s23CustomStringConvertibleP", + "mangledName": "$ss23CustomStringConvertibleP" }, { "kind": "Conformance", @@ -2177,38 +2083,53 @@ }, { "kind": "Conformance", - "name": "CodingKeyRepresentable", - "printedName": "CodingKeyRepresentable", - "usr": "s:s22CodingKeyRepresentableP", - "mangledName": "$ss22CodingKeyRepresentableP" + "name": "Encodable", + "printedName": "Encodable", + "usr": "s:SE", + "mangledName": "$sSE" }, { "kind": "Conformance", - "name": "CustomReflectable", - "printedName": "CustomReflectable", - "usr": "s:s17CustomReflectableP", - "mangledName": "$ss17CustomReflectableP" + "name": "Equatable", + "printedName": "Equatable", + "usr": "s:SQ", + "mangledName": "$sSQ" }, { "kind": "Conformance", - "name": "_CustomPlaygroundQuickLookable", - "printedName": "_CustomPlaygroundQuickLookable", - "usr": "s:s30_CustomPlaygroundQuickLookableP", - "mangledName": "$ss30_CustomPlaygroundQuickLookableP" + "name": "Escapable", + "printedName": "Escapable", + "usr": "s:s9EscapableP", + "mangledName": "$ss9EscapableP" }, { "kind": "Conformance", - "name": "MirrorPath", - "printedName": "MirrorPath", - "usr": "s:s10MirrorPathP", - "mangledName": "$ss10MirrorPathP" + "name": "ExpressibleByIntegerLiteral", + "printedName": "ExpressibleByIntegerLiteral", + "children": [ + { + "kind": "TypeWitness", + "name": "IntegerLiteralType", + "printedName": "IntegerLiteralType", + "children": [ + { + "kind": "TypeNominal", + "name": "Int", + "printedName": "Swift.Int", + "usr": "s:Si" + } + ] + } + ], + "usr": "s:s27ExpressibleByIntegerLiteralP", + "mangledName": "$ss27ExpressibleByIntegerLiteralP" }, { "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" - }, - { - "kind": "Conformance", - "name": "_HasCustomAnyHashableRepresentation", - "printedName": "_HasCustomAnyHashableRepresentation", - "usr": "s:s35_HasCustomAnyHashableRepresentationP", - "mangledName": "$ss35_HasCustomAnyHashableRepresentationP" + "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": "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" } ] } diff --git a/test/api-digester/Outputs/cake.json b/test/api-digester/Outputs/dump-module/cake.json similarity index 100% rename from test/api-digester/Outputs/cake.json rename to test/api-digester/Outputs/dump-module/cake.json index 5f1d958671cea..ddd11114a05fd 100644 --- a/test/api-digester/Outputs/cake.json +++ b/test/api-digester/Outputs/dump-module/cake.json @@ -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": [ - { - "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" + "name": "CodingKeyRepresentable", + "printedName": "CodingKeyRepresentable", + "usr": "s:s22CodingKeyRepresentableP", + "mangledName": "$ss22CodingKeyRepresentableP" + }, + { + "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": "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" } ] } diff --git a/test/api-digester/dump-module.swift b/test/api-digester/dump-module.swift index 9f37802413831..d6c4abefb94a5 100644 --- a/test/api-digester/dump-module.swift +++ b/test/api-digester/dump-module.swift @@ -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