From b75f9dda9e436b346c684c3694fbef6b14a00795 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 3 Mar 2003 23:27:52 +0000 Subject: [PATCH] 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 --- include/llvm/Analysis/AliasSetTracker.h | 63 ++++++++++++++----------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/include/llvm/Analysis/AliasSetTracker.h b/include/llvm/Analysis/AliasSetTracker.h index 713add5506b..45867ae9162 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 *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 *CurNode; @@ -125,31 +155,6 @@ class AliasSet { } }; - friend class ilist_traits; - 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 &getAliasSets() const { return AliasSets; } -- 2.34.1