@@ -207,7 +207,7 @@ static LValueTypeData getAbstractedTypeData(SILGenModule &SGM,
207207 accessKind,
208208 origFormalType,
209209 substFormalType,
210- SGM.Types .getLoweredType (origFormalType, substFormalType). getObjectType ( )
210+ SGM.Types .getLoweredRValueType (origFormalType, substFormalType)
211211 };
212212}
213213
@@ -455,13 +455,13 @@ static LValueTypeData getValueTypeData(SGFAccessKind accessKind,
455455 accessKind,
456456 AbstractionPattern (formalType),
457457 formalType,
458- value->getType ().getObjectType ()
458+ value->getType ().getASTType (),
459459 };
460460}
461461static LValueTypeData getValueTypeData (SILGenFunction &SGF,
462462 SGFAccessKind accessKind, Expr *e) {
463463 CanType formalType = getSubstFormalRValueType (e);
464- SILType loweredType = SGF.getLoweredType (formalType).getObjectType ();
464+ CanType loweredType = SGF.getLoweredType (formalType).getASTType ();
465465
466466 return {
467467 accessKind,
@@ -488,7 +488,8 @@ static ManagedValue getAddressOfOptionalValue(SILGenFunction &SGF,
488488 // embedded in the payload.
489489 SILValue valueAddr =
490490 SGF.B .createUncheckedTakeEnumDataAddr (loc, optAddr.forward (SGF), someDecl,
491- valueTypeData.TypeOfRValue .getAddressType ());
491+ SILType::getPrimitiveAddressType (
492+ valueTypeData.TypeOfRValue ));
492493
493494 // Return the value as +1 if the optional was +1.
494495 if (hadCleanup) {
@@ -2080,7 +2081,7 @@ LValue LValue::forAddress(SGFAccessKind accessKind, ManagedValue address,
20802081 assert (address.isLValue ());
20812082 LValueTypeData typeData = {
20822083 accessKind, origFormalType, substFormalType,
2083- address.getType ().getObjectType ()
2084+ address.getType ().getASTType ()
20842085 };
20852086
20862087 LValue lv;
@@ -2133,7 +2134,7 @@ void LValue::addOrigToSubstComponent(SILType loweredSubstType) {
21332134 getAccessKind (),
21342135 AbstractionPattern (substFormalType),
21352136 substFormalType,
2136- loweredSubstType
2137+ loweredSubstType. getASTType ()
21372138 };
21382139 add<OrigToSubstComponent>(typeData, getOrigFormalType ());
21392140}
@@ -2161,7 +2162,7 @@ void LValue::addSubstToOrigComponent(AbstractionPattern origType,
21612162 getAccessKind (),
21622163 origType,
21632164 getSubstFormalType (),
2164- loweredSubstType
2165+ loweredSubstType. getASTType ()
21652166 };
21662167 add<SubstToOrigComponent>(typeData);
21672168}
@@ -2674,7 +2675,9 @@ LValue SILGenLValue::visitDiscardAssignmentExpr(DiscardAssignmentExpr *e,
26742675 LValueOptions options) {
26752676 LValueTypeData typeData = getValueTypeData (SGF, accessKind, e);
26762677
2677- SILValue address = SGF.emitTemporaryAllocation (e, typeData.TypeOfRValue );
2678+ SILValue address = SGF.emitTemporaryAllocation (e,
2679+ SILType::getPrimitiveObjectType (
2680+ typeData.TypeOfRValue ));
26782681 address = SGF.B .createMarkUninitialized (e, address,
26792682 MarkUninitializedInst::Var);
26802683 LValue lv;
@@ -3133,7 +3136,7 @@ LValue SILGenLValue::visitKeyPathApplicationExpr(KeyPathApplicationExpr *e,
31333136
31343137 // Reabstract to the substituted abstraction level if necessary.
31353138 auto substResultSILTy = SGF.getLoweredType (substFormalType);
3136- if (typeData.TypeOfRValue != substResultSILTy.getObjectType ()) {
3139+ if (typeData.TypeOfRValue != substResultSILTy.getASTType ()) {
31373140 lv.addOrigToSubstComponent (substResultSILTy);
31383141 }
31393142 }
@@ -3191,7 +3194,7 @@ LValue SILGenLValue::visitTupleElementExpr(TupleElementExpr *e,
31913194 accessKind,
31923195 baseTypeData.OrigFormalType .getTupleElementType (index),
31933196 cast<TupleType>(baseTypeData.SubstFormalType ).getElementType (index),
3194- baseTypeData.TypeOfRValue . getTupleElementType (index)
3197+ cast<TupleType>( baseTypeData.TypeOfRValue ). getElementType (index)
31953198 };
31963199
31973200 lv.add <TupleElementComponent>(index, typeData);
@@ -3229,13 +3232,11 @@ LValue SILGenLValue::visitOpenExistentialExpr(OpenExistentialExpr *e,
32293232static LValueTypeData
32303233getOptionalObjectTypeData (SILGenFunction &SGF, SGFAccessKind accessKind,
32313234 const LValueTypeData &baseTypeData) {
3232- EnumElementDecl *someDecl = SGF.getASTContext ().getOptionalSomeDecl ();
3233-
32343235 return {
32353236 accessKind,
32363237 baseTypeData.OrigFormalType .getOptionalObjectType (),
32373238 baseTypeData.SubstFormalType .getOptionalObjectType (),
3238- baseTypeData.TypeOfRValue .getEnumElementType (someDecl, SGF. SGM . M ),
3239+ baseTypeData.TypeOfRValue .getOptionalObjectType ( ),
32393240 };
32403241}
32413242
@@ -4077,7 +4078,7 @@ SILGenFunction::emitOpenExistentialLValue(SILLocation loc,
40774078 assert (!formalRValueType->hasLValueType ());
40784079 LValueTypeData typeData = {
40794080 accessKind, AbstractionPattern::getOpaque (), formalRValueType,
4080- getLoweredType (formalRValueType).getObjectType ()
4081+ getLoweredType (formalRValueType).getASTType ()
40814082 };
40824083
40834084 // Open up the existential.
0 commit comments