SILGen: Add TypeExpansionContext to SILGen

This commit is contained in:
Arnold Schwaighofer
2019-11-04 12:01:11 -08:00
parent e9971100d9
commit 33f4f57cc4
17 changed files with 404 additions and 241 deletions

View File

@@ -1878,7 +1878,8 @@ void PatternMatchEmission::emitEnumElementObjectDispatch(
bool hasNonVoidAssocValue = false;
bool hasAssocValue = elt->hasAssociatedValues();
if (hasAssocValue) {
eltTy = src.getType().getEnumElementType(elt, SGF.SGM.M);
eltTy = src.getType().getEnumElementType(elt, SGF.SGM.M,
SGF.getTypeExpansionContext());
hasNonVoidAssocValue = !eltTy.getASTType()->isVoid();
}
@@ -2060,7 +2061,8 @@ void PatternMatchEmission::emitEnumElementDispatch(
SILType eltTy;
bool hasElt = false;
if (elt->hasAssociatedValues()) {
eltTy = src.getType().getEnumElementType(elt, SGF.SGM.M);
eltTy = src.getType().getEnumElementType(elt, SGF.SGM.M,
SGF.getTypeExpansionContext());
hasElt = !eltTy.getASTType()->isVoid();
}