summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/VMCore')
-rw-r--r--llvm/lib/VMCore/Dominators.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Dominators.cpp b/llvm/lib/VMCore/Dominators.cpp
index 3206ba2e51a..45a2cebb630 100644
--- a/llvm/lib/VMCore/Dominators.cpp
+++ b/llvm/lib/VMCore/Dominators.cpp
@@ -873,6 +873,12 @@ bool ETForestBase::dominates(Instruction *A, Instruction *B) {
}
}
+/// isReachableFromEntry - Return true if A is dominated by the entry
+/// block of the function containing it.
+const bool ETForestBase::isReachableFromEntry(BasicBlock* A) {
+ return dominates(&A->getParent()->getEntryBlock(), A);
+}
+
ETNode *ETForest::getNodeForBlock(BasicBlock *BB) {
ETNode *&BBNode = Nodes[BB];
if (BBNode) return BBNode;
OpenPOWER on IntegriCloud