1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

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 ea3c945817
commit 7553394275

View File

@ -321,6 +321,13 @@ public:
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();
AU.addRequired<DominatorTree>();