| 3811 | } |
| 3812 | |
| 3813 | void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateType) |
| 3814 | { |
| 3815 | if (populateType == BfPopulateType_Identity) |
| 3816 | return; |
| 3817 | |
| 3818 | if ((populateType <= BfPopulateType_Data) && (resolvedTypeRef->mDefineState >= BfTypeDefineState_Defined)) |
| 3819 | return; |
| 3820 | |
| 3821 | auto typeInstance = resolvedTypeRef->ToTypeInstance(); |
| 3822 | |
| 3823 | BfTypeInstance* boxedUnderlyingTypeInstance = NULL; |
| 3824 | if (typeInstance->IsBoxed()) |
| 3825 | { |
| 3826 | auto underlyingType = typeInstance->GetUnderlyingType(); |
| 3827 | if (underlyingType->IsPrimitiveType()) |
| 3828 | boxedUnderlyingTypeInstance = GetPrimitiveStructType(((BfPrimitiveType*)underlyingType)->mTypeDef->mTypeCode); |
| 3829 | else |
| 3830 | boxedUnderlyingTypeInstance = underlyingType->ToTypeInstance(); |
| 3831 | |
| 3832 | typeInstance->mTypeDef = boxedUnderlyingTypeInstance->mTypeDef; |
| 3833 | } |
| 3834 | |
| 3835 | auto typeDef = typeInstance->mTypeDef; |
| 3836 | |
| 3837 | BF_ASSERT((typeInstance->mTypeDef->mNextRevision == NULL) || (mCompiler->IsAutocomplete())); |
| 3838 | |
| 3839 | // This is a special case where our base type has been rebuilt but we haven't |
| 3840 | if ((typeInstance->mBaseTypeMayBeIncomplete) && (!typeInstance->mTypeIncomplete)) |
| 3841 | { |
| 3842 | BfLogSysM("BaseTypeMayBeIncomplete processing. Type:%p -> Base:%p\n", typeInstance, typeInstance->mBaseType); |
| 3843 | PopulateType(typeInstance->mBaseType, populateType); |
| 3844 | if (!typeInstance->mBaseType->IsIncomplete()) |
| 3845 | typeInstance->mBaseTypeMayBeIncomplete = false; |
| 3846 | if (!typeInstance->mTypeIncomplete) |
| 3847 | return; |
| 3848 | } |
| 3849 | typeInstance->mBaseTypeMayBeIncomplete = false; |
| 3850 | |
| 3851 | BF_ASSERT(mIsModuleMutable); |
| 3852 | |
| 3853 | // Don't do type instance method processing for an autocomplete pass - this will get handled later on during |
| 3854 | // the PopulateType worklist pass in the full resolver. We do need to handle the methods for delegates, though, |
| 3855 | // since those can affect method declarations of other methods |
| 3856 | // TODO: Investigate this "Delegate" claim |
| 3857 | bool canDoMethodProcessing = ((mCompiler->mResolvePassData == NULL) || (mCompiler->mResolvePassData->mAutoComplete == NULL) /*|| (typeInstance->IsDelegate())*/); |
| 3858 | |
| 3859 | if (populateType == BfPopulateType_Full_Force) |
| 3860 | canDoMethodProcessing = true; |
| 3861 | |
| 3862 | if (typeInstance->mResolvingConstField) |
| 3863 | return; |
| 3864 | |
| 3865 | // Partial population break out point |
| 3866 | if ((populateType >= BfPopulateType_Identity) && (populateType <= BfPopulateType_IdentityNoRemapAlias)) |
| 3867 | return; |
| 3868 | |
| 3869 | if ((populateType <= BfPopulateType_AllowStaticMethods) && (typeInstance->mDefineState >= BfTypeDefineState_HasInterfaces_Direct)) |
| 3870 | return; |
no test coverage detected