summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2016-06-17 00:11:01 +0000
committerChandler Carruth <chandlerc@gmail.com>2016-06-17 00:11:01 +0000
commit164a2aa6f44956a242f4843c4c21f059a735411d (patch)
tree690c975226d809c46dde3d3d4496f2dbf9f5d3ad /llvm/lib/Transforms/IPO
parent5078f94690ec346b97b30c6b3d4a0f74d7ab1349 (diff)
downloadbcm5719-llvm-164a2aa6f44956a242f4843c4c21f059a735411d.tar.gz
bcm5719-llvm-164a2aa6f44956a242f4843c4c21f059a735411d.zip
[PM] Remove support for omitting the AnalysisManager argument to new
pass manager passes' `run` methods. This removes a bunch of SFINAE goop from the pass manager and just requires pass authors to accept `AnalysisManager<IRUnitT> &` as a dead argument. This is a small price to pay for the simplicity of the system as a whole, despite the noise that changing it causes at this stage. This will also helpfull allow us to make the signature of the run methods much more flexible for different kinds af passes to support things like intelligently updating the pass's progression over IR units. While this touches many, many, files, the changes are really boring. Mostly made with the help of my trusty perl one liners. Thanks to Sean and Hal for bouncing ideas for this with me in IRC. llvm-svn: 272978
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r--llvm/lib/Transforms/IPO/ConstantMerge.cpp2
-rw-r--r--llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp6
-rw-r--r--llvm/lib/Transforms/IPO/ElimAvailExtern.cpp3
-rw-r--r--llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp3
-rw-r--r--llvm/lib/Transforms/IPO/GlobalDCE.cpp5
-rw-r--r--llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp3
-rw-r--r--llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp3
7 files changed, 16 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/IPO/ConstantMerge.cpp b/llvm/lib/Transforms/IPO/ConstantMerge.cpp
index 65b042534f3..d75ed206ad2 100644
--- a/llvm/lib/Transforms/IPO/ConstantMerge.cpp
+++ b/llvm/lib/Transforms/IPO/ConstantMerge.cpp
@@ -192,7 +192,7 @@ static bool mergeConstants(Module &M) {
}
}
-PreservedAnalyses ConstantMergePass::run(Module &M) {
+PreservedAnalyses ConstantMergePass::run(Module &M, ModuleAnalysisManager &) {
if (!mergeConstants(M))
return PreservedAnalyses::all();
return PreservedAnalyses::none();
diff --git a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
index 3caaa4a3218..70b0bd8ee64 100644
--- a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
+++ b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
@@ -64,7 +64,8 @@ namespace {
if (skipModule(M))
return false;
DeadArgumentEliminationPass DAEP(ShouldHackArguments());
- PreservedAnalyses PA = DAEP.run(M);
+ ModuleAnalysisManager DummyMAM;
+ PreservedAnalyses PA = DAEP.run(M, DummyMAM);
return !PA.areAllPreserved();
}
@@ -1029,7 +1030,8 @@ bool DeadArgumentEliminationPass::RemoveDeadStuffFromFunction(Function *F) {
return true;
}
-PreservedAnalyses DeadArgumentEliminationPass::run(Module &M) {
+PreservedAnalyses DeadArgumentEliminationPass::run(Module &M,
+ ModuleAnalysisManager &) {
bool Changed = false;
// First pass: Do a simple check to see if any functions can have their "..."
diff --git a/llvm/lib/Transforms/IPO/ElimAvailExtern.cpp b/llvm/lib/Transforms/IPO/ElimAvailExtern.cpp
index b3ca10bd945..98c4b174030 100644
--- a/llvm/lib/Transforms/IPO/ElimAvailExtern.cpp
+++ b/llvm/lib/Transforms/IPO/ElimAvailExtern.cpp
@@ -61,7 +61,8 @@ static bool eliminateAvailableExternally(Module &M) {
return Changed;
}
-PreservedAnalyses EliminateAvailableExternallyPass::run(Module &M) {
+PreservedAnalyses
+EliminateAvailableExternallyPass::run(Module &M, ModuleAnalysisManager &) {
if (!eliminateAvailableExternally(M))
return PreservedAnalyses::all();
return PreservedAnalyses::none();
diff --git a/llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp b/llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp
index 6df044762cf..96871213820 100644
--- a/llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp
+++ b/llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp
@@ -80,7 +80,8 @@ static void addForcedAttributes(Function &F) {
}
}
-PreservedAnalyses ForceFunctionAttrsPass::run(Module &M) {
+PreservedAnalyses ForceFunctionAttrsPass::run(Module &M,
+ ModuleAnalysisManager &) {
if (ForceAttributes.empty())
return PreservedAnalyses::all();
diff --git a/llvm/lib/Transforms/IPO/GlobalDCE.cpp b/llvm/lib/Transforms/IPO/GlobalDCE.cpp
index fca549947c6..f30e69ccbcd 100644
--- a/llvm/lib/Transforms/IPO/GlobalDCE.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalDCE.cpp
@@ -50,7 +50,8 @@ namespace {
if (skipModule(M))
return false;
- auto PA = Impl.run(M);
+ ModuleAnalysisManager DummyMAM;
+ auto PA = Impl.run(M, DummyMAM);
return !PA.areAllPreserved();
}
@@ -77,7 +78,7 @@ static bool isEmptyFunction(Function *F) {
return RI.getReturnValue() == nullptr;
}
-PreservedAnalyses GlobalDCEPass::run(Module &M) {
+PreservedAnalyses GlobalDCEPass::run(Module &M, ModuleAnalysisManager &) {
bool Changed = false;
// Remove empty functions from the global ctors list.
diff --git a/llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp b/llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp
index 602fdfa8d74..3c3c5dd19d1 100644
--- a/llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp
+++ b/llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp
@@ -53,7 +53,8 @@ static bool stripDeadPrototypes(Module &M) {
return MadeChange;
}
-PreservedAnalyses StripDeadPrototypesPass::run(Module &M) {
+PreservedAnalyses StripDeadPrototypesPass::run(Module &M,
+ ModuleAnalysisManager &) {
if (stripDeadPrototypes(M))
return PreservedAnalyses::none();
return PreservedAnalyses::all();
diff --git a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
index 4a80e4f11c9..93ee07cf64e 100644
--- a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
+++ b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
@@ -280,7 +280,8 @@ ModulePass *llvm::createWholeProgramDevirtPass() {
return new WholeProgramDevirt;
}
-PreservedAnalyses WholeProgramDevirtPass::run(Module &M) {
+PreservedAnalyses WholeProgramDevirtPass::run(Module &M,
+ ModuleAnalysisManager &) {
if (!DevirtModule(M).run())
return PreservedAnalyses::all();
return PreservedAnalyses::none();
OpenPOWER on IntegriCloud