[AST] Use SubstitutionMap, not SubstitutionList, in SILBoxType.

Eliminate the last place in the AST proper that stores
SubstitutionLists rather than SubstitutionMaps. Randomly fixes a
crasher, too.
This commit is contained in:
Doug Gregor
2018-05-02 11:48:57 -07:00
parent 3e2bed119b
commit bc5bbe8b64
19 changed files with 114 additions and 215 deletions

View File

@@ -3847,17 +3847,8 @@ void Serializer::writeType(Type ty) {
unsigned abbrCode = DeclTypeAbbrCodes[SILBoxTypeLayout::Code];
SILLayoutID layoutRef = addSILLayoutRef(boxTy->getLayout());
#ifndef NDEBUG
if (auto sig = boxTy->getLayout()->getGenericSignature()) {
assert(sig->getSubstitutionListSize()
== boxTy->getGenericArgs().size());
}
#endif
SILBoxTypeLayout::emitRecord(Out, ScratchRecord, abbrCode, layoutRef);
// Write the set of substitutions.
writeSubstitutions(boxTy->getGenericArgs(), DeclTypeAbbrCodes);
SILBoxTypeLayout::emitRecord(Out, ScratchRecord, abbrCode, layoutRef,
addSubstitutionMapRef(boxTy->getSubstitutions()));
break;
}