void AliasSetTracker::add(const AliasSetTracker &AST) { assert(&AA == &AST.AA && "Merging AliasSetTracker objects with different Alias Analyses!"); // Loop over all of the alias sets in AST, adding the pointers contained // therein into the current alias sets. This can cause alias sets to be // merged together in the current AST. for (const_iterator I = AST.begin(), E = AST.end(); I != E; ++I) { if (I->Forward) continue; // Ignore forwarding alias sets AliasSet &AS = const_cast<AliasSet&>(*I); // If there are any call sites in the alias set, add them to this AST. for (unsigned i = 0, e = AS.UnknownInsts.size(); i != e; ++i) add(AS.UnknownInsts[i]); // Loop over all of the pointers in this alias set. bool X; for (AliasSet::iterator ASI = AS.begin(), E = AS.end(); ASI != E; ++ASI) { AliasSet &NewAS = addPointer(ASI.getPointer(), ASI.getSize(), ASI.getTBAAInfo(), (AliasSet::AccessType)AS.AccessTy, X); if (AS.isVolatile()) NewAS.setVolatile(); } } }
void DeadStoreEliminationPass::printSet(raw_ostream &O, AliasSetTracker &myset) const { O << " {\n"; for (AliasSetTracker::const_iterator it = myset.begin(); it != myset.end(); ++it) { O << " "; (*it).print(O); } O << " }\n"; }
void AliasSetTracker::add(const AliasSetTracker &AST) { assert(&AA == &AST.AA && "Merging AliasSetTracker objects with different Alias Analyses!"); // Loop over all of the alias sets in AST, adding the pointers contained // therein into the current alias sets. This can cause alias sets to be // merged together in the current AST. for (const_iterator I = AST.begin(), E = AST.end(); I != E; ++I) if (!I->Forward) { // Ignore forwarding alias sets AliasSet &AS = const_cast<AliasSet&>(*I); // If there are any call sites in the alias set, add them to this AST. for (unsigned i = 0, e = AS.CallSites.size(); i != e; ++i) add(AS.CallSites[i]); // Loop over all of the pointers in this alias set... AliasSet::iterator I = AS.begin(), E = AS.end(); bool X; for (; I != E; ++I) addPointer(I.getPointer(), I.getSize(), (AliasSet::AccessType)AS.AccessTy, X); } }