Avoid inserting an entry block unless we need it
[oota-llvm.git] / lib / Transforms / Scalar / PiNodeInsertion.cpp
index 2c16049684d71b26b498b78b7dbdec42fca5a51a..bf0119f2f3c359984eaf66d67d41064d639de800 100644 (file)
@@ -40,13 +40,11 @@ static Statistic<> NumInserted("pinodes\t\t- Number of Pi nodes inserted");
 
 namespace {
   struct PiNodeInserter : public FunctionPass {
-    const char *getPassName() const { return "Pi Node Insertion"; }
-    
     virtual bool runOnFunction(Function &F);
     
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.preservesCFG();
-      AU.addRequired(DominatorSet::ID);
+      AU.addRequired<DominatorSet>();
     }
 
     // insertPiNodeFor - Insert a Pi node for V in the successors of BB if our
@@ -56,6 +54,8 @@ namespace {
     //
     bool insertPiNodeFor(Value *V, BasicBlock *BB, Value *Rep = 0);
   };
+
+  RegisterOpt<PiNodeInserter> X("pinodes", "Pi Node Insertion");
 }
 
 Pass *createPiNodeInsertionPass() { return new PiNodeInserter(); }