Force postdom to be linked into opt and bugpoint, even though it is no longer used...
[oota-llvm.git] / lib / Analysis / PostDominators.cpp
index 8bfa0692b9adc67850518d6d22b7e9d99300ba87..3d3713b11d9210fa11b0c7eebb9d3350f6bf5283 100644 (file)
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "postdomtree"
+
 #include "llvm/Analysis/PostDominators.h"
 #include "llvm/Instructions.h"
 #include "llvm/Support/CFG.h"
+#include "llvm/Support/Debug.h"
 #include "llvm/ADT/DepthFirstIterator.h"
 #include "llvm/ADT/SetOperations.h"
 #include "llvm/Analysis/DominatorInternals.h"
@@ -30,9 +33,19 @@ F("postdomtree", "Post-Dominator Tree Construction", true, true);
 
 bool PostDominatorTree::runOnFunction(Function &F) {
   DT->recalculate(F);
+  DEBUG(DT->dump());
   return false;
 }
 
+PostDominatorTree::~PostDominatorTree()
+{
+  delete DT;
+}
+
+FunctionPass* llvm::createPostDomTree() {
+  return new PostDominatorTree();
+}
+
 //===----------------------------------------------------------------------===//
 //  PostDominanceFrontier Implementation
 //===----------------------------------------------------------------------===//
@@ -76,5 +89,6 @@ PostDominanceFrontier::calculate(const PostDominatorTree &DT,
   return S;
 }
 
-// Ensure that this .cpp file gets linked when PostDominators.h is used.
-DEFINING_FILE_FOR(PostDominanceFrontier)
+FunctionPass* llvm::createPostDomFrontier() {
+  return new PostDominanceFrontier();
+}
\ No newline at end of file