summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2015-05-12 21:21:18 +0000
committerPhilip Reames <listmail@philipreames.com>2015-05-12 21:21:18 +0000
commit7b9817927ab3c88527907bf0a87f0ef326a050d8 (patch)
treebd9fa59e1538dcd8b485be47b6ff1fdc6900ffc0 /llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
parentbef5ff3035f7b19422184394beec0ed5904e60fe (diff)
downloadbcm5719-llvm-7b9817927ab3c88527907bf0a87f0ef326a050d8.tar.gz
bcm5719-llvm-7b9817927ab3c88527907bf0a87f0ef326a050d8.zip
[PlaceSafepoints] Switch to being a FunctionPass
The pass doesn't actually modify the module outside of the function being processed. The only confusing piece is that it both inserts calls and then inlines the resulting calls. Given that, it definitely invalidates module level analysis results, but many FunctionPasses do that. Differential Revision: http://reviews.llvm.org/D9590 llvm-svn: 237185
Diffstat (limited to 'llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
index 06b642c73c3..5c3f6131625 100644
--- a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
+++ b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
@@ -166,20 +166,13 @@ static cl::opt<bool> NoCall("spp-no-call", cl::Hidden, cl::init(false));
static cl::opt<bool> 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
@@ -755,7 +748,9 @@ bool PlaceSafepoints::runOnFunction(Function &F) {
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",
OpenPOWER on IntegriCloud