mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 01:03:52 +00:00
Make dominates(A,B) work with post dominators. Patch contributed by
Naveen Neelakantam, thanks! llvm-svn: 21543
This commit is contained in:
parent
95c14163f6
commit
3aff97254e
@ -245,8 +245,13 @@ bool DominatorSetBase::dominates(Instruction *A, Instruction *B) const {
|
||||
BasicBlock::iterator I = BBA->begin();
|
||||
for (; &*I != A && &*I != B; ++I) /*empty*/;
|
||||
|
||||
// A dominates B if it is found first in the basic block...
|
||||
return &*I == A;
|
||||
if(!IsPostDominators) {
|
||||
// A dominates B if it is found first in the basic block.
|
||||
return &*I == A;
|
||||
} else {
|
||||
// A post-dominates B if B is found first in the basic block.
|
||||
return &*I == B;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user