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

Method UpdateCompletion

IDEHelper/Compiler/BfCompiler.cpp:5568–5602  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5566}
5567
5568void BfCompiler::UpdateCompletion()
5569{
5570 if (mIsResolveOnly)
5571 return;
5572
5573 float typeScale = 10.0f;
5574 float methodScale = 1.0f;
5575 float queueModuleScale = 50.0f;
5576 float genModuleScale = 50.0f;
5577
5578 mCodeGen.UpdateStats();
5579
5580 BF_ASSERT(mCodeGen.mQueuedCount >= mCodeGen.mCompletionCount);
5581 BF_ASSERT(mStats.mModulesFinished <= mStats.mModulesStarted);
5582 BF_ASSERT(mCodeGen.mCompletionCount <= mStats.mModulesStarted);
5583
5584 float numerator = ((mStats.mQueuedTypesProcessed * typeScale) + //(mStats.mMethodsProcessed * methodScale) +
5585 (mStats.mModulesFinished * queueModuleScale) + (mCodeGen.mCompletionCount * genModuleScale));
5586 float divisor = ((mStats.mTypesQueued * typeScale) + //(mStats.mMethodsQueued * methodScale) +
5587 (mStats.mModulesStarted * queueModuleScale) + (mStats.mReifiedModuleCount * genModuleScale));
5588 float checkPct = 0;
5589 if (divisor > 0)
5590 {
5591 checkPct = numerator / divisor;
5592 BF_ASSERT(checkPct >= 0);
5593 if (checkPct > mCompletionPct)
5594 mCompletionPct = checkPct;
5595 }
5596 else
5597 mCompletionPct = 0;
5598 if (!mHadCancel)
5599 BF_ASSERT(mCompletionPct <= 1.0f);
5600 if (mCompletionPct > 1.0f)
5601 mCompletionPct = 1.0f;
5602}
5603
5604void BfCompiler::MarkStringPool(BfModule* module)
5605{

Callers 11

DoMethodDeclarationMethod · 0.80
ProcessMethodMethod · 0.80
AssignModuleMethod · 0.80
ProcessWorkListMethod · 0.80
AddTypeToWorkListMethod · 0.80
RebuildTypeMethod · 0.80
InitTypeMethod · 0.80
RebuildMethodsMethod · 0.80
AddMethodToWorkListMethod · 0.80

Calls 1

UpdateStatsMethod · 0.45

Tested by

no test coverage detected