Add an accessor to make ETForest more useful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36246 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson 2007-04-18 04:38:39 +00:00
parent 61a4c072b9
commit 1c2b862be0

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();