[llvm-commits] [llvm] r153398 - /llvm/trunk/include/llvm/Analysis/Dominators.h
Rafael Espindola
rafael.espindola at gmail.com
Sat Mar 24 15:52:25 PDT 2012
Author: rafael
Date: Sat Mar 24 17:52:25 2012
New Revision: 153398
URL: http://llvm.org/viewvc/llvm-project?rev=153398&view=rev
Log:
Avoid using dominatedBySlowTreeWalk.
Modified:
llvm/trunk/include/llvm/Analysis/Dominators.h
Modified: llvm/trunk/include/llvm/Analysis/Dominators.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Dominators.h?rev=153398&r1=153397&r2=153398&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/Dominators.h (original)
+++ llvm/trunk/include/llvm/Analysis/Dominators.h Sat Mar 24 17:52:25 2012
@@ -338,9 +338,12 @@
/// Note that this is not a constant time operation!
///
bool properlyDominates(const DomTreeNodeBase<NodeT> *A,
- const DomTreeNodeBase<NodeT> *B) const {
- if (A == 0 || B == 0) return false;
- return dominatedBySlowTreeWalk(A, B);
+ const DomTreeNodeBase<NodeT> *B) {
+ if (A == 0 || B == 0)
+ return false;
+ if (A == B)
+ return false;
+ return dominates(A, B);
}
inline bool properlyDominates(const NodeT *A, const NodeT *B) {
@@ -350,8 +353,8 @@
// Cast away the const qualifiers here. This is ok since
// this function doesn't actually return the values returned
// from getNode.
- return properlyDominates(getNode(const_cast<NodeT *>(A)),
- getNode(const_cast<NodeT *>(B)));
+ return dominates(getNode(const_cast<NodeT *>(A)),
+ getNode(const_cast<NodeT *>(B)));
}
bool dominatedBySlowTreeWalk(const DomTreeNodeBase<NodeT> *A,
More information about the llvm-commits
mailing list