summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-11-26 21:36:25 +0000
committerChris Lattner <sabre@nondot.org>2004-11-26 21:36:25 +0000
commiteeaa29c377e9d22154ec712293d7c3d061bf140b (patch)
tree3bcb7930c4a10950df75912d0f1bee9260da5f76 /llvm
parentb137409926d186df0d4ab4203f480967342a4738 (diff)
downloadbcm5719-llvm-eeaa29c377e9d22154ec712293d7c3d061bf140b.tar.gz
bcm5719-llvm-eeaa29c377e9d22154ec712293d7c3d061bf140b.zip
Add a new interface
llvm-svn: 18266
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Analysis/AliasSetTracker.h5
-rw-r--r--llvm/lib/Analysis/AliasSetTracker.cpp12
2 files changed, 17 insertions, 0 deletions
diff --git a/llvm/include/llvm/Analysis/AliasSetTracker.h b/llvm/include/llvm/Analysis/AliasSetTracker.h
index 91c822b5031..7f974fd0634 100644
--- a/llvm/include/llvm/Analysis/AliasSetTracker.h
+++ b/llvm/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/llvm/lib/Analysis/AliasSetTracker.cpp b/llvm/lib/Analysis/AliasSetTracker.cpp
index 2da144c35fe..b351874e883 100644
--- a/llvm/lib/Analysis/AliasSetTracker.cpp
+++ b/llvm/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)
OpenPOWER on IntegriCloud