mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Recursive type rebuild fix
This commit is contained in:
parent
2d74aac74c
commit
9d8647cd84
3 changed files with 21 additions and 1 deletions
|
@ -1032,6 +1032,12 @@ void BfContext::RebuildType(BfType* type, bool deleteOnDemandTypes, bool rebuild
|
|||
return;
|
||||
}
|
||||
|
||||
typeInst->mRebuildFlags = (BfTypeRebuildFlags)(typeInst->mRebuildFlags | BfTypeRebuildFlag_InRebuildType);
|
||||
defer(
|
||||
{
|
||||
typeInst->mRebuildFlags = (BfTypeRebuildFlags)(typeInst->mRebuildFlags & ~BfTypeRebuildFlag_InRebuildType);
|
||||
});
|
||||
|
||||
if (mCompiler->mCeMachine != NULL)
|
||||
mCompiler->mCeMachine->ClearTypeData(typeInst);
|
||||
|
||||
|
@ -1369,6 +1375,11 @@ void BfContext::RebuildDependentTypes_MidCompile(BfDependedType* dType, const St
|
|||
}
|
||||
}
|
||||
|
||||
bool BfContext::IsRebuilding(BfType* type)
|
||||
{
|
||||
return ((type->mRebuildFlags & BfTypeRebuildFlag_InRebuildType) != 0);
|
||||
}
|
||||
|
||||
bool BfContext::CanRebuild(BfType* type)
|
||||
{
|
||||
if (type->mRevision == mCompiler->mRevision)
|
||||
|
@ -2007,6 +2018,10 @@ void BfContext::DeleteType(BfType* type, bool deferDepRebuilds)
|
|||
{
|
||||
RebuildType(dependentType);
|
||||
}
|
||||
else if (IsRebuilding(dependentType))
|
||||
{
|
||||
// Ignore
|
||||
}
|
||||
else if (dependentTypeInst != NULL)
|
||||
{
|
||||
mGhostDependencies.Add(type);
|
||||
|
@ -3409,6 +3424,9 @@ void BfContext::MarkUsedModules(BfProject* project, BfModule* module)
|
|||
{
|
||||
BP_ZONE("BfContext::MarkUsedModules");
|
||||
|
||||
if (module->mIsDeleting)
|
||||
return;
|
||||
|
||||
BF_ASSERT_REL(!module->mIsDeleting);
|
||||
|
||||
if (module->mIsScratchModule)
|
||||
|
|
|
@ -503,6 +503,7 @@ public:
|
|||
void RebuildDependentTypes(BfDependedType* dType);
|
||||
void QueueMidCompileRebuildDependentTypes(BfDependedType* dType, const String& reason);
|
||||
void RebuildDependentTypes_MidCompile(BfDependedType* dType, const String& reason);
|
||||
bool IsRebuilding(BfType* type);
|
||||
bool CanRebuild(BfType* type);
|
||||
void TypeDataChanged(BfDependedType* dType, bool isNonStaticDataChange);
|
||||
void TypeMethodSignaturesChanged(BfTypeInstance* typeInst);
|
||||
|
|
|
@ -449,7 +449,8 @@ enum BfTypeRebuildFlags
|
|||
BfTypeRebuildFlag_RebuildQueued = 0x20000,
|
||||
BfTypeRebuildFlag_ConstEvalCancelled = 0x40000,
|
||||
BfTypeRebuildFlag_ChangedMidCompile = 0x80000,
|
||||
BfTypeRebuildFlag_PendingGenericArgDep = 0x100000
|
||||
BfTypeRebuildFlag_PendingGenericArgDep = 0x100000,
|
||||
BfTypeRebuildFlag_InRebuildType = 0x200000
|
||||
};
|
||||
|
||||
class BfTypeDIReplaceCallback;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue