| 20907 | } |
| 20908 | |
| 20909 | void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup, bool forceIRWrites) |
| 20910 | { |
| 20911 | BP_ZONE_F("BfModule::ProcessMethod %s", BP_DYN_STR(methodInstance->mMethodDef->mName.c_str())); |
| 20912 | |
| 20913 | if (mIsComptimeModule) |
| 20914 | { |
| 20915 | BF_ASSERT(!mCompiler->IsAutocomplete()); |
| 20916 | } |
| 20917 | |
| 20918 | if (mAwaitingInitFinish) |
| 20919 | FinishInit(); |
| 20920 | |
| 20921 | if ((methodInstance->mIsReified) && (!mCompiler->mIsResolveOnly)) |
| 20922 | { |
| 20923 | BfLogSysM("REIFIED(ProcessMethod): %s %p Module: %s\n", methodInstance->mMethodDef->mName.c_str(), methodInstance, mModuleName.c_str()); |
| 20924 | } |
| 20925 | |
| 20926 | // Reify types that are actually used - they don't get reified during method declaration |
| 20927 | if ((!mCompiler->mIsResolveOnly) && (mIsReified)) |
| 20928 | { |
| 20929 | auto _CheckType = [&](BfType* type) |
| 20930 | { |
| 20931 | if (!type->IsReified()) |
| 20932 | PopulateType(type, BfPopulateType_Declaration); |
| 20933 | }; |
| 20934 | _CheckType(methodInstance->mReturnType); |
| 20935 | for (auto& param : methodInstance->mParams) |
| 20936 | { |
| 20937 | _CheckType(param.mResolvedType); |
| 20938 | } |
| 20939 | } |
| 20940 | |
| 20941 | if (!methodInstance->mIsReified) |
| 20942 | BF_ASSERT(!mIsReified); |
| 20943 | |
| 20944 | BF_ASSERT((!methodInstance->GetOwner()->IsUnspecializedTypeVariation()) || (mIsComptimeModule)); |
| 20945 | |
| 20946 | if (methodInstance->mMethodInfoEx != NULL) |
| 20947 | { |
| 20948 | for (auto methodGenericArg : methodInstance->mMethodInfoEx->mMethodGenericArguments) |
| 20949 | { |
| 20950 | if (methodGenericArg->IsMethodRef()) |
| 20951 | { |
| 20952 | auto methodRefType = (BfMethodRefType*)methodGenericArg; |
| 20953 | BF_ASSERT(methodRefType->mOwnerRevision == methodRefType->mOwner->mRevision); |
| 20954 | } |
| 20955 | } |
| 20956 | } |
| 20957 | |
| 20958 | if (mBfIRBuilder == NULL) |
| 20959 | { |
| 20960 | BfLogSysM("ProcessMethod %p calling EnsureIRBuilder\n", methodInstance); |
| 20961 | EnsureIRBuilder(); |
| 20962 | } |
| 20963 | |
| 20964 | SetAndRestoreValue<bool> prevIgnoreWrites(mBfIRBuilder->mIgnoreWrites, (mWantsIRIgnoreWrites || methodInstance->mIsUnspecialized) && (!forceIRWrites)); |
| 20965 | |
| 20966 | if ((HasCompiledOutput()) && (!mBfIRBuilder->mIgnoreWrites)) |
no test coverage detected