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

Method SanitizeDependencyMap

IDEHelper/Compiler/BfCompiler.cpp:2615–2645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2613}
2614
2615void BfCompiler::SanitizeDependencyMap()
2616{
2617 BfLogSysM("SanitizeDependencyMap\n");
2618
2619 for (auto type : mContext->mResolvedTypes)
2620 {
2621 if (type == NULL)
2622 continue;
2623
2624 auto depType = type->ToDependedType();
2625 if (depType == NULL)
2626 continue;
2627
2628 // Not combined with previous loop because PopulateType could modify typeInst->mDependencyMap
2629 for (auto itr = depType->mDependencyMap.begin(); itr != depType->mDependencyMap.end();)
2630 {
2631 auto dependentType = itr->mKey;
2632 auto depTypeInst = dependentType->ToTypeInstance();
2633 if (dependentType->IsDeleting())
2634 {
2635 BfLogSysM("SanitizeDependencyMap removing old dependent %p from %p\n", dependentType, depType);
2636 itr = depType->mDependencyMap.erase(itr);
2637 }
2638 else
2639 ++itr;
2640 }
2641 }
2642
2643 mContext->RemoveInvalidWorkItems();
2644 mDepsMayHaveDeletedTypes = false;
2645}
2646
2647// When we are unsure of whether an old generic instance will survive, we RebuildType but don't put it in any worklist.
2648// One of three things happens:

Callers

nothing calls this directly

Calls 7

IsDeletingMethod · 0.80
ToDependedTypeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
ToTypeInstanceMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected