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

Method GetSpecializedMethodModule

IDEHelper/Compiler/BfModule.cpp:11451–11485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11449}
11450
11451BfModule* BfModule::GetSpecializedMethodModule(const SizedArrayImpl<BfProject*>& projectList)
11452{
11453 BF_ASSERT(!mIsScratchModule);
11454 BF_ASSERT(mIsReified);
11455
11456 BfModule* mainModule = this;
11457 if (mParentModule != NULL)
11458 mainModule = mParentModule;
11459
11460 BfModule* specModule = NULL;
11461 BfModule** specModulePtr = NULL;
11462 if (mainModule->mSpecializedMethodModules.TryGetValueWith(projectList, &specModulePtr))
11463 {
11464 return *specModulePtr;
11465 }
11466 else
11467 {
11468 String specModuleName = mModuleName;
11469 for (auto bfProject : projectList)
11470 {
11471 specModuleName += StrFormat("@%s", bfProject->mSafeName.c_str());
11472 }
11473 specModule = new BfModule(mContext, specModuleName);
11474 specModule->mProject = mainModule->mProject;
11475 specModule->mParentModule = mainModule;
11476 specModule->mIsSpecializedMethodModuleRoot = true;
11477 specModule->Init();
11478
11479 Array<BfProject*> projList;
11480 for (auto project : projectList)
11481 projList.Add(project);
11482 mainModule->mSpecializedMethodModules[projList] = specModule;
11483 }
11484 return specModule;
11485}
11486
11487BfIRValue BfModule::CreateFunctionFrom(BfMethodInstance* methodInstance, bool tryExisting, bool isInlined)
11488{

Callers

nothing calls this directly

Calls 4

TryGetValueWithMethod · 0.80
c_strMethod · 0.45
InitMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected