diff --git a/include/swift/APIDigester/ModuleAnalyzerNodes.h b/include/swift/APIDigester/ModuleAnalyzerNodes.h index e0e3fb682bba1..ba816dd25722b 100644 --- a/include/swift/APIDigester/ModuleAnalyzerNodes.h +++ b/include/swift/APIDigester/ModuleAnalyzerNodes.h @@ -339,6 +339,7 @@ struct PlatformIntroVersion { class SDKNodeDecl: public SDKNode { DeclKind DKind; StringRef Usr; + StringRef MangledName; SourceLoc Loc; StringRef Location; StringRef ModuleName; @@ -463,6 +464,7 @@ class SDKNodeType: public SDKNode { class SDKNodeTypeNominal : public SDKNodeType { StringRef USR; + StringRef MangledName; public: SDKNodeTypeNominal(SDKNodeInitInfo Info); // Get the usr of the correspoding nominal type decl. @@ -583,6 +585,7 @@ class SDKNodeDeclType: public SDKNodeDecl { /// in the conformance, thus getName() will give us the name of the protocol. class SDKNodeConformance: public SDKNode { StringRef Usr; + StringRef MangledName; SDKNodeDeclType *TypeDecl; friend class SDKNodeDeclType; bool IsABIPlaceholder; diff --git a/include/swift/AST/ASTMangler.h b/include/swift/AST/ASTMangler.h index fc165eea39fa9..08fdac734613d 100644 --- a/include/swift/AST/ASTMangler.h +++ b/include/swift/AST/ASTMangler.h @@ -267,6 +267,7 @@ class ASTMangler : public Mangler { std::string mangleTypeAsContextUSR(const NominalTypeDecl *type); + std::string mangleAnyDecl(const ValueDecl *Decl, bool prefix); std::string mangleDeclAsUSR(const ValueDecl *Decl, StringRef USRPrefix); std::string mangleAccessorEntityAsUSR(AccessorKind kind, diff --git a/include/swift/IDE/DigesterEnums.def b/include/swift/IDE/DigesterEnums.def index b58b49fe0b471..3dd94674f4b12 100644 --- a/include/swift/IDE/DigesterEnums.def +++ b/include/swift/IDE/DigesterEnums.def @@ -142,6 +142,7 @@ KEY(kind) KEY_STRING(Name, name) KEY_STRING(PrintedName, printedName) KEY_STRING(Usr, usr) +KEY_STRING(MangledName, mangledName) KEY_STRING(Location, location) KEY_STRING(ModuleName, moduleName) KEY_STRING(SuperclassUsr, superclassUsr) diff --git a/lib/APIDigester/ModuleAnalyzerNodes.cpp b/lib/APIDigester/ModuleAnalyzerNodes.cpp index 4fab30f60ea7d..bd9a7679bf61d 100644 --- a/lib/APIDigester/ModuleAnalyzerNodes.cpp +++ b/lib/APIDigester/ModuleAnalyzerNodes.cpp @@ -1,6 +1,7 @@ #include "llvm/ADT/STLExtras.h" #include "swift/Basic/Defer.h" #include "swift/SIL/SILDeclRef.h" +#include "swift/AST/ASTMangler.h" #include #include @@ -98,7 +99,8 @@ SDKNodeRoot::SDKNodeRoot(SDKNodeInitInfo Info): SDKNode(Info, SDKNodeKind::Root) JsonFormatVer(Info.JsonFormatVer.hasValue() ? *Info.JsonFormatVer : DIGESTER_JSON_DEFAULT_VERSION) {} SDKNodeDecl::SDKNodeDecl(SDKNodeInitInfo Info, SDKNodeKind Kind) - : SDKNode(Info, Kind), DKind(Info.DKind), Usr(Info.Usr), Loc(Info.Loc), + : SDKNode(Info, Kind), DKind(Info.DKind), Usr(Info.Usr), + MangledName(Info.MangledName), Loc(Info.Loc), Location(Info.Location), ModuleName(Info.ModuleName), DeclAttributes(Info.DeclAttrs), IsImplicit(Info.IsImplicit), IsStatic(Info.IsStatic), IsDeprecated(Info.IsDeprecated), @@ -120,7 +122,8 @@ SDKNodeType::SDKNodeType(SDKNodeInitInfo Info, SDKNodeKind Kind): ParamValueOwnership(Info.ParamValueOwnership) {} SDKNodeTypeNominal::SDKNodeTypeNominal(SDKNodeInitInfo Info): - SDKNodeType(Info, SDKNodeKind::TypeNominal), USR(Info.Usr) {} + SDKNodeType(Info, SDKNodeKind::TypeNominal), USR(Info.Usr), + MangledName(Info.MangledName) {} SDKNodeTypeFunc::SDKNodeTypeFunc(SDKNodeInitInfo Info): SDKNodeType(Info, SDKNodeKind::TypeFunc) {} @@ -139,7 +142,8 @@ SDKNodeDeclType::SDKNodeDeclType(SDKNodeInitInfo Info): SDKNodeConformance::SDKNodeConformance(SDKNodeInitInfo Info): SDKNode(Info, SDKNodeKind::Conformance), - Usr(Info.Usr), IsABIPlaceholder(Info.IsABIPlaceholder) {} + Usr(Info.Usr), MangledName(Info.MangledName), + IsABIPlaceholder(Info.IsABIPlaceholder) {} SDKNodeTypeWitness::SDKNodeTypeWitness(SDKNodeInitInfo Info): SDKNode(Info, SDKNodeKind::TypeWitness) {} @@ -1036,6 +1040,18 @@ static StringRef calculateUsr(SDKContext &Ctx, ValueDecl *VD) { return StringRef(); } +static StringRef calculateMangledName(SDKContext &Ctx, ValueDecl *VD) { + if (isFromClang(VD)) { + // Don't mangle clang symbols. + return StringRef(); + } + if (auto *attr = VD->getAttrs().getAttribute()) { + return Ctx.buffer(attr->Name); + } + Mangle::ASTMangler NewMangler; + return Ctx.buffer(NewMangler.mangleAnyDecl(VD, true)); +} + static StringRef calculateLocation(SDKContext &SDKCtx, Decl *D) { if (SDKCtx.getOpts().AvoidLocation) return StringRef(); @@ -1298,6 +1314,7 @@ SDKNodeInitInfo::SDKNodeInitInfo(SDKContext &Ctx, Type Ty, TypeInitInfo Info) : // If this is a nominal type, get its Usr. if (auto *ND = Ty->getAnyNominal()) { Usr = calculateUsr(Ctx, ND); + MangledName = calculateMangledName(Ctx, ND); } } @@ -1415,6 +1432,7 @@ SDKNodeInitInfo::SDKNodeInitInfo(SDKContext &Ctx, ValueDecl *VD) Name = getSimpleName(VD); PrintedName = getPrintedName(Ctx, VD); Usr = calculateUsr(Ctx, VD); + MangledName = calculateMangledName(Ctx, VD); IsThrowing = isFuncThrowing(VD); IsStatic = VD->isStatic(); IsOverriding = VD->getOverriddenDecl(); @@ -1970,6 +1988,7 @@ void SDKNodeRoot::jsonize(json::Output &out) { void SDKNodeConformance::jsonize(json::Output &out) { SDKNode::jsonize(out); output(out, KeyKind::KK_usr, Usr); + output(out, KeyKind::KK_mangledName, MangledName); output(out, KeyKind::KK_isABIPlaceholder, IsABIPlaceholder); } @@ -1977,6 +1996,7 @@ void SDKNodeDecl::jsonize(json::Output &out) { SDKNode::jsonize(out); out.mapRequired(getKeyContent(Ctx, KeyKind::KK_declKind).data(), DKind); output(out, KeyKind::KK_usr, Usr); + output(out, KeyKind::KK_mangledName, MangledName); output(out, KeyKind::KK_location, Location); output(out, KeyKind::KK_moduleName, ModuleName); output(out, KeyKind::KK_genericSig, GenericSig); diff --git a/lib/AST/ASTMangler.cpp b/lib/AST/ASTMangler.cpp index bc1b0a62e1ff3..5ba426d77a35e 100644 --- a/lib/AST/ASTMangler.cpp +++ b/lib/AST/ASTMangler.cpp @@ -742,16 +742,14 @@ std::string ASTMangler::mangleTypeAsUSR(Type Ty) { return finalize(); } -std::string ASTMangler::mangleDeclAsUSR(const ValueDecl *Decl, - StringRef USRPrefix) { -#if SWIFT_BUILD_ONLY_SYNTAXPARSERLIB - return std::string(); // not needed for the parser library. -#endif - +std::string ASTMangler::mangleAnyDecl(const ValueDecl *Decl, bool prefix) { DWARFMangling = true; - beginManglingWithoutPrefix(); + if (prefix) { + beginMangling(); + } else { + beginManglingWithoutPrefix(); + } llvm::SaveAndRestore allowUnnamedRAII(AllowNamelessEntities, true); - Buffer << USRPrefix; auto Sig = Decl->getInnermostDeclContext()->getGenericSignatureOfContext(); bindGenericParameters(Sig); @@ -773,10 +771,18 @@ std::string ASTMangler::mangleDeclAsUSR(const ValueDecl *Decl, // We have a custom prefix, so finalize() won't verify for us. If we're not // in invalid code (coming from an IDE caller) verify manually. if (!Decl->isInvalid()) - verify(Storage.str().drop_front(USRPrefix.size())); + verify(Storage.str()); return finalize(); } +std::string ASTMangler::mangleDeclAsUSR(const ValueDecl *Decl, + StringRef USRPrefix) { +#if SWIFT_BUILD_ONLY_SYNTAXPARSERLIB + return std::string(); // not needed for the parser library. +#endif + return (llvm::Twine(USRPrefix) + mangleAnyDecl(Decl, false)).str(); +} + std::string ASTMangler::mangleAccessorEntityAsUSR(AccessorKind kind, const AbstractStorageDecl *decl, StringRef USRPrefix, diff --git a/test/api-digester/Inputs/cake.swift b/test/api-digester/Inputs/cake.swift index b1728b6f61d48..210c7d98ed71b 100644 --- a/test/api-digester/Inputs/cake.swift +++ b/test/api-digester/Inputs/cake.swift @@ -142,3 +142,6 @@ extension SwiftObjcClass { @_alwaysEmitIntoClient public func emitIntoClientFunc() {} + +@_silgen_name("silgenName") +public func silgenNamedFunc() {} diff --git a/test/api-digester/Outputs/cake-abi.json b/test/api-digester/Outputs/cake-abi.json index 46b2e407e05b2..6fa91fce54507 100644 --- a/test/api-digester/Outputs/cake-abi.json +++ b/test/api-digester/Outputs/cake-abi.json @@ -58,6 +58,7 @@ ], "declKind": "Func", "usr": "s:4cake2P1PAAE1poiyAaB_pAaB_p_AaB_ptFZ", + "mangledName": "$s4cake2P1PAAE1poiyAaB_pAaB_p_AaB_ptFZ", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.P1>", "sugared_genericSig": "", @@ -67,6 +68,7 @@ ], "declKind": "Protocol", "usr": "s:4cake2P1P", + "mangledName": "$s4cake2P1P", "moduleName": "cake" }, { @@ -75,6 +77,7 @@ "printedName": "P2", "declKind": "Protocol", "usr": "s:4cake2P2P", + "mangledName": "$s4cake2P2P", "moduleName": "cake" }, { @@ -83,6 +86,7 @@ "printedName": "P3", "declKind": "Protocol", "usr": "s:4cake2P3P", + "mangledName": "$s4cake2P3P", "moduleName": "cake", "genericSig": "<τ_0_0 : cake.P1, τ_0_0 : cake.P2>", "sugared_genericSig": "", @@ -91,13 +95,15 @@ "kind": "Conformance", "name": "P2", "printedName": "P2", - "usr": "s:4cake2P2P" + "usr": "s:4cake2P2P", + "mangledName": "$s4cake2P2P" }, { "kind": "Conformance", "name": "P1", "printedName": "P1", - "usr": "s:4cake2P1P" + "usr": "s:4cake2P1P", + "mangledName": "$s4cake2P1P" } ] }, @@ -119,6 +125,7 @@ ], "declKind": "Func", "usr": "s:4cake2S1V4foo1yyFZ", + "mangledName": "$s4cake2S1V4foo1yyFZ", "moduleName": "cake", "static": true, "funcSelfKind": "NonMutating" @@ -136,6 +143,7 @@ ], "declKind": "Func", "usr": "s:4cake2S1V4foo2yyF", + "mangledName": "$s4cake2S1V4foo2yyF", "moduleName": "cake", "funcSelfKind": "Mutating" }, @@ -152,12 +160,14 @@ ], "declKind": "Func", "usr": "s:4cake2S1V4foo6yyF", + "mangledName": "$s4cake2S1V4foo6yyF", "moduleName": "cake", "funcSelfKind": "NonMutating" } ], "declKind": "Struct", "usr": "s:4cake2S1V", + "mangledName": "$s4cake2S1V", "moduleName": "cake", "declAttributes": [ "Frozen" @@ -167,19 +177,22 @@ "kind": "Conformance", "name": "P1", "printedName": "P1", - "usr": "s:4cake2P1P" + "usr": "s:4cake2P1P", + "mangledName": "$s4cake2P1P" }, { "kind": "Conformance", "name": "Sendable", "printedName": "Sendable", - "usr": "s:s8SendableP" + "usr": "s:s8SendableP", + "mangledName": "$ss8SendableP" }, { "kind": "Conformance", "name": "P2", "printedName": "P2", - "usr": "s:4cake2P2P" + "usr": "s:4cake2P2P", + "mangledName": "$s4cake2P2P" } ] }, @@ -201,6 +214,7 @@ ], "declKind": "Func", "usr": "s:4cake2C0CA2A2S1VRszAERs_AERs0_rlE17conditionalFooExtyyF", + "mangledName": "$s4cake2C0CA2A2S1VRszAERs_AERs0_rlE17conditionalFooExtyyF", "moduleName": "cake", "genericSig": "<τ_0_0, τ_0_1, τ_0_2 where τ_0_0 == cake.S1, τ_0_1 == cake.S1, τ_0_2 == cake.S1>", "sugared_genericSig": "", @@ -219,6 +233,7 @@ ], "declKind": "Func", "usr": "s:4cake2C0C19unconditionalFooExtyyF", + "mangledName": "$s4cake2C0C19unconditionalFooExtyyF", "moduleName": "cake", "genericSig": "<τ_0_0, τ_0_1, τ_0_2>", "sugared_genericSig": "", @@ -227,6 +242,7 @@ ], "declKind": "Class", "usr": "s:4cake2C0C", + "mangledName": "$s4cake2C0C", "moduleName": "cake", "genericSig": "<τ_0_0, τ_0_1, τ_0_2>", "sugared_genericSig": "", @@ -250,6 +266,7 @@ ], "declKind": "Func", "usr": "s:4cake2C1C4foo1yyFZ", + "mangledName": "$s4cake2C1C4foo1yyFZ", "moduleName": "cake", "static": true, "funcSelfKind": "NonMutating" @@ -267,6 +284,7 @@ ], "declKind": "Var", "usr": "s:4cake2C1C3InsACSgvp", + "mangledName": "$s4cake2C1C3InsACSgvp", "moduleName": "cake", "declAttributes": [ "HasInitialValue", @@ -299,6 +317,7 @@ ], "declKind": "Accessor", "usr": "s:4cake2C1C3InsACSgvg", + "mangledName": "$s4cake2C1C3InsACSgvg", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -333,6 +352,7 @@ ], "declKind": "Accessor", "usr": "s:4cake2C1C3InsACSgvs", + "mangledName": "$s4cake2C1C3InsACSgvs", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -353,6 +373,7 @@ ], "declKind": "Accessor", "usr": "s:4cake2C1C3InsACSgvM", + "mangledName": "$s4cake2C1C3InsACSgvM", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -375,6 +396,7 @@ ], "declKind": "Var", "usr": "s:4cake2C1C4Ins2ACvp", + "mangledName": "$s4cake2C1C4Ins2ACvp", "moduleName": "cake", "declAttributes": [ "HasInitialValue", @@ -399,6 +421,7 @@ ], "declKind": "Accessor", "usr": "s:4cake2C1C4Ins2ACvg", + "mangledName": "$s4cake2C1C4Ins2ACvg", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -425,6 +448,7 @@ ], "declKind": "Accessor", "usr": "s:4cake2C1C4Ins2ACvs", + "mangledName": "$s4cake2C1C4Ins2ACvs", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -445,6 +469,7 @@ ], "declKind": "Accessor", "usr": "s:4cake2C1C4Ins2ACvM", + "mangledName": "$s4cake2C1C4Ins2ACvM", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -457,6 +482,7 @@ ], "declKind": "Class", "usr": "s:4cake2C1C", + "mangledName": "$s4cake2C1C", "moduleName": "cake", "superclassUsr": "s:4cake2C0C", "hasMissingDesignatedInitializers": true, @@ -491,6 +517,7 @@ ], "declKind": "Func", "usr": "s:4cake4foo1_1bySi_AA2S1VtF", + "mangledName": "$s4cake4foo1_1bySi_AA2S1VtF", "moduleName": "cake", "funcSelfKind": "NonMutating" }, @@ -520,6 +547,7 @@ ], "declKind": "Func", "usr": "s:4cake4foo2_1bySi_AA2S1VtF", + "mangledName": "$s4cake4foo2_1bySi_AA2S1VtF", "moduleName": "cake", "funcSelfKind": "NonMutating" }, @@ -562,6 +590,7 @@ ], "declKind": "EnumElement", "usr": "s:4cake6NumberO3oneyA2CmF", + "mangledName": "$s4cake6NumberO3oneyA2CmF", "moduleName": "cake", "fixedbinaryorder": 0 }, @@ -593,6 +622,7 @@ ], "declKind": "Constructor", "usr": "s:4cake6NumberO8rawValueACSgSi_tcfc", + "mangledName": "$s4cake6NumberO8rawValueACSgSi_tcfc", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -614,6 +644,7 @@ ], "declKind": "Var", "usr": "s:4cake6NumberO8rawValueSivp", + "mangledName": "$s4cake6NumberO8rawValueSivp", "moduleName": "cake", "implicit": true, "accessors": [ @@ -631,6 +662,7 @@ ], "declKind": "Accessor", "usr": "s:4cake6NumberO8rawValueSivg", + "mangledName": "$s4cake6NumberO8rawValueSivg", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -643,6 +675,7 @@ ], "declKind": "Enum", "usr": "s:4cake6NumberO", + "mangledName": "$s4cake6NumberO", "moduleName": "cake", "enumRawTypeName": "Int", "isEnumExhaustive": true, @@ -651,13 +684,15 @@ "kind": "Conformance", "name": "Equatable", "printedName": "Equatable", - "usr": "s:SQ" + "usr": "s:SQ", + "mangledName": "$sSQ" }, { "kind": "Conformance", "name": "Hashable", "printedName": "Hashable", - "usr": "s:SH" + "usr": "s:SH", + "mangledName": "$sSH" }, { "kind": "Conformance", @@ -678,7 +713,8 @@ ] } ], - "usr": "s:SY" + "usr": "s:SY", + "mangledName": "$sSY" } ] }, @@ -715,6 +751,7 @@ ], "declKind": "Func", "usr": "s:4cake4foo3yySDySiSSGF", + "mangledName": "$s4cake4foo3yySDySiSSGF", "moduleName": "cake", "funcSelfKind": "NonMutating" }, @@ -737,6 +774,7 @@ ], "declKind": "Var", "usr": "s:4cake17fixedLayoutStructV1aSivp", + "mangledName": "$s4cake17fixedLayoutStructV1aSivp", "moduleName": "cake", "declAttributes": [ "HasInitialValue", @@ -759,6 +797,7 @@ ], "declKind": "Accessor", "usr": "s:4cake17fixedLayoutStructV1aSivg", + "mangledName": "$s4cake17fixedLayoutStructV1aSivg", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -785,6 +824,7 @@ ], "declKind": "Accessor", "usr": "s:4cake17fixedLayoutStructV1aSivs", + "mangledName": "$s4cake17fixedLayoutStructV1aSivs", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -805,6 +845,7 @@ ], "declKind": "Accessor", "usr": "s:4cake17fixedLayoutStructV1aSivM", + "mangledName": "$s4cake17fixedLayoutStructV1aSivM", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -828,6 +869,7 @@ ], "declKind": "Var", "usr": "s:4cake17fixedLayoutStructV1b33_3D8926C30F7417F2EF9A277D0C73FBDBLLSivp", + "mangledName": "$s4cake17fixedLayoutStructV1b33_3D8926C30F7417F2EF9A277D0C73FBDBLLSivp", "moduleName": "cake", "isInternal": true, "declAttributes": [ @@ -851,6 +893,7 @@ ], "declKind": "Var", "usr": "s:4cake17fixedLayoutStructV1cSivp", + "mangledName": "$s4cake17fixedLayoutStructV1cSivp", "moduleName": "cake", "isInternal": true, "declAttributes": [ @@ -874,6 +917,7 @@ ], "declKind": "Var", "usr": "s:4cake17fixedLayoutStructV19unavailablePropertySivp", + "mangledName": "$s4cake17fixedLayoutStructV19unavailablePropertySivp", "moduleName": "cake", "declAttributes": [ "HasInitialValue", @@ -898,6 +942,7 @@ ], "declKind": "Accessor", "usr": "s:4cake17fixedLayoutStructV19unavailablePropertySivg", + "mangledName": "$s4cake17fixedLayoutStructV19unavailablePropertySivg", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -910,6 +955,7 @@ ], "declKind": "Struct", "usr": "s:4cake17fixedLayoutStructV", + "mangledName": "$s4cake17fixedLayoutStructV", "moduleName": "cake", "declAttributes": [ "Frozen" @@ -919,7 +965,8 @@ "kind": "Conformance", "name": "Sendable", "printedName": "Sendable", - "usr": "s:s8SendableP" + "usr": "s:s8SendableP", + "mangledName": "$ss8SendableP" } ] }, @@ -934,6 +981,7 @@ "printedName": "A", "declKind": "AssociatedType", "usr": "s:4cake21ProWithAssociatedTypeP1AQa", + "mangledName": "$s4cake21ProWithAssociatedTypeP1AQa", "moduleName": "cake", "protocolReq": true }, @@ -951,6 +999,7 @@ ], "declKind": "AssociatedType", "usr": "s:4cake21ProWithAssociatedTypeP1BQa", + "mangledName": "$s4cake21ProWithAssociatedTypeP1BQa", "moduleName": "cake", "protocolReq": true }, @@ -967,6 +1016,7 @@ ], "declKind": "Func", "usr": "s:4cake21ProWithAssociatedTypePAAE10NonReqFuncyyF", + "mangledName": "$s4cake21ProWithAssociatedTypePAAE10NonReqFuncyyF", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.ProWithAssociatedType>", "sugared_genericSig": "", @@ -986,6 +1036,7 @@ ], "declKind": "Var", "usr": "s:4cake21ProWithAssociatedTypePAAE9NonReqVarSivp", + "mangledName": "$s4cake21ProWithAssociatedTypePAAE9NonReqVarSivp", "moduleName": "cake", "accessors": [ { @@ -1002,6 +1053,7 @@ ], "declKind": "Accessor", "usr": "s:4cake21ProWithAssociatedTypePAAE9NonReqVarSivg", + "mangledName": "$s4cake21ProWithAssociatedTypePAAE9NonReqVarSivg", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.ProWithAssociatedType>", "sugared_genericSig": "", @@ -1012,6 +1064,7 @@ ], "declKind": "Protocol", "usr": "s:4cake21ProWithAssociatedTypeP", + "mangledName": "$s4cake21ProWithAssociatedTypeP", "moduleName": "cake" }, { @@ -1039,6 +1092,7 @@ ], "declKind": "Subscript", "usr": "s:4cake13SubsContainerP6getterS2i_tcip", + "mangledName": "$s4cake13SubsContainerP6getterS2i_tcip", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.SubsContainer>", "sugared_genericSig": "", @@ -1064,6 +1118,7 @@ ], "declKind": "Accessor", "usr": "s:4cake13SubsContainerP6getterS2i_tcig", + "mangledName": "$s4cake13SubsContainerP6getterS2i_tcig", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.SubsContainer>", "sugared_genericSig": "", @@ -1093,6 +1148,7 @@ ], "declKind": "Subscript", "usr": "s:4cake13SubsContainerP6setterS2i_tcip", + "mangledName": "$s4cake13SubsContainerP6setterS2i_tcip", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.SubsContainer>", "sugared_genericSig": "", @@ -1118,6 +1174,7 @@ ], "declKind": "Accessor", "usr": "s:4cake13SubsContainerP6setterS2i_tcig", + "mangledName": "$s4cake13SubsContainerP6setterS2i_tcig", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.SubsContainer>", "sugared_genericSig": "", @@ -1150,6 +1207,7 @@ ], "declKind": "Accessor", "usr": "s:4cake13SubsContainerP6setterS2i_tcis", + "mangledName": "$s4cake13SubsContainerP6setterS2i_tcis", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.SubsContainer>", "sugared_genericSig": "", @@ -1176,6 +1234,7 @@ ], "declKind": "Accessor", "usr": "s:4cake13SubsContainerP6setterS2i_tciM", + "mangledName": "$s4cake13SubsContainerP6setterS2i_tciM", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.SubsContainer>", "sugared_genericSig": "", @@ -1189,6 +1248,7 @@ ], "declKind": "Protocol", "usr": "s:4cake13SubsContainerP", + "mangledName": "$s4cake13SubsContainerP", "moduleName": "cake" }, { @@ -1202,6 +1262,7 @@ "printedName": "T", "declKind": "AssociatedType", "usr": "s:4cake6PSuperP1TQa", + "mangledName": "$s4cake6PSuperP1TQa", "moduleName": "cake", "protocolReq": true }, @@ -1218,6 +1279,7 @@ ], "declKind": "Func", "usr": "s:4cake6PSuperP3fooyyF", + "mangledName": "$s4cake6PSuperP3fooyyF", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.PSuper>", "sugared_genericSig": "", @@ -1238,6 +1300,7 @@ ], "declKind": "Func", "usr": "s:4cake6PSuperPAAE9futureFooyyF", + "mangledName": "$s4cake6PSuperPAAE9futureFooyyF", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.PSuper>", "sugared_genericSig": "", @@ -1246,6 +1309,7 @@ ], "declKind": "Protocol", "usr": "s:4cake6PSuperP", + "mangledName": "$s4cake6PSuperP", "moduleName": "cake" }, { @@ -1259,6 +1323,7 @@ "printedName": "T", "declKind": "AssociatedType", "usr": "s:4cake4PSubP1TQa", + "mangledName": "$s4cake4PSubP1TQa", "moduleName": "cake", "protocolReq": true, "overriding": true @@ -1276,6 +1341,7 @@ ], "declKind": "Func", "usr": "s:4cake4PSubP3fooyyF", + "mangledName": "$s4cake4PSubP3fooyyF", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.PSub>", "sugared_genericSig": "", @@ -1289,6 +1355,7 @@ ], "declKind": "Protocol", "usr": "s:4cake4PSubP", + "mangledName": "$s4cake4PSubP", "moduleName": "cake", "genericSig": "<τ_0_0 : cake.PSuper>", "sugared_genericSig": "", @@ -1297,7 +1364,8 @@ "kind": "Conformance", "name": "PSuper", "printedName": "PSuper", - "usr": "s:4cake6PSuperP" + "usr": "s:4cake6PSuperP", + "mangledName": "$s4cake6PSuperP" } ] }, @@ -1315,6 +1383,7 @@ ], "declKind": "Var", "usr": "s:4cake9GlobalVarSivp", + "mangledName": "$s4cake9GlobalVarSivp", "moduleName": "cake", "declAttributes": [ "HasInitialValue", @@ -1352,6 +1421,7 @@ ], "declKind": "Var", "usr": "s:4cake21UsableFromInlineClassC4Prop33_3D8926C30F7417F2EF9A277D0C73FBDBLLSivp", + "mangledName": "$s4cake21UsableFromInlineClassC4Prop33_3D8926C30F7417F2EF9A277D0C73FBDBLLSivp", "moduleName": "cake", "isInternal": true, "declAttributes": [ @@ -1364,6 +1434,7 @@ ], "declKind": "Class", "usr": "s:4cake21UsableFromInlineClassC", + "mangledName": "$s4cake21UsableFromInlineClassC", "moduleName": "cake", "declAttributes": [ "FixedLayout", @@ -1389,6 +1460,7 @@ ], "declKind": "Func", "usr": "s:4cake15FutureContainerC9futureFooyyF", + "mangledName": "$s4cake15FutureContainerC9futureFooyyF", "moduleName": "cake", "intro_Macosx": "10.15", "intro_iOS": "13", @@ -1415,6 +1487,7 @@ ], "declKind": "Func", "usr": "s:4cake15FutureContainerC12NotfutureFooyyF", + "mangledName": "$s4cake15FutureContainerC12NotfutureFooyyF", "moduleName": "cake", "intro_Macosx": "10.15", "declAttributes": [ @@ -1425,6 +1498,7 @@ ], "declKind": "Class", "usr": "s:4cake15FutureContainerC", + "mangledName": "$s4cake15FutureContainerC", "moduleName": "cake", "hasMissingDesignatedInitializers": true, "conformances": [ @@ -1432,13 +1506,15 @@ "kind": "Conformance", "name": "P1", "printedName": "P1", - "usr": "s:4cake2P1P" + "usr": "s:4cake2P1P", + "mangledName": "$s4cake2P1P" }, { "kind": "Conformance", "name": "P2", "printedName": "P2", - "usr": "s:4cake2P2P" + "usr": "s:4cake2P2P", + "mangledName": "$s4cake2P2P" } ] }, @@ -1448,6 +1524,7 @@ "printedName": "PlatformIntroClass", "declKind": "Class", "usr": "s:4cake18PlatformIntroClassC", + "mangledName": "$s4cake18PlatformIntroClassC", "moduleName": "cake", "intro_Macosx": "10.1", "intro_iOS": "10.2", @@ -1467,6 +1544,7 @@ "printedName": "SwiftIntroClass", "declKind": "Class", "usr": "s:4cake15SwiftIntroClassC", + "mangledName": "$s4cake15SwiftIntroClassC", "moduleName": "cake", "intro_swift": "5", "declAttributes": [ @@ -1510,6 +1588,7 @@ ], "declKind": "Func", "usr": "c:@M@cake@objc(cs)NewObjCClass(im)ObjCFool:ObjCA:ObjCB:", + "mangledName": "$s4cake14SwiftObjcClassC3foo1a1b1cySi_S2itF", "moduleName": "cake", "objc_name": "ObjCFool:ObjCA:ObjCB:", "declAttributes": [ @@ -1520,6 +1599,7 @@ ], "declKind": "Class", "usr": "c:@M@cake@objc(cs)NewObjCClass", + "mangledName": "$s4cake14SwiftObjcClassC", "moduleName": "cake", "objc_name": "NewObjCClass", "declAttributes": [ @@ -1527,6 +1607,26 @@ ], "hasMissingDesignatedInitializers": true }, + { + "kind": "Function", + "name": "silgenNamedFunc", + "printedName": "silgenNamedFunc()", + "children": [ + { + "kind": "TypeNominal", + "name": "Void", + "printedName": "()" + } + ], + "declKind": "Func", + "usr": "s:4cake15silgenNamedFuncyyF", + "mangledName": "silgenName", + "moduleName": "cake", + "declAttributes": [ + "SILGenName" + ], + "funcSelfKind": "NonMutating" + }, { "kind": "TypeDecl", "name": "Int", @@ -1545,6 +1645,7 @@ ], "declKind": "Func", "usr": "s:Si4cakeE3fooyyF", + "mangledName": "$sSi4cakeE3fooyyF", "moduleName": "cake", "funcSelfKind": "NonMutating" }, @@ -1561,12 +1662,14 @@ ], "declKind": "Func", "usr": "s:Si4cakeE3baryyF", + "mangledName": "$sSi4cakeE3baryyF", "moduleName": "cake", "funcSelfKind": "NonMutating" } ], "declKind": "Struct", "usr": "s:Si", + "mangledName": "$sSi", "moduleName": "Swift", "declAttributes": [ "Frozen" @@ -1577,19 +1680,22 @@ "kind": "Conformance", "name": "FixedWidthInteger", "printedName": "FixedWidthInteger", - "usr": "s:s17FixedWidthIntegerP" + "usr": "s:s17FixedWidthIntegerP", + "mangledName": "$ss17FixedWidthIntegerP" }, { "kind": "Conformance", "name": "SignedInteger", "printedName": "SignedInteger", - "usr": "s:SZ" + "usr": "s:SZ", + "mangledName": "$sSZ" }, { "kind": "Conformance", "name": "_ExpressibleByBuiltinIntegerLiteral", "printedName": "_ExpressibleByBuiltinIntegerLiteral", - "usr": "s:s35_ExpressibleByBuiltinIntegerLiteralP" + "usr": "s:s35_ExpressibleByBuiltinIntegerLiteralP", + "mangledName": "$ss35_ExpressibleByBuiltinIntegerLiteralP" }, { "kind": "Conformance", @@ -1610,19 +1716,22 @@ ] } ], - "usr": "s:Sz" + "usr": "s:Sz", + "mangledName": "$sSz" }, { "kind": "Conformance", "name": "LosslessStringConvertible", "printedName": "LosslessStringConvertible", - "usr": "s:s25LosslessStringConvertibleP" + "usr": "s:s25LosslessStringConvertibleP", + "mangledName": "$ss25LosslessStringConvertibleP" }, { "kind": "Conformance", "name": "SignedNumeric", "printedName": "SignedNumeric", - "usr": "s:s13SignedNumericP" + "usr": "s:s13SignedNumericP", + "mangledName": "$ss13SignedNumericP" }, { "kind": "Conformance", @@ -1643,13 +1752,15 @@ ] } ], - "usr": "s:Sj" + "usr": "s:Sj", + "mangledName": "$sSj" }, { "kind": "Conformance", "name": "CustomStringConvertible", "printedName": "CustomStringConvertible", - "usr": "s:s23CustomStringConvertibleP" + "usr": "s:s23CustomStringConvertibleP", + "mangledName": "$ss23CustomStringConvertibleP" }, { "kind": "Conformance", @@ -1670,13 +1781,15 @@ ] } ], - "usr": "s:Sx" + "usr": "s:Sx", + "mangledName": "$sSx" }, { "kind": "Conformance", "name": "AdditiveArithmetic", "printedName": "AdditiveArithmetic", - "usr": "s:s18AdditiveArithmeticP" + "usr": "s:s18AdditiveArithmeticP", + "mangledName": "$ss18AdditiveArithmeticP" }, { "kind": "Conformance", @@ -1697,79 +1810,92 @@ ] } ], - "usr": "s:s27ExpressibleByIntegerLiteralP" + "usr": "s:s27ExpressibleByIntegerLiteralP", + "mangledName": "$ss27ExpressibleByIntegerLiteralP" }, { "kind": "Conformance", "name": "Comparable", "printedName": "Comparable", - "usr": "s:SL" + "usr": "s:SL", + "mangledName": "$sSL" }, { "kind": "Conformance", "name": "P1", "printedName": "P1", - "usr": "s:4cake2P1P" + "usr": "s:4cake2P1P", + "mangledName": "$s4cake2P1P" }, { "kind": "Conformance", "name": "Encodable", "printedName": "Encodable", - "usr": "s:SE" + "usr": "s:SE", + "mangledName": "$sSE" }, { "kind": "Conformance", "name": "Decodable", "printedName": "Decodable", - "usr": "s:Se" + "usr": "s:Se", + "mangledName": "$sSe" }, { "kind": "Conformance", "name": "CustomReflectable", "printedName": "CustomReflectable", - "usr": "s:s17CustomReflectableP" + "usr": "s:s17CustomReflectableP", + "mangledName": "$ss17CustomReflectableP" }, { "kind": "Conformance", "name": "_CustomPlaygroundQuickLookable", "printedName": "_CustomPlaygroundQuickLookable", - "usr": "s:s30_CustomPlaygroundQuickLookableP" + "usr": "s:s30_CustomPlaygroundQuickLookableP", + "mangledName": "$ss30_CustomPlaygroundQuickLookableP" }, { "kind": "Conformance", "name": "MirrorPath", "printedName": "MirrorPath", - "usr": "s:s10MirrorPathP" + "usr": "s:s10MirrorPathP", + "mangledName": "$ss10MirrorPathP" }, { "kind": "Conformance", "name": "CVarArg", "printedName": "CVarArg", - "usr": "s:s7CVarArgP" + "usr": "s:s7CVarArgP", + "mangledName": "$ss7CVarArgP" }, { "kind": "Conformance", "name": "Hashable", "printedName": "Hashable", - "usr": "s:SH" + "usr": "s:SH", + "mangledName": "$sSH" }, { "kind": "Conformance", "name": "Equatable", "printedName": "Equatable", - "usr": "s:SQ" + "usr": "s:SQ", + "mangledName": "$sSQ" }, { "kind": "Conformance", "name": "_HasCustomAnyHashableRepresentation", "printedName": "_HasCustomAnyHashableRepresentation", - "usr": "s:s35_HasCustomAnyHashableRepresentationP" + "usr": "s:s35_HasCustomAnyHashableRepresentationP", + "mangledName": "$ss35_HasCustomAnyHashableRepresentationP" }, { "kind": "Conformance", "name": "Sendable", "printedName": "Sendable", - "usr": "s:s8SendableP" + "usr": "s:s8SendableP", + "mangledName": "$ss8SendableP" }, { "kind": "Conformance", @@ -1868,7 +1994,8 @@ ] } ], - "usr": "s:s10SIMDScalarP" + "usr": "s:s10SIMDScalarP", + "mangledName": "$ss10SIMDScalarP" } ] } diff --git a/test/api-digester/Outputs/cake.json b/test/api-digester/Outputs/cake.json index e7b79d34b5f72..786f5f6e5ac7f 100644 --- a/test/api-digester/Outputs/cake.json +++ b/test/api-digester/Outputs/cake.json @@ -58,6 +58,7 @@ ], "declKind": "Func", "usr": "s:4cake2P1PAAE1poiyAaB_pAaB_p_AaB_ptFZ", + "mangledName": "$s4cake2P1PAAE1poiyAaB_pAaB_p_AaB_ptFZ", "moduleName": "cake", "genericSig": "", "static": true, @@ -66,6 +67,7 @@ ], "declKind": "Protocol", "usr": "s:4cake2P1P", + "mangledName": "$s4cake2P1P", "moduleName": "cake" }, { @@ -74,6 +76,7 @@ "printedName": "P2", "declKind": "Protocol", "usr": "s:4cake2P2P", + "mangledName": "$s4cake2P2P", "moduleName": "cake" }, { @@ -82,6 +85,7 @@ "printedName": "P3", "declKind": "Protocol", "usr": "s:4cake2P3P", + "mangledName": "$s4cake2P3P", "moduleName": "cake", "genericSig": "", "conformances": [ @@ -89,13 +93,15 @@ "kind": "Conformance", "name": "P2", "printedName": "P2", - "usr": "s:4cake2P2P" + "usr": "s:4cake2P2P", + "mangledName": "$s4cake2P2P" }, { "kind": "Conformance", "name": "P1", "printedName": "P1", - "usr": "s:4cake2P1P" + "usr": "s:4cake2P1P", + "mangledName": "$s4cake2P1P" } ] }, @@ -117,6 +123,7 @@ ], "declKind": "Func", "usr": "s:4cake2S1V4foo1yyFZ", + "mangledName": "$s4cake2S1V4foo1yyFZ", "moduleName": "cake", "static": true, "funcSelfKind": "NonMutating" @@ -134,6 +141,7 @@ ], "declKind": "Func", "usr": "s:4cake2S1V4foo2yyF", + "mangledName": "$s4cake2S1V4foo2yyF", "moduleName": "cake", "funcSelfKind": "Mutating" }, @@ -157,12 +165,14 @@ ], "declKind": "Func", "usr": "s:4cake2S1V4foo6yyF", + "mangledName": "$s4cake2S1V4foo6yyF", "moduleName": "cake", "funcSelfKind": "NonMutating" } ], "declKind": "Struct", "usr": "s:4cake2S1V", + "mangledName": "$s4cake2S1V", "moduleName": "cake", "declAttributes": [ "Frozen" @@ -172,19 +182,22 @@ "kind": "Conformance", "name": "P1", "printedName": "P1", - "usr": "s:4cake2P1P" + "usr": "s:4cake2P1P", + "mangledName": "$s4cake2P1P" }, { "kind": "Conformance", "name": "Sendable", "printedName": "Sendable", - "usr": "s:s8SendableP" + "usr": "s:s8SendableP", + "mangledName": "$ss8SendableP" }, { "kind": "Conformance", "name": "P2", "printedName": "P2", - "usr": "s:4cake2P2P" + "usr": "s:4cake2P2P", + "mangledName": "$s4cake2P2P" } ] }, @@ -206,6 +219,7 @@ ], "declKind": "Func", "usr": "s:4cake2C0CA2A2S1VRszAERs_AERs0_rlE17conditionalFooExtyyF", + "mangledName": "$s4cake2C0CA2A2S1VRszAERs_AERs0_rlE17conditionalFooExtyyF", "moduleName": "cake", "genericSig": "", "funcSelfKind": "NonMutating" @@ -223,6 +237,7 @@ ], "declKind": "Func", "usr": "s:4cake2C0C19unconditionalFooExtyyF", + "mangledName": "$s4cake2C0C19unconditionalFooExtyyF", "moduleName": "cake", "genericSig": "", "funcSelfKind": "NonMutating" @@ -230,6 +245,7 @@ ], "declKind": "Class", "usr": "s:4cake2C0C", + "mangledName": "$s4cake2C0C", "moduleName": "cake", "genericSig": "", "hasMissingDesignatedInitializers": true @@ -268,6 +284,7 @@ ], "declKind": "TypeAlias", "usr": "s:4cake7C0Aliasa", + "mangledName": "$s4cake7C0Aliasa", "moduleName": "cake" }, { @@ -288,6 +305,7 @@ ], "declKind": "Func", "usr": "s:4cake2C1C4foo1yyFZ", + "mangledName": "$s4cake2C1C4foo1yyFZ", "moduleName": "cake", "static": true, "isOpen": true, @@ -306,6 +324,7 @@ ], "declKind": "Var", "usr": "s:4cake2C1C3InsACSgvp", + "mangledName": "$s4cake2C1C3InsACSgvp", "moduleName": "cake", "declAttributes": [ "HasInitialValue", @@ -337,6 +356,7 @@ ], "declKind": "Accessor", "usr": "s:4cake2C1C3InsACSgvg", + "mangledName": "$s4cake2C1C3InsACSgvg", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -371,6 +391,7 @@ ], "declKind": "Accessor", "usr": "s:4cake2C1C3InsACSgvs", + "mangledName": "$s4cake2C1C3InsACSgvs", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -393,6 +414,7 @@ ], "declKind": "Var", "usr": "s:4cake2C1C4Ins2ACvp", + "mangledName": "$s4cake2C1C4Ins2ACvp", "moduleName": "cake", "declAttributes": [ "HasInitialValue", @@ -416,6 +438,7 @@ ], "declKind": "Accessor", "usr": "s:4cake2C1C4Ins2ACvg", + "mangledName": "$s4cake2C1C4Ins2ACvg", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -442,6 +465,7 @@ ], "declKind": "Accessor", "usr": "s:4cake2C1C4Ins2ACvs", + "mangledName": "$s4cake2C1C4Ins2ACvs", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -454,6 +478,7 @@ ], "declKind": "Class", "usr": "s:4cake2C1C", + "mangledName": "$s4cake2C1C", "moduleName": "cake", "superclassUsr": "s:4cake2C0C", "hasMissingDesignatedInitializers": true, @@ -488,6 +513,7 @@ ], "declKind": "Func", "usr": "s:4cake4foo1_1bySi_AA2S1VtF", + "mangledName": "$s4cake4foo1_1bySi_AA2S1VtF", "moduleName": "cake", "funcSelfKind": "NonMutating" }, @@ -517,6 +543,7 @@ ], "declKind": "Func", "usr": "s:4cake4foo2_1bySi_AA2S1VtF", + "mangledName": "$s4cake4foo2_1bySi_AA2S1VtF", "moduleName": "cake", "funcSelfKind": "NonMutating" }, @@ -566,6 +593,7 @@ ], "declKind": "EnumElement", "usr": "s:4cake6NumberO3oneyA2CmF", + "mangledName": "$s4cake6NumberO3oneyA2CmF", "moduleName": "cake" }, { @@ -596,6 +624,7 @@ ], "declKind": "Constructor", "usr": "s:4cake6NumberO8rawValueACSgSi_tcfc", + "mangledName": "$s4cake6NumberO8rawValueACSgSi_tcfc", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -617,6 +646,7 @@ ], "declKind": "TypeAlias", "usr": "s:4cake6NumberO8RawValuea", + "mangledName": "$s4cake6NumberO8RawValuea", "moduleName": "cake", "implicit": true }, @@ -634,6 +664,7 @@ ], "declKind": "Var", "usr": "s:4cake6NumberO8rawValueSivp", + "mangledName": "$s4cake6NumberO8rawValueSivp", "moduleName": "cake", "implicit": true, "accessors": [ @@ -651,6 +682,7 @@ ], "declKind": "Accessor", "usr": "s:4cake6NumberO8rawValueSivg", + "mangledName": "$s4cake6NumberO8rawValueSivg", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -663,6 +695,7 @@ ], "declKind": "Enum", "usr": "s:4cake6NumberO", + "mangledName": "$s4cake6NumberO", "moduleName": "cake", "enumRawTypeName": "Int", "isEnumExhaustive": true, @@ -671,13 +704,15 @@ "kind": "Conformance", "name": "Equatable", "printedName": "Equatable", - "usr": "s:SQ" + "usr": "s:SQ", + "mangledName": "$sSQ" }, { "kind": "Conformance", "name": "Hashable", "printedName": "Hashable", - "usr": "s:SH" + "usr": "s:SH", + "mangledName": "$sSH" }, { "kind": "Conformance", @@ -698,7 +733,8 @@ ] } ], - "usr": "s:SY" + "usr": "s:SY", + "mangledName": "$sSY" } ] }, @@ -735,6 +771,7 @@ ], "declKind": "Func", "usr": "s:4cake4foo3yySDySiSSGF", + "mangledName": "$s4cake4foo3yySDySiSSGF", "moduleName": "cake", "funcSelfKind": "NonMutating" }, @@ -757,6 +794,7 @@ ], "declKind": "Var", "usr": "s:4cake17fixedLayoutStructV1aSivp", + "mangledName": "$s4cake17fixedLayoutStructV1aSivp", "moduleName": "cake", "declAttributes": [ "HasInitialValue", @@ -778,6 +816,7 @@ ], "declKind": "Accessor", "usr": "s:4cake17fixedLayoutStructV1aSivg", + "mangledName": "$s4cake17fixedLayoutStructV1aSivg", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -804,6 +843,7 @@ ], "declKind": "Accessor", "usr": "s:4cake17fixedLayoutStructV1aSivs", + "mangledName": "$s4cake17fixedLayoutStructV1aSivs", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -816,6 +856,7 @@ ], "declKind": "Struct", "usr": "s:4cake17fixedLayoutStructV", + "mangledName": "$s4cake17fixedLayoutStructV", "moduleName": "cake", "declAttributes": [ "Frozen" @@ -825,7 +866,8 @@ "kind": "Conformance", "name": "Sendable", "printedName": "Sendable", - "usr": "s:s8SendableP" + "usr": "s:s8SendableP", + "mangledName": "$ss8SendableP" } ] }, @@ -840,6 +882,7 @@ "printedName": "A", "declKind": "AssociatedType", "usr": "s:4cake21ProWithAssociatedTypeP1AQa", + "mangledName": "$s4cake21ProWithAssociatedTypeP1AQa", "moduleName": "cake", "protocolReq": true }, @@ -857,6 +900,7 @@ ], "declKind": "AssociatedType", "usr": "s:4cake21ProWithAssociatedTypeP1BQa", + "mangledName": "$s4cake21ProWithAssociatedTypeP1BQa", "moduleName": "cake", "protocolReq": true }, @@ -873,6 +917,7 @@ ], "declKind": "Func", "usr": "s:4cake21ProWithAssociatedTypePAAE10NonReqFuncyyF", + "mangledName": "$s4cake21ProWithAssociatedTypePAAE10NonReqFuncyyF", "moduleName": "cake", "genericSig": "", "funcSelfKind": "NonMutating" @@ -891,6 +936,7 @@ ], "declKind": "Var", "usr": "s:4cake21ProWithAssociatedTypePAAE9NonReqVarSivp", + "mangledName": "$s4cake21ProWithAssociatedTypePAAE9NonReqVarSivp", "moduleName": "cake", "accessors": [ { @@ -907,6 +953,7 @@ ], "declKind": "Accessor", "usr": "s:4cake21ProWithAssociatedTypePAAE9NonReqVarSivg", + "mangledName": "$s4cake21ProWithAssociatedTypePAAE9NonReqVarSivg", "moduleName": "cake", "genericSig": "", "accessorKind": "get" @@ -927,12 +974,14 @@ ], "declKind": "TypeAlias", "usr": "s:4cake21ProWithAssociatedTypePAAE11NonReqAliasa", + "mangledName": "$s4cake21ProWithAssociatedTypePAAE11NonReqAliasa", "moduleName": "cake", "genericSig": "" } ], "declKind": "Protocol", "usr": "s:4cake21ProWithAssociatedTypeP", + "mangledName": "$s4cake21ProWithAssociatedTypeP", "moduleName": "cake" }, { @@ -960,6 +1009,7 @@ ], "declKind": "Subscript", "usr": "s:4cake13SubsContainerP6getterS2i_tcip", + "mangledName": "$s4cake13SubsContainerP6getterS2i_tcip", "moduleName": "cake", "genericSig": "", "protocolReq": true, @@ -984,6 +1034,7 @@ ], "declKind": "Accessor", "usr": "s:4cake13SubsContainerP6getterS2i_tcig", + "mangledName": "$s4cake13SubsContainerP6getterS2i_tcig", "moduleName": "cake", "genericSig": "", "protocolReq": true, @@ -1012,6 +1063,7 @@ ], "declKind": "Subscript", "usr": "s:4cake13SubsContainerP6setterS2i_tcip", + "mangledName": "$s4cake13SubsContainerP6setterS2i_tcip", "moduleName": "cake", "genericSig": "", "protocolReq": true, @@ -1036,6 +1088,7 @@ ], "declKind": "Accessor", "usr": "s:4cake13SubsContainerP6setterS2i_tcig", + "mangledName": "$s4cake13SubsContainerP6setterS2i_tcig", "moduleName": "cake", "genericSig": "", "protocolReq": true, @@ -1067,6 +1120,7 @@ ], "declKind": "Accessor", "usr": "s:4cake13SubsContainerP6setterS2i_tcis", + "mangledName": "$s4cake13SubsContainerP6setterS2i_tcis", "moduleName": "cake", "genericSig": "", "protocolReq": true, @@ -1078,6 +1132,7 @@ ], "declKind": "Protocol", "usr": "s:4cake13SubsContainerP", + "mangledName": "$s4cake13SubsContainerP", "moduleName": "cake" }, { @@ -1091,6 +1146,7 @@ "printedName": "T", "declKind": "AssociatedType", "usr": "s:4cake6PSuperP1TQa", + "mangledName": "$s4cake6PSuperP1TQa", "moduleName": "cake", "protocolReq": true }, @@ -1107,6 +1163,7 @@ ], "declKind": "Func", "usr": "s:4cake6PSuperP3fooyyF", + "mangledName": "$s4cake6PSuperP3fooyyF", "moduleName": "cake", "genericSig": "", "protocolReq": true, @@ -1126,6 +1183,7 @@ ], "declKind": "Func", "usr": "s:4cake6PSuperPAAE9futureFooyyF", + "mangledName": "$s4cake6PSuperPAAE9futureFooyyF", "moduleName": "cake", "genericSig": "", "funcSelfKind": "NonMutating" @@ -1133,6 +1191,7 @@ ], "declKind": "Protocol", "usr": "s:4cake6PSuperP", + "mangledName": "$s4cake6PSuperP", "moduleName": "cake" }, { @@ -1146,6 +1205,7 @@ "printedName": "T", "declKind": "AssociatedType", "usr": "s:4cake4PSubP1TQa", + "mangledName": "$s4cake4PSubP1TQa", "moduleName": "cake", "protocolReq": true, "overriding": true @@ -1163,6 +1223,7 @@ ], "declKind": "Func", "usr": "s:4cake4PSubP3fooyyF", + "mangledName": "$s4cake4PSubP3fooyyF", "moduleName": "cake", "genericSig": "", "protocolReq": true, @@ -1175,6 +1236,7 @@ ], "declKind": "Protocol", "usr": "s:4cake4PSubP", + "mangledName": "$s4cake4PSubP", "moduleName": "cake", "genericSig": "", "conformances": [ @@ -1182,7 +1244,8 @@ "kind": "Conformance", "name": "PSuper", "printedName": "PSuper", - "usr": "s:4cake6PSuperP" + "usr": "s:4cake6PSuperP", + "mangledName": "$s4cake6PSuperP" } ] }, @@ -1200,6 +1263,7 @@ ], "declKind": "Var", "usr": "s:4cake9GlobalVarSivp", + "mangledName": "$s4cake9GlobalVarSivp", "moduleName": "cake", "declAttributes": [ "HasInitialValue", @@ -1236,6 +1300,7 @@ ], "declKind": "Func", "usr": "s:4cake15FutureContainerC9futureFooyyF", + "mangledName": "$s4cake15FutureContainerC9futureFooyyF", "moduleName": "cake", "intro_Macosx": "10.15", "intro_iOS": "13", @@ -1262,6 +1327,7 @@ ], "declKind": "Func", "usr": "s:4cake15FutureContainerC12NotfutureFooyyF", + "mangledName": "$s4cake15FutureContainerC12NotfutureFooyyF", "moduleName": "cake", "intro_Macosx": "10.15", "declAttributes": [ @@ -1272,6 +1338,7 @@ ], "declKind": "Class", "usr": "s:4cake15FutureContainerC", + "mangledName": "$s4cake15FutureContainerC", "moduleName": "cake", "hasMissingDesignatedInitializers": true, "conformances": [ @@ -1279,13 +1346,15 @@ "kind": "Conformance", "name": "P1", "printedName": "P1", - "usr": "s:4cake2P1P" + "usr": "s:4cake2P1P", + "mangledName": "$s4cake2P1P" }, { "kind": "Conformance", "name": "P2", "printedName": "P2", - "usr": "s:4cake2P2P" + "usr": "s:4cake2P2P", + "mangledName": "$s4cake2P2P" } ] }, @@ -1295,6 +1364,7 @@ "printedName": "PlatformIntroClass", "declKind": "Class", "usr": "s:4cake18PlatformIntroClassC", + "mangledName": "$s4cake18PlatformIntroClassC", "moduleName": "cake", "intro_Macosx": "10.1", "intro_iOS": "10.2", @@ -1314,6 +1384,7 @@ "printedName": "SwiftIntroClass", "declKind": "Class", "usr": "s:4cake15SwiftIntroClassC", + "mangledName": "$s4cake15SwiftIntroClassC", "moduleName": "cake", "intro_swift": "5", "declAttributes": [ @@ -1357,6 +1428,7 @@ ], "declKind": "Func", "usr": "c:@M@cake@objc(cs)NewObjCClass(im)ObjCFool:ObjCA:ObjCB:", + "mangledName": "$s4cake14SwiftObjcClassC3foo1a1b1cySi_S2itF", "moduleName": "cake", "objc_name": "ObjCFool:ObjCA:ObjCB:", "declAttributes": [ @@ -1367,6 +1439,7 @@ ], "declKind": "Class", "usr": "c:@M@cake@objc(cs)NewObjCClass", + "mangledName": "$s4cake14SwiftObjcClassC", "moduleName": "cake", "objc_name": "NewObjCClass", "declAttributes": [ @@ -1387,12 +1460,33 @@ ], "declKind": "Func", "usr": "s:4cake18emitIntoClientFuncyyF", + "mangledName": "$s4cake18emitIntoClientFuncyyF", "moduleName": "cake", "declAttributes": [ "AlwaysEmitIntoClient" ], "funcSelfKind": "NonMutating" }, + { + "kind": "Function", + "name": "silgenNamedFunc", + "printedName": "silgenNamedFunc()", + "children": [ + { + "kind": "TypeNominal", + "name": "Void", + "printedName": "()" + } + ], + "declKind": "Func", + "usr": "s:4cake15silgenNamedFuncyyF", + "mangledName": "silgenName", + "moduleName": "cake", + "declAttributes": [ + "SILGenName" + ], + "funcSelfKind": "NonMutating" + }, { "kind": "TypeDecl", "name": "Int", @@ -1411,6 +1505,7 @@ ], "declKind": "Func", "usr": "s:Si4cakeE3fooyyF", + "mangledName": "$sSi4cakeE3fooyyF", "moduleName": "cake", "funcSelfKind": "NonMutating" }, @@ -1427,12 +1522,14 @@ ], "declKind": "Func", "usr": "s:Si4cakeE3baryyF", + "mangledName": "$sSi4cakeE3baryyF", "moduleName": "cake", "funcSelfKind": "NonMutating" } ], "declKind": "Struct", "usr": "s:Si", + "mangledName": "$sSi", "moduleName": "Swift", "declAttributes": [ "Frozen" @@ -1443,13 +1540,15 @@ "kind": "Conformance", "name": "FixedWidthInteger", "printedName": "FixedWidthInteger", - "usr": "s:s17FixedWidthIntegerP" + "usr": "s:s17FixedWidthIntegerP", + "mangledName": "$ss17FixedWidthIntegerP" }, { "kind": "Conformance", "name": "SignedInteger", "printedName": "SignedInteger", - "usr": "s:SZ" + "usr": "s:SZ", + "mangledName": "$sSZ" }, { "kind": "Conformance", @@ -1470,19 +1569,22 @@ ] } ], - "usr": "s:Sz" + "usr": "s:Sz", + "mangledName": "$sSz" }, { "kind": "Conformance", "name": "LosslessStringConvertible", "printedName": "LosslessStringConvertible", - "usr": "s:s25LosslessStringConvertibleP" + "usr": "s:s25LosslessStringConvertibleP", + "mangledName": "$ss25LosslessStringConvertibleP" }, { "kind": "Conformance", "name": "SignedNumeric", "printedName": "SignedNumeric", - "usr": "s:s13SignedNumericP" + "usr": "s:s13SignedNumericP", + "mangledName": "$ss13SignedNumericP" }, { "kind": "Conformance", @@ -1510,13 +1612,15 @@ ] } ], - "usr": "s:Sj" + "usr": "s:Sj", + "mangledName": "$sSj" }, { "kind": "Conformance", "name": "CustomStringConvertible", "printedName": "CustomStringConvertible", - "usr": "s:s23CustomStringConvertibleP" + "usr": "s:s23CustomStringConvertibleP", + "mangledName": "$ss23CustomStringConvertibleP" }, { "kind": "Conformance", @@ -1537,13 +1641,15 @@ ] } ], - "usr": "s:Sx" + "usr": "s:Sx", + "mangledName": "$sSx" }, { "kind": "Conformance", "name": "AdditiveArithmetic", "printedName": "AdditiveArithmetic", - "usr": "s:s18AdditiveArithmeticP" + "usr": "s:s18AdditiveArithmeticP", + "mangledName": "$ss18AdditiveArithmeticP" }, { "kind": "Conformance", @@ -1571,67 +1677,78 @@ ] } ], - "usr": "s:s27ExpressibleByIntegerLiteralP" + "usr": "s:s27ExpressibleByIntegerLiteralP", + "mangledName": "$ss27ExpressibleByIntegerLiteralP" }, { "kind": "Conformance", "name": "Comparable", "printedName": "Comparable", - "usr": "s:SL" + "usr": "s:SL", + "mangledName": "$sSL" }, { "kind": "Conformance", "name": "P1", "printedName": "P1", - "usr": "s:4cake2P1P" + "usr": "s:4cake2P1P", + "mangledName": "$s4cake2P1P" }, { "kind": "Conformance", "name": "Encodable", "printedName": "Encodable", - "usr": "s:SE" + "usr": "s:SE", + "mangledName": "$sSE" }, { "kind": "Conformance", "name": "Decodable", "printedName": "Decodable", - "usr": "s:Se" + "usr": "s:Se", + "mangledName": "$sSe" }, { "kind": "Conformance", "name": "CustomReflectable", "printedName": "CustomReflectable", - "usr": "s:s17CustomReflectableP" + "usr": "s:s17CustomReflectableP", + "mangledName": "$ss17CustomReflectableP" }, { "kind": "Conformance", "name": "MirrorPath", "printedName": "MirrorPath", - "usr": "s:s10MirrorPathP" + "usr": "s:s10MirrorPathP", + "mangledName": "$ss10MirrorPathP" }, { "kind": "Conformance", "name": "CVarArg", "printedName": "CVarArg", - "usr": "s:s7CVarArgP" + "usr": "s:s7CVarArgP", + "mangledName": "$ss7CVarArgP" }, { "kind": "Conformance", "name": "Hashable", "printedName": "Hashable", - "usr": "s:SH" + "usr": "s:SH", + "mangledName": "$sSH" }, { "kind": "Conformance", "name": "Equatable", "printedName": "Equatable", - "usr": "s:SQ" + "usr": "s:SQ", + "mangledName": "$sSQ" }, { "kind": "Conformance", "name": "Sendable", "printedName": "Sendable", - "usr": "s:s8SendableP" + "usr": "s:s8SendableP", + "mangledName": "$ss8SendableP" }, { "kind": "Conformance", @@ -1737,7 +1854,8 @@ ] } ], - "usr": "s:s10SIMDScalarP" + "usr": "s:s10SIMDScalarP", + "mangledName": "$ss10SIMDScalarP" } ] } diff --git a/test/api-digester/internal-extension.swift b/test/api-digester/internal-extension.swift index 76c9ebb385d85..4d49473acb353 100644 --- a/test/api-digester/internal-extension.swift +++ b/test/api-digester/internal-extension.swift @@ -31,7 +31,8 @@ internal extension S1 { // CHECK-NEXT: "kind": "Conformance", // CHECK-NEXT: "name": "PublicProto", // CHECK-NEXT: "printedName": "PublicProto", -// CHECK-NEXT: "usr": "s:4main11PublicProtoP" +// CHECK-NEXT: "usr": "s:4main11PublicProtoP", +// CHECK-NEXT: "mangledName": "$s4main11PublicProtoP" // CHECK-NEXT: } // CHECK-NEXT: ] extension C0: InternalProto {