[PM] Introduce CRTP mixin base classes to help define passes and

analyses in the new pass manager.

These just handle really basic stuff: turning a type name into a string
statically that is nice to print in logs, and getting a static unique ID
for each analysis.

Sadly, the format of passes in anonymous namespaces makes using their
names in tests really annoying so I've customized the names of the no-op
passes to keep tests sane to read.

This is the first of a few simplifying refactorings for the new pass
manager that should reduce boilerplate and confusion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262004 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chandler Carruth
2016-02-26 11:44:45 +00:00
parent 7768d8796b
commit adb60a3a11
59 changed files with 123 additions and 454 deletions
-8
View File
@@ -13,8 +13,6 @@
using namespace llvm;
char CGSCCAnalysisManagerModuleProxy::PassID;
CGSCCAnalysisManagerModuleProxy::Result
CGSCCAnalysisManagerModuleProxy::run(Module &M) {
assert(CGAM->empty() && "CGSCC analyses ran prior to the module proxy!");
@@ -44,10 +42,6 @@ bool CGSCCAnalysisManagerModuleProxy::Result::invalidate(
return false;
}
char ModuleAnalysisManagerCGSCCProxy::PassID;
char FunctionAnalysisManagerCGSCCProxy::PassID;
FunctionAnalysisManagerCGSCCProxy::Result
FunctionAnalysisManagerCGSCCProxy::run(LazyCallGraph::SCC &C) {
return Result(*FAM);
@@ -75,5 +69,3 @@ bool FunctionAnalysisManagerCGSCCProxy::Result::invalidate(
// Return false to indicate that this result is still a valid proxy.
return false;
}
char CGSCCAnalysisManagerFunctionProxy::PassID;