From a870b06055b0b7d191857dc84af84bbb0f526e37 Mon Sep 17 00:00:00 2001 From: Xi Ge Date: Wed, 20 Oct 2021 15:40:31 -0700 Subject: [PATCH] ABI Checker: include mangled names in ABI descriptor files Previously, we use USR as a delegate for mangled name. However, USR won't incorporate name changes made by attributes like @_silgen_name. Instead, we should add a dedicated field for canonical mangled names. rdar://84202064 --- .../swift/APIDigester/ModuleAnalyzerNodes.h | 3 + include/swift/AST/ASTMangler.h | 1 + include/swift/IDE/DigesterEnums.def | 1 + lib/APIDigester/ModuleAnalyzerNodes.cpp | 26 ++- lib/AST/ASTMangler.cpp | 24 ++- test/api-digester/Inputs/cake.swift | 3 + test/api-digester/Outputs/cake-abi.json | 200 ++++++++++++++---- test/api-digester/Outputs/cake.json | 185 +++++++++++++--- test/api-digester/internal-extension.swift | 3 +- 9 files changed, 364 insertions(+), 82 deletions(-) diff --git a/include/swift/APIDigester/ModuleAnalyzerNodes.h b/include/swift/APIDigester/ModuleAnalyzerNodes.h index 964f09c26bceb..3dec92837f356 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 corresponding 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 20946c5fc1f8f..1e1286a86f475 100644 --- a/include/swift/AST/ASTMangler.h +++ b/include/swift/AST/ASTMangler.h @@ -271,6 +271,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 d3b167f1cc9a4..7137d6ee408e8 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, false)); +} + 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(); @@ -1969,6 +1987,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); } @@ -1976,6 +1995,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 b779d248eacff..2f8a35ee1a6ae 100644 --- a/lib/AST/ASTMangler.cpp +++ b/lib/AST/ASTMangler.cpp @@ -756,16 +756,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; if (auto Ctor = dyn_cast(Decl)) { appendConstructorEntity(Ctor, /*isAllocating=*/false); @@ -784,10 +782,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 9c73629cdd6bd..7b283c1a31974 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": "4cake2P1PAAE1poiyAaB_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": "4cake2P1P", "moduleName": "cake" }, { @@ -75,6 +77,7 @@ "printedName": "P2", "declKind": "Protocol", "usr": "s:4cake2P2P", + "mangledName": "4cake2P2P", "moduleName": "cake" }, { @@ -83,6 +86,7 @@ "printedName": "P3", "declKind": "Protocol", "usr": "s:4cake2P3P", + "mangledName": "4cake2P3P", "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": "4cake2P2P" }, { "kind": "Conformance", "name": "P1", "printedName": "P1", - "usr": "s:4cake2P1P" + "usr": "s:4cake2P1P", + "mangledName": "4cake2P1P" } ] }, @@ -119,6 +125,7 @@ ], "declKind": "Func", "usr": "s:4cake2S1V4foo1yyFZ", + "mangledName": "4cake2S1V4foo1yyFZ", "moduleName": "cake", "static": true, "funcSelfKind": "NonMutating" @@ -136,6 +143,7 @@ ], "declKind": "Func", "usr": "s:4cake2S1V4foo2yyF", + "mangledName": "4cake2S1V4foo2yyF", "moduleName": "cake", "funcSelfKind": "Mutating" }, @@ -152,12 +160,14 @@ ], "declKind": "Func", "usr": "s:4cake2S1V4foo6yyF", + "mangledName": "4cake2S1V4foo6yyF", "moduleName": "cake", "funcSelfKind": "NonMutating" } ], "declKind": "Struct", "usr": "s:4cake2S1V", + "mangledName": "4cake2S1V", "moduleName": "cake", "declAttributes": [ "Frozen" @@ -167,19 +177,22 @@ "kind": "Conformance", "name": "P1", "printedName": "P1", - "usr": "s:4cake2P1P" + "usr": "s:4cake2P1P", + "mangledName": "4cake2P1P" }, { "kind": "Conformance", "name": "Sendable", "printedName": "Sendable", - "usr": "s:s8SendableP" + "usr": "s:s8SendableP", + "mangledName": "s8SendableP" }, { "kind": "Conformance", "name": "P2", "printedName": "P2", - "usr": "s:4cake2P2P" + "usr": "s:4cake2P2P", + "mangledName": "4cake2P2P" } ] }, @@ -201,6 +214,7 @@ ], "declKind": "Func", "usr": "s:4cake2C0CA2A2S1VRszAERs_AERs0_rlE17conditionalFooExtyyF", + "mangledName": "4cake2C0CA2A2S1VRszAERs_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": "4cake2C0C19unconditionalFooExtyyF", "moduleName": "cake", "genericSig": "<τ_0_0, τ_0_1, τ_0_2>", "sugared_genericSig": "", @@ -227,6 +242,7 @@ ], "declKind": "Class", "usr": "s:4cake2C0C", + "mangledName": "4cake2C0C", "moduleName": "cake", "genericSig": "<τ_0_0, τ_0_1, τ_0_2>", "sugared_genericSig": "", @@ -250,6 +266,7 @@ ], "declKind": "Func", "usr": "s:4cake2C1C4foo1yyFZ", + "mangledName": "4cake2C1C4foo1yyFZ", "moduleName": "cake", "static": true, "funcSelfKind": "NonMutating" @@ -267,6 +284,7 @@ ], "declKind": "Var", "usr": "s:4cake2C1C3InsACSgvp", + "mangledName": "4cake2C1C3InsACSgvp", "moduleName": "cake", "declAttributes": [ "HasInitialValue", @@ -299,6 +317,7 @@ ], "declKind": "Accessor", "usr": "s:4cake2C1C3InsACSgvg", + "mangledName": "4cake2C1C3InsACSgvg", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -333,6 +352,7 @@ ], "declKind": "Accessor", "usr": "s:4cake2C1C3InsACSgvs", + "mangledName": "4cake2C1C3InsACSgvs", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -353,6 +373,7 @@ ], "declKind": "Accessor", "usr": "s:4cake2C1C3InsACSgvM", + "mangledName": "4cake2C1C3InsACSgvM", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -375,6 +396,7 @@ ], "declKind": "Var", "usr": "s:4cake2C1C4Ins2ACvp", + "mangledName": "4cake2C1C4Ins2ACvp", "moduleName": "cake", "declAttributes": [ "HasInitialValue", @@ -399,6 +421,7 @@ ], "declKind": "Accessor", "usr": "s:4cake2C1C4Ins2ACvg", + "mangledName": "4cake2C1C4Ins2ACvg", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -425,6 +448,7 @@ ], "declKind": "Accessor", "usr": "s:4cake2C1C4Ins2ACvs", + "mangledName": "4cake2C1C4Ins2ACvs", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -445,6 +469,7 @@ ], "declKind": "Accessor", "usr": "s:4cake2C1C4Ins2ACvM", + "mangledName": "4cake2C1C4Ins2ACvM", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -457,6 +482,7 @@ ], "declKind": "Class", "usr": "s:4cake2C1C", + "mangledName": "4cake2C1C", "moduleName": "cake", "superclassUsr": "s:4cake2C0C", "hasMissingDesignatedInitializers": true, @@ -491,6 +517,7 @@ ], "declKind": "Func", "usr": "s:4cake4foo1_1bySi_AA2S1VtF", + "mangledName": "4cake4foo1_1bySi_AA2S1VtF", "moduleName": "cake", "funcSelfKind": "NonMutating" }, @@ -520,6 +547,7 @@ ], "declKind": "Func", "usr": "s:4cake4foo2_1bySi_AA2S1VtF", + "mangledName": "4cake4foo2_1bySi_AA2S1VtF", "moduleName": "cake", "funcSelfKind": "NonMutating" }, @@ -562,6 +590,7 @@ ], "declKind": "EnumElement", "usr": "s:4cake6NumberO3oneyA2CmF", + "mangledName": "4cake6NumberO3oneyA2CmF", "moduleName": "cake", "fixedbinaryorder": 0 }, @@ -591,6 +620,7 @@ ], "declKind": "Func", "usr": "s:4cake6NumberO21__derived_enum_equalsySbAC_ACtFZ", + "mangledName": "4cake6NumberO21__derived_enum_equalsySbAC_ACtFZ", "moduleName": "cake", "static": true, "implicit": true, @@ -624,6 +654,7 @@ ], "declKind": "Constructor", "usr": "s:4cake6NumberO8rawValueACSgSi_tcfc", + "mangledName": "4cake6NumberO8rawValueACSgSi_tcfc", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -645,6 +676,7 @@ ], "declKind": "Var", "usr": "s:4cake6NumberO8rawValueSivp", + "mangledName": "4cake6NumberO8rawValueSivp", "moduleName": "cake", "implicit": true, "accessors": [ @@ -662,6 +694,7 @@ ], "declKind": "Accessor", "usr": "s:4cake6NumberO8rawValueSivg", + "mangledName": "4cake6NumberO8rawValueSivg", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -674,6 +707,7 @@ ], "declKind": "Enum", "usr": "s:4cake6NumberO", + "mangledName": "4cake6NumberO", "moduleName": "cake", "enumRawTypeName": "Int", "isEnumExhaustive": true, @@ -682,13 +716,15 @@ "kind": "Conformance", "name": "Equatable", "printedName": "Equatable", - "usr": "s:SQ" + "usr": "s:SQ", + "mangledName": "SQ" }, { "kind": "Conformance", "name": "Hashable", "printedName": "Hashable", - "usr": "s:SH" + "usr": "s:SH", + "mangledName": "SH" }, { "kind": "Conformance", @@ -709,7 +745,8 @@ ] } ], - "usr": "s:SY" + "usr": "s:SY", + "mangledName": "SY" } ] }, @@ -746,6 +783,7 @@ ], "declKind": "Func", "usr": "s:4cake4foo3yySDySiSSGF", + "mangledName": "4cake4foo3yySDySiSSGF", "moduleName": "cake", "funcSelfKind": "NonMutating" }, @@ -768,6 +806,7 @@ ], "declKind": "Var", "usr": "s:4cake17fixedLayoutStructV1aSivp", + "mangledName": "4cake17fixedLayoutStructV1aSivp", "moduleName": "cake", "declAttributes": [ "HasInitialValue", @@ -790,6 +829,7 @@ ], "declKind": "Accessor", "usr": "s:4cake17fixedLayoutStructV1aSivg", + "mangledName": "4cake17fixedLayoutStructV1aSivg", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -816,6 +856,7 @@ ], "declKind": "Accessor", "usr": "s:4cake17fixedLayoutStructV1aSivs", + "mangledName": "4cake17fixedLayoutStructV1aSivs", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -836,6 +877,7 @@ ], "declKind": "Accessor", "usr": "s:4cake17fixedLayoutStructV1aSivM", + "mangledName": "4cake17fixedLayoutStructV1aSivM", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -859,6 +901,7 @@ ], "declKind": "Var", "usr": "s:4cake17fixedLayoutStructV1b33_3D8926C30F7417F2EF9A277D0C73FBDBLLSivp", + "mangledName": "4cake17fixedLayoutStructV1b33_3D8926C30F7417F2EF9A277D0C73FBDBLLSivp", "moduleName": "cake", "isInternal": true, "declAttributes": [ @@ -882,6 +925,7 @@ ], "declKind": "Var", "usr": "s:4cake17fixedLayoutStructV1cSivp", + "mangledName": "4cake17fixedLayoutStructV1cSivp", "moduleName": "cake", "isInternal": true, "declAttributes": [ @@ -905,6 +949,7 @@ ], "declKind": "Var", "usr": "s:4cake17fixedLayoutStructV19unavailablePropertySivp", + "mangledName": "4cake17fixedLayoutStructV19unavailablePropertySivp", "moduleName": "cake", "declAttributes": [ "HasInitialValue", @@ -929,6 +974,7 @@ ], "declKind": "Accessor", "usr": "s:4cake17fixedLayoutStructV19unavailablePropertySivg", + "mangledName": "4cake17fixedLayoutStructV19unavailablePropertySivg", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -941,6 +987,7 @@ ], "declKind": "Struct", "usr": "s:4cake17fixedLayoutStructV", + "mangledName": "4cake17fixedLayoutStructV", "moduleName": "cake", "declAttributes": [ "Frozen" @@ -950,7 +997,8 @@ "kind": "Conformance", "name": "Sendable", "printedName": "Sendable", - "usr": "s:s8SendableP" + "usr": "s:s8SendableP", + "mangledName": "s8SendableP" } ] }, @@ -965,6 +1013,7 @@ "printedName": "A", "declKind": "AssociatedType", "usr": "s:4cake21ProWithAssociatedTypeP1AQa", + "mangledName": "4cake21ProWithAssociatedTypeP1AQa", "moduleName": "cake", "protocolReq": true }, @@ -982,6 +1031,7 @@ ], "declKind": "AssociatedType", "usr": "s:4cake21ProWithAssociatedTypeP1BQa", + "mangledName": "4cake21ProWithAssociatedTypeP1BQa", "moduleName": "cake", "protocolReq": true }, @@ -998,6 +1048,7 @@ ], "declKind": "Func", "usr": "s:4cake21ProWithAssociatedTypePAAE10NonReqFuncyyF", + "mangledName": "4cake21ProWithAssociatedTypePAAE10NonReqFuncyyF", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.ProWithAssociatedType>", "sugared_genericSig": "", @@ -1017,6 +1068,7 @@ ], "declKind": "Var", "usr": "s:4cake21ProWithAssociatedTypePAAE9NonReqVarSivp", + "mangledName": "4cake21ProWithAssociatedTypePAAE9NonReqVarSivp", "moduleName": "cake", "accessors": [ { @@ -1033,6 +1085,7 @@ ], "declKind": "Accessor", "usr": "s:4cake21ProWithAssociatedTypePAAE9NonReqVarSivg", + "mangledName": "4cake21ProWithAssociatedTypePAAE9NonReqVarSivg", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.ProWithAssociatedType>", "sugared_genericSig": "", @@ -1043,6 +1096,7 @@ ], "declKind": "Protocol", "usr": "s:4cake21ProWithAssociatedTypeP", + "mangledName": "4cake21ProWithAssociatedTypeP", "moduleName": "cake" }, { @@ -1070,6 +1124,7 @@ ], "declKind": "Subscript", "usr": "s:4cake13SubsContainerP6getterS2i_tcip", + "mangledName": "4cake13SubsContainerP6getterS2i_tcip", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.SubsContainer>", "sugared_genericSig": "", @@ -1095,6 +1150,7 @@ ], "declKind": "Accessor", "usr": "s:4cake13SubsContainerP6getterS2i_tcig", + "mangledName": "4cake13SubsContainerP6getterS2i_tcig", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.SubsContainer>", "sugared_genericSig": "", @@ -1124,6 +1180,7 @@ ], "declKind": "Subscript", "usr": "s:4cake13SubsContainerP6setterS2i_tcip", + "mangledName": "4cake13SubsContainerP6setterS2i_tcip", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.SubsContainer>", "sugared_genericSig": "", @@ -1149,6 +1206,7 @@ ], "declKind": "Accessor", "usr": "s:4cake13SubsContainerP6setterS2i_tcig", + "mangledName": "4cake13SubsContainerP6setterS2i_tcig", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.SubsContainer>", "sugared_genericSig": "", @@ -1181,6 +1239,7 @@ ], "declKind": "Accessor", "usr": "s:4cake13SubsContainerP6setterS2i_tcis", + "mangledName": "4cake13SubsContainerP6setterS2i_tcis", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.SubsContainer>", "sugared_genericSig": "", @@ -1207,6 +1266,7 @@ ], "declKind": "Accessor", "usr": "s:4cake13SubsContainerP6setterS2i_tciM", + "mangledName": "4cake13SubsContainerP6setterS2i_tciM", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.SubsContainer>", "sugared_genericSig": "", @@ -1220,6 +1280,7 @@ ], "declKind": "Protocol", "usr": "s:4cake13SubsContainerP", + "mangledName": "4cake13SubsContainerP", "moduleName": "cake" }, { @@ -1233,6 +1294,7 @@ "printedName": "T", "declKind": "AssociatedType", "usr": "s:4cake6PSuperP1TQa", + "mangledName": "4cake6PSuperP1TQa", "moduleName": "cake", "protocolReq": true }, @@ -1249,6 +1311,7 @@ ], "declKind": "Func", "usr": "s:4cake6PSuperP3fooyyF", + "mangledName": "4cake6PSuperP3fooyyF", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.PSuper>", "sugared_genericSig": "", @@ -1269,6 +1332,7 @@ ], "declKind": "Func", "usr": "s:4cake6PSuperPAAE9futureFooyyF", + "mangledName": "4cake6PSuperPAAE9futureFooyyF", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.PSuper>", "sugared_genericSig": "", @@ -1277,6 +1341,7 @@ ], "declKind": "Protocol", "usr": "s:4cake6PSuperP", + "mangledName": "4cake6PSuperP", "moduleName": "cake" }, { @@ -1290,6 +1355,7 @@ "printedName": "T", "declKind": "AssociatedType", "usr": "s:4cake4PSubP1TQa", + "mangledName": "4cake4PSubP1TQa", "moduleName": "cake", "protocolReq": true, "overriding": true @@ -1307,6 +1373,7 @@ ], "declKind": "Func", "usr": "s:4cake4PSubP3fooyyF", + "mangledName": "4cake4PSubP3fooyyF", "moduleName": "cake", "genericSig": "<τ_0_0 where τ_0_0 : cake.PSub>", "sugared_genericSig": "", @@ -1320,6 +1387,7 @@ ], "declKind": "Protocol", "usr": "s:4cake4PSubP", + "mangledName": "4cake4PSubP", "moduleName": "cake", "genericSig": "<τ_0_0 : cake.PSuper>", "sugared_genericSig": "", @@ -1328,7 +1396,8 @@ "kind": "Conformance", "name": "PSuper", "printedName": "PSuper", - "usr": "s:4cake6PSuperP" + "usr": "s:4cake6PSuperP", + "mangledName": "4cake6PSuperP" } ] }, @@ -1346,6 +1415,7 @@ ], "declKind": "Var", "usr": "s:4cake9GlobalVarSivp", + "mangledName": "4cake9GlobalVarSivp", "moduleName": "cake", "declAttributes": [ "HasInitialValue", @@ -1383,6 +1453,7 @@ ], "declKind": "Var", "usr": "s:4cake21UsableFromInlineClassC4Prop33_3D8926C30F7417F2EF9A277D0C73FBDBLLSivp", + "mangledName": "4cake21UsableFromInlineClassC4Prop33_3D8926C30F7417F2EF9A277D0C73FBDBLLSivp", "moduleName": "cake", "isInternal": true, "declAttributes": [ @@ -1395,6 +1466,7 @@ ], "declKind": "Class", "usr": "s:4cake21UsableFromInlineClassC", + "mangledName": "4cake21UsableFromInlineClassC", "moduleName": "cake", "declAttributes": [ "FixedLayout", @@ -1420,6 +1492,7 @@ ], "declKind": "Func", "usr": "s:4cake15FutureContainerC9futureFooyyF", + "mangledName": "4cake15FutureContainerC9futureFooyyF", "moduleName": "cake", "intro_Macosx": "10.15", "intro_iOS": "13", @@ -1446,6 +1519,7 @@ ], "declKind": "Func", "usr": "s:4cake15FutureContainerC12NotfutureFooyyF", + "mangledName": "4cake15FutureContainerC12NotfutureFooyyF", "moduleName": "cake", "intro_Macosx": "10.15", "declAttributes": [ @@ -1456,6 +1530,7 @@ ], "declKind": "Class", "usr": "s:4cake15FutureContainerC", + "mangledName": "4cake15FutureContainerC", "moduleName": "cake", "hasMissingDesignatedInitializers": true, "conformances": [ @@ -1463,13 +1538,15 @@ "kind": "Conformance", "name": "P1", "printedName": "P1", - "usr": "s:4cake2P1P" + "usr": "s:4cake2P1P", + "mangledName": "4cake2P1P" }, { "kind": "Conformance", "name": "P2", "printedName": "P2", - "usr": "s:4cake2P2P" + "usr": "s:4cake2P2P", + "mangledName": "4cake2P2P" } ] }, @@ -1479,6 +1556,7 @@ "printedName": "PlatformIntroClass", "declKind": "Class", "usr": "s:4cake18PlatformIntroClassC", + "mangledName": "4cake18PlatformIntroClassC", "moduleName": "cake", "intro_Macosx": "10.1", "intro_iOS": "10.2", @@ -1498,6 +1576,7 @@ "printedName": "SwiftIntroClass", "declKind": "Class", "usr": "s:4cake15SwiftIntroClassC", + "mangledName": "4cake15SwiftIntroClassC", "moduleName": "cake", "intro_swift": "5", "declAttributes": [ @@ -1541,6 +1620,7 @@ ], "declKind": "Func", "usr": "c:@M@cake@objc(cs)NewObjCClass(im)ObjCFool:ObjCA:ObjCB:", + "mangledName": "4cake14SwiftObjcClassC3foo1a1b1cySi_S2itF", "moduleName": "cake", "objc_name": "ObjCFool:ObjCA:ObjCB:", "declAttributes": [ @@ -1551,6 +1631,7 @@ ], "declKind": "Class", "usr": "c:@M@cake@objc(cs)NewObjCClass", + "mangledName": "4cake14SwiftObjcClassC", "moduleName": "cake", "objc_name": "NewObjCClass", "declAttributes": [ @@ -1558,6 +1639,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", @@ -1576,6 +1677,7 @@ ], "declKind": "Func", "usr": "s:Si4cakeE3fooyyF", + "mangledName": "Si4cakeE3fooyyF", "moduleName": "cake", "funcSelfKind": "NonMutating" }, @@ -1592,12 +1694,14 @@ ], "declKind": "Func", "usr": "s:Si4cakeE3baryyF", + "mangledName": "Si4cakeE3baryyF", "moduleName": "cake", "funcSelfKind": "NonMutating" } ], "declKind": "Struct", "usr": "s:Si", + "mangledName": "Si", "moduleName": "Swift", "declAttributes": [ "Frozen" @@ -1608,19 +1712,22 @@ "kind": "Conformance", "name": "FixedWidthInteger", "printedName": "FixedWidthInteger", - "usr": "s:s17FixedWidthIntegerP" + "usr": "s:s17FixedWidthIntegerP", + "mangledName": "s17FixedWidthIntegerP" }, { "kind": "Conformance", "name": "SignedInteger", "printedName": "SignedInteger", - "usr": "s:SZ" + "usr": "s:SZ", + "mangledName": "SZ" }, { "kind": "Conformance", "name": "_ExpressibleByBuiltinIntegerLiteral", "printedName": "_ExpressibleByBuiltinIntegerLiteral", - "usr": "s:s35_ExpressibleByBuiltinIntegerLiteralP" + "usr": "s:s35_ExpressibleByBuiltinIntegerLiteralP", + "mangledName": "s35_ExpressibleByBuiltinIntegerLiteralP" }, { "kind": "Conformance", @@ -1641,19 +1748,22 @@ ] } ], - "usr": "s:Sz" + "usr": "s:Sz", + "mangledName": "Sz" }, { "kind": "Conformance", "name": "LosslessStringConvertible", "printedName": "LosslessStringConvertible", - "usr": "s:s25LosslessStringConvertibleP" + "usr": "s:s25LosslessStringConvertibleP", + "mangledName": "s25LosslessStringConvertibleP" }, { "kind": "Conformance", "name": "SignedNumeric", "printedName": "SignedNumeric", - "usr": "s:s13SignedNumericP" + "usr": "s:s13SignedNumericP", + "mangledName": "s13SignedNumericP" }, { "kind": "Conformance", @@ -1674,13 +1784,15 @@ ] } ], - "usr": "s:Sj" + "usr": "s:Sj", + "mangledName": "Sj" }, { "kind": "Conformance", "name": "CustomStringConvertible", "printedName": "CustomStringConvertible", - "usr": "s:s23CustomStringConvertibleP" + "usr": "s:s23CustomStringConvertibleP", + "mangledName": "s23CustomStringConvertibleP" }, { "kind": "Conformance", @@ -1701,13 +1813,15 @@ ] } ], - "usr": "s:Sx" + "usr": "s:Sx", + "mangledName": "Sx" }, { "kind": "Conformance", "name": "AdditiveArithmetic", "printedName": "AdditiveArithmetic", - "usr": "s:s18AdditiveArithmeticP" + "usr": "s:s18AdditiveArithmeticP", + "mangledName": "s18AdditiveArithmeticP" }, { "kind": "Conformance", @@ -1728,79 +1842,92 @@ ] } ], - "usr": "s:s27ExpressibleByIntegerLiteralP" + "usr": "s:s27ExpressibleByIntegerLiteralP", + "mangledName": "s27ExpressibleByIntegerLiteralP" }, { "kind": "Conformance", "name": "Comparable", "printedName": "Comparable", - "usr": "s:SL" + "usr": "s:SL", + "mangledName": "SL" }, { "kind": "Conformance", "name": "P1", "printedName": "P1", - "usr": "s:4cake2P1P" + "usr": "s:4cake2P1P", + "mangledName": "4cake2P1P" }, { "kind": "Conformance", "name": "Encodable", "printedName": "Encodable", - "usr": "s:SE" + "usr": "s:SE", + "mangledName": "SE" }, { "kind": "Conformance", "name": "Decodable", "printedName": "Decodable", - "usr": "s:Se" + "usr": "s:Se", + "mangledName": "Se" }, { "kind": "Conformance", "name": "CustomReflectable", "printedName": "CustomReflectable", - "usr": "s:s17CustomReflectableP" + "usr": "s:s17CustomReflectableP", + "mangledName": "s17CustomReflectableP" }, { "kind": "Conformance", "name": "_CustomPlaygroundQuickLookable", "printedName": "_CustomPlaygroundQuickLookable", - "usr": "s:s30_CustomPlaygroundQuickLookableP" + "usr": "s:s30_CustomPlaygroundQuickLookableP", + "mangledName": "s30_CustomPlaygroundQuickLookableP" }, { "kind": "Conformance", "name": "MirrorPath", "printedName": "MirrorPath", - "usr": "s:s10MirrorPathP" + "usr": "s:s10MirrorPathP", + "mangledName": "s10MirrorPathP" }, { "kind": "Conformance", "name": "CVarArg", "printedName": "CVarArg", - "usr": "s:s7CVarArgP" + "usr": "s:s7CVarArgP", + "mangledName": "s7CVarArgP" }, { "kind": "Conformance", "name": "Hashable", "printedName": "Hashable", - "usr": "s:SH" + "usr": "s:SH", + "mangledName": "SH" }, { "kind": "Conformance", "name": "Equatable", "printedName": "Equatable", - "usr": "s:SQ" + "usr": "s:SQ", + "mangledName": "SQ" }, { "kind": "Conformance", "name": "_HasCustomAnyHashableRepresentation", "printedName": "_HasCustomAnyHashableRepresentation", - "usr": "s:s35_HasCustomAnyHashableRepresentationP" + "usr": "s:s35_HasCustomAnyHashableRepresentationP", + "mangledName": "s35_HasCustomAnyHashableRepresentationP" }, { "kind": "Conformance", "name": "Sendable", "printedName": "Sendable", - "usr": "s:s8SendableP" + "usr": "s:s8SendableP", + "mangledName": "s8SendableP" }, { "kind": "Conformance", @@ -1899,7 +2026,8 @@ ] } ], - "usr": "s:s10SIMDScalarP" + "usr": "s:s10SIMDScalarP", + "mangledName": "s10SIMDScalarP" } ] } diff --git a/test/api-digester/Outputs/cake.json b/test/api-digester/Outputs/cake.json index c2195cc677257..c07d7b0e4bd01 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": "4cake2P1PAAE1poiyAaB_pAaB_p_AaB_ptFZ", "moduleName": "cake", "genericSig": "", "static": true, @@ -66,6 +67,7 @@ ], "declKind": "Protocol", "usr": "s:4cake2P1P", + "mangledName": "4cake2P1P", "moduleName": "cake" }, { @@ -74,6 +76,7 @@ "printedName": "P2", "declKind": "Protocol", "usr": "s:4cake2P2P", + "mangledName": "4cake2P2P", "moduleName": "cake" }, { @@ -82,6 +85,7 @@ "printedName": "P3", "declKind": "Protocol", "usr": "s:4cake2P3P", + "mangledName": "4cake2P3P", "moduleName": "cake", "genericSig": "", "conformances": [ @@ -89,13 +93,15 @@ "kind": "Conformance", "name": "P2", "printedName": "P2", - "usr": "s:4cake2P2P" + "usr": "s:4cake2P2P", + "mangledName": "4cake2P2P" }, { "kind": "Conformance", "name": "P1", "printedName": "P1", - "usr": "s:4cake2P1P" + "usr": "s:4cake2P1P", + "mangledName": "4cake2P1P" } ] }, @@ -117,6 +123,7 @@ ], "declKind": "Func", "usr": "s:4cake2S1V4foo1yyFZ", + "mangledName": "4cake2S1V4foo1yyFZ", "moduleName": "cake", "static": true, "funcSelfKind": "NonMutating" @@ -134,6 +141,7 @@ ], "declKind": "Func", "usr": "s:4cake2S1V4foo2yyF", + "mangledName": "4cake2S1V4foo2yyF", "moduleName": "cake", "funcSelfKind": "Mutating" }, @@ -157,12 +165,14 @@ ], "declKind": "Func", "usr": "s:4cake2S1V4foo6yyF", + "mangledName": "4cake2S1V4foo6yyF", "moduleName": "cake", "funcSelfKind": "NonMutating" } ], "declKind": "Struct", "usr": "s:4cake2S1V", + "mangledName": "4cake2S1V", "moduleName": "cake", "declAttributes": [ "Frozen" @@ -172,19 +182,22 @@ "kind": "Conformance", "name": "P1", "printedName": "P1", - "usr": "s:4cake2P1P" + "usr": "s:4cake2P1P", + "mangledName": "4cake2P1P" }, { "kind": "Conformance", "name": "Sendable", "printedName": "Sendable", - "usr": "s:s8SendableP" + "usr": "s:s8SendableP", + "mangledName": "s8SendableP" }, { "kind": "Conformance", "name": "P2", "printedName": "P2", - "usr": "s:4cake2P2P" + "usr": "s:4cake2P2P", + "mangledName": "4cake2P2P" } ] }, @@ -206,6 +219,7 @@ ], "declKind": "Func", "usr": "s:4cake2C0CA2A2S1VRszAERs_AERs0_rlE17conditionalFooExtyyF", + "mangledName": "4cake2C0CA2A2S1VRszAERs_AERs0_rlE17conditionalFooExtyyF", "moduleName": "cake", "genericSig": "", "funcSelfKind": "NonMutating" @@ -223,6 +237,7 @@ ], "declKind": "Func", "usr": "s:4cake2C0C19unconditionalFooExtyyF", + "mangledName": "4cake2C0C19unconditionalFooExtyyF", "moduleName": "cake", "genericSig": "", "funcSelfKind": "NonMutating" @@ -230,6 +245,7 @@ ], "declKind": "Class", "usr": "s:4cake2C0C", + "mangledName": "4cake2C0C", "moduleName": "cake", "genericSig": "", "hasMissingDesignatedInitializers": true @@ -268,6 +284,7 @@ ], "declKind": "TypeAlias", "usr": "s:4cake7C0Aliasa", + "mangledName": "4cake7C0Aliasa", "moduleName": "cake" }, { @@ -288,6 +305,7 @@ ], "declKind": "Func", "usr": "s:4cake2C1C4foo1yyFZ", + "mangledName": "4cake2C1C4foo1yyFZ", "moduleName": "cake", "static": true, "isOpen": true, @@ -306,6 +324,7 @@ ], "declKind": "Var", "usr": "s:4cake2C1C3InsACSgvp", + "mangledName": "4cake2C1C3InsACSgvp", "moduleName": "cake", "declAttributes": [ "HasInitialValue", @@ -337,6 +356,7 @@ ], "declKind": "Accessor", "usr": "s:4cake2C1C3InsACSgvg", + "mangledName": "4cake2C1C3InsACSgvg", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -371,6 +391,7 @@ ], "declKind": "Accessor", "usr": "s:4cake2C1C3InsACSgvs", + "mangledName": "4cake2C1C3InsACSgvs", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -393,6 +414,7 @@ ], "declKind": "Var", "usr": "s:4cake2C1C4Ins2ACvp", + "mangledName": "4cake2C1C4Ins2ACvp", "moduleName": "cake", "declAttributes": [ "HasInitialValue", @@ -416,6 +438,7 @@ ], "declKind": "Accessor", "usr": "s:4cake2C1C4Ins2ACvg", + "mangledName": "4cake2C1C4Ins2ACvg", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -442,6 +465,7 @@ ], "declKind": "Accessor", "usr": "s:4cake2C1C4Ins2ACvs", + "mangledName": "4cake2C1C4Ins2ACvs", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -454,6 +478,7 @@ ], "declKind": "Class", "usr": "s:4cake2C1C", + "mangledName": "4cake2C1C", "moduleName": "cake", "superclassUsr": "s:4cake2C0C", "hasMissingDesignatedInitializers": true, @@ -488,6 +513,7 @@ ], "declKind": "Func", "usr": "s:4cake4foo1_1bySi_AA2S1VtF", + "mangledName": "4cake4foo1_1bySi_AA2S1VtF", "moduleName": "cake", "funcSelfKind": "NonMutating" }, @@ -517,6 +543,7 @@ ], "declKind": "Func", "usr": "s:4cake4foo2_1bySi_AA2S1VtF", + "mangledName": "4cake4foo2_1bySi_AA2S1VtF", "moduleName": "cake", "funcSelfKind": "NonMutating" }, @@ -566,6 +593,7 @@ ], "declKind": "EnumElement", "usr": "s:4cake6NumberO3oneyA2CmF", + "mangledName": "4cake6NumberO3oneyA2CmF", "moduleName": "cake" }, { @@ -594,6 +622,7 @@ ], "declKind": "Func", "usr": "s:4cake6NumberO21__derived_enum_equalsySbAC_ACtFZ", + "mangledName": "4cake6NumberO21__derived_enum_equalsySbAC_ACtFZ", "moduleName": "cake", "static": true, "implicit": true, @@ -627,6 +656,7 @@ ], "declKind": "Constructor", "usr": "s:4cake6NumberO8rawValueACSgSi_tcfc", + "mangledName": "4cake6NumberO8rawValueACSgSi_tcfc", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -648,6 +678,7 @@ ], "declKind": "TypeAlias", "usr": "s:4cake6NumberO8RawValuea", + "mangledName": "4cake6NumberO8RawValuea", "moduleName": "cake", "implicit": true }, @@ -665,6 +696,7 @@ ], "declKind": "Var", "usr": "s:4cake6NumberO8rawValueSivp", + "mangledName": "4cake6NumberO8rawValueSivp", "moduleName": "cake", "implicit": true, "accessors": [ @@ -682,6 +714,7 @@ ], "declKind": "Accessor", "usr": "s:4cake6NumberO8rawValueSivg", + "mangledName": "4cake6NumberO8rawValueSivg", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -694,6 +727,7 @@ ], "declKind": "Enum", "usr": "s:4cake6NumberO", + "mangledName": "4cake6NumberO", "moduleName": "cake", "enumRawTypeName": "Int", "isEnumExhaustive": true, @@ -702,13 +736,15 @@ "kind": "Conformance", "name": "Equatable", "printedName": "Equatable", - "usr": "s:SQ" + "usr": "s:SQ", + "mangledName": "SQ" }, { "kind": "Conformance", "name": "Hashable", "printedName": "Hashable", - "usr": "s:SH" + "usr": "s:SH", + "mangledName": "SH" }, { "kind": "Conformance", @@ -729,7 +765,8 @@ ] } ], - "usr": "s:SY" + "usr": "s:SY", + "mangledName": "SY" } ] }, @@ -766,6 +803,7 @@ ], "declKind": "Func", "usr": "s:4cake4foo3yySDySiSSGF", + "mangledName": "4cake4foo3yySDySiSSGF", "moduleName": "cake", "funcSelfKind": "NonMutating" }, @@ -788,6 +826,7 @@ ], "declKind": "Var", "usr": "s:4cake17fixedLayoutStructV1aSivp", + "mangledName": "4cake17fixedLayoutStructV1aSivp", "moduleName": "cake", "declAttributes": [ "HasInitialValue", @@ -809,6 +848,7 @@ ], "declKind": "Accessor", "usr": "s:4cake17fixedLayoutStructV1aSivg", + "mangledName": "4cake17fixedLayoutStructV1aSivg", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -835,6 +875,7 @@ ], "declKind": "Accessor", "usr": "s:4cake17fixedLayoutStructV1aSivs", + "mangledName": "4cake17fixedLayoutStructV1aSivs", "moduleName": "cake", "implicit": true, "declAttributes": [ @@ -847,6 +888,7 @@ ], "declKind": "Struct", "usr": "s:4cake17fixedLayoutStructV", + "mangledName": "4cake17fixedLayoutStructV", "moduleName": "cake", "declAttributes": [ "Frozen" @@ -856,7 +898,8 @@ "kind": "Conformance", "name": "Sendable", "printedName": "Sendable", - "usr": "s:s8SendableP" + "usr": "s:s8SendableP", + "mangledName": "s8SendableP" } ] }, @@ -871,6 +914,7 @@ "printedName": "A", "declKind": "AssociatedType", "usr": "s:4cake21ProWithAssociatedTypeP1AQa", + "mangledName": "4cake21ProWithAssociatedTypeP1AQa", "moduleName": "cake", "protocolReq": true }, @@ -888,6 +932,7 @@ ], "declKind": "AssociatedType", "usr": "s:4cake21ProWithAssociatedTypeP1BQa", + "mangledName": "4cake21ProWithAssociatedTypeP1BQa", "moduleName": "cake", "protocolReq": true }, @@ -904,6 +949,7 @@ ], "declKind": "Func", "usr": "s:4cake21ProWithAssociatedTypePAAE10NonReqFuncyyF", + "mangledName": "4cake21ProWithAssociatedTypePAAE10NonReqFuncyyF", "moduleName": "cake", "genericSig": "", "funcSelfKind": "NonMutating" @@ -922,6 +968,7 @@ ], "declKind": "Var", "usr": "s:4cake21ProWithAssociatedTypePAAE9NonReqVarSivp", + "mangledName": "4cake21ProWithAssociatedTypePAAE9NonReqVarSivp", "moduleName": "cake", "accessors": [ { @@ -938,6 +985,7 @@ ], "declKind": "Accessor", "usr": "s:4cake21ProWithAssociatedTypePAAE9NonReqVarSivg", + "mangledName": "4cake21ProWithAssociatedTypePAAE9NonReqVarSivg", "moduleName": "cake", "genericSig": "", "accessorKind": "get" @@ -958,12 +1006,14 @@ ], "declKind": "TypeAlias", "usr": "s:4cake21ProWithAssociatedTypePAAE11NonReqAliasa", + "mangledName": "4cake21ProWithAssociatedTypePAAE11NonReqAliasa", "moduleName": "cake", "genericSig": "" } ], "declKind": "Protocol", "usr": "s:4cake21ProWithAssociatedTypeP", + "mangledName": "4cake21ProWithAssociatedTypeP", "moduleName": "cake" }, { @@ -991,6 +1041,7 @@ ], "declKind": "Subscript", "usr": "s:4cake13SubsContainerP6getterS2i_tcip", + "mangledName": "4cake13SubsContainerP6getterS2i_tcip", "moduleName": "cake", "genericSig": "", "protocolReq": true, @@ -1015,6 +1066,7 @@ ], "declKind": "Accessor", "usr": "s:4cake13SubsContainerP6getterS2i_tcig", + "mangledName": "4cake13SubsContainerP6getterS2i_tcig", "moduleName": "cake", "genericSig": "", "protocolReq": true, @@ -1043,6 +1095,7 @@ ], "declKind": "Subscript", "usr": "s:4cake13SubsContainerP6setterS2i_tcip", + "mangledName": "4cake13SubsContainerP6setterS2i_tcip", "moduleName": "cake", "genericSig": "", "protocolReq": true, @@ -1067,6 +1120,7 @@ ], "declKind": "Accessor", "usr": "s:4cake13SubsContainerP6setterS2i_tcig", + "mangledName": "4cake13SubsContainerP6setterS2i_tcig", "moduleName": "cake", "genericSig": "", "protocolReq": true, @@ -1098,6 +1152,7 @@ ], "declKind": "Accessor", "usr": "s:4cake13SubsContainerP6setterS2i_tcis", + "mangledName": "4cake13SubsContainerP6setterS2i_tcis", "moduleName": "cake", "genericSig": "", "protocolReq": true, @@ -1109,6 +1164,7 @@ ], "declKind": "Protocol", "usr": "s:4cake13SubsContainerP", + "mangledName": "4cake13SubsContainerP", "moduleName": "cake" }, { @@ -1122,6 +1178,7 @@ "printedName": "T", "declKind": "AssociatedType", "usr": "s:4cake6PSuperP1TQa", + "mangledName": "4cake6PSuperP1TQa", "moduleName": "cake", "protocolReq": true }, @@ -1138,6 +1195,7 @@ ], "declKind": "Func", "usr": "s:4cake6PSuperP3fooyyF", + "mangledName": "4cake6PSuperP3fooyyF", "moduleName": "cake", "genericSig": "", "protocolReq": true, @@ -1157,6 +1215,7 @@ ], "declKind": "Func", "usr": "s:4cake6PSuperPAAE9futureFooyyF", + "mangledName": "4cake6PSuperPAAE9futureFooyyF", "moduleName": "cake", "genericSig": "", "funcSelfKind": "NonMutating" @@ -1164,6 +1223,7 @@ ], "declKind": "Protocol", "usr": "s:4cake6PSuperP", + "mangledName": "4cake6PSuperP", "moduleName": "cake" }, { @@ -1177,6 +1237,7 @@ "printedName": "T", "declKind": "AssociatedType", "usr": "s:4cake4PSubP1TQa", + "mangledName": "4cake4PSubP1TQa", "moduleName": "cake", "protocolReq": true, "overriding": true @@ -1194,6 +1255,7 @@ ], "declKind": "Func", "usr": "s:4cake4PSubP3fooyyF", + "mangledName": "4cake4PSubP3fooyyF", "moduleName": "cake", "genericSig": "", "protocolReq": true, @@ -1206,6 +1268,7 @@ ], "declKind": "Protocol", "usr": "s:4cake4PSubP", + "mangledName": "4cake4PSubP", "moduleName": "cake", "genericSig": "", "conformances": [ @@ -1213,7 +1276,8 @@ "kind": "Conformance", "name": "PSuper", "printedName": "PSuper", - "usr": "s:4cake6PSuperP" + "usr": "s:4cake6PSuperP", + "mangledName": "4cake6PSuperP" } ] }, @@ -1231,6 +1295,7 @@ ], "declKind": "Var", "usr": "s:4cake9GlobalVarSivp", + "mangledName": "4cake9GlobalVarSivp", "moduleName": "cake", "declAttributes": [ "HasInitialValue", @@ -1267,6 +1332,7 @@ ], "declKind": "Func", "usr": "s:4cake15FutureContainerC9futureFooyyF", + "mangledName": "4cake15FutureContainerC9futureFooyyF", "moduleName": "cake", "intro_Macosx": "10.15", "intro_iOS": "13", @@ -1293,6 +1359,7 @@ ], "declKind": "Func", "usr": "s:4cake15FutureContainerC12NotfutureFooyyF", + "mangledName": "4cake15FutureContainerC12NotfutureFooyyF", "moduleName": "cake", "intro_Macosx": "10.15", "declAttributes": [ @@ -1303,6 +1370,7 @@ ], "declKind": "Class", "usr": "s:4cake15FutureContainerC", + "mangledName": "4cake15FutureContainerC", "moduleName": "cake", "hasMissingDesignatedInitializers": true, "conformances": [ @@ -1310,13 +1378,15 @@ "kind": "Conformance", "name": "P1", "printedName": "P1", - "usr": "s:4cake2P1P" + "usr": "s:4cake2P1P", + "mangledName": "4cake2P1P" }, { "kind": "Conformance", "name": "P2", "printedName": "P2", - "usr": "s:4cake2P2P" + "usr": "s:4cake2P2P", + "mangledName": "4cake2P2P" } ] }, @@ -1326,6 +1396,7 @@ "printedName": "PlatformIntroClass", "declKind": "Class", "usr": "s:4cake18PlatformIntroClassC", + "mangledName": "4cake18PlatformIntroClassC", "moduleName": "cake", "intro_Macosx": "10.1", "intro_iOS": "10.2", @@ -1345,6 +1416,7 @@ "printedName": "SwiftIntroClass", "declKind": "Class", "usr": "s:4cake15SwiftIntroClassC", + "mangledName": "4cake15SwiftIntroClassC", "moduleName": "cake", "intro_swift": "5", "declAttributes": [ @@ -1388,6 +1460,7 @@ ], "declKind": "Func", "usr": "c:@M@cake@objc(cs)NewObjCClass(im)ObjCFool:ObjCA:ObjCB:", + "mangledName": "4cake14SwiftObjcClassC3foo1a1b1cySi_S2itF", "moduleName": "cake", "objc_name": "ObjCFool:ObjCA:ObjCB:", "declAttributes": [ @@ -1398,6 +1471,7 @@ ], "declKind": "Class", "usr": "c:@M@cake@objc(cs)NewObjCClass", + "mangledName": "4cake14SwiftObjcClassC", "moduleName": "cake", "objc_name": "NewObjCClass", "declAttributes": [ @@ -1418,12 +1492,33 @@ ], "declKind": "Func", "usr": "s:4cake18emitIntoClientFuncyyF", + "mangledName": "4cake18emitIntoClientFuncyyF", "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", @@ -1442,6 +1537,7 @@ ], "declKind": "Func", "usr": "s:Si4cakeE3fooyyF", + "mangledName": "Si4cakeE3fooyyF", "moduleName": "cake", "funcSelfKind": "NonMutating" }, @@ -1458,12 +1554,14 @@ ], "declKind": "Func", "usr": "s:Si4cakeE3baryyF", + "mangledName": "Si4cakeE3baryyF", "moduleName": "cake", "funcSelfKind": "NonMutating" } ], "declKind": "Struct", "usr": "s:Si", + "mangledName": "Si", "moduleName": "Swift", "declAttributes": [ "Frozen" @@ -1474,13 +1572,15 @@ "kind": "Conformance", "name": "FixedWidthInteger", "printedName": "FixedWidthInteger", - "usr": "s:s17FixedWidthIntegerP" + "usr": "s:s17FixedWidthIntegerP", + "mangledName": "s17FixedWidthIntegerP" }, { "kind": "Conformance", "name": "SignedInteger", "printedName": "SignedInteger", - "usr": "s:SZ" + "usr": "s:SZ", + "mangledName": "SZ" }, { "kind": "Conformance", @@ -1501,19 +1601,22 @@ ] } ], - "usr": "s:Sz" + "usr": "s:Sz", + "mangledName": "Sz" }, { "kind": "Conformance", "name": "LosslessStringConvertible", "printedName": "LosslessStringConvertible", - "usr": "s:s25LosslessStringConvertibleP" + "usr": "s:s25LosslessStringConvertibleP", + "mangledName": "s25LosslessStringConvertibleP" }, { "kind": "Conformance", "name": "SignedNumeric", "printedName": "SignedNumeric", - "usr": "s:s13SignedNumericP" + "usr": "s:s13SignedNumericP", + "mangledName": "s13SignedNumericP" }, { "kind": "Conformance", @@ -1541,13 +1644,15 @@ ] } ], - "usr": "s:Sj" + "usr": "s:Sj", + "mangledName": "Sj" }, { "kind": "Conformance", "name": "CustomStringConvertible", "printedName": "CustomStringConvertible", - "usr": "s:s23CustomStringConvertibleP" + "usr": "s:s23CustomStringConvertibleP", + "mangledName": "s23CustomStringConvertibleP" }, { "kind": "Conformance", @@ -1568,13 +1673,15 @@ ] } ], - "usr": "s:Sx" + "usr": "s:Sx", + "mangledName": "Sx" }, { "kind": "Conformance", "name": "AdditiveArithmetic", "printedName": "AdditiveArithmetic", - "usr": "s:s18AdditiveArithmeticP" + "usr": "s:s18AdditiveArithmeticP", + "mangledName": "s18AdditiveArithmeticP" }, { "kind": "Conformance", @@ -1602,67 +1709,78 @@ ] } ], - "usr": "s:s27ExpressibleByIntegerLiteralP" + "usr": "s:s27ExpressibleByIntegerLiteralP", + "mangledName": "s27ExpressibleByIntegerLiteralP" }, { "kind": "Conformance", "name": "Comparable", "printedName": "Comparable", - "usr": "s:SL" + "usr": "s:SL", + "mangledName": "SL" }, { "kind": "Conformance", "name": "P1", "printedName": "P1", - "usr": "s:4cake2P1P" + "usr": "s:4cake2P1P", + "mangledName": "4cake2P1P" }, { "kind": "Conformance", "name": "Encodable", "printedName": "Encodable", - "usr": "s:SE" + "usr": "s:SE", + "mangledName": "SE" }, { "kind": "Conformance", "name": "Decodable", "printedName": "Decodable", - "usr": "s:Se" + "usr": "s:Se", + "mangledName": "Se" }, { "kind": "Conformance", "name": "CustomReflectable", "printedName": "CustomReflectable", - "usr": "s:s17CustomReflectableP" + "usr": "s:s17CustomReflectableP", + "mangledName": "s17CustomReflectableP" }, { "kind": "Conformance", "name": "MirrorPath", "printedName": "MirrorPath", - "usr": "s:s10MirrorPathP" + "usr": "s:s10MirrorPathP", + "mangledName": "s10MirrorPathP" }, { "kind": "Conformance", "name": "CVarArg", "printedName": "CVarArg", - "usr": "s:s7CVarArgP" + "usr": "s:s7CVarArgP", + "mangledName": "s7CVarArgP" }, { "kind": "Conformance", "name": "Hashable", "printedName": "Hashable", - "usr": "s:SH" + "usr": "s:SH", + "mangledName": "SH" }, { "kind": "Conformance", "name": "Equatable", "printedName": "Equatable", - "usr": "s:SQ" + "usr": "s:SQ", + "mangledName": "SQ" }, { "kind": "Conformance", "name": "Sendable", "printedName": "Sendable", - "usr": "s:s8SendableP" + "usr": "s:s8SendableP", + "mangledName": "s8SendableP" }, { "kind": "Conformance", @@ -1768,7 +1886,8 @@ ] } ], - "usr": "s:s10SIMDScalarP" + "usr": "s:s10SIMDScalarP", + "mangledName": "s10SIMDScalarP" } ] } diff --git a/test/api-digester/internal-extension.swift b/test/api-digester/internal-extension.swift index 76c9ebb385d85..e5780c13f748a 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": "4main11PublicProtoP" // CHECK-NEXT: } // CHECK-NEXT: ] extension C0: InternalProto {