Skip to content

Commit 9f8ce05

Browse files
committed
ASTMangler: Replace unnecessary subst() with tranformRec()
1 parent f525dae commit 9f8ce05

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

lib/AST/ASTMangler.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -828,14 +828,12 @@ std::string ASTMangler::mangleAutoDiffGeneratedDeclaration(
828828
// Since we don't have a distinct mangling for sugared generic
829829
// parameter types, we must desugar them here.
830830
static Type getTypeForDWARFMangling(Type t) {
831-
return t.subst(
832-
[](SubstitutableType *t) -> Type {
833-
if (t->isRootParameterPack()) {
834-
return PackType::getSingletonPackExpansion(t->getCanonicalType());
835-
}
836-
return t->getCanonicalType();
837-
},
838-
MakeAbstractConformanceForGenericType());
831+
return t.transformRec(
832+
[](TypeBase *t) -> std::optional<Type> {
833+
if (isa<GenericTypeParamType>(t))
834+
return t->getCanonicalType();
835+
return std::nullopt;
836+
});
839837
}
840838

841839
std::string ASTMangler::mangleTypeForDebugger(Type Ty, GenericSignature sig) {

0 commit comments

Comments
 (0)