Add some new methods
authorChris Lattner <sabre@nondot.org>
Mon, 26 Jul 2004 05:50:23 +0000 (05:50 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 26 Jul 2004 05:50:23 +0000 (05:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15230 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/AliasSetTracker.cpp

index f11159ef9e1bf62850d9e7adf6fabc792bced0b1..867e58adcc6c4339f703311574c34f1a3e84795b 100644 (file)
@@ -215,6 +215,13 @@ AliasSet &AliasSetTracker::getAliasSetForPointer(Value *Pointer, unsigned Size,
   }
 }
 
+bool AliasSetTracker::add(Value *Ptr, unsigned Size) {
+  bool NewPtr;
+  addPointer(Ptr, Size, AliasSet::NoModRef, NewPtr);
+  return NewPtr;
+}
+
+
 bool AliasSetTracker::add(LoadInst *LI) {
   bool NewPtr;
   AliasSet &AS = addPointer(LI->getOperand(0),
@@ -319,6 +326,12 @@ void AliasSetTracker::remove(AliasSet &AS) {
   } while (!SetDead);
 }
 
+bool AliasSetTracker::remove(Value *Ptr, unsigned Size) {
+  AliasSet *AS = findAliasSetForPointer(Ptr, Size);
+  if (!AS) return false;
+  remove(*AS);
+  return true;
+}
 
 bool AliasSetTracker::remove(LoadInst *LI) {
   unsigned Size = AA.getTargetData().getTypeSize(LI->getType());