From: Chris Lattner Date: Fri, 26 Nov 2004 21:36:25 +0000 (+0000) Subject: Add a new interface X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=07bfa52405feb99155304c1a28b71e69d046589c;p=oota-llvm.git Add a new interface git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18266 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Analysis/AliasSetTracker.h b/include/llvm/Analysis/AliasSetTracker.h index 91c822b5031..7f974fd0634 100644 --- a/include/llvm/Analysis/AliasSetTracker.h +++ b/include/llvm/Analysis/AliasSetTracker.h @@ -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. diff --git a/lib/Analysis/AliasSetTracker.cpp b/lib/Analysis/AliasSetTracker.cpp index 2da144c35fe..b351874e883 100644 --- a/lib/Analysis/AliasSetTracker.cpp +++ b/lib/Analysis/AliasSetTracker.cpp @@ -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)