diff options
author | Chris Lattner <sabre@nondot.org> | 2003-03-03 23:27:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-03-03 23:27:52 +0000 |
commit | b75f9dda9e436b346c684c3694fbef6b14a00795 (patch) | |
tree | 8baddd16f944c3824e90968af8775650a381c1cd | |
parent | 1e6233af96267e322426b516cf23959f91235c97 (diff) |
Add a few new 'add' methods. Move the iterator around
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5690 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Analysis/AliasSetTracker.h | 63 |
1 files changed, 35 insertions, 28 deletions
diff --git a/include/llvm/Analysis/AliasSetTracker.h b/include/llvm/Analysis/AliasSetTracker.h index 713add5506..45867ae916 100644 --- a/include/llvm/Analysis/AliasSetTracker.h +++ b/include/llvm/Analysis/AliasSetTracker.h @@ -93,6 +93,36 @@ class AliasSet { }; unsigned AliasTy : 1; + friend class ilist_traits<AliasSet>; + AliasSet *getPrev() const { return Prev; } + AliasSet *getNext() const { return Next; } + void setPrev(AliasSet *P) { Prev = P; } + void setNext(AliasSet *N) { Next = N; } + +public: + /// Accessors... + bool isRef() const { return AccessTy & Refs; } + bool isMod() const { return AccessTy & Mods; } + bool isMustAlias() const { return AliasTy == MustAlias; } + bool isMayAlias() const { return AliasTy == MayAlias; } + + /// isForwardingAliasSet - Return true if this alias set should be ignored as + /// part of the AliasSetTracker object. + bool isForwardingAliasSet() const { return Forward; } + + /// mergeSetIn - Merge the specified alias set into this alias set... + /// + void mergeSetIn(AliasSet &AS); + + // Alias Set iteration - Allow access to all of the pointer which are part of + // this alias set... + class iterator; + iterator begin() const { return iterator(PtrListHead); } + iterator end() const { return iterator(); } + + void print(std::ostream &OS) const; + void dump() const; + /// Define an iterator for alias sets... this is just a forward iterator. class iterator : public forward_iterator<HashNodePair, ptrdiff_t> { HashNodePair *CurNode; @@ -125,31 +155,6 @@ class AliasSet { } }; - friend class ilist_traits<AliasSet>; - AliasSet *getPrev() const { return Prev; } - AliasSet *getNext() const { return Next; } - void setPrev(AliasSet *P) { Prev = P; } - void setNext(AliasSet *N) { Next = N; } - -public: - /// Accessors... - bool isRef() const { return AccessTy & Refs; } - bool isMod() const { return AccessTy & Mods; } - bool isMustAlias() const { return AliasTy == MustAlias; } - bool isMayAlias() const { return AliasTy == MayAlias; } - - /// mergeSetIn - Merge the specified alias set into this alias set... - /// - void mergeSetIn(AliasSet &AS); - - // Alias Set iteration - Allow access to all of the pointer which are part of - // this alias set... - iterator begin() const { return iterator(PtrListHead); } - iterator end() const { return iterator(); } - - void print(std::ostream &OS) const; - void dump() const; - private: // Can only be created by AliasSetTracker AliasSet() : PtrListHead(0), PtrListTail(0), Forward(0), RefCount(0), @@ -216,10 +221,12 @@ public: /// void add(LoadInst *LI); void add(StoreInst *SI); - void add(CallSite CS); // Call/Invoke instructions - void add(CallInst *CI) { add(CallSite(CI)); } + void add(CallSite CS); // Call/Invoke instructions + void add(CallInst *CI) { add(CallSite(CI)); } void add(InvokeInst *II) { add(CallSite(II)); } - void add(Instruction *I); // Dispatch to one of the other add methods... + void add(Instruction *I); // Dispatch to one of the other add methods... + void add(BasicBlock &BB); // Add all instructions in basic block + void add(const AliasSetTracker &AST); // Add alias relations from another AST /// getAliasSets - Return the alias sets that are active. const ilist<AliasSet> &getAliasSets() const { return AliasSets; } |