summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/IR/PassManagerTest.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2016-03-11 10:33:22 +0000
committerChandler Carruth <chandlerc@gmail.com>2016-03-11 10:33:22 +0000
commit30a073029c37b1c4fb49ad517677a9c74d1e6802 (patch)
tree2433f5b421bd407cc395c43ef4959417ff205f45 /llvm/unittests/IR/PassManagerTest.cpp
parentb4faf13c15596473468293d92940500dd16784b7 (diff)
downloadbcm5719-llvm-30a073029c37b1c4fb49ad517677a9c74d1e6802.tar.gz
bcm5719-llvm-30a073029c37b1c4fb49ad517677a9c74d1e6802.zip
[PM] Rename the CRTP mixin base classes for the new pass manager to
clarify their purpose. Firstly, call them "...Mixin" types so it is clear that there is no type hierarchy being formed here. Secondly, use the term 'Info' to clarify that they aren't adding any interesting *semantics* to the passes or analyses, just exposing APIs used by the management layer to get information about the pass or analysis. Thanks to Manuel for helping pin down the naming confusion here and come up with effective names to address it. In case you already have some out-of-tree stuff, the following should be roughly what you want to update: perl -pi -e 's/\b(Pass|Analysis)Base\b/\1InfoMixin/g' llvm-svn: 263217
Diffstat (limited to 'llvm/unittests/IR/PassManagerTest.cpp')
-rw-r--r--llvm/unittests/IR/PassManagerTest.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/llvm/unittests/IR/PassManagerTest.cpp b/llvm/unittests/IR/PassManagerTest.cpp
index c00748cadb9..68218cc6d59 100644
--- a/llvm/unittests/IR/PassManagerTest.cpp
+++ b/llvm/unittests/IR/PassManagerTest.cpp
@@ -19,7 +19,7 @@ using namespace llvm;
namespace {
-class TestFunctionAnalysis : public AnalysisBase<TestFunctionAnalysis> {
+class TestFunctionAnalysis : public AnalysisInfoMixin<TestFunctionAnalysis> {
public:
struct Result {
Result(int Count) : InstructionCount(Count) {}
@@ -40,7 +40,7 @@ public:
}
private:
- friend AnalysisBase<TestFunctionAnalysis>;
+ friend AnalysisInfoMixin<TestFunctionAnalysis>;
static char PassID;
int &Runs;
@@ -48,7 +48,7 @@ private:
char TestFunctionAnalysis::PassID;
-class TestModuleAnalysis : public AnalysisBase<TestModuleAnalysis> {
+class TestModuleAnalysis : public AnalysisInfoMixin<TestModuleAnalysis> {
public:
struct Result {
Result(int Count) : FunctionCount(Count) {}
@@ -66,7 +66,7 @@ public:
}
private:
- friend AnalysisBase<TestModuleAnalysis>;
+ friend AnalysisInfoMixin<TestModuleAnalysis>;
static char PassID;
int &Runs;
@@ -74,7 +74,7 @@ private:
char TestModuleAnalysis::PassID;
-struct TestModulePass : PassBase<TestModulePass> {
+struct TestModulePass : PassInfoMixin<TestModulePass> {
TestModulePass(int &RunCount) : RunCount(RunCount) {}
PreservedAnalyses run(Module &M) {
@@ -85,11 +85,12 @@ struct TestModulePass : PassBase<TestModulePass> {
int &RunCount;
};
-struct TestPreservingModulePass : PassBase<TestPreservingModulePass> {
+struct TestPreservingModulePass : PassInfoMixin<TestPreservingModulePass> {
PreservedAnalyses run(Module &M) { return PreservedAnalyses::all(); }
};
-struct TestMinPreservingModulePass : PassBase<TestMinPreservingModulePass> {
+struct TestMinPreservingModulePass
+ : PassInfoMixin<TestMinPreservingModulePass> {
PreservedAnalyses run(Module &M, ModuleAnalysisManager *AM) {
PreservedAnalyses PA;
@@ -101,7 +102,7 @@ struct TestMinPreservingModulePass : PassBase<TestMinPreservingModulePass> {
}
};
-struct TestFunctionPass : PassBase<TestFunctionPass> {
+struct TestFunctionPass : PassInfoMixin<TestFunctionPass> {
TestFunctionPass(int &RunCount, int &AnalyzedInstrCount,
int &AnalyzedFunctionCount,
bool OnlyUseCachedResults = false)
@@ -140,7 +141,8 @@ struct TestFunctionPass : PassBase<TestFunctionPass> {
// A test function pass that invalidates all function analyses for a function
// with a specific name.
-struct TestInvalidationFunctionPass : PassBase<TestInvalidationFunctionPass> {
+struct TestInvalidationFunctionPass
+ : PassInfoMixin<TestInvalidationFunctionPass> {
TestInvalidationFunctionPass(StringRef FunctionName) : Name(FunctionName) {}
PreservedAnalyses run(Function &F) {
OpenPOWER on IntegriCloud