summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/AliasSetTracker.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-03-03 23:28:05 +0000
committerChris Lattner <sabre@nondot.org>2003-03-03 23:28:05 +0000
commitc048bb3addb47b8a9b01eb756ce5060db3ee6585 (patch)
treec72cb86c5b889c813885226eaf408d9b441e9e3c /llvm/lib/Analysis/AliasSetTracker.cpp
parent12f3ec7d103585066c11f39b854d31f3dbc39cac (diff)
downloadbcm5719-llvm-c048bb3addb47b8a9b01eb756ce5060db3ee6585.tar.gz
bcm5719-llvm-c048bb3addb47b8a9b01eb756ce5060db3ee6585.zip
ADd two new 'add' methods
llvm-svn: 5691
Diffstat (limited to 'llvm/lib/Analysis/AliasSetTracker.cpp')
-rw-r--r--llvm/lib/Analysis/AliasSetTracker.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/AliasSetTracker.cpp b/llvm/lib/Analysis/AliasSetTracker.cpp
index f58aaa3e815..7130a60dc8f 100644
--- a/llvm/lib/Analysis/AliasSetTracker.cpp
+++ b/llvm/lib/Analysis/AliasSetTracker.cpp
@@ -211,6 +211,34 @@ void AliasSetTracker::add(Instruction *I) {
add(II);
}
+void AliasSetTracker::add(BasicBlock &BB) {
+ for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I)
+ add(I);
+}
+
+void AliasSetTracker::add(const AliasSetTracker &AST) {
+ assert(&AA == &AST.AA &&
+ "Merging AliasSetTracker objects with different Alias Analyses!");
+
+ // Loop over all of the alias sets in AST, adding the pointers contained
+ // therein into the current alias sets. This can cause alias sets to be
+ // merged together in the current AST.
+ for (const_iterator I = AST.begin(), E = AST.end(); I != E; ++I)
+ if (!I->Forward) { // Ignore forwarding alias sets
+ AliasSet &AS = const_cast<AliasSet&>(*I);
+
+ // If there are any call sites in the alias set, add them to this AST.
+ for (unsigned i = 0, e = AS.CallSites.size(); i != e; ++i)
+ add(AS.CallSites[i]);
+
+ // Loop over all of the pointers in this alias set...
+ AliasSet::iterator I = AS.begin(), E = AS.end();
+ for (; I != E; ++I)
+ addPointer(I->first, I->second.getSize(),
+ (AliasSet::AccessType)AS.AccessTy);
+ }
+}
+
//===----------------------------------------------------------------------===//
// AliasSet/AliasSetTracker Printing Support
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud