mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +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();
|
const ETNode *idom = NodeA->getFather();
|
||||||
return idom ? idom->getData<BasicBlock>() : 0;
|
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 {
|
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
||||||
AU.setPreservesAll();
|
AU.setPreservesAll();
|
||||||
|
@ -275,6 +275,14 @@ public:
|
|||||||
return DFSNumOut;
|
return DFSNumOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ETNode *getSon() const {
|
||||||
|
return Son;
|
||||||
|
}
|
||||||
|
|
||||||
|
const ETNode *getBrother() const {
|
||||||
|
return Left;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Data represented by the node
|
// Data represented by the node
|
||||||
void *data;
|
void *data;
|
||||||
|
Loading…
Reference in New Issue
Block a user