mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Add accessor to get the blocks immediately dominated by a given block to ETForest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36251 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f44c72817e
commit
9e7919785e
@ -327,6 +327,20 @@ public:
|
||||
const ETNode *idom = NodeA->getFather();
|
||||
return idom ? idom->getData<BasicBlock>() : 0;
|
||||
}
|
||||
|
||||
void getChildren(BasicBlock *A, std::vector<BasicBlock*>& children) {
|
||||
ETNode *NodeA = getNode(A);
|
||||
const ETNode* son = NodeA->getSon();
|
||||
|
||||
if (!son) return;
|
||||
children.push_back(son->getData<BasicBlock>());
|
||||
|
||||
const ETNode* brother = son->getBrother();
|
||||
while (brother != son) {
|
||||
children.push_back(brother->getData<BasicBlock>());
|
||||
brother = brother->getBrother();
|
||||
}
|
||||
}
|
||||
|
||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
AU.setPreservesAll();
|
||||
|
@ -275,6 +275,14 @@ public:
|
||||
return DFSNumOut;
|
||||
}
|
||||
|
||||
const ETNode *getSon() const {
|
||||
return Son;
|
||||
}
|
||||
|
||||
const ETNode *getBrother() const {
|
||||
return Left;
|
||||
}
|
||||
|
||||
private:
|
||||
// Data represented by the node
|
||||
void *data;
|
||||
|
Loading…
Reference in New Issue
Block a user