[llvm-commits] CVS: llvm/include/llvm/Analysis/Dominators.h
Chris Lattner
lattner at cs.uiuc.edu
Wed Oct 30 20:40:00 PST 2002
Changes in directory llvm/include/llvm/Analysis:
Dominators.h updated: 1.29 -> 1.30
---
Log message:
Add interface to update domfrontier info, thanks to Casey Carter for impl
---
Diffs of the changes:
Index: llvm/include/llvm/Analysis/Dominators.h
diff -u llvm/include/llvm/Analysis/Dominators.h:1.29 llvm/include/llvm/Analysis/Dominators.h:1.30
--- llvm/include/llvm/Analysis/Dominators.h:1.29 Wed Oct 16 20:36:08 2002
+++ llvm/include/llvm/Analysis/Dominators.h Wed Oct 30 20:39:48 2002
@@ -379,9 +379,27 @@
// Accessor interface:
typedef DomSetMapType::const_iterator const_iterator;
- inline const_iterator begin() const { return Frontiers.begin(); }
- inline const_iterator end() const { return Frontiers.end(); }
- inline const_iterator find(BasicBlock* B) const { return Frontiers.find(B); }
+ const_iterator begin() const { return Frontiers.begin(); }
+ const_iterator end() const { return Frontiers.end(); }
+ 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);
+ assert(I != end() && "BB is not in DominanceFrontier!");
+ I->second.insert(Node);
+ }
+
+ void removeFromFrontier(BasicBlock *BB, BasicBlock *Node) {
+ DomSetMapType::iterator I = Frontiers.find(BB);
+ assert(I != end() && "BB is not in DominanceFrontier!");
+ assert(I->second.count(Node) && "Node is not in DominanceFrontier of BB");
+ I->second.erase(Node);
+ }
// print - Convert to human readable form
virtual void print(std::ostream &OS) const;
More information about the llvm-commits
mailing list