mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Add interface to update domfrontier info, thanks to Casey Carter for impl
llvm-svn: 4456
This commit is contained in:
parent
6543ec06a6
commit
2e98413a27
@ -379,9 +379,27 @@ public:
|
||||
|
||||
// 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;
|
||||
|
Loading…
Reference in New Issue
Block a user