| 15503 | } |
| 15504 | |
| 15505 | void BfModule::SetupMethodIdHash(BfMethodInstance* methodInstance) |
| 15506 | { |
| 15507 | HashContext hashCtx; |
| 15508 | |
| 15509 | std::function<void(BfMethodInstance*)> _MixinMethodInstance = [&](BfMethodInstance* methodInstance) |
| 15510 | { |
| 15511 | hashCtx.Mixin(methodInstance->GetOwner()->mTypeId); |
| 15512 | hashCtx.Mixin(methodInstance->mMethodDef->mIdx); |
| 15513 | |
| 15514 | if (methodInstance->GetNumGenericArguments() != 0) |
| 15515 | { |
| 15516 | hashCtx.Mixin((int32)methodInstance->mMethodInfoEx->mMethodGenericArguments.size()); |
| 15517 | for (auto methodGenericArg : methodInstance->mMethodInfoEx->mMethodGenericArguments) |
| 15518 | hashCtx.Mixin(methodGenericArg->mTypeId); |
| 15519 | } |
| 15520 | }; |
| 15521 | |
| 15522 | _MixinMethodInstance(methodInstance); |
| 15523 | |
| 15524 | if (methodInstance->mMethodDef->mIsLocalMethod) |
| 15525 | { |
| 15526 | auto outmostMethodInstance = mCurMethodState->GetRootMethodState()->mMethodInstance; |
| 15527 | if (outmostMethodInstance != NULL) |
| 15528 | { |
| 15529 | BF_ASSERT((outmostMethodInstance->mIdHash != 0) || (outmostMethodInstance->mIsAutocompleteMethod)); |
| 15530 | hashCtx.Mixin(outmostMethodInstance->mIdHash); |
| 15531 | } |
| 15532 | } |
| 15533 | |
| 15534 | methodInstance->mIdHash = (int64)hashCtx.Finish64(); |
| 15535 | } |
| 15536 | |
| 15537 | bool BfModule::CheckUseMethodInstance(BfMethodInstance* methodInstance, BfAstNode* refNode) |
| 15538 | { |
nothing calls this directly
no test coverage detected