| 640 | } |
| 641 | |
| 642 | void BfModule::CheckInjectNewRevision(BfTypeInstance* typeInstance) |
| 643 | { |
| 644 | if ((typeInstance != NULL) && (typeInstance->mTypeDef != NULL)) |
| 645 | { |
| 646 | auto typeDef = typeInstance->mTypeDef; |
| 647 | if (typeDef->mEmitParent != NULL) |
| 648 | typeDef = typeDef->mEmitParent; |
| 649 | if (typeDef->mNextRevision != NULL) |
| 650 | { |
| 651 | // It's possible that our main compiler thread is generating a new typedef while we're autocompleting. This handles that case... |
| 652 | if (typeInstance->mDefineState == BfTypeDefineState_Undefined) |
| 653 | { |
| 654 | if (typeInstance->IsBoxed()) |
| 655 | { |
| 656 | BfBoxedType* boxedType = (BfBoxedType*)typeInstance; |
| 657 | BfTypeInstance* innerType = boxedType->mElementType->ToTypeInstance(); |
| 658 | PopulateType(innerType, BfPopulateType_Data); |
| 659 | } |
| 660 | else |
| 661 | { |
| 662 | mContext->HandleChangedTypeDef(typeDef); |
| 663 | mSystem->InjectNewRevision(typeDef); |
| 664 | } |
| 665 | } |
| 666 | else |
| 667 | { |
| 668 | BF_ASSERT(mCompiler->IsAutocomplete()); |
| 669 | } |
| 670 | } |
| 671 | if ((!typeInstance->IsDeleting()) && (!mCompiler->IsAutocomplete())) |
| 672 | BF_ASSERT((typeDef->mDefState == BfTypeDef::DefState_Defined) || (typeDef->mDefState == BfTypeDef::DefState_New)); |
| 673 | |
| 674 | if ((typeInstance->mTypeDef->mDefState == BfTypeDef::DefState_EmittedDirty) && (typeInstance->mTypeDef->mEmitParent->mNextRevision == NULL)) |
| 675 | mSystem->UpdateEmittedTypeDef(typeInstance->mTypeDef); |
| 676 | } |
| 677 | } |
| 678 | |
| 679 | void BfModule::InitType(BfType* resolvedTypeRef, BfPopulateType populateType) |
| 680 | { |
nothing calls this directly
no test coverage detected