1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Fixed reification of elemented underlying types

This commit is contained in:
Brian Fiete 2022-06-28 10:25:39 -07:00
parent 31608be8a9
commit ae46452f9e
2 changed files with 16 additions and 3 deletions

View file

@ -2717,9 +2717,6 @@ void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDbgDefine)
if ((typeInstance != NULL) && (typeInstance->mModule != NULL)) if ((typeInstance != NULL) && (typeInstance->mModule != NULL))
populateModule = typeInstance->mModule; populateModule = typeInstance->mModule;
//TODO: Temporary
populateModule = mModule;
bool wantDIData = DbgHasInfo() && (!type->IsUnspecializedType()); bool wantDIData = DbgHasInfo() && (!type->IsUnspecializedType());
// Types that don't have a proper 'defining module' need to be defined in every module they are used // Types that don't have a proper 'defining module' need to be defined in every module they are used

View file

@ -1257,6 +1257,22 @@ void BfModule::PopulateType(BfType* resolvedTypeRef, BfPopulateType populateType
} }
} }
} }
else
{
// If we're a type like "A*", make sure we reify "A" if necessary
auto checkUnderlying = resolvedTypeRef->GetUnderlyingType();
while (checkUnderlying != NULL)
{
auto checkTypeInst = checkUnderlying->ToTypeInstance();
if (checkTypeInst != NULL)
{
if (!checkTypeInst->mIsReified)
PopulateType(checkTypeInst, BfPopulateType_BaseType);
break;
}
checkUnderlying = checkUnderlying->GetUnderlyingType();
}
}
} }
if (!resolvedTypeRef->IsIncomplete()) if (!resolvedTypeRef->IsIncomplete())