Changes in directory llvm/include/llvm/Analysis:
Dominators.h updated: 1.67 -> 1.68 --- Log message: Cleanup some from my DomSet-removal changes. Add a new isReachableFromEntry test to ETForest to factor a common test out of code. --- Diffs of the changes: (+8 -1) Dominators.h | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Analysis/Dominators.h diff -u llvm/include/llvm/Analysis/Dominators.h:1.67 llvm/include/llvm/Analysis/Dominators.h:1.68 --- llvm/include/llvm/Analysis/Dominators.h:1.67 Sun Apr 8 16:30:05 2007 +++ llvm/include/llvm/Analysis/Dominators.h Sun Apr 8 19:52:49 2007 @@ -27,6 +27,7 @@ #define LLVM_ANALYSIS_DOMINATORS_H #include "llvm/Analysis/ET-Forest.h" +#include "llvm/Function.h" #include "llvm/Pass.h" #include <set> @@ -395,7 +396,7 @@ } } - // dominates - Return true if A dominates B. THis performs the + // dominates - Return true if A dominates B. This performs the // special checks necessary if A and B are in the same basic block. bool dominates(Instruction *A, Instruction *B); @@ -405,6 +406,12 @@ return dominates(A, B) && A != B; } + /// isReachableFromEntry - Return true if A is dominated by the entry + /// block of the function containing it. + bool isReachableFromEntry(BasicBlock* A) { + return dominates(&A->getParent()->getEntryBlock(), A); + } + /// Return the nearest common dominator of A and B. BasicBlock *nearestCommonDominator(BasicBlock *A, BasicBlock *B) const { ETNode *NodeA = getNode(A); _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits