Skip to content

Fix a couple of places in the IRGen where we still don't use interface types #7112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/IRGen/GenClass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1568,8 +1568,10 @@ namespace {
// metadata statically, so compute the field layout using the
// originally-declared type.
SILType fieldType =
IGM.getLoweredType(IGM.getSILTypes().getAbstractionPattern(var),
var->getType());
IGM.getLoweredType(IGM.getSILTypes().getAbstractionPattern(var),
var->getDeclContext()
->mapTypeIntoContext(var->getInterfaceType())
->getCanonicalType());
Ivars.push_back(buildIvar(var, fieldType));

// Build property accessors for the ivar if necessary.
Expand Down
6 changes: 4 additions & 2 deletions lib/IRGen/GenMeta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2438,7 +2438,8 @@ namespace {
NominalTypeDecl::StoredPropertyRange storedProperties){
SmallVector<FieldTypeInfo, 4> types;
for (VarDecl *prop : storedProperties) {
auto propertyType = prop->getType()->getCanonicalType();
auto propertyType = type->mapTypeIntoContext(prop->getInterfaceType())
->getCanonicalType();
types.push_back(FieldTypeInfo(propertyType,
/*indirect*/ false,
propertyType->is<WeakStorageType>()));
Expand Down Expand Up @@ -3211,7 +3212,8 @@ static llvm::Value *emitInitializeFieldOffsetVector(IRGenFunction &IGF,
Address firstField;
unsigned index = 0;
for (auto prop : storedProperties) {
auto propFormalTy = prop->getType()->getCanonicalType();
auto propFormalTy = target->mapTypeIntoContext(prop->getInterfaceType())
->getCanonicalType();
SILType propLoweredTy = IGF.IGM.getLoweredType(propFormalTy);
auto &propTI = IGF.getTypeInfo(propLoweredTy);
auto sizeAndAlignMask
Expand Down