aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/AliasSetTracker.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-07-21 07:03:57 +0000
committerChris Lattner <sabre@nondot.org>2004-07-21 07:03:57 +0000
commit877ad7d80b3eac84f9f61294bc1b78817bbca530 (patch)
treed2c70e62d8dd7d88843058475b49d97dcf929883 /include/llvm/Analysis/AliasSetTracker.h
parent12c1155403fd2dbd3a24e3748e7d80bbaa27c7f6 (diff)
Add a bunch of new functionality, primarily to do with removing aliasing
pointers from an AST. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15065 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/AliasSetTracker.h')
-rw-r--r--include/llvm/Analysis/AliasSetTracker.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/include/llvm/Analysis/AliasSetTracker.h b/include/llvm/Analysis/AliasSetTracker.h
index 3d4d99f034..d9afe30003 100644
--- a/include/llvm/Analysis/AliasSetTracker.h
+++ b/include/llvm/Analysis/AliasSetTracker.h
@@ -129,7 +129,6 @@ public:
// stores.
bool isVolatile() const { return Volatile; }
-
/// isForwardingAliasSet - Return true if this alias set should be ignored as
/// part of the AliasSetTracker object.
bool isForwardingAliasSet() const { return Forward; }
@@ -143,6 +142,7 @@ public:
class iterator;
iterator begin() const { return iterator(PtrList); }
iterator end() const { return iterator(); }
+ bool empty() const { return PtrList == 0; }
void print(std::ostream &OS) const;
void dump() const;
@@ -168,6 +168,9 @@ public:
return *CurNode;
}
value_type *operator->() const { return &operator*(); }
+
+ Value *getPointer() const { return CurNode->first; }
+ unsigned getSize() const { return CurNode->second.getSize(); }
iterator& operator++() { // Preincrement
assert(CurNode && "Advancing past AliasSet.end()!");
@@ -267,6 +270,18 @@ public:
void add(BasicBlock &BB); // Add all instructions in basic block
void add(const AliasSetTracker &AST); // Add alias relations from another AST
+ /// remove methods - These methods are used to remove all entries that might
+ /// be aliased by the specified instruction. These methods return true if any
+ /// alias sets were eliminated.
+ bool remove(LoadInst *LI);
+ bool remove(StoreInst *SI);
+ bool remove(CallSite CS);
+ bool remove(CallInst *CI) { return remove(CallSite(CI)); }
+ bool remove(InvokeInst *II) { return remove(CallSite(II)); }
+ bool remove(Instruction *I);
+ void remove(AliasSet &AS);
+
+
/// deleteValue method - This method is used to remove a pointer value from
/// the AliasSetTracker entirely. It should be used when an instruction is
/// deleted from the program to update the AST. If you don't use this, you
@@ -283,6 +298,12 @@ public:
/// pointer didn't alias anything).
AliasSet &getAliasSetForPointer(Value *P, unsigned Size, bool *New = 0);
+ /// getAliasSetForPointerIfExists - Return the alias set containing the
+ /// location specified if one exists, otherwise return null.
+ AliasSet *getAliasSetForPointerIfExists(Value *P, unsigned Size) {
+ return findAliasSetForPointer(P, Size);
+ }
+
/// getAliasAnalysis - Return the underlying alias analysis object used by
/// this tracker.
AliasAnalysis &getAliasAnalysis() const { return AA; }