Because I like being able to instantiate the cfgprinter from external projects,
[oota-llvm.git] / include / llvm / Analysis / PostDominators.h
index b1a9b8ed1687b63c0609e869d7dd7f442e6417e2..2386f9d1258ac7a54aa295461e95cad006af0a3f 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "llvm/Analysis/Dominators.h"
 
+namespace llvm {
 
 /// PostDominatorSet Class - Concrete subclass of DominatorSetBase that is used
 /// to compute the post-dominator set.  Because there can be multiple exit nodes
@@ -29,19 +30,17 @@ struct PostDominatorSet : public DominatorSetBase {
 
   virtual bool runOnFunction(Function &F);
 
-  // getAnalysisUsage - This pass does not modify the function at all.
-  //
+  /// getAnalysisUsage - This pass does not modify the function at all.
+  ///
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
   }
 };
 
 
-
-//===-------------------------------------
-// ImmediatePostDominators Class - Concrete subclass of ImmediateDominatorsBase
-// that is used to compute the immediate post-dominators.
-//
+/// ImmediatePostDominators Class - Concrete subclass of ImmediateDominatorsBase
+/// that is used to compute the immediate post-dominators.
+///
 struct ImmediatePostDominators : public ImmediateDominatorsBase {
   ImmediatePostDominators() : ImmediateDominatorsBase(true) {}
 
@@ -57,13 +56,14 @@ struct ImmediatePostDominators : public ImmediateDominatorsBase {
     AU.setPreservesAll();
     AU.addRequired<PostDominatorSet>();
   }
+private:
+  void calcIDoms(const DominatorSetBase &DS);
 };
 
 
-//===-------------------------------------
-// PostDominatorTree Class - Concrete subclass of DominatorTree that is used to
-// compute the a post-dominator tree.
-//
+/// PostDominatorTree Class - Concrete subclass of DominatorTree that is used to
+/// compute the a post-dominator tree.
+///
 struct PostDominatorTree : public DominatorTreeBase {
   PostDominatorTree() : DominatorTreeBase(true) {}
 
@@ -84,10 +84,9 @@ private:
 };
 
 
-//===-------------------------------------
-// PostDominanceFrontier Class - Concrete subclass of DominanceFrontier that is
-// used to compute the a post-dominance frontier.
-//
+/// PostDominanceFrontier Class - Concrete subclass of DominanceFrontier that is
+/// used to compute the a post-dominance frontier.
+///
 struct PostDominanceFrontier : public DominanceFrontierBase {
   PostDominanceFrontier() : DominanceFrontierBase(true) {}
 
@@ -117,4 +116,6 @@ private:
 static IncludeFile
 POST_DOMINATOR_INCLUDE_FILE((void*)&PostDominanceFrontier::stub);
 
+} // End llvm namespace
+
 #endif