<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 26, 2016 at 7:09 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@gmail.com" target="_blank">chandlerc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, Feb 26, 2016 at 8:10 AM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Awesome! - though I'm curious why you chose to place this detail in the pass implementations, rather than hardcoding it into the pass manager itself? (it's a win, no doubt - trading some boilerplate for less boilerplate, but it seems like it could remove the boilerplate entirely if the pass manager did this work itself instead)</div></blockquote><div><br></div><div>Because it lets passes customize the behavior if desired. For example, the NoOp passes and analyses avoid the ugly anonymous namespace prefix by supplying their own name. It seemed like a nice tradeoff in that sense.</div></div></div></blockquote><div><br></div><div>Eh, fair enough.<br><br>Would a template (that users could specialize) work too (removing the boilerplate, but making it opt-in)? (or something like std::swap - overloaded & with ADL)<br><br>No big deal, just tossing around some ideas.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><br><div class="gmail_quote"></div></div><div class="gmail_extra"><div class="gmail_quote">On Fri, Feb 26, 2016 at 3:44 AM, Chandler Carruth via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: chandlerc<br>
Date: Fri Feb 26 05:44:45 2016<br>
New Revision: 262004<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=262004&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=262004&view=rev</a><br>
Log:<br>
[PM] Introduce CRTP mixin base classes to help define passes and<br>
analyses in the new pass manager.<br>
<br>
These just handle really basic stuff: turning a type name into a string<br>
statically that is nice to print in logs, and getting a static unique ID<br>
for each analysis.<br>
<br>
Sadly, the format of passes in anonymous namespaces makes using their<br>
names in tests really annoying so I've customized the names of the no-op<br>
passes to keep tests sane to read.<br>
<br>
This is the first of a few simplifying refactorings for the new pass<br>
manager that should reduce boilerplate and confusion.<br>
<br>
Modified:<br>
llvm/trunk/include/llvm/Analysis/AliasAnalysis.h<br>
llvm/trunk/include/llvm/Analysis/AliasAnalysisEvaluator.h<br>
llvm/trunk/include/llvm/Analysis/AssumptionCache.h<br>
llvm/trunk/include/llvm/Analysis/BasicAliasAnalysis.h<br>
llvm/trunk/include/llvm/Analysis/CFLAliasAnalysis.h<br>
llvm/trunk/include/llvm/Analysis/CGSCCPassManager.h<br>
llvm/trunk/include/llvm/Analysis/CallGraph.h<br>
llvm/trunk/include/llvm/Analysis/DominanceFrontier.h<br>
llvm/trunk/include/llvm/Analysis/GlobalsModRef.h<br>
llvm/trunk/include/llvm/Analysis/LazyCallGraph.h<br>
llvm/trunk/include/llvm/Analysis/LoopInfo.h<br>
llvm/trunk/include/llvm/Analysis/LoopPassManager.h<br>
llvm/trunk/include/llvm/Analysis/ObjCARCAliasAnalysis.h<br>
llvm/trunk/include/llvm/Analysis/PostDominators.h<br>
llvm/trunk/include/llvm/Analysis/RegionInfo.h<br>
llvm/trunk/include/llvm/Analysis/ScalarEvolution.h<br>
llvm/trunk/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h<br>
llvm/trunk/include/llvm/Analysis/ScopedNoAliasAA.h<br>
llvm/trunk/include/llvm/Analysis/TargetLibraryInfo.h<br>
llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h<br>
llvm/trunk/include/llvm/Analysis/TypeBasedAliasAnalysis.h<br>
llvm/trunk/include/llvm/IR/Dominators.h<br>
llvm/trunk/include/llvm/IR/PassManager.h<br>
llvm/trunk/include/llvm/IR/Verifier.h<br>
llvm/trunk/include/llvm/Transforms/IPO/ForceFunctionAttrs.h<br>
llvm/trunk/include/llvm/Transforms/IPO/FunctionAttrs.h<br>
llvm/trunk/include/llvm/Transforms/IPO/InferFunctionAttrs.h<br>
llvm/trunk/include/llvm/Transforms/IPO/StripDeadPrototypes.h<br>
llvm/trunk/include/llvm/Transforms/InstCombine/InstCombine.h<br>
llvm/trunk/include/llvm/Transforms/Scalar/ADCE.h<br>
llvm/trunk/include/llvm/Transforms/Scalar/EarlyCSE.h<br>
llvm/trunk/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h<br>
llvm/trunk/include/llvm/Transforms/Scalar/SROA.h<br>
llvm/trunk/include/llvm/Transforms/Scalar/SimplifyCFG.h<br>
llvm/trunk/lib/Analysis/AliasAnalysis.cpp<br>
llvm/trunk/lib/Analysis/AssumptionCache.cpp<br>
llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp<br>
llvm/trunk/lib/Analysis/CFLAliasAnalysis.cpp<br>
llvm/trunk/lib/Analysis/CGSCCPassManager.cpp<br>
llvm/trunk/lib/Analysis/CallGraph.cpp<br>
llvm/trunk/lib/Analysis/DominanceFrontier.cpp<br>
llvm/trunk/lib/Analysis/GlobalsModRef.cpp<br>
llvm/trunk/lib/Analysis/LazyCallGraph.cpp<br>
llvm/trunk/lib/Analysis/LoopInfo.cpp<br>
llvm/trunk/lib/Analysis/LoopPassManager.cpp<br>
llvm/trunk/lib/Analysis/ObjCARCAliasAnalysis.cpp<br>
llvm/trunk/lib/Analysis/PostDominators.cpp<br>
llvm/trunk/lib/Analysis/RegionInfo.cpp<br>
llvm/trunk/lib/Analysis/ScalarEvolution.cpp<br>
llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp<br>
llvm/trunk/lib/Analysis/ScopedNoAliasAA.cpp<br>
llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp<br>
llvm/trunk/lib/Analysis/TargetTransformInfo.cpp<br>
llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp<br>
llvm/trunk/lib/IR/Dominators.cpp<br>
llvm/trunk/lib/IR/PassManager.cpp<br>
llvm/trunk/lib/Passes/PassBuilder.cpp<br>
llvm/trunk/test/Other/new-pass-manager.ll<br>
llvm/trunk/unittests/IR/PassManagerTest.cpp<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysis.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysis.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/AliasAnalysis.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Fri Feb 26 05:44:45 2016<br>
@@ -979,16 +979,10 @@ bool isIdentifiedFunctionLocal(const Val<br>
/// This manager effectively wraps the AnalysisManager for registering alias<br>
/// analyses. When you register your alias analysis with this manager, it will<br>
/// ensure the analysis itself is registered with its AnalysisManager.<br>
-class AAManager {<br>
+class AAManager : public AnalysisBase<AAManager> {<br>
public:<br>
typedef AAResults Result;<br>
<br>
- /// \brief Opaque, unique identifier for this analysis pass.<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
- /// \brief Provide access to a name for this pass.<br>
- static StringRef name() { return "AAManager"; }<br>
-<br>
// This type hase value semantics. We have to spell these out because MSVC<br>
// won't synthesize them.<br>
AAManager() {}<br>
@@ -1018,8 +1012,6 @@ public:<br>
}<br>
<br>
private:<br>
- static char PassID;<br>
-<br>
SmallVector<void (*)(Function &F, AnalysisManager<Function> &AM,<br>
AAResults &AAResults),<br>
4> FunctionResultGetters;<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysisEvaluator.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysisEvaluator.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysisEvaluator.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/AliasAnalysisEvaluator.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/AliasAnalysisEvaluator.h Fri Feb 26 05:44:45 2016<br>
@@ -26,7 +26,7 @@<br>
namespace llvm {<br>
class AAResults;<br>
<br>
-class AAEvaluator {<br>
+class AAEvaluator : public PassBase<AAEvaluator> {<br>
int64_t FunctionCount;<br>
int64_t NoAliasCount, MayAliasCount, PartialAliasCount, MustAliasCount;<br>
int64_t NoModRefCount, ModCount, RefCount, ModRefCount;<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/AssumptionCache.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AssumptionCache.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AssumptionCache.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/AssumptionCache.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/AssumptionCache.h Fri Feb 26 05:44:45 2016<br>
@@ -93,18 +93,9 @@ public:<br>
///<br>
/// This analysis is intended for use with the new pass manager and will vend<br>
/// assumption caches for a given function.<br>
-class AssumptionAnalysis {<br>
- static char PassID;<br>
-<br>
-public:<br>
+struct AssumptionAnalysis : AnalysisBase<AssumptionAnalysis> {<br>
typedef AssumptionCache Result;<br>
<br>
- /// \brief Opaque, unique identifier for this analysis pass.<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
- /// \brief Provide a name for the analysis for debugging and logging.<br>
- static StringRef name() { return "AssumptionAnalysis"; }<br>
-<br>
AssumptionAnalysis() {}<br>
AssumptionAnalysis(const AssumptionAnalysis &Arg) {}<br>
AssumptionAnalysis(AssumptionAnalysis &&Arg) {}<br>
@@ -115,7 +106,7 @@ public:<br>
};<br>
<br>
/// \brief Printer pass for the \c AssumptionAnalysis results.<br>
-class AssumptionPrinterPass {<br>
+class AssumptionPrinterPass : public PassBase<AssumptionPrinterPass> {<br>
raw_ostream &OS;<br>
<br>
public:<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/BasicAliasAnalysis.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/BasicAliasAnalysis.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/BasicAliasAnalysis.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/BasicAliasAnalysis.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/BasicAliasAnalysis.h Fri Feb 26 05:44:45 2016<br>
@@ -178,20 +178,10 @@ private:<br>
};<br>
<br>
/// Analysis pass providing a never-invalidated alias analysis result.<br>
-class BasicAA {<br>
-public:<br>
+struct BasicAA : AnalysisBase<BasicAA> {<br>
typedef BasicAAResult Result;<br>
<br>
- /// \brief Opaque, unique identifier for this analysis pass.<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
- /// \brief Provide access to a name for this pass for debugging purposes.<br>
- static StringRef name() { return "BasicAA"; }<br>
-<br>
BasicAAResult run(Function &F, AnalysisManager<Function> *AM);<br>
-<br>
-private:<br>
- static char PassID;<br>
};<br>
<br>
/// Legacy wrapper pass to provide the BasicAAResult object.<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/CFLAliasAnalysis.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/CFLAliasAnalysis.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/CFLAliasAnalysis.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/CFLAliasAnalysis.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/CFLAliasAnalysis.h Fri Feb 26 05:44:45 2016<br>
@@ -109,20 +109,10 @@ private:<br>
///<br>
/// FIXME: We really should refactor CFL to use the analysis more heavily, and<br>
/// in particular to leverage invalidation to trigger re-computation of sets.<br>
-class CFLAA {<br>
-public:<br>
+struct CFLAA : AnalysisBase<CFLAA> {<br>
typedef CFLAAResult Result;<br>
<br>
- /// \brief Opaque, unique identifier for this analysis pass.<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
CFLAAResult run(Function &F, AnalysisManager<Function> *AM);<br>
-<br>
- /// \brief Provide access to a name for this pass for debugging purposes.<br>
- static StringRef name() { return "CFLAA"; }<br>
-<br>
-private:<br>
- static char PassID;<br>
};<br>
<br>
/// Legacy wrapper pass to provide the CFLAAResult object.<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/CGSCCPassManager.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/CGSCCPassManager.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/CGSCCPassManager.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/CGSCCPassManager.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/CGSCCPassManager.h Fri Feb 26 05:44:45 2016<br>
@@ -52,7 +52,8 @@ typedef AnalysisManager<LazyCallGraph::S<br>
///<br>
/// Note that the proxy's result is a move-only object and represents ownership<br>
/// of the validity of the analyses in the \c CGSCCAnalysisManager it provides.<br>
-class CGSCCAnalysisManagerModuleProxy {<br>
+class CGSCCAnalysisManagerModuleProxy<br>
+ : public AnalysisBase<CGSCCAnalysisManagerModuleProxy> {<br>
public:<br>
class Result {<br>
public:<br>
@@ -92,10 +93,6 @@ public:<br>
CGSCCAnalysisManager *CGAM;<br>
};<br>
<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
- static StringRef name() { return "CGSCCAnalysisManagerModuleProxy"; }<br>
-<br>
explicit CGSCCAnalysisManagerModuleProxy(CGSCCAnalysisManager &CGAM)<br>
: CGAM(&CGAM) {}<br>
// We have to explicitly define all the special member functions because MSVC<br>
@@ -122,8 +119,6 @@ public:<br>
Result run(Module &M);<br>
<br>
private:<br>
- static char PassID;<br>
-<br>
CGSCCAnalysisManager *CGAM;<br>
};<br>
<br>
@@ -139,7 +134,8 @@ private:<br>
/// This proxy *doesn't* manage the invalidation in any way. That is handled by<br>
/// the recursive return path of each layer of the pass manager and the<br>
/// returned PreservedAnalysis set.<br>
-class ModuleAnalysisManagerCGSCCProxy {<br>
+class ModuleAnalysisManagerCGSCCProxy<br>
+ : public AnalysisBase<ModuleAnalysisManagerCGSCCProxy> {<br>
public:<br>
/// \brief Result proxy object for \c ModuleAnalysisManagerCGSCCProxy.<br>
class Result {<br>
@@ -163,10 +159,6 @@ public:<br>
const ModuleAnalysisManager *MAM;<br>
};<br>
<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
- static StringRef name() { return "ModuleAnalysisManagerCGSCCProxy"; }<br>
-<br>
ModuleAnalysisManagerCGSCCProxy(const ModuleAnalysisManager &MAM)<br>
: MAM(&MAM) {}<br>
// We have to explicitly define all the special member functions because MSVC<br>
@@ -187,8 +179,6 @@ public:<br>
Result run(LazyCallGraph::SCC &) { return Result(*MAM); }<br>
<br>
private:<br>
- static char PassID;<br>
-<br>
const ModuleAnalysisManager *MAM;<br>
};<br>
<br>
@@ -201,7 +191,9 @@ private:<br>
/// \c CGSCCAnalysisManagerModuleProxy analysis prior to running the CGSCC<br>
/// pass over the module to enable a \c FunctionAnalysisManager to be used<br>
/// within this run safely.<br>
-template <typename CGSCCPassT> class ModuleToPostOrderCGSCCPassAdaptor {<br>
+template <typename CGSCCPassT><br>
+class ModuleToPostOrderCGSCCPassAdaptor<br>
+ : public PassBase<ModuleToPostOrderCGSCCPassAdaptor<CGSCCPassT>> {<br>
public:<br>
explicit ModuleToPostOrderCGSCCPassAdaptor(CGSCCPassT Pass)<br>
: Pass(std::move(Pass)) {}<br>
@@ -262,8 +254,6 @@ public:<br>
return PA;<br>
}<br>
<br>
- static StringRef name() { return "ModuleToPostOrderCGSCCPassAdaptor"; }<br>
-<br>
private:<br>
CGSCCPassT Pass;<br>
};<br>
@@ -288,7 +278,8 @@ createModuleToPostOrderCGSCCPassAdaptor(<br>
/// Note that the proxy's result is a move-only object and represents ownership<br>
/// of the validity of the analyses in the \c FunctionAnalysisManager it<br>
/// provides.<br>
-class FunctionAnalysisManagerCGSCCProxy {<br>
+class FunctionAnalysisManagerCGSCCProxy<br>
+ : public AnalysisBase<FunctionAnalysisManagerCGSCCProxy> {<br>
public:<br>
class Result {<br>
public:<br>
@@ -328,10 +319,6 @@ public:<br>
FunctionAnalysisManager *FAM;<br>
};<br>
<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
- static StringRef name() { return "FunctionAnalysisManagerCGSCCProxy"; }<br>
-<br>
explicit FunctionAnalysisManagerCGSCCProxy(FunctionAnalysisManager &FAM)<br>
: FAM(&FAM) {}<br>
// We have to explicitly define all the special member functions because MSVC<br>
@@ -359,8 +346,6 @@ public:<br>
Result run(LazyCallGraph::SCC &C);<br>
<br>
private:<br>
- static char PassID;<br>
-<br>
FunctionAnalysisManager *FAM;<br>
};<br>
<br>
@@ -376,7 +361,8 @@ private:<br>
/// This proxy *doesn't* manage the invalidation in any way. That is handled by<br>
/// the recursive return path of each layer of the pass manager and the<br>
/// returned PreservedAnalysis set.<br>
-class CGSCCAnalysisManagerFunctionProxy {<br>
+class CGSCCAnalysisManagerFunctionProxy<br>
+ : public AnalysisBase<CGSCCAnalysisManagerFunctionProxy> {<br>
public:<br>
/// \brief Result proxy object for \c CGSCCAnalysisManagerFunctionProxy.<br>
class Result {<br>
@@ -400,10 +386,6 @@ public:<br>
const CGSCCAnalysisManager *CGAM;<br>
};<br>
<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
- static StringRef name() { return "CGSCCAnalysisManagerFunctionProxy"; }<br>
-<br>
CGSCCAnalysisManagerFunctionProxy(const CGSCCAnalysisManager &CGAM)<br>
: CGAM(&CGAM) {}<br>
// We have to explicitly define all the special member functions because MSVC<br>
@@ -425,8 +407,6 @@ public:<br>
Result run(Function &) { return Result(*CGAM); }<br>
<br>
private:<br>
- static char PassID;<br>
-<br>
const CGSCCAnalysisManager *CGAM;<br>
};<br>
<br>
@@ -438,7 +418,9 @@ private:<br>
/// \c FunctionAnalysisManagerCGSCCProxy analysis prior to running the function<br>
/// pass over the SCC to enable a \c FunctionAnalysisManager to be used<br>
/// within this run safely.<br>
-template <typename FunctionPassT> class CGSCCToFunctionPassAdaptor {<br>
+template <typename FunctionPassT><br>
+class CGSCCToFunctionPassAdaptor<br>
+ : public PassBase<CGSCCToFunctionPassAdaptor<FunctionPassT>> {<br>
public:<br>
explicit CGSCCToFunctionPassAdaptor(FunctionPassT Pass)<br>
: Pass(std::move(Pass)) {}<br>
@@ -492,8 +474,6 @@ public:<br>
return PA;<br>
}<br>
<br>
- static StringRef name() { return "CGSCCToFunctionPassAdaptor"; }<br>
-<br>
private:<br>
FunctionPassT Pass;<br>
};<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/CallGraph.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/CallGraph.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/CallGraph.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/CallGraph.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/CallGraph.h Fri Feb 26 05:44:45 2016<br>
@@ -57,6 +57,7 @@<br>
#include "llvm/IR/CallSite.h"<br>
#include "llvm/IR/Function.h"<br>
#include "llvm/IR/Intrinsics.h"<br>
+#include "llvm/IR/PassManager.h"<br>
#include "llvm/IR/ValueHandle.h"<br>
#include "llvm/Pass.h"<br>
#include <map><br>
@@ -294,20 +295,15 @@ private:<br>
/// This class implements the concept of an analysis pass used by the \c<br>
/// ModuleAnalysisManager to run an analysis over a module and cache the<br>
/// resulting data.<br>
-class CallGraphAnalysis {<br>
+struct CallGraphAnalysis : AnalysisBase<CallGraphAnalysis> {<br>
public:<br>
/// \brief A formulaic typedef to inform clients of the result type.<br>
typedef CallGraph Result;<br>
<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
/// \brief Compute the \c CallGraph for the module \c M.<br>
///<br>
/// The real work here is done in the \c CallGraph constructor.<br>
CallGraph run(Module *M) { return CallGraph(*M); }<br>
-<br>
-private:<br>
- static char PassID;<br>
};<br>
<br>
/// \brief The \c ModulePass which wraps up a \c CallGraph and the logic to<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/DominanceFrontier.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DominanceFrontier.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DominanceFrontier.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/DominanceFrontier.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/DominanceFrontier.h Fri Feb 26 05:44:45 2016<br>
@@ -168,33 +168,22 @@ extern template class DominanceFrontierB<br>
extern template class ForwardDominanceFrontierBase<BasicBlock>;<br>
<br>
/// \brief Analysis pass which computes a \c DominanceFrontier.<br>
-class DominanceFrontierAnalysis {<br>
-public:<br>
+struct DominanceFrontierAnalysis : AnalysisBase<DominanceFrontierAnalysis> {<br>
/// \brief Provide the result typedef for this analysis pass.<br>
typedef DominanceFrontier Result;<br>
<br>
- /// \brief Opaque, unique identifier for this analysis pass.<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
/// \brief Run the analysis pass over a function and produce a dominator tree.<br>
DominanceFrontier run(Function &F, AnalysisManager<Function> *AM);<br>
-<br>
- /// \brief Provide access to a name for this pass for debugging purposes.<br>
- static StringRef name() { return "DominanceFrontierAnalysis"; }<br>
-<br>
-private:<br>
- static char PassID;<br>
};<br>
<br>
/// \brief Printer pass for the \c DominanceFrontier.<br>
-class DominanceFrontierPrinterPass {<br>
+class DominanceFrontierPrinterPass<br>
+ : public PassBase<DominanceFrontierPrinterPass> {<br>
raw_ostream &OS;<br>
<br>
public:<br>
explicit DominanceFrontierPrinterPass(raw_ostream &OS);<br>
PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM);<br>
-<br>
- static StringRef name() { return "DominanceFrontierAnalysis"; }<br>
};<br>
<br>
} // End llvm namespace<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/GlobalsModRef.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/GlobalsModRef.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/GlobalsModRef.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/GlobalsModRef.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/GlobalsModRef.h Fri Feb 26 05:44:45 2016<br>
@@ -116,20 +116,10 @@ private:<br>
};<br>
<br>
/// Analysis pass providing a never-invalidated alias analysis result.<br>
-class GlobalsAA {<br>
-public:<br>
+struct GlobalsAA : AnalysisBase<GlobalsAA> {<br>
typedef GlobalsAAResult Result;<br>
<br>
- /// \brief Opaque, unique identifier for this analysis pass.<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
GlobalsAAResult run(Module &M, AnalysisManager<Module> *AM);<br>
-<br>
- /// \brief Provide access to a name for this pass for debugging purposes.<br>
- static StringRef name() { return "GlobalsAA"; }<br>
-<br>
-private:<br>
- static char PassID;<br>
};<br>
<br>
/// Legacy wrapper pass to provide the GlobalsAAResult object.<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/LazyCallGraph.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LazyCallGraph.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LazyCallGraph.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/LazyCallGraph.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/LazyCallGraph.h Fri Feb 26 05:44:45 2016<br>
@@ -895,37 +895,27 @@ template <> struct GraphTraits<LazyCallG<br>
};<br>
<br>
/// An analysis pass which computes the call graph for a module.<br>
-class LazyCallGraphAnalysis {<br>
-public:<br>
+struct LazyCallGraphAnalysis : AnalysisBase<LazyCallGraphAnalysis> {<br>
/// Inform generic clients of the result type.<br>
typedef LazyCallGraph Result;<br>
<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
- static StringRef name() { return "Lazy CallGraph Analysis"; }<br>
-<br>
/// Compute the \c LazyCallGraph for the module \c M.<br>
///<br>
/// This just builds the set of entry points to the call graph. The rest is<br>
/// built lazily as it is walked.<br>
LazyCallGraph run(Module &M) { return LazyCallGraph(M); }<br>
-<br>
-private:<br>
- static char PassID;<br>
};<br>
<br>
/// A pass which prints the call graph to a \c raw_ostream.<br>
///<br>
/// This is primarily useful for testing the analysis.<br>
-class LazyCallGraphPrinterPass {<br>
+class LazyCallGraphPrinterPass : public PassBase<LazyCallGraphPrinterPass> {<br>
raw_ostream &OS;<br>
<br>
public:<br>
explicit LazyCallGraphPrinterPass(raw_ostream &OS);<br>
<br>
PreservedAnalyses run(Module &M, ModuleAnalysisManager *AM);<br>
-<br>
- static StringRef name() { return "LazyCallGraphPrinterPass"; }<br>
};<br>
<br>
}<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Fri Feb 26 05:44:45 2016<br>
@@ -787,30 +787,19 @@ template <> struct GraphTraits<Loop*> {<br>
};<br>
<br>
/// \brief Analysis pass that exposes the \c LoopInfo for a function.<br>
-class LoopAnalysis {<br>
- static char PassID;<br>
-<br>
-public:<br>
+struct LoopAnalysis : AnalysisBase<LoopAnalysis> {<br>
typedef LoopInfo Result;<br>
<br>
- /// \brief Opaque, unique identifier for this analysis pass.<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
- /// \brief Provide a name for the analysis for debugging and logging.<br>
- static StringRef name() { return "LoopAnalysis"; }<br>
-<br>
LoopInfo run(Function &F, AnalysisManager<Function> *AM);<br>
};<br>
<br>
/// \brief Printer pass for the \c LoopAnalysis results.<br>
-class LoopPrinterPass {<br>
+class LoopPrinterPass : public PassBase<LoopPrinterPass> {<br>
raw_ostream &OS;<br>
<br>
public:<br>
explicit LoopPrinterPass(raw_ostream &OS) : OS(OS) {}<br>
PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM);<br>
-<br>
- static StringRef name() { return "LoopPrinterPass"; }<br>
};<br>
<br>
/// \brief The legacy pass manager's analysis pass to compute loop information.<br>
@@ -840,7 +829,7 @@ public:<br>
};<br>
<br>
/// \brief Pass for printing a loop's contents as LLVM's text IR assembly.<br>
-class PrintLoopPass {<br>
+class PrintLoopPass : public PassBase<PrintLoopPass> {<br>
raw_ostream &OS;<br>
std::string Banner;<br>
<br>
@@ -849,7 +838,6 @@ public:<br>
PrintLoopPass(raw_ostream &OS, const std::string &Banner = "");<br>
<br>
PreservedAnalyses run(Loop &L);<br>
- static StringRef name() { return "PrintLoopPass"; }<br>
};<br>
<br>
} // End llvm namespace<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/LoopPassManager.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopPassManager.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopPassManager.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/LoopPassManager.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/LoopPassManager.h Fri Feb 26 05:44:45 2016<br>
@@ -44,7 +44,8 @@ typedef AnalysisManager<Loop> LoopAnalys<br>
/// never use a loop analysis manager from within (transitively) a function<br>
/// pass manager unless your parent function pass has received a proxy result<br>
/// object for it.<br>
-class LoopAnalysisManagerFunctionProxy {<br>
+class LoopAnalysisManagerFunctionProxy<br>
+ : public AnalysisBase<LoopAnalysisManagerFunctionProxy> {<br>
public:<br>
class Result {<br>
public:<br>
@@ -77,10 +78,6 @@ public:<br>
LoopAnalysisManager *LAM;<br>
};<br>
<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
- static StringRef name() { return "LoopAnalysisManagerFunctionProxy"; }<br>
-<br>
explicit LoopAnalysisManagerFunctionProxy(LoopAnalysisManager &LAM)<br>
: LAM(&LAM) {}<br>
// We have to explicitly define all the special member functions because MSVC<br>
@@ -107,8 +104,6 @@ public:<br>
Result run(Function &F);<br>
<br>
private:<br>
- static char PassID;<br>
-<br>
LoopAnalysisManager *LAM;<br>
};<br>
<br>
@@ -124,7 +119,8 @@ private:<br>
/// This proxy *doesn't* manage the invalidation in any way. That is handled by<br>
/// the recursive return path of each layer of the pass manager and the<br>
/// returned PreservedAnalysis set.<br>
-class FunctionAnalysisManagerLoopProxy {<br>
+class FunctionAnalysisManagerLoopProxy<br>
+ : public AnalysisBase<FunctionAnalysisManagerLoopProxy> {<br>
public:<br>
/// \brief Result proxy object for \c FunctionAnalysisManagerLoopProxy.<br>
class Result {<br>
@@ -148,10 +144,6 @@ public:<br>
const FunctionAnalysisManager *FAM;<br>
};<br>
<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
- static StringRef name() { return "FunctionAnalysisManagerLoopProxy"; }<br>
-<br>
FunctionAnalysisManagerLoopProxy(const FunctionAnalysisManager &FAM)<br>
: FAM(&FAM) {}<br>
// We have to explicitly define all the special member functions because MSVC<br>
@@ -172,8 +164,6 @@ public:<br>
Result run(Loop &) { return Result(*FAM); }<br>
<br>
private:<br>
- static char PassID;<br>
-<br>
const FunctionAnalysisManager *FAM;<br>
};<br>
<br>
@@ -184,7 +174,9 @@ private:<br>
/// FunctionAnalysisManager it will run the \c LoopAnalysisManagerFunctionProxy<br>
/// analysis prior to running the loop passes over the function to enable a \c<br>
/// LoopAnalysisManager to be used within this run safely.<br>
-template <typename LoopPassT> class FunctionToLoopPassAdaptor {<br>
+template <typename LoopPassT><br>
+class FunctionToLoopPassAdaptor<br>
+ : public PassBase<FunctionToLoopPassAdaptor<LoopPassT>> {<br>
public:<br>
explicit FunctionToLoopPassAdaptor(LoopPassT Pass)<br>
: Pass(std::move(Pass)) {}<br>
@@ -250,8 +242,6 @@ public:<br>
return PA;<br>
}<br>
<br>
- static StringRef name() { return "FunctionToLoopPassAdaptor"; }<br>
-<br>
private:<br>
LoopPassT Pass;<br>
};<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/ObjCARCAliasAnalysis.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ObjCARCAliasAnalysis.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ObjCARCAliasAnalysis.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/ObjCARCAliasAnalysis.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/ObjCARCAliasAnalysis.h Fri Feb 26 05:44:45 2016<br>
@@ -63,20 +63,10 @@ public:<br>
};<br>
<br>
/// Analysis pass providing a never-invalidated alias analysis result.<br>
-class ObjCARCAA {<br>
-public:<br>
+struct ObjCARCAA : AnalysisBase<ObjCARCAA> {<br>
typedef ObjCARCAAResult Result;<br>
<br>
- /// \brief Opaque, unique identifier for this analysis pass.<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
ObjCARCAAResult run(Function &F, AnalysisManager<Function> *AM);<br>
-<br>
- /// \brief Provide access to a name for this pass for debugging purposes.<br>
- static StringRef name() { return "ObjCARCAA"; }<br>
-<br>
-private:<br>
- static char PassID;<br>
};<br>
<br>
/// Legacy wrapper pass to provide the ObjCARCAAResult object.<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/PostDominators.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/PostDominators.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/PostDominators.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/PostDominators.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/PostDominators.h Fri Feb 26 05:44:45 2016<br>
@@ -37,34 +37,23 @@ struct PostDominatorTree : public Domina<br>
};<br>
<br>
/// \brief Analysis pass which computes a \c PostDominatorTree.<br>
-class PostDominatorTreeAnalysis {<br>
-public:<br>
+struct PostDominatorTreeAnalysis : AnalysisBase<PostDominatorTreeAnalysis> {<br>
/// \brief Provide the result typedef for this analysis pass.<br>
typedef PostDominatorTree Result;<br>
<br>
- /// \brief Opaque, unique identifier for this analysis pass.<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
/// \brief Run the analysis pass over a function and produce a post dominator<br>
/// tree.<br>
PostDominatorTree run(Function &F);<br>
-<br>
- /// \brief Provide access to a name for this pass for debugging purposes.<br>
- static StringRef name() { return "PostDominatorTreeAnalysis"; }<br>
-<br>
-private:<br>
- static char PassID;<br>
};<br>
<br>
/// \brief Printer pass for the \c PostDominatorTree.<br>
-class PostDominatorTreePrinterPass {<br>
+class PostDominatorTreePrinterPass<br>
+ : public PassBase<PostDominatorTreePrinterPass> {<br>
raw_ostream &OS;<br>
<br>
public:<br>
explicit PostDominatorTreePrinterPass(raw_ostream &OS);<br>
PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM);<br>
-<br>
- static StringRef name() { return "PostDominatorTreePrinterPass"; }<br>
};<br>
<br>
struct PostDominatorTreeWrapperPass : public FunctionPass {<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/RegionInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/RegionInfo.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/RegionInfo.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/RegionInfo.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/RegionInfo.h Fri Feb 26 05:44:45 2016<br>
@@ -923,37 +923,24 @@ public:<br>
};<br>
<br>
/// \brief Analysis pass that exposes the \c RegionInfo for a function.<br>
-class RegionInfoAnalysis {<br>
- static char PassID;<br>
-<br>
-public:<br>
+struct RegionInfoAnalysis : AnalysisBase<RegionInfoAnalysis> {<br>
typedef RegionInfo Result;<br>
<br>
- /// \brief Opaque, unique identifier for this analysis pass.<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
- /// \brief Provide a name for the analysis for debugging and logging.<br>
- static StringRef name() { return "RegionInfoAnalysis"; }<br>
-<br>
RegionInfo run(Function &F, AnalysisManager<Function> *AM);<br>
};<br>
<br>
/// \brief Printer pass for the \c RegionInfo.<br>
-class RegionInfoPrinterPass {<br>
+class RegionInfoPrinterPass : public PassBase<RegionInfoPrinterPass> {<br>
raw_ostream &OS;<br>
<br>
public:<br>
explicit RegionInfoPrinterPass(raw_ostream &OS);<br>
PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM);<br>
-<br>
- static StringRef name() { return "RegionInfoPrinterPass"; }<br>
};<br>
<br>
/// \brief Verifier pass for the \c RegionInfo.<br>
-struct RegionInfoVerifierPass {<br>
+struct RegionInfoVerifierPass : PassBase<RegionInfoVerifierPass> {<br>
PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM);<br>
-<br>
- static StringRef name() { return "RegionInfoVerifierPass"; }<br>
};<br>
<br>
template <><br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Fri Feb 26 05:44:45 2016<br>
@@ -1415,30 +1415,20 @@ namespace llvm {<br>
};<br>
<br>
/// \brief Analysis pass that exposes the \c ScalarEvolution for a function.<br>
- class ScalarEvolutionAnalysis {<br>
- static char PassID;<br>
-<br>
- public:<br>
+ struct ScalarEvolutionAnalysis : AnalysisBase<ScalarEvolutionAnalysis> {<br>
typedef ScalarEvolution Result;<br>
<br>
- /// \brief Opaque, unique identifier for this analysis pass.<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
- /// \brief Provide a name for the analysis for debugging and logging.<br>
- static StringRef name() { return "ScalarEvolutionAnalysis"; }<br>
-<br>
ScalarEvolution run(Function &F, AnalysisManager<Function> *AM);<br>
};<br>
<br>
/// \brief Printer pass for the \c ScalarEvolutionAnalysis results.<br>
- class ScalarEvolutionPrinterPass {<br>
+ class ScalarEvolutionPrinterPass<br>
+ : public PassBase<ScalarEvolutionPrinterPass> {<br>
raw_ostream &OS;<br>
<br>
public:<br>
explicit ScalarEvolutionPrinterPass(raw_ostream &OS) : OS(OS) {}<br>
PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM);<br>
-<br>
- static StringRef name() { return "ScalarEvolutionPrinterPass"; }<br>
};<br>
<br>
class ScalarEvolutionWrapperPass : public FunctionPass {<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h Fri Feb 26 05:44:45 2016<br>
@@ -39,20 +39,10 @@ private:<br>
};<br>
<br>
/// Analysis pass providing a never-invalidated alias analysis result.<br>
-class SCEVAA {<br>
-public:<br>
+struct SCEVAA : AnalysisBase<SCEVAA> {<br>
typedef SCEVAAResult Result;<br>
<br>
- /// \brief Opaque, unique identifier for this analysis pass.<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
SCEVAAResult run(Function &F, AnalysisManager<Function> *AM);<br>
-<br>
- /// \brief Provide access to a name for this pass for debugging purposes.<br>
- static StringRef name() { return "SCEVAA"; }<br>
-<br>
-private:<br>
- static char PassID;<br>
};<br>
<br>
/// Legacy wrapper pass to provide the SCEVAAResult object.<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/ScopedNoAliasAA.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScopedNoAliasAA.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScopedNoAliasAA.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/ScopedNoAliasAA.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/ScopedNoAliasAA.h Fri Feb 26 05:44:45 2016<br>
@@ -48,20 +48,10 @@ private:<br>
};<br>
<br>
/// Analysis pass providing a never-invalidated alias analysis result.<br>
-class ScopedNoAliasAA {<br>
-public:<br>
+struct ScopedNoAliasAA : AnalysisBase<ScopedNoAliasAA> {<br>
typedef ScopedNoAliasAAResult Result;<br>
<br>
- /// \brief Opaque, unique identifier for this analysis pass.<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
ScopedNoAliasAAResult run(Function &F, AnalysisManager<Function> *AM);<br>
-<br>
- /// \brief Provide access to a name for this pass for debugging purposes.<br>
- static StringRef name() { return "ScopedNoAliasAA"; }<br>
-<br>
-private:<br>
- static char PassID;<br>
};<br>
<br>
/// Legacy wrapper pass to provide the ScopedNoAliasAAResult object.<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/TargetLibraryInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/TargetLibraryInfo.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/TargetLibraryInfo.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/TargetLibraryInfo.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/TargetLibraryInfo.h Fri Feb 26 05:44:45 2016<br>
@@ -16,6 +16,7 @@<br>
#include "llvm/ADT/Triple.h"<br>
#include "llvm/IR/Function.h"<br>
#include "llvm/IR/Module.h"<br>
+#include "llvm/IR/PassManager.h"<br>
#include "llvm/Pass.h"<br>
<br>
namespace llvm {<br>
@@ -27,7 +28,6 @@ struct VecDesc {<br>
const char *VectorFnName;<br>
unsigned VectorizationFactor;<br>
};<br>
-class PreservedAnalyses;<br>
<br>
namespace LibFunc {<br>
enum Func {<br>
@@ -262,13 +262,10 @@ public:<br>
///<br>
/// Note that this pass's result cannot be invalidated, it is immutable for the<br>
/// life of the module.<br>
-class TargetLibraryAnalysis {<br>
+class TargetLibraryAnalysis : public AnalysisBase<TargetLibraryAnalysis> {<br>
public:<br>
typedef TargetLibraryInfo Result;<br>
<br>
- /// \brief Opaque, unique identifier for this analysis pass.<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
/// \brief Default construct the library analysis.<br>
///<br>
/// This will use the module's triple to construct the library info for that<br>
@@ -294,12 +291,7 @@ public:<br>
TargetLibraryInfo run(Module &M);<br>
TargetLibraryInfo run(Function &F);<br>
<br>
- /// \brief Provide access to a name for this pass for debugging purposes.<br>
- static StringRef name() { return "TargetLibraryAnalysis"; }<br>
-<br>
private:<br>
- static char PassID;<br>
-<br>
Optional<TargetLibraryInfoImpl> PresetInfoImpl;<br>
<br>
StringMap<std::unique_ptr<TargetLibraryInfoImpl>> Impls;<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h Fri Feb 26 05:44:45 2016<br>
@@ -25,6 +25,7 @@<br>
#include "llvm/ADT/Optional.h"<br>
#include "llvm/IR/IntrinsicInst.h"<br>
#include "llvm/IR/Intrinsics.h"<br>
+#include "llvm/IR/PassManager.h"<br>
#include "llvm/Pass.h"<br>
#include "llvm/Support/DataTypes.h"<br>
#include <functional><br>
@@ -34,7 +35,6 @@ namespace llvm {<br>
class Function;<br>
class GlobalValue;<br>
class Loop;<br>
-class PreservedAnalyses;<br>
class Type;<br>
class User;<br>
class Value;<br>
@@ -889,16 +889,10 @@ TargetTransformInfo::TargetTransformInfo<br>
/// is done in a subtarget specific way and LLVM supports compiling different<br>
/// functions targeting different subtargets in order to support runtime<br>
/// dispatch according to the observed subtarget.<br>
-class TargetIRAnalysis {<br>
+class TargetIRAnalysis : public AnalysisBase<TargetIRAnalysis> {<br>
public:<br>
typedef TargetTransformInfo Result;<br>
<br>
- /// \brief Opaque, unique identifier for this analysis pass.<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
- /// \brief Provide access to a name for this pass for debugging purposes.<br>
- static StringRef name() { return "TargetIRAnalysis"; }<br>
-<br>
/// \brief Default construct a target IR analysis.<br>
///<br>
/// This will use the module's datalayout to construct a baseline<br>
@@ -928,8 +922,6 @@ public:<br>
Result run(const Function &F);<br>
<br>
private:<br>
- static char PassID;<br>
-<br>
/// \brief The callback used to produce a result.<br>
///<br>
/// We use a completely opaque callback so that targets can provide whatever<br>
<br>
Modified: llvm/trunk/include/llvm/Analysis/TypeBasedAliasAnalysis.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/TypeBasedAliasAnalysis.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/TypeBasedAliasAnalysis.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Analysis/TypeBasedAliasAnalysis.h (original)<br>
+++ llvm/trunk/include/llvm/Analysis/TypeBasedAliasAnalysis.h Fri Feb 26 05:44:45 2016<br>
@@ -49,20 +49,10 @@ private:<br>
};<br>
<br>
/// Analysis pass providing a never-invalidated alias analysis result.<br>
-class TypeBasedAA {<br>
-public:<br>
+struct TypeBasedAA : AnalysisBase<TypeBasedAA> {<br>
typedef TypeBasedAAResult Result;<br>
<br>
- /// \brief Opaque, unique identifier for this analysis pass.<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
TypeBasedAAResult run(Function &F, AnalysisManager<Function> *AM);<br>
-<br>
- /// \brief Provide access to a name for this pass for debugging purposes.<br>
- static StringRef name() { return "TypeBasedAA"; }<br>
-<br>
-private:<br>
- static char PassID;<br>
};<br>
<br>
/// Legacy wrapper pass to provide the TypeBasedAAResult object.<br>
<br>
Modified: llvm/trunk/include/llvm/IR/Dominators.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Dominators.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Dominators.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/IR/Dominators.h (original)<br>
+++ llvm/trunk/include/llvm/IR/Dominators.h Fri Feb 26 05:44:45 2016<br>
@@ -182,40 +182,26 @@ template <> struct GraphTraits<Dominator<br>
};<br>
<br>
/// \brief Analysis pass which computes a \c DominatorTree.<br>
-class DominatorTreeAnalysis {<br>
-public:<br>
+struct DominatorTreeAnalysis : AnalysisBase<DominatorTreeAnalysis> {<br>
/// \brief Provide the result typedef for this analysis pass.<br>
typedef DominatorTree Result;<br>
<br>
- /// \brief Opaque, unique identifier for this analysis pass.<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
/// \brief Run the analysis pass over a function and produce a dominator tree.<br>
DominatorTree run(Function &F);<br>
-<br>
- /// \brief Provide access to a name for this pass for debugging purposes.<br>
- static StringRef name() { return "DominatorTreeAnalysis"; }<br>
-<br>
-private:<br>
- static char PassID;<br>
};<br>
<br>
/// \brief Printer pass for the \c DominatorTree.<br>
-class DominatorTreePrinterPass {<br>
+class DominatorTreePrinterPass : public PassBase<DominatorTreePrinterPass> {<br>
raw_ostream &OS;<br>
<br>
public:<br>
explicit DominatorTreePrinterPass(raw_ostream &OS);<br>
PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM);<br>
-<br>
- static StringRef name() { return "DominatorTreePrinterPass"; }<br>
};<br>
<br>
/// \brief Verifier pass for the \c DominatorTree.<br>
-struct DominatorTreeVerifierPass {<br>
+struct DominatorTreeVerifierPass : PassBase<DominatorTreeVerifierPass> {<br>
PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM);<br>
-<br>
- static StringRef name() { return "DominatorTreeVerifierPass"; }<br>
};<br>
<br>
/// \brief Legacy analysis pass which computes a \c DominatorTree.<br>
<br>
Modified: llvm/trunk/include/llvm/IR/PassManager.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/PassManager.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/PassManager.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/IR/PassManager.h (original)<br>
+++ llvm/trunk/include/llvm/IR/PassManager.h Fri Feb 26 05:44:45 2016<br>
@@ -167,6 +167,33 @@ private:<br>
// Forward declare the analysis manager template.<br>
template <typename IRUnitT> class AnalysisManager;<br>
<br>
+/// A CRTP mix-in base class to help define types that are valid passes.<br>
+///<br>
+/// This provides some boiler plate for types that are passes.<br>
+template <typename DerivedT> struct PassBase {<br>
+ /// Returns the name of the derived pass type.<br>
+ static StringRef name() {<br>
+ StringRef Name = getTypeName<DerivedT>();<br>
+ if (Name.startswith("llvm::"))<br>
+ Name = Name.drop_front(strlen("llvm::"));<br>
+ return Name;<br>
+ }<br>
+};<br>
+<br>
+/// A CRTP mix-in base class to help define types that are valid analyses.<br>
+///<br>
+/// This provides some boiler plate for types that are analysis passes.<br>
+template <typename DerivedT> class AnalysisBase : public PassBase<DerivedT> {<br>
+ static char PassID;<br>
+<br>
+public:<br>
+ /// Returns an opaque, unique ID for this pass type.<br>
+ static void *ID() { return (void *)&PassID; }<br>
+};<br>
+<br>
+/// Private static data to provide unique ID.<br>
+template <typename DerivedT> char AnalysisBase<DerivedT>::PassID;<br>
+<br>
/// \brief Manages a sequence of passes over units of IR.<br>
///<br>
/// A pass manager contains a sequence of passes to run over units of IR. It is<br>
@@ -178,7 +205,8 @@ template <typename IRUnitT> class Analys<br>
/// that analysis manager to each pass it runs, as well as calling the analysis<br>
/// manager's invalidation routine with the PreservedAnalyses of each pass it<br>
/// runs.<br>
-template <typename IRUnitT> class PassManager {<br>
+template <typename IRUnitT><br>
+class PassManager : public PassBase<PassManager<IRUnitT>> {<br>
public:<br>
/// \brief Construct a pass manager.<br>
///<br>
@@ -623,14 +651,11 @@ typedef AnalysisManager<Function> Functi<br>
/// Note that the proxy's result is a move-only object and represents ownership<br>
/// of the validity of the analyses in the \c FunctionAnalysisManager it<br>
/// provides.<br>
-class FunctionAnalysisManagerModuleProxy {<br>
+class FunctionAnalysisManagerModuleProxy<br>
+ : public AnalysisBase<FunctionAnalysisManagerModuleProxy> {<br>
public:<br>
class Result;<br>
<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
- static StringRef name() { return "FunctionAnalysisManagerModuleProxy"; }<br>
-<br>
explicit FunctionAnalysisManagerModuleProxy(FunctionAnalysisManager &FAM)<br>
: FAM(&FAM) {}<br>
// We have to explicitly define all the special member functions because MSVC<br>
@@ -658,8 +683,6 @@ public:<br>
Result run(Module &M);<br>
<br>
private:<br>
- static char PassID;<br>
-<br>
FunctionAnalysisManager *FAM;<br>
};<br>
<br>
@@ -717,7 +740,8 @@ private:<br>
/// This proxy *doesn't* manage the invalidation in any way. That is handled by<br>
/// the recursive return path of each layer of the pass manager and the<br>
/// returned PreservedAnalysis set.<br>
-class ModuleAnalysisManagerFunctionProxy {<br>
+class ModuleAnalysisManagerFunctionProxy<br>
+ : public AnalysisBase<ModuleAnalysisManagerFunctionProxy> {<br>
public:<br>
/// \brief Result proxy object for \c ModuleAnalysisManagerFunctionProxy.<br>
class Result {<br>
@@ -741,10 +765,6 @@ public:<br>
const ModuleAnalysisManager *MAM;<br>
};<br>
<br>
- static void *ID() { return (void *)&PassID; }<br>
-<br>
- static StringRef name() { return "ModuleAnalysisManagerFunctionProxy"; }<br>
-<br>
ModuleAnalysisManagerFunctionProxy(const ModuleAnalysisManager &MAM)<br>
: MAM(&MAM) {}<br>
// We have to explicitly define all the special member functions because MSVC<br>
@@ -766,8 +786,6 @@ public:<br>
Result run(Function &) { return Result(*MAM); }<br>
<br>
private:<br>
- static char PassID;<br>
-<br>
const ModuleAnalysisManager *MAM;<br>
};<br>
<br>
@@ -793,7 +811,9 @@ private:<br>
/// module.<br>
/// FIXME: Make the above true for all of LLVM's actual passes, some still<br>
/// violate this principle.<br>
-template <typename FunctionPassT> class ModuleToFunctionPassAdaptor {<br>
+template <typename FunctionPassT><br>
+class ModuleToFunctionPassAdaptor<br>
+ : public PassBase<ModuleToFunctionPassAdaptor<FunctionPassT>> {<br>
public:<br>
explicit ModuleToFunctionPassAdaptor(FunctionPassT Pass)<br>
: Pass(std::move(Pass)) {}<br>
@@ -848,8 +868,6 @@ public:<br>
return PA;<br>
}<br>
<br>
- static StringRef name() { return "ModuleToFunctionPassAdaptor"; }<br>
-<br>
private:<br>
FunctionPassT Pass;<br>
};<br>
@@ -866,7 +884,8 @@ createModuleToFunctionPassAdaptor(Functi<br>
///<br>
/// This is a no-op pass which simply forces a specific analysis pass's result<br>
/// to be available when it is run.<br>
-template <typename AnalysisT> struct RequireAnalysisPass {<br>
+template <typename AnalysisT><br>
+struct RequireAnalysisPass : PassBase<RequireAnalysisPass<AnalysisT>> {<br>
/// \brief Run this pass over some unit of IR.<br>
///<br>
/// This pass can be run over any unit of IR and use any analysis manager<br>
@@ -880,8 +899,6 @@ template <typename AnalysisT> struct Req<br>
<br>
return PreservedAnalyses::all();<br>
}<br>
-<br>
- static StringRef name() { return "RequireAnalysisPass"; }<br>
};<br>
<br>
/// \brief A template utility pass to force an analysis result to be<br>
@@ -889,7 +906,8 @@ template <typename AnalysisT> struct Req<br>
///<br>
/// This is a no-op pass which simply forces a specific analysis result to be<br>
/// invalidated when it is run.<br>
-template <typename AnalysisT> struct InvalidateAnalysisPass {<br>
+template <typename AnalysisT><br>
+struct InvalidateAnalysisPass : PassBase<InvalidateAnalysisPass<AnalysisT>> {<br>
/// \brief Run this pass over some unit of IR.<br>
///<br>
/// This pass can be run over any unit of IR and use any analysis manager<br>
@@ -905,21 +923,17 @@ template <typename AnalysisT> struct Inv<br>
<br>
return PreservedAnalyses::all();<br>
}<br>
-<br>
- static StringRef name() { return "InvalidateAnalysisPass"; }<br>
};<br>
<br>
/// \brief A utility pass that does nothing but preserves no analyses.<br>
///<br>
/// As a consequence fo not preserving any analyses, this pass will force all<br>
/// analysis passes to be re-run to produce fresh results if any are needed.<br>
-struct InvalidateAllAnalysesPass {<br>
+struct InvalidateAllAnalysesPass : PassBase<InvalidateAllAnalysesPass> {<br>
/// \brief Run this pass over some unit of IR.<br>
template <typename IRUnitT> PreservedAnalyses run(IRUnitT &Arg) {<br>
return PreservedAnalyses::none();<br>
}<br>
-<br>
- static StringRef name() { return "InvalidateAllAnalysesPass"; }<br>
};<br>
<br>
}<br>
<br>
Modified: llvm/trunk/include/llvm/IR/Verifier.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Verifier.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Verifier.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/IR/Verifier.h (original)<br>
+++ llvm/trunk/include/llvm/IR/Verifier.h Fri Feb 26 05:44:45 2016<br>
@@ -22,6 +22,7 @@<br>
#define LLVM_IR_VERIFIER_H<br>
<br>
#include "llvm/ADT/StringRef.h"<br>
+#include "llvm/IR/PassManager.h"<br>
#include <string><br>
<br>
namespace llvm {<br>
@@ -30,7 +31,6 @@ class Function;<br>
class FunctionPass;<br>
class ModulePass;<br>
class Module;<br>
-class PreservedAnalyses;<br>
class raw_ostream;<br>
<br>
/// \brief Check a function for errors, useful for use when debugging a<br>
@@ -60,7 +60,7 @@ bool verifyModule(const Module &M, raw_o<br>
/// nothing to do with \c VerifierPass.<br>
FunctionPass *createVerifierPass(bool FatalErrors = true);<br>
<br>
-class VerifierPass {<br>
+class VerifierPass : public PassBase<VerifierPass> {<br>
bool FatalErrors;<br>
<br>
public:<br>
@@ -68,8 +68,6 @@ public:<br>
<br>
PreservedAnalyses run(Module &M);<br>
PreservedAnalyses run(Function &F);<br>
-<br>
- static StringRef name() { return "VerifierPass"; }<br>
};<br>
<br>
} // End llvm namespace<br>
<br>
Modified: llvm/trunk/include/llvm/Transforms/IPO/ForceFunctionAttrs.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/ForceFunctionAttrs.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/ForceFunctionAttrs.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Transforms/IPO/ForceFunctionAttrs.h (original)<br>
+++ llvm/trunk/include/llvm/Transforms/IPO/ForceFunctionAttrs.h Fri Feb 26 05:44:45 2016<br>
@@ -21,9 +21,7 @@ namespace llvm {<br>
<br>
/// Pass which forces specific function attributes into the IR, primarily as<br>
/// a debugging tool.<br>
-class ForceFunctionAttrsPass {<br>
-public:<br>
- static StringRef name() { return "ForceFunctionAttrsPass"; }<br>
+struct ForceFunctionAttrsPass : PassBase<ForceFunctionAttrsPass> {<br>
PreservedAnalyses run(Module &M);<br>
};<br>
<br>
<br>
Modified: llvm/trunk/include/llvm/Transforms/IPO/FunctionAttrs.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/FunctionAttrs.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/FunctionAttrs.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Transforms/IPO/FunctionAttrs.h (original)<br>
+++ llvm/trunk/include/llvm/Transforms/IPO/FunctionAttrs.h Fri Feb 26 05:44:45 2016<br>
@@ -29,10 +29,7 @@ namespace llvm {<br>
/// access memory, or only read memory, and give them the readnone/readonly<br>
/// attribute. It also discovers function arguments that are not captured by<br>
/// the function and marks them with the nocapture attribute.<br>
-class PostOrderFunctionAttrsPass {<br>
-public:<br>
- static StringRef name() { return "PostOrderFunctionAttrsPass"; }<br>
-<br>
+struct PostOrderFunctionAttrsPass : PassBase<PostOrderFunctionAttrsPass> {<br>
PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager *AM);<br>
};<br>
<br>
<br>
Modified: llvm/trunk/include/llvm/Transforms/IPO/InferFunctionAttrs.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/InferFunctionAttrs.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/InferFunctionAttrs.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Transforms/IPO/InferFunctionAttrs.h (original)<br>
+++ llvm/trunk/include/llvm/Transforms/IPO/InferFunctionAttrs.h Fri Feb 26 05:44:45 2016<br>
@@ -23,9 +23,7 @@ namespace llvm {<br>
<br>
/// A pass which infers function attributes from the names and signatures of<br>
/// function declarations in a module.<br>
-class InferFunctionAttrsPass {<br>
-public:<br>
- static StringRef name() { return "InferFunctionAttrsPass"; }<br>
+struct InferFunctionAttrsPass : PassBase<InferFunctionAttrsPass> {<br>
PreservedAnalyses run(Module &M, AnalysisManager<Module> *AM);<br>
};<br>
<br>
<br>
Modified: llvm/trunk/include/llvm/Transforms/IPO/StripDeadPrototypes.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/StripDeadPrototypes.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/StripDeadPrototypes.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Transforms/IPO/StripDeadPrototypes.h (original)<br>
+++ llvm/trunk/include/llvm/Transforms/IPO/StripDeadPrototypes.h Fri Feb 26 05:44:45 2016<br>
@@ -23,9 +23,7 @@<br>
namespace llvm {<br>
<br>
/// Pass to remove unused function declarations.<br>
-class StripDeadPrototypesPass {<br>
-public:<br>
- static StringRef name() { return "StripDeadPrototypesPass"; }<br>
+struct StripDeadPrototypesPass : PassBase<StripDeadPrototypesPass> {<br>
PreservedAnalyses run(Module &M);<br>
};<br>
<br>
<br>
Modified: llvm/trunk/include/llvm/Transforms/InstCombine/InstCombine.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/InstCombine/InstCombine.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/InstCombine/InstCombine.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Transforms/InstCombine/InstCombine.h (original)<br>
+++ llvm/trunk/include/llvm/Transforms/InstCombine/InstCombine.h Fri Feb 26 05:44:45 2016<br>
@@ -24,7 +24,7 @@<br>
<br>
namespace llvm {<br>
<br>
-class InstCombinePass {<br>
+class InstCombinePass : public PassBase<InstCombinePass> {<br>
InstCombineWorklist Worklist;<br>
<br>
public:<br>
<br>
Modified: llvm/trunk/include/llvm/Transforms/Scalar/ADCE.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar/ADCE.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar/ADCE.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Transforms/Scalar/ADCE.h (original)<br>
+++ llvm/trunk/include/llvm/Transforms/Scalar/ADCE.h Fri Feb 26 05:44:45 2016<br>
@@ -28,9 +28,7 @@ namespace llvm {<br>
/// instructions are dead until proven otherwise. This allows it to eliminate<br>
/// dead computations that other DCE passes do not catch, particularly involving<br>
/// loop computations.<br>
-class ADCEPass {<br>
-public:<br>
- static StringRef name() { return "ADCEPass"; }<br>
+struct ADCEPass : PassBase<ADCEPass> {<br>
PreservedAnalyses run(Function &F);<br>
};<br>
}<br>
<br>
Modified: llvm/trunk/include/llvm/Transforms/Scalar/EarlyCSE.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar/EarlyCSE.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar/EarlyCSE.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Transforms/Scalar/EarlyCSE.h (original)<br>
+++ llvm/trunk/include/llvm/Transforms/Scalar/EarlyCSE.h Fri Feb 26 05:44:45 2016<br>
@@ -26,10 +26,7 @@ namespace llvm {<br>
/// canonicalize things as it goes. It is intended to be fast and catch obvious<br>
/// cases so that instcombine and other passes are more effective. It is<br>
/// expected that a later pass of GVN will catch the interesting/hard cases.<br>
-class EarlyCSEPass {<br>
-public:<br>
- static StringRef name() { return "EarlyCSEPass"; }<br>
-<br>
+struct EarlyCSEPass : PassBase<EarlyCSEPass> {<br>
/// \brief Run the pass over the function.<br>
PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM);<br>
};<br>
<br>
Modified: llvm/trunk/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h (original)<br>
+++ llvm/trunk/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h Fri Feb 26 05:44:45 2016<br>
@@ -21,10 +21,7 @@<br>
<br>
namespace llvm {<br>
<br>
-class LowerExpectIntrinsicPass {<br>
-public:<br>
- static StringRef name() { return "LowerExpectIntrinsicPass"; }<br>
-<br>
+struct LowerExpectIntrinsicPass : PassBase<LowerExpectIntrinsicPass> {<br>
/// \brief Run the pass over the function.<br>
///<br>
/// This will lower all of th expect intrinsic calls in this function into<br>
<br>
Modified: llvm/trunk/include/llvm/Transforms/Scalar/SROA.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar/SROA.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar/SROA.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Transforms/Scalar/SROA.h (original)<br>
+++ llvm/trunk/include/llvm/Transforms/Scalar/SROA.h Fri Feb 26 05:44:45 2016<br>
@@ -51,7 +51,7 @@ class SROALegacyPass;<br>
/// onto insert and extract operations on a vector value, and convert them to<br>
/// this form. By doing so, it will enable promotion of vector aggregates to<br>
/// SSA vector values.<br>
-class SROA {<br>
+class SROA : public PassBase<SROA> {<br>
LLVMContext *C;<br>
DominatorTree *DT;<br>
AssumptionCache *AC;<br>
@@ -101,8 +101,6 @@ class SROA {<br>
public:<br>
SROA() : C(nullptr), DT(nullptr), AC(nullptr) {}<br>
<br>
- static StringRef name() { return "SROA"; }<br>
-<br>
/// \brief Run the pass over the function.<br>
PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM);<br>
<br>
<br>
Modified: llvm/trunk/include/llvm/Transforms/Scalar/SimplifyCFG.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar/SimplifyCFG.h?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar/SimplifyCFG.h?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Transforms/Scalar/SimplifyCFG.h (original)<br>
+++ llvm/trunk/include/llvm/Transforms/Scalar/SimplifyCFG.h Fri Feb 26 05:44:45 2016<br>
@@ -25,12 +25,10 @@ namespace llvm {<br>
/// This pass iteratively simplifies the entire CFG of a function, removing<br>
/// unnecessary control flows and bringing it into the canonical form expected<br>
/// by the rest of the mid-level optimizer.<br>
-class SimplifyCFGPass {<br>
+class SimplifyCFGPass : public PassBase<SimplifyCFGPass> {<br>
int BonusInstThreshold;<br>
<br>
public:<br>
- static StringRef name() { return "SimplifyCFGPass"; }<br>
-<br>
/// \brief Construct a pass with the default thresholds.<br>
SimplifyCFGPass();<br>
<br>
<br>
Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Fri Feb 26 05:44:45 2016<br>
@@ -390,9 +390,6 @@ bool AAResults::canInstructionRangeModRe<br>
// Provide a definition for the root virtual destructor.<br>
AAResults::Concept::~Concept() {}<br>
<br>
-// Provide a definition for the static object used to identify passes.<br>
-char AAManager::PassID;<br>
-<br>
namespace {<br>
/// A wrapper pass for external alias analyses. This just squirrels away the<br>
/// callback used to run any analyses and register their results.<br>
<br>
Modified: llvm/trunk/lib/Analysis/AssumptionCache.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AssumptionCache.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AssumptionCache.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/AssumptionCache.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/AssumptionCache.cpp Fri Feb 26 05:44:45 2016<br>
@@ -74,8 +74,6 @@ void AssumptionCache::registerAssumption<br>
#endif<br>
}<br>
<br>
-char AssumptionAnalysis::PassID;<br>
-<br>
PreservedAnalyses AssumptionPrinterPass::run(Function &F,<br>
AnalysisManager<Function> *AM) {<br>
AssumptionCache &AC = AM->getResult<AssumptionAnalysis>(F);<br>
<br>
Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Fri Feb 26 05:44:45 2016<br>
@@ -1586,8 +1586,6 @@ bool BasicAAResult::constantOffsetHeuris<br>
// BasicAliasAnalysis Pass<br>
//===----------------------------------------------------------------------===//<br>
<br>
-char BasicAA::PassID;<br>
-<br>
BasicAAResult BasicAA::run(Function &F, AnalysisManager<Function> *AM) {<br>
return BasicAAResult(F.getParent()->getDataLayout(),<br>
AM->getResult<TargetLibraryAnalysis>(F),<br>
<br>
Modified: llvm/trunk/lib/Analysis/CFLAliasAnalysis.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFLAliasAnalysis.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFLAliasAnalysis.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/CFLAliasAnalysis.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/CFLAliasAnalysis.cpp Fri Feb 26 05:44:45 2016<br>
@@ -1093,8 +1093,6 @@ CFLAAResult CFLAA::run(Function &F, Anal<br>
return CFLAAResult(AM->getResult<TargetLibraryAnalysis>(F));<br>
}<br>
<br>
-char CFLAA::PassID;<br>
-<br>
char CFLAAWrapperPass::ID = 0;<br>
INITIALIZE_PASS_BEGIN(CFLAAWrapperPass, "cfl-aa", "CFL-Based Alias Analysis",<br>
false, true)<br>
<br>
Modified: llvm/trunk/lib/Analysis/CGSCCPassManager.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CGSCCPassManager.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CGSCCPassManager.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/CGSCCPassManager.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/CGSCCPassManager.cpp Fri Feb 26 05:44:45 2016<br>
@@ -13,8 +13,6 @@<br>
<br>
using namespace llvm;<br>
<br>
-char CGSCCAnalysisManagerModuleProxy::PassID;<br>
-<br>
CGSCCAnalysisManagerModuleProxy::Result<br>
CGSCCAnalysisManagerModuleProxy::run(Module &M) {<br>
assert(CGAM->empty() && "CGSCC analyses ran prior to the module proxy!");<br>
@@ -44,10 +42,6 @@ bool CGSCCAnalysisManagerModuleProxy::Re<br>
return false;<br>
}<br>
<br>
-char ModuleAnalysisManagerCGSCCProxy::PassID;<br>
-<br>
-char FunctionAnalysisManagerCGSCCProxy::PassID;<br>
-<br>
FunctionAnalysisManagerCGSCCProxy::Result<br>
FunctionAnalysisManagerCGSCCProxy::run(LazyCallGraph::SCC &C) {<br>
return Result(*FAM);<br>
@@ -75,5 +69,3 @@ bool FunctionAnalysisManagerCGSCCProxy::<br>
// Return false to indicate that this result is still a valid proxy.<br>
return false;<br>
}<br>
-<br>
-char CGSCCAnalysisManagerFunctionProxy::PassID;<br>
<br>
Modified: llvm/trunk/lib/Analysis/CallGraph.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CallGraph.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CallGraph.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/CallGraph.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/CallGraph.cpp Fri Feb 26 05:44:45 2016<br>
@@ -263,8 +263,6 @@ void CallGraphNode::replaceCallEdge(Call<br>
// Out-of-line definitions of CallGraphAnalysis class members.<br>
//<br>
<br>
-char CallGraphAnalysis::PassID;<br>
-<br>
//===----------------------------------------------------------------------===//<br>
// Implementations of the CallGraphWrapperPass class methods.<br>
//<br>
<br>
Modified: llvm/trunk/lib/Analysis/DominanceFrontier.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DominanceFrontier.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DominanceFrontier.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/DominanceFrontier.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/DominanceFrontier.cpp Fri Feb 26 05:44:45 2016<br>
@@ -56,8 +56,6 @@ LLVM_DUMP_METHOD void DominanceFrontierW<br>
}<br>
#endif<br>
<br>
-char DominanceFrontierAnalysis::PassID;<br>
-<br>
DominanceFrontier DominanceFrontierAnalysis::run(Function &F,<br>
FunctionAnalysisManager *AM) {<br>
DominanceFrontier DF;<br>
<br>
Modified: llvm/trunk/lib/Analysis/GlobalsModRef.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/GlobalsModRef.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/GlobalsModRef.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/GlobalsModRef.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/GlobalsModRef.cpp Fri Feb 26 05:44:45 2016<br>
@@ -940,8 +940,6 @@ GlobalsAAResult GlobalsAA::run(Module &M<br>
AM->getResult<CallGraphAnalysis>(M));<br>
}<br>
<br>
-char GlobalsAA::PassID;<br>
-<br>
char GlobalsAAWrapperPass::ID = 0;<br>
INITIALIZE_PASS_BEGIN(GlobalsAAWrapperPass, "globals-aa",<br>
"Globals Alias Analysis", false, true)<br>
<br>
Modified: llvm/trunk/lib/Analysis/LazyCallGraph.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LazyCallGraph.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LazyCallGraph.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/LazyCallGraph.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/LazyCallGraph.cpp Fri Feb 26 05:44:45 2016<br>
@@ -1499,8 +1499,6 @@ LazyCallGraph::RefSCC *LazyCallGraph::ge<br>
}<br>
}<br>
<br>
-char LazyCallGraphAnalysis::PassID;<br>
-<br>
LazyCallGraphPrinterPass::LazyCallGraphPrinterPass(raw_ostream &OS) : OS(OS) {}<br>
<br>
static void printNode(raw_ostream &OS, LazyCallGraph::Node &N) {<br>
<br>
Modified: llvm/trunk/lib/Analysis/LoopInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopInfo.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopInfo.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/LoopInfo.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/LoopInfo.cpp Fri Feb 26 05:44:45 2016<br>
@@ -641,8 +641,6 @@ void LoopInfo::markAsRemoved(Loop *Unloo<br>
}<br>
}<br>
<br>
-char LoopAnalysis::PassID;<br>
-<br>
LoopInfo LoopAnalysis::run(Function &F, AnalysisManager<Function> *AM) {<br>
// FIXME: Currently we create a LoopInfo from scratch for every function.<br>
// This may prove to be too wasteful due to deallocating and re-allocating<br>
<br>
Modified: llvm/trunk/lib/Analysis/LoopPassManager.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopPassManager.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopPassManager.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/LoopPassManager.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/LoopPassManager.cpp Fri Feb 26 05:44:45 2016<br>
@@ -11,8 +11,6 @@<br>
<br>
using namespace llvm;<br>
<br>
-char LoopAnalysisManagerFunctionProxy::PassID;<br>
-<br>
LoopAnalysisManagerFunctionProxy::Result<br>
LoopAnalysisManagerFunctionProxy::run(Function &F) {<br>
// TODO: In FunctionAnalysisManagerModuleProxy we assert that the<br>
@@ -41,5 +39,3 @@ bool LoopAnalysisManagerFunctionProxy::R<br>
// Return false to indicate that this result is still a valid proxy.<br>
return false;<br>
}<br>
-<br>
-char FunctionAnalysisManagerLoopProxy::PassID;<br>
<br>
Modified: llvm/trunk/lib/Analysis/ObjCARCAliasAnalysis.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ObjCARCAliasAnalysis.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ObjCARCAliasAnalysis.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/ObjCARCAliasAnalysis.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/ObjCARCAliasAnalysis.cpp Fri Feb 26 05:44:45 2016<br>
@@ -136,8 +136,6 @@ ObjCARCAAResult ObjCARCAA::run(Function<br>
AM->getResult<TargetLibraryAnalysis>(F));<br>
}<br>
<br>
-char ObjCARCAA::PassID;<br>
-<br>
char ObjCARCAAWrapperPass::ID = 0;<br>
INITIALIZE_PASS_BEGIN(ObjCARCAAWrapperPass, "objc-arc-aa",<br>
"ObjC-ARC-Based Alias Analysis", false, true)<br>
<br>
Modified: llvm/trunk/lib/Analysis/PostDominators.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/PostDominators.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/PostDominators.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/PostDominators.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/PostDominators.cpp Fri Feb 26 05:44:45 2016<br>
@@ -44,8 +44,6 @@ FunctionPass* llvm::createPostDomTree()<br>
return new PostDominatorTreeWrapperPass();<br>
}<br>
<br>
-char PostDominatorTreeAnalysis::PassID;<br>
-<br>
PostDominatorTree PostDominatorTreeAnalysis::run(Function &F) {<br>
PostDominatorTree PDT;<br>
PDT.recalculate(F);<br>
<br>
Modified: llvm/trunk/lib/Analysis/RegionInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionInfo.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionInfo.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/RegionInfo.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/RegionInfo.cpp Fri Feb 26 05:44:45 2016<br>
@@ -185,8 +185,6 @@ namespace llvm {<br>
// RegionInfoAnalysis implementation<br>
//<br>
<br>
-char RegionInfoAnalysis::PassID;<br>
-<br>
RegionInfo RegionInfoAnalysis::run(Function &F, AnalysisManager<Function> *AM) {<br>
RegionInfo RI;<br>
auto *DT = &AM->getResult<DominatorTreeAnalysis>(F);<br>
<br>
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Fri Feb 26 05:44:45 2016<br>
@@ -9554,8 +9554,6 @@ void ScalarEvolution::verify() const {<br>
// TODO: Verify more things.<br>
}<br>
<br>
-char ScalarEvolutionAnalysis::PassID;<br>
-<br>
ScalarEvolution ScalarEvolutionAnalysis::run(Function &F,<br>
AnalysisManager<Function> *AM) {<br>
return ScalarEvolution(F, AM->getResult<TargetLibraryAnalysis>(F),<br>
<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Modified: llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp Fri Feb 26 05:44:45 2016<br>
@@ -116,8 +116,6 @@ SCEVAAResult SCEVAA::run(Function &F, An<br>
AM->getResult<ScalarEvolutionAnalysis>(F));<br>
}<br>
<br>
-char SCEVAA::PassID;<br>
-<br>
char SCEVAAWrapperPass::ID = 0;<br>
INITIALIZE_PASS_BEGIN(SCEVAAWrapperPass, "scev-aa",<br>
"ScalarEvolution-based Alias Analysis", false, true)<br>
<br>
Modified: llvm/trunk/lib/Analysis/ScopedNoAliasAA.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScopedNoAliasAA.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScopedNoAliasAA.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/ScopedNoAliasAA.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/ScopedNoAliasAA.cpp Fri Feb 26 05:44:45 2016<br>
@@ -178,8 +178,6 @@ ScopedNoAliasAAResult ScopedNoAliasAA::r<br>
return ScopedNoAliasAAResult(AM->getResult<TargetLibraryAnalysis>(F));<br>
}<br>
<br>
-char ScopedNoAliasAA::PassID;<br>
-<br>
char ScopedNoAliasAAWrapperPass::ID = 0;<br>
INITIALIZE_PASS_BEGIN(ScopedNoAliasAAWrapperPass, "scoped-noalias",<br>
"Scoped NoAlias Alias Analysis", false, true)<br>
<br>
Modified: llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp Fri Feb 26 05:44:45 2016<br>
@@ -636,8 +636,6 @@ TargetLibraryInfoWrapperPass::TargetLibr<br>
initializeTargetLibraryInfoWrapperPassPass(*PassRegistry::getPassRegistry());<br>
}<br>
<br>
-char TargetLibraryAnalysis::PassID;<br>
-<br>
// Register the basic pass.<br>
INITIALIZE_PASS(TargetLibraryInfoWrapperPass, "targetlibinfo",<br>
"Target Library Information", false, true)<br>
<br>
Modified: llvm/trunk/lib/Analysis/TargetTransformInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TargetTransformInfo.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TargetTransformInfo.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/TargetTransformInfo.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/TargetTransformInfo.cpp Fri Feb 26 05:44:45 2016<br>
@@ -377,8 +377,6 @@ TargetIRAnalysis::Result TargetIRAnalysi<br>
return TTICallback(F);<br>
}<br>
<br>
-char TargetIRAnalysis::PassID;<br>
-<br>
TargetIRAnalysis::Result TargetIRAnalysis::getDefaultTTI(const Function &F) {<br>
return Result(F.getParent()->getDataLayout());<br>
}<br>
<br>
Modified: llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp Fri Feb 26 05:44:45 2016<br>
@@ -588,8 +588,6 @@ TypeBasedAAResult TypeBasedAA::run(Funct<br>
return TypeBasedAAResult(AM->getResult<TargetLibraryAnalysis>(F));<br>
}<br>
<br>
-char TypeBasedAA::PassID;<br>
-<br>
char TypeBasedAAWrapperPass::ID = 0;<br>
INITIALIZE_PASS_BEGIN(TypeBasedAAWrapperPass, "tbaa",<br>
"Type-Based Alias Analysis", false, true)<br>
<br>
Modified: llvm/trunk/lib/IR/Dominators.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Dominators.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Dominators.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/IR/Dominators.cpp (original)<br>
+++ llvm/trunk/lib/IR/Dominators.cpp Fri Feb 26 05:44:45 2016<br>
@@ -308,8 +308,6 @@ DominatorTree DominatorTreeAnalysis::run<br>
return DT;<br>
}<br>
<br>
-char DominatorTreeAnalysis::PassID;<br>
-<br>
DominatorTreePrinterPass::DominatorTreePrinterPass(raw_ostream &OS) : OS(OS) {}<br>
<br>
PreservedAnalyses DominatorTreePrinterPass::run(Function &F,<br>
<br>
Modified: llvm/trunk/lib/IR/PassManager.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/PassManager.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/PassManager.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/IR/PassManager.cpp (original)<br>
+++ llvm/trunk/lib/IR/PassManager.cpp Fri Feb 26 05:44:45 2016</blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
@@ -13,8 +13,6 @@<br>
<br>
using namespace llvm;<br>
<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-char FunctionAnalysisManagerModuleProxy::PassID;<br>
-<br>
FunctionAnalysisManagerModuleProxy::Result<br>
FunctionAnalysisManagerModuleProxy::run(Module &M) {<br>
assert(FAM->empty() && "Function analyses ran prior to the module proxy!");<br>
@@ -43,5 +41,3 @@ bool FunctionAnalysisManagerModuleProxy:</blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
// Return false to indicate that this result is still a valid proxy.<br>
return false;<br>
}<br>
-<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-char ModuleAnalysisManagerFunctionProxy::PassID;<br>
<br>
Modified: llvm/trunk/lib/Passes/PassBuilder.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Passes/PassBuilder.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Passes/PassBuilder.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Passes/PassBuilder.cpp (original)<br>
+++ llvm/trunk/lib/Passes/PassBuilder.cpp Fri Feb 26 05:44:45 2016<br>
@@ -61,17 +61,12 @@ struct NoOpModulePass {<br>
};<br>
<br>
/// \brief No-op module analysis.<br>
-struct NoOpModuleAnalysis {<br>
+struct NoOpModuleAnalysis : AnalysisBase<NoOpModuleAnalysis> {<br>
struct Result {};<br>
Result run(Module &) { return Result(); }<br>
static StringRef name() { return "NoOpModuleAnalysis"; }</blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
- static void *ID() { return (void *)&PassID; }<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-private:<br>
- static char PassID;<br>
};<br>
<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-char NoOpModuleAnalysis::PassID;<br>
-<br>
/// \brief No-op CGSCC pass which does nothing.<br>
struct NoOpCGSCCPass {<br>
PreservedAnalyses run(LazyCallGraph::SCC &C) {<br>
@@ -81,17 +76,12 @@ struct NoOpCGSCCPass {<br>
};<br>
<br>
/// \brief No-op CGSCC analysis.<br>
-struct NoOpCGSCCAnalysis {<br>
+struct NoOpCGSCCAnalysis : AnalysisBase<NoOpCGSCCAnalysis> {<br>
struct Result {};<br>
Result run(LazyCallGraph::SCC &) { return Result(); }<br>
static StringRef name() { return "NoOpCGSCCAnalysis"; }</blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
- static void *ID() { return (void *)&PassID; }<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-private:<br>
- static char PassID;<br>
};<br>
<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-char NoOpCGSCCAnalysis::PassID;<br>
-<br>
/// \brief No-op function pass which does nothing.<br>
struct NoOpFunctionPass {<br>
PreservedAnalyses run(Function &F) { return PreservedAnalyses::all(); }<br>
@@ -99,17 +89,12 @@ struct NoOpFunctionPass {<br>
};<br>
<br>
/// \brief No-op function analysis.<br>
-struct NoOpFunctionAnalysis {<br>
+struct NoOpFunctionAnalysis : AnalysisBase<NoOpFunctionAnalysis> {<br>
struct Result {};<br>
Result run(Function &) { return Result(); }<br>
static StringRef name() { return "NoOpFunctionAnalysis"; }</blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
- static void *ID() { return (void *)&PassID; }<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-private:<br>
- static char PassID;<br>
};<br>
<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-char NoOpFunctionAnalysis::PassID;<br>
-<br>
/// \brief No-op loop pass which does nothing.<br>
struct NoOpLoopPass {<br>
PreservedAnalyses run(Loop &L) { return PreservedAnalyses::all(); }<br>
@@ -117,17 +102,12 @@ struct NoOpLoopPass {<br>
};<br>
<br>
/// \brief No-op loop analysis.<br>
-struct NoOpLoopAnalysis {<br>
+struct NoOpLoopAnalysis : AnalysisBase<NoOpLoopAnalysis> {<br>
struct Result {};<br>
Result run(Loop &) { return Result(); }<br>
static StringRef name() { return "NoOpLoopAnalysis"; }</blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
- static void *ID() { return (void *)&PassID; }<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-private:<br>
- static char PassID;<br>
};<br>
<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-char NoOpLoopAnalysis::PassID;<br>
-<br>
} // End anonymous namespace.<br>
<br>
void PassBuilder::registerModuleAnalyses(ModuleAnalysisManager &MAM) {<br>
<br>
Modified: llvm/trunk/test/Other/new-pass-manager.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/new-pass-manager.ll?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/new-pass-manager.ll?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/Other/new-pass-manager.ll (original)<br>
+++ llvm/trunk/test/Other/new-pass-manager.ll Fri Feb 26 05:44:45 2016<br>
@@ -21,7 +21,7 @@<br>
; CHECK-CGSCC-PASS: Starting llvm::Module pass manager run<br>
; CHECK-CGSCC-PASS-NEXT: Running pass: ModuleToPostOrderCGSCCPassAdaptor<br>
; CHECK-CGSCC-PASS-NEXT: Running analysis: CGSCCAnalysisManagerModuleProxy<br>
-; CHECK-CGSCC-PASS-NEXT: Running analysis: Lazy CallGraph Analysis<br>
+; CHECK-CGSCC-PASS-NEXT: Running analysis: LazyCallGraphAnalysis<br>
; CHECK-CGSCC-PASS-NEXT: Starting llvm::LazyCallGraph::SCC pass manager run<br>
; CHECK-CGSCC-PASS-NEXT: Running pass: NoOpCGSCCPass<br>
; CHECK-CGSCC-PASS-NEXT: Finished llvm::LazyCallGraph::SCC pass manager run<br>
<br>
Modified: llvm/trunk/unittests/IR/PassManagerTest.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/PassManagerTest.cpp?rev=262004&r1=262003&r2=262004&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/PassManagerTest.cpp?rev=262004&r1=262003&r2=262004&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/unittests/IR/PassManagerTest.cpp (original)<br>
+++ llvm/trunk/unittests/IR/PassManagerTest.cpp Fri Feb 26 05:44:45 2016<br>
@@ -19,19 +19,13 @@ using namespace llvm;<br>
<br>
namespace {<br>
<br>
-class TestFunctionAnalysis {<br>
+class TestFunctionAnalysis : public AnalysisBase<TestFunctionAnalysis> {<br>
public:<br>
struct Result {<br>
Result(int Count) : InstructionCount(Count) {}<br>
int InstructionCount;<br>
};<br>
<br>
- /// \brief Returns an opaque, unique ID for this pass type.</blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
- static void *ID() { return (void *)&PassID; }<br>
-<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- /// \brief Returns the name of the analysis.<br>
- static StringRef name() { return "TestFunctionAnalysis"; }<br>
-<br>
TestFunctionAnalysis(int &Runs) : Runs(Runs) {}<br>
<br>
/// \brief Run the analysis pass over the function and return a result.<br>
@@ -46,25 +40,16 @@ public:<br>
}<br>
<br>
private:<br>
- /// \brief Private static data to provide unique ID.</blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
- static char PassID;<br>
-<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
int &Runs;<br>
};<br>
<br>
-char TestFunctionAnalysis::PassID;<br>
-<br>
-class TestModuleAnalysis {<br>
+class TestModuleAnalysis : public AnalysisBase<TestModuleAnalysis> {<br>
public:<br>
struct Result {<br>
Result(int Count) : FunctionCount(Count) {}<br>
int FunctionCount;<br>
</blockquote></div></div></blockquote></div></div>
</blockquote></div><br></div></div>