Add a new interface
authorChris Lattner <sabre@nondot.org>
Fri, 26 Nov 2004 21:36:25 +0000 (21:36 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 26 Nov 2004 21:36:25 +0000 (21:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18266 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/AliasSetTracker.h
lib/Analysis/AliasSetTracker.cpp

index 91c822b50316f44765d82d4d195937165f16a587..7f974fd0634d6c2ff552507db6ec9d6fa509051f 100644 (file)
@@ -306,6 +306,11 @@ public:
   AliasSet *getAliasSetForPointerIfExists(Value *P, unsigned Size) {
     return findAliasSetForPointer(P, Size);
   }
+  
+  /// containsPointer - Return true if the specified location is represented by
+  /// this alias set, false otherwise.  This does not modify the AST object or
+  /// alias sets.
+  bool containsPointer(Value *P, unsigned Size) const;
 
   /// getAliasAnalysis - Return the underlying alias analysis object used by
   /// this tracker.
index 2da144c35fe809b52b91a31cc5178e4f2fc75849..b351874e883fae05e200ae03b860a4c50fea0d2b 100644 (file)
@@ -189,6 +189,18 @@ AliasSet *AliasSetTracker::findAliasSetForPointer(const Value *Ptr,
   return FoundSet;
 }
 
+/// containsPointer - Return true if the specified location is represented by
+/// this alias set, false otherwise.  This does not modify the AST object or
+/// alias sets.
+bool AliasSetTracker::containsPointer(Value *Ptr, unsigned Size) const {
+  for (const_iterator I = begin(), E = end(); I != E; ++I)
+    if (!I->Forward && I->aliasesPointer(Ptr, Size, AA))
+      return true;
+  return false;
+}
+
+
+
 AliasSet *AliasSetTracker::findAliasSetForCallSite(CallSite CS) {
   AliasSet *FoundSet = 0;
   for (iterator I = begin(), E = end(); I != E; ++I)