[llvm-commits] CVS: llvm/include/llvm/Analysis/Dominators.h

Owen Anderson resistor at mac.com
Sun Apr 8 17:53:08 PDT 2007



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);






More information about the llvm-commits mailing list