Changes in directory llvm/include/llvm/Analysis:
Dominators.h updated: 1.93 -> 1.94 --- Log message: Add BasicBlock level dominates(A,B) interface. --- Diffs of the changes: (+14 -2) Dominators.h | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Analysis/Dominators.h diff -u llvm/include/llvm/Analysis/Dominators.h:1.93 llvm/include/llvm/Analysis/Dominators.h:1.94 --- llvm/include/llvm/Analysis/Dominators.h:1.93 Thu Jun 7 12:47:21 2007 +++ llvm/include/llvm/Analysis/Dominators.h Thu Jun 7 13:39:40 2007 @@ -170,11 +170,16 @@ } void updateDFSNumbers(); + /// dominates - Returns true iff this dominates N. Note that this is not a /// constant time operation! /// inline bool dominates(const DomTreeNode *A, DomTreeNode *B) { - if (B == A) return true; // A node trivially dominates itself. + if (B == A) + return true; // A node trivially dominates itself. + + if (A == 0 || B == 0) + return false; ETNode *NodeA = A->getETNode(); ETNode *NodeB = B->getETNode(); @@ -192,7 +197,14 @@ //return NodeB->DominatedBySlow(NodeA); return dominatedBySlowTreeWalk(A, B); } - + + inline bool dominates(BasicBlock *A, BasicBlock *B) { + if (A == B) + return true; + + return dominates(getNode(A), getNode(B)); + } + //===--------------------------------------------------------------------===// // API to update (Post)DominatorTree information based on modifications to // the CFG... _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits