mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-06 10:58:04 +00:00
Add new method - nearestCommonDominator().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37508 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
53c279b194
commit
0ab301c5fa
@ -185,6 +185,17 @@ protected:
|
||||
|
||||
void updateDFSNumbers();
|
||||
|
||||
/// Return the nearest common dominator of A and B.
|
||||
BasicBlock *nearestCommonDominator(BasicBlock *A, BasicBlock *B) const {
|
||||
ETNode *NodeA = getNode(A)->getETNode();
|
||||
ETNode *NodeB = getNode(B)->getETNode();
|
||||
|
||||
ETNode *Common = NodeA->NCA(NodeB);
|
||||
if (!Common)
|
||||
return NULL;
|
||||
return Common->getData<BasicBlock>();
|
||||
}
|
||||
|
||||
/// dominates - Returns true iff this dominates N. Note that this is not a
|
||||
/// constant time operation!
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user