diff options
author | Chris Lattner <sabre@nondot.org> | 2003-02-27 20:24:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-02-27 20:24:17 +0000 |
commit | ef05100950dfc6e4c9dfd806695db9f1922a0618 (patch) | |
tree | b748f8d0c8670fa2e6717992295608577d433712 /include/llvm/Analysis | |
parent | 5f82b8a1ad3072dbcf893a8b76c783d3188393a5 (diff) | |
download | external_llvm-ef05100950dfc6e4c9dfd806695db9f1922a0618.zip external_llvm-ef05100950dfc6e4c9dfd806695db9f1922a0618.tar.gz external_llvm-ef05100950dfc6e4c9dfd806695db9f1922a0618.tar.bz2 |
Make the interface to update a little more efficient
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5651 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis')
-rw-r--r-- | include/llvm/Analysis/Dominators.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index 775f44e..63a84c0 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -378,24 +378,26 @@ public: virtual void releaseMemory() { Frontiers.clear(); } // Accessor interface: + typedef DomSetMapType::iterator iterator; typedef DomSetMapType::const_iterator const_iterator; + iterator begin() { return Frontiers.begin(); } const_iterator begin() const { return Frontiers.begin(); } + iterator end() { return Frontiers.end(); } const_iterator end() const { return Frontiers.end(); } - const_iterator find(BasicBlock* B) const { return Frontiers.find(B); } + iterator find(BasicBlock *B) { return Frontiers.find(B); } + const_iterator find(BasicBlock *B) const { return Frontiers.find(B); } void addBasicBlock(BasicBlock *BB, const DomSetType &frontier) { assert(find(BB) == end() && "Block already in DominanceFrontier!"); Frontiers.insert(std::make_pair(BB, frontier)); } - void addToFrontier(BasicBlock *BB, BasicBlock *Node) { - DomSetMapType::iterator I = Frontiers.find(BB); + void addToFrontier(iterator I, BasicBlock *Node) { assert(I != end() && "BB is not in DominanceFrontier!"); I->second.insert(Node); } - void removeFromFrontier(BasicBlock *BB, BasicBlock *Node) { - DomSetMapType::iterator I = Frontiers.find(BB); + void removeFromFrontier(iterator I, BasicBlock *Node) { assert(I != end() && "BB is not in DominanceFrontier!"); assert(I->second.count(Node) && "Node is not in DominanceFrontier of BB"); I->second.erase(Node); |