Add an accessor to make ETForest more useful.

llvm-svn: 36246
This commit is contained in:
Owen Anderson 2007-04-18 04:38:39 +00:00
parent f03c90bee6
commit fae86bcbaa
1 changed files with 7 additions and 0 deletions

View File

@ -320,6 +320,13 @@ public:
return NULL;
return Common->getData<BasicBlock>();
}
/// Return the immediate dominator of A.
BasicBlock *getIDom(BasicBlock *A) {
ETNode *NodeA = getNode(A);
const ETNode *idom = NodeA->getFather();
return idom ? idom->getData<BasicBlock>() : 0;
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();