diff options
author | Owen Anderson <resistor@mac.com> | 2007-04-09 00:52:49 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2007-04-09 00:52:49 +0000 |
commit | 558fc740da62bb93ddfc85f353ab0665b566127f (patch) | |
tree | 1b830bce4a2d5f5dd85278f85ccc2b4bcf6918c0 /include | |
parent | d2eae62e93fc6e398263a952609b6ea60a204802 (diff) |
Cleanup some from my DomSet-removal changes. Add a new
isReachableFromEntry
test to ETForest to factor a common test out of code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35786 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/Dominators.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index f6ac58a69f..b6453bae17 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -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 @@ public: } } - // 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 @@ public: 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); |