/// remove - Remove the specified (potentially non-empty) alias set from the /// tracker. void AliasSetTracker::remove(AliasSet &AS) { // Drop all call sites. AS.UnknownInsts.clear(); // Clear the alias set. unsigned NumRefs = 0; while (!AS.empty()) { AliasSet::PointerRec *P = AS.PtrList; Value *ValToRemove = P->getValue(); // Unlink and delete entry from the list of values. P->eraseFromList(); // Remember how many references need to be dropped. ++NumRefs; // Finally, remove the entry. PointerMap.erase(ValToRemove); } // Stop using the alias set, removing it. AS.RefCount -= NumRefs; if (AS.RefCount == 0) AS.removeFromTracker(*this); }
/// remove - Remove the specified (potentially non-empty) alias set from the /// tracker. void AliasSetTracker::remove(AliasSet &AS) { // Drop all call sites. AS.CallSites.clear(); // Clear the alias set. unsigned NumRefs = 0; while (!AS.empty()) { AliasSet::HashNodePair *P = AS.PtrList; // Unlink from the list of values. P->second.removeFromList(); // Remember how many references need to be dropped. ++NumRefs; // Finally, remove the entry. Value *Remove = P->first; // Take a copy because it is invalid to pass PointerMap.erase(Remove); // a reference to the data being erased. } // Stop using the alias set, removing it. AS.RefCount -= NumRefs; if (AS.RefCount == 0) AS.removeFromTracker(*this); }