Skip to content

Commit 5a4d827

Browse files
authored
Merge pull request #7112 from swiftix/wip-irgen-fixes
Fix a couple of places in the IRGen where we still don't use interface types
2 parents b8b7b5f + 383dc9c commit 5a4d827

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

lib/IRGen/GenClass.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,8 +1568,10 @@ namespace {
15681568
// metadata statically, so compute the field layout using the
15691569
// originally-declared type.
15701570
SILType fieldType =
1571-
IGM.getLoweredType(IGM.getSILTypes().getAbstractionPattern(var),
1572-
var->getType());
1571+
IGM.getLoweredType(IGM.getSILTypes().getAbstractionPattern(var),
1572+
var->getDeclContext()
1573+
->mapTypeIntoContext(var->getInterfaceType())
1574+
->getCanonicalType());
15731575
Ivars.push_back(buildIvar(var, fieldType));
15741576

15751577
// Build property accessors for the ivar if necessary.

lib/IRGen/GenMeta.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2438,7 +2438,8 @@ namespace {
24382438
NominalTypeDecl::StoredPropertyRange storedProperties){
24392439
SmallVector<FieldTypeInfo, 4> types;
24402440
for (VarDecl *prop : storedProperties) {
2441-
auto propertyType = prop->getType()->getCanonicalType();
2441+
auto propertyType = type->mapTypeIntoContext(prop->getInterfaceType())
2442+
->getCanonicalType();
24422443
types.push_back(FieldTypeInfo(propertyType,
24432444
/*indirect*/ false,
24442445
propertyType->is<WeakStorageType>()));
@@ -3213,7 +3214,8 @@ static llvm::Value *emitInitializeFieldOffsetVector(IRGenFunction &IGF,
32133214
Address firstField;
32143215
unsigned index = 0;
32153216
for (auto prop : storedProperties) {
3216-
auto propFormalTy = prop->getType()->getCanonicalType();
3217+
auto propFormalTy = target->mapTypeIntoContext(prop->getInterfaceType())
3218+
->getCanonicalType();
32173219
SILType propLoweredTy = IGF.IGM.getLoweredType(propFormalTy);
32183220
auto &propTI = IGF.getTypeInfo(propLoweredTy);
32193221
auto sizeAndAlignMask

0 commit comments

Comments
 (0)