Index: include/llvm/Transforms/Scalar.h =================================================================== --- include/llvm/Transforms/Scalar.h +++ include/llvm/Transforms/Scalar.h @@ -442,7 +442,7 @@ // RewriteStatepointsForGC which can be run at an arbitrary point in the pass // order following this pass. // -ModulePass *createPlaceSafepointsPass(); +FunctionPass *createPlaceSafepointsPass(); //===----------------------------------------------------------------------===// // Index: lib/Transforms/Scalar/PlaceSafepoints.cpp =================================================================== --- lib/Transforms/Scalar/PlaceSafepoints.cpp +++ lib/Transforms/Scalar/PlaceSafepoints.cpp @@ -166,20 +166,13 @@ static cl::opt NoBackedge("spp-no-backedge", cl::Hidden, cl::init(false)); namespace { -struct PlaceSafepoints : public ModulePass { +struct PlaceSafepoints : public FunctionPass { static char ID; // Pass identification, replacement for typeid - PlaceSafepoints() : ModulePass(ID) { + PlaceSafepoints() : FunctionPass(ID) { initializePlaceSafepointsPass(*PassRegistry::getPassRegistry()); } - bool runOnModule(Module &M) override { - bool modified = false; - for (Function &F : M) { - modified |= runOnFunction(F); - } - return modified; - } - bool runOnFunction(Function &F); + bool runOnFunction(Function &F) override; void getAnalysisUsage(AnalysisUsage &AU) const override { // We modify the graph wholesale (inlining, block insertion, etc). We @@ -738,7 +731,9 @@ char PlaceBackedgeSafepointsImpl::ID = 0; char PlaceSafepoints::ID = 0; -ModulePass *llvm::createPlaceSafepointsPass() { return new PlaceSafepoints(); } +FunctionPass *llvm::createPlaceSafepointsPass() { + return new PlaceSafepoints(); +} INITIALIZE_PASS_BEGIN(PlaceBackedgeSafepointsImpl, "place-backedge-safepoints-impl",