MCPcopy Create free account
hub / github.com/beefytech/Beef / AddMethodReference

Method AddMethodReference

IDEHelper/Compiler/BfModule.cpp:14343–14369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14341}
14342
14343void BfModule::AddMethodReference(const BfMethodRef& methodRef, BfGetMethodInstanceFlags flags)
14344{
14345 BfMethodInstance* methodInstance = methodRef;
14346
14347 if ((mCurTypeInstance != NULL) && (!mCompiler->IsAutocomplete()))
14348 {
14349 auto methodInstanceGroup = methodInstance->mMethodInstanceGroup;
14350 if ((methodInstance->IsSpecializedGenericMethod()) || (methodInstanceGroup->mOnDemandKind != BfMethodOnDemandKind_AlwaysInclude))
14351 {
14352 BF_ASSERT(!methodRef.mTypeInstance->IsFunction());
14353
14354 // This ensures we rebuild - there are some cases where we get a method reference but never call it, so this is required here
14355 AddDependency(methodInstance->GetOwner(), mCurTypeInstance, BfDependencyMap::DependencyFlag_Calls);
14356
14357 BfMethodRef methodRef = methodInstance;
14358 BfSpecializedMethodRefInfo* specializedMethodRefInfo = NULL;
14359 bool isNew = mCurTypeInstance->mSpecializedMethodReferences.TryAdd(methodRef, NULL, &specializedMethodRefInfo);
14360
14361 if (((flags & BfGetMethodInstanceFlag_Unreified) == 0) &&
14362 ((flags & BfGetMethodInstanceFlag_NoForceReification) == 0) &&
14363 (mIsReified))
14364 {
14365 specializedMethodRefInfo->mHasReifiedRef = true;
14366 }
14367 }
14368 }
14369}
14370
14371BfModuleMethodInstance BfModule::ReferenceExternalMethodInstance(BfMethodInstance* methodInstance, BfGetMethodInstanceFlags flags)
14372{

Callers

nothing calls this directly

Calls 5

IsAutocompleteMethod · 0.80
IsFunctionMethod · 0.45
GetOwnerMethod · 0.45
TryAddMethod · 0.45

Tested by

no test coverage detected