@@ -509,57 +509,6 @@ void AliasSetTracker::add(const AliasSetTracker &AST) {
509
509
}
510
510
}
511
511
512
- // deleteValue method - This method is used to remove a pointer value from the
513
- // AliasSetTracker entirely. It should be used when an instruction is deleted
514
- // from the program to update the AST. If you don't use this, you would have
515
- // dangling pointers to deleted instructions.
516
- //
517
- void AliasSetTracker::deleteValue (Value *PtrVal) {
518
- // First, look up the PointerRec for this pointer.
519
- PointerMapType::iterator I = PointerMap.find_as (PtrVal);
520
- if (I == PointerMap.end ()) return ; // Noop
521
-
522
- // If we found one, remove the pointer from the alias set it is in.
523
- AliasSet::PointerRec *PtrValEnt = I->second ;
524
- AliasSet *AS = PtrValEnt->getAliasSet (*this );
525
-
526
- // Unlink and delete from the list of values.
527
- PtrValEnt->eraseFromList ();
528
-
529
- if (AS->Alias == AliasSet::SetMayAlias) {
530
- AS->SetSize --;
531
- TotalMayAliasSetSize--;
532
- }
533
-
534
- // Stop using the alias set.
535
- AS->dropRef (*this );
536
-
537
- PointerMap.erase (I);
538
- }
539
-
540
- // copyValue - This method should be used whenever a preexisting value in the
541
- // program is copied or cloned, introducing a new value. Note that it is ok for
542
- // clients that use this method to introduce the same value multiple times: if
543
- // the tracker already knows about a value, it will ignore the request.
544
- //
545
- void AliasSetTracker::copyValue (Value *From, Value *To) {
546
- // First, look up the PointerRec for this pointer.
547
- PointerMapType::iterator I = PointerMap.find_as (From);
548
- if (I == PointerMap.end ())
549
- return ; // Noop
550
- assert (I->second ->hasAliasSet () && " Dead entry?" );
551
-
552
- AliasSet::PointerRec &Entry = getEntryFor (To);
553
- if (Entry.hasAliasSet ()) return ; // Already in the tracker!
554
-
555
- // getEntryFor above may invalidate iterator \c I, so reinitialize it.
556
- I = PointerMap.find_as (From);
557
- // Add it to the alias set it aliases...
558
- AliasSet *AS = I->second ->getAliasSet (*this );
559
- AS->addPointer (*this , Entry, I->second ->getSize (), I->second ->getAAInfo (),
560
- true , true );
561
- }
562
-
563
512
AliasSet &AliasSetTracker::mergeAllAliasSets () {
564
513
assert (!AliasAnyAS && (TotalMayAliasSetSize > SaturationThreshold) &&
565
514
" Full merge should happen once, when the saturation threshold is "
@@ -672,28 +621,6 @@ LLVM_DUMP_METHOD void AliasSet::dump() const { print(dbgs()); }
672
621
LLVM_DUMP_METHOD void AliasSetTracker::dump () const { print (dbgs ()); }
673
622
#endif
674
623
675
- // ===----------------------------------------------------------------------===//
676
- // ASTCallbackVH Class Implementation
677
- // ===----------------------------------------------------------------------===//
678
-
679
- void AliasSetTracker::ASTCallbackVH::deleted () {
680
- assert (AST && " ASTCallbackVH called with a null AliasSetTracker!" );
681
- AST->deleteValue (getValPtr ());
682
- // this now dangles!
683
- }
684
-
685
- void AliasSetTracker::ASTCallbackVH::allUsesReplacedWith (Value *V) {
686
- AST->copyValue (getValPtr (), V);
687
- }
688
-
689
- AliasSetTracker::ASTCallbackVH::ASTCallbackVH (Value *V, AliasSetTracker *ast)
690
- : CallbackVH(V), AST(ast) {}
691
-
692
- AliasSetTracker::ASTCallbackVH &
693
- AliasSetTracker::ASTCallbackVH::operator =(Value *V) {
694
- return *this = ASTCallbackVH (V, AST);
695
- }
696
-
697
624
// ===----------------------------------------------------------------------===//
698
625
// AliasSetPrinter Pass
699
626
// ===----------------------------------------------------------------------===//
0 commit comments