[Serialization] Use decl mangling for local decls, not type mangling. (#10022)

Otherwise we get an error with local generic types. We don't need the
complexity of type mangling anyway.

https://bugs.swift.org/browse/SR-5038
This commit is contained in:
Jordan Rose
2017-06-01 16:37:59 -07:00
committed by GitHub
parent 89fed4fe20
commit 5d1412d8bc
3 changed files with 45 additions and 11 deletions

View File

@@ -4468,8 +4468,7 @@ void Serializer::writeAST(ModuleOrSourceFile DC,
for (auto TD : localTypeDecls) {
hasLocalTypes = true;
Mangle::ASTMangler Mangler;
std::string MangledName = Mangler.mangleTypeAsUSR(
TD->getDeclaredInterfaceType());
std::string MangledName = Mangler.mangleDeclAsUSR(TD, /*USRPrefix*/"");
assert(!MangledName.empty() && "Mangled type came back empty!");
localTypeGenerator.insert(MangledName, {
addDeclRef(TD), TD->getLocalDiscriminator()