Function.h is unnecessary when Module.h is included.
[oota-llvm.git] / lib / Transforms / Scalar / ConstantProp.cpp
index 720266ce1874997793708a7eb64fe6c3da30fa9c..5da909e2020bc68ddaa04894ff7f84fdcf3b1067 100644 (file)
@@ -24,14 +24,14 @@ static Statistic<> NumInstKilled("constprop - Number of instructions killed");
 
 namespace {
   struct ConstantPropogation : public FunctionPass {
-    const char *getPassName() const { return "Simple Constant Propogation"; }
-
-    bool runOnFunction(Function *F);
+    bool runOnFunction(Function &F);
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.preservesCFG();
     }
   };
+
+  RegisterOpt<ConstantPropogation> X("constprop","Simple constant propogation");
 }
 
 Pass *createConstantPropogationPass() {
@@ -39,7 +39,7 @@ Pass *createConstantPropogationPass() {
 }
 
 
-bool ConstantPropogation::runOnFunction(Function *F) {
+bool ConstantPropogation::runOnFunction(Function &F) {
   // Initialize the worklist to all of the instructions ready to process...
   std::set<Instruction*> WorkList(inst_begin(F), inst_end(F));
   bool Changed = false;