| 2613 | } |
| 2614 | |
| 2615 | void 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: |
nothing calls this directly
no test coverage detected