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() {
}
-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;