mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Reification fixes
This commit is contained in:
parent
622b832858
commit
0d1fc7e1a5
2 changed files with 8 additions and 5 deletions
|
@ -2890,13 +2890,18 @@ bool BfIRBuilder::WantsDbgDefinition(BfType* type)
|
|||
|
||||
void BfIRBuilder::CreateTypeDefinition(BfType* type, bool forceDbgDefine)
|
||||
{
|
||||
auto populateModule = mModule->mContext->mUnreifiedModule;
|
||||
auto typeInstance = type->ToTypeInstance();
|
||||
if (typeInstance != NULL)
|
||||
populateModule = typeInstance->mModule;
|
||||
|
||||
// This PopulateType is generally NOT needed, but here is a scenario in which it is:
|
||||
// ClassB derives from ClassA. ClassC uses ClassB. A method inside ClassA gets modified,
|
||||
// marking ClassA as incomplete, and then ClassC rebuilds and calls MapType on ClassB.
|
||||
// "ClassB" itself is still populated, but its base class (ClassA) is not -- until we call
|
||||
// this PopulateType below.
|
||||
if (type->IsDataIncomplete())
|
||||
mModule->PopulateType(type, BfPopulateType_Data);
|
||||
populateModule->PopulateType(type, BfPopulateType_Data);
|
||||
|
||||
bool isDefiningModule = ((type->GetModule() == mModule) || (type->IsFunction()));
|
||||
if (mModule->mExtensionCount != 0)
|
||||
|
@ -2906,7 +2911,7 @@ void BfIRBuilder::CreateTypeDefinition(BfType* type, bool forceDbgDefine)
|
|||
// isDefiningModule = true;
|
||||
|
||||
if ((isDefiningModule) || (type->IsValueType()))
|
||||
mModule->PopulateType(type, BfPopulateType_DataAndMethods);
|
||||
populateModule->PopulateType(type, BfPopulateType_DataAndMethods);
|
||||
|
||||
if ((!isDefiningModule) && (!type->IsUnspecializedType()) && (type->IsValueType()) && (mHasDebugInfo))
|
||||
{
|
||||
|
@ -2915,7 +2920,6 @@ void BfIRBuilder::CreateTypeDefinition(BfType* type, bool forceDbgDefine)
|
|||
|
||||
bool isPrimEnum = (type->IsEnum()) && (type->IsTypedPrimitive());
|
||||
|
||||
auto typeInstance = type->ToTypeInstance();
|
||||
if (typeInstance == NULL)
|
||||
return;
|
||||
|
||||
|
|
|
@ -11416,7 +11416,6 @@ BfModuleMethodInstance BfModule::GetMethodInstance(BfTypeInstance* typeInst, BfM
|
|||
if (!instModule->mReifyQueued)
|
||||
{
|
||||
BF_ASSERT((mCompiler->mCompileState != BfCompiler::CompileState_Unreified) && (mCompiler->mCompileState != BfCompiler::CompileState_VData));
|
||||
|
||||
BfLogSysM("Queueing ReifyModule: %p\n", instModule);
|
||||
mContext->mReifyModuleWorkList.Add(instModule);
|
||||
instModule->mReifyQueued = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue