clarify their purpose.
Firstly, call them "...Mixin" types so it is clear that there is no
type hierarchy being formed here. Secondly, use the term 'Info' to
clarify that they aren't adding any interesting *semantics* to the
passes or analyses, just exposing APIs used by the management layer to
get information about the pass or analysis.
Thanks to Manuel for helping pin down the naming confusion here and come
up with effective names to address it.
In case you already have some out-of-tree stuff, the following should be
roughly what you want to update:
perl -pi -e 's/\b(Pass|Analysis)Base\b/\1InfoMixin/g'
llvm-svn: 263217
/// This manager effectively wraps the AnalysisManager for registering alias
/// analyses. When you register your alias analysis with this manager, it will
/// ensure the analysis itself is registered with its AnalysisManager.
-class AAManager : public AnalysisBase<AAManager> {
+class AAManager : public AnalysisInfoMixin<AAManager> {
public:
typedef AAResults Result;
}
private:
- friend AnalysisBase<AAManager>;
+ friend AnalysisInfoMixin<AAManager>;
static char PassID;
SmallVector<void (*)(Function &F, AnalysisManager<Function> &AM,
namespace llvm {
class AAResults;
-class AAEvaluator : public PassBase<AAEvaluator> {
+class AAEvaluator : public PassInfoMixin<AAEvaluator> {
int64_t FunctionCount;
int64_t NoAliasCount, MayAliasCount, PartialAliasCount, MustAliasCount;
int64_t NoModRefCount, ModCount, RefCount, ModRefCount;
///
/// This analysis is intended for use with the new pass manager and will vend
/// assumption caches for a given function.
-class AssumptionAnalysis : public AnalysisBase<AssumptionAnalysis> {
- friend AnalysisBase<AssumptionAnalysis>;
+class AssumptionAnalysis : public AnalysisInfoMixin<AssumptionAnalysis> {
+ friend AnalysisInfoMixin<AssumptionAnalysis>;
static char PassID;
public:
};
/// \brief Printer pass for the \c AssumptionAnalysis results.
-class AssumptionPrinterPass : public PassBase<AssumptionPrinterPass> {
+class AssumptionPrinterPass : public PassInfoMixin<AssumptionPrinterPass> {
raw_ostream &OS;
public:
};
/// Analysis pass providing a never-invalidated alias analysis result.
-class BasicAA : public AnalysisBase<BasicAA> {
- friend AnalysisBase<BasicAA>;
+class BasicAA : public AnalysisInfoMixin<BasicAA> {
+ friend AnalysisInfoMixin<BasicAA>;
static char PassID;
public:
///
/// FIXME: We really should refactor CFL to use the analysis more heavily, and
/// in particular to leverage invalidation to trigger re-computation of sets.
-class CFLAA : public AnalysisBase<CFLAA> {
- friend AnalysisBase<CFLAA>;
+class CFLAA : public AnalysisInfoMixin<CFLAA> {
+ friend AnalysisInfoMixin<CFLAA>;
static char PassID;
public:
/// within this run safely.
template <typename CGSCCPassT>
class ModuleToPostOrderCGSCCPassAdaptor
- : public PassBase<ModuleToPostOrderCGSCCPassAdaptor<CGSCCPassT>> {
+ : public PassInfoMixin<ModuleToPostOrderCGSCCPassAdaptor<CGSCCPassT>> {
public:
explicit ModuleToPostOrderCGSCCPassAdaptor(CGSCCPassT Pass)
: Pass(std::move(Pass)) {}
/// within this run safely.
template <typename FunctionPassT>
class CGSCCToFunctionPassAdaptor
- : public PassBase<CGSCCToFunctionPassAdaptor<FunctionPassT>> {
+ : public PassInfoMixin<CGSCCToFunctionPassAdaptor<FunctionPassT>> {
public:
explicit CGSCCToFunctionPassAdaptor(FunctionPassT Pass)
: Pass(std::move(Pass)) {}
/// This class implements the concept of an analysis pass used by the \c
/// ModuleAnalysisManager to run an analysis over a module and cache the
/// resulting data.
-class CallGraphAnalysis : public AnalysisBase<CallGraphAnalysis> {
- friend AnalysisBase<CallGraphAnalysis>;
+class CallGraphAnalysis : public AnalysisInfoMixin<CallGraphAnalysis> {
+ friend AnalysisInfoMixin<CallGraphAnalysis>;
static char PassID;
public:
};
/// \brief Printer pass for the \c CallGraphAnalysis results.
-class CallGraphPrinterPass : public PassBase<CallGraphPrinterPass> {
+class CallGraphPrinterPass : public PassInfoMixin<CallGraphPrinterPass> {
raw_ostream &OS;
public:
/// \brief Analysis pass which computes a \c DominanceFrontier.
class DominanceFrontierAnalysis
- : public AnalysisBase<DominanceFrontierAnalysis> {
- friend AnalysisBase<DominanceFrontierAnalysis>;
+ : public AnalysisInfoMixin<DominanceFrontierAnalysis> {
+ friend AnalysisInfoMixin<DominanceFrontierAnalysis>;
static char PassID;
public:
/// \brief Printer pass for the \c DominanceFrontier.
class DominanceFrontierPrinterPass
- : public PassBase<DominanceFrontierPrinterPass> {
+ : public PassInfoMixin<DominanceFrontierPrinterPass> {
raw_ostream &OS;
public:
};
/// Analysis pass providing a never-invalidated alias analysis result.
-class GlobalsAA : public AnalysisBase<GlobalsAA> {
- friend AnalysisBase<GlobalsAA>;
+class GlobalsAA : public AnalysisInfoMixin<GlobalsAA> {
+ friend AnalysisInfoMixin<GlobalsAA>;
static char PassID;
public:
};
/// An analysis pass which computes the call graph for a module.
-class LazyCallGraphAnalysis : public AnalysisBase<LazyCallGraphAnalysis> {
- friend AnalysisBase<LazyCallGraphAnalysis>;
+class LazyCallGraphAnalysis : public AnalysisInfoMixin<LazyCallGraphAnalysis> {
+ friend AnalysisInfoMixin<LazyCallGraphAnalysis>;
static char PassID;
public:
/// A pass which prints the call graph to a \c raw_ostream.
///
/// This is primarily useful for testing the analysis.
-class LazyCallGraphPrinterPass : public PassBase<LazyCallGraphPrinterPass> {
+class LazyCallGraphPrinterPass
+ : public PassInfoMixin<LazyCallGraphPrinterPass> {
raw_ostream &OS;
public:
};
/// \brief Analysis pass that exposes the \c LoopInfo for a function.
-class LoopAnalysis : public AnalysisBase<LoopAnalysis> {
- friend AnalysisBase<LoopAnalysis>;
+class LoopAnalysis : public AnalysisInfoMixin<LoopAnalysis> {
+ friend AnalysisInfoMixin<LoopAnalysis>;
static char PassID;
public:
};
/// \brief Printer pass for the \c LoopAnalysis results.
-class LoopPrinterPass : public PassBase<LoopPrinterPass> {
+class LoopPrinterPass : public PassInfoMixin<LoopPrinterPass> {
raw_ostream &OS;
public:
};
/// \brief Pass for printing a loop's contents as LLVM's text IR assembly.
-class PrintLoopPass : public PassBase<PrintLoopPass> {
+class PrintLoopPass : public PassInfoMixin<PrintLoopPass> {
raw_ostream &OS;
std::string Banner;
/// LoopAnalysisManager to be used within this run safely.
template <typename LoopPassT>
class FunctionToLoopPassAdaptor
- : public PassBase<FunctionToLoopPassAdaptor<LoopPassT>> {
+ : public PassInfoMixin<FunctionToLoopPassAdaptor<LoopPassT>> {
public:
explicit FunctionToLoopPassAdaptor(LoopPassT Pass)
: Pass(std::move(Pass)) {}
///
/// This is essentially a no-op because the results are computed entirely
/// lazily.
-class MemoryDependenceAnalysis : public AnalysisBase<MemoryDependenceAnalysis> {
- friend AnalysisBase<MemoryDependenceAnalysis>;
+class MemoryDependenceAnalysis
+ : public AnalysisInfoMixin<MemoryDependenceAnalysis> {
+ friend AnalysisInfoMixin<MemoryDependenceAnalysis>;
static char PassID;
public:
};
/// Analysis pass providing a never-invalidated alias analysis result.
-class ObjCARCAA : public AnalysisBase<ObjCARCAA> {
- friend AnalysisBase<ObjCARCAA>;
+class ObjCARCAA : public AnalysisInfoMixin<ObjCARCAA> {
+ friend AnalysisInfoMixin<ObjCARCAA>;
static char PassID;
public:
/// \brief Analysis pass which computes a \c PostDominatorTree.
class PostDominatorTreeAnalysis
- : public AnalysisBase<PostDominatorTreeAnalysis> {
- friend AnalysisBase<PostDominatorTreeAnalysis>;
+ : public AnalysisInfoMixin<PostDominatorTreeAnalysis> {
+ friend AnalysisInfoMixin<PostDominatorTreeAnalysis>;
static char PassID;
public:
/// \brief Printer pass for the \c PostDominatorTree.
class PostDominatorTreePrinterPass
- : public PassBase<PostDominatorTreePrinterPass> {
+ : public PassInfoMixin<PostDominatorTreePrinterPass> {
raw_ostream &OS;
public:
};
/// \brief Analysis pass that exposes the \c RegionInfo for a function.
-class RegionInfoAnalysis : public AnalysisBase<RegionInfoAnalysis> {
- friend AnalysisBase<RegionInfoAnalysis>;
+class RegionInfoAnalysis : public AnalysisInfoMixin<RegionInfoAnalysis> {
+ friend AnalysisInfoMixin<RegionInfoAnalysis>;
static char PassID;
public:
};
/// \brief Printer pass for the \c RegionInfo.
-class RegionInfoPrinterPass : public PassBase<RegionInfoPrinterPass> {
+class RegionInfoPrinterPass : public PassInfoMixin<RegionInfoPrinterPass> {
raw_ostream &OS;
public:
};
/// \brief Verifier pass for the \c RegionInfo.
-struct RegionInfoVerifierPass : PassBase<RegionInfoVerifierPass> {
+struct RegionInfoVerifierPass : PassInfoMixin<RegionInfoVerifierPass> {
PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM);
};
};
/// \brief Analysis pass that exposes the \c ScalarEvolution for a function.
- class ScalarEvolutionAnalysis : public AnalysisBase<ScalarEvolutionAnalysis> {
- friend AnalysisBase<ScalarEvolutionAnalysis>;
+ class ScalarEvolutionAnalysis
+ : public AnalysisInfoMixin<ScalarEvolutionAnalysis> {
+ friend AnalysisInfoMixin<ScalarEvolutionAnalysis>;
static char PassID;
public:
/// \brief Printer pass for the \c ScalarEvolutionAnalysis results.
class ScalarEvolutionPrinterPass
- : public PassBase<ScalarEvolutionPrinterPass> {
+ : public PassInfoMixin<ScalarEvolutionPrinterPass> {
raw_ostream &OS;
public:
};
/// Analysis pass providing a never-invalidated alias analysis result.
-class SCEVAA : public AnalysisBase<SCEVAA> {
- friend AnalysisBase<SCEVAA>;
+class SCEVAA : public AnalysisInfoMixin<SCEVAA> {
+ friend AnalysisInfoMixin<SCEVAA>;
static char PassID;
public:
};
/// Analysis pass providing a never-invalidated alias analysis result.
-class ScopedNoAliasAA : public AnalysisBase<ScopedNoAliasAA> {
- friend AnalysisBase<ScopedNoAliasAA>;
+class ScopedNoAliasAA : public AnalysisInfoMixin<ScopedNoAliasAA> {
+ friend AnalysisInfoMixin<ScopedNoAliasAA>;
static char PassID;
public:
///
/// Note that this pass's result cannot be invalidated, it is immutable for the
/// life of the module.
-class TargetLibraryAnalysis : public AnalysisBase<TargetLibraryAnalysis> {
+class TargetLibraryAnalysis : public AnalysisInfoMixin<TargetLibraryAnalysis> {
public:
typedef TargetLibraryInfo Result;
TargetLibraryInfo run(Function &F);
private:
- friend AnalysisBase<TargetLibraryAnalysis>;
+ friend AnalysisInfoMixin<TargetLibraryAnalysis>;
static char PassID;
Optional<TargetLibraryInfoImpl> PresetInfoImpl;
/// is done in a subtarget specific way and LLVM supports compiling different
/// functions targeting different subtargets in order to support runtime
/// dispatch according to the observed subtarget.
-class TargetIRAnalysis : public AnalysisBase<TargetIRAnalysis> {
+class TargetIRAnalysis : public AnalysisInfoMixin<TargetIRAnalysis> {
public:
typedef TargetTransformInfo Result;
Result run(const Function &F);
private:
- friend AnalysisBase<TargetIRAnalysis>;
+ friend AnalysisInfoMixin<TargetIRAnalysis>;
static char PassID;
/// \brief The callback used to produce a result.
};
/// Analysis pass providing a never-invalidated alias analysis result.
-class TypeBasedAA : public AnalysisBase<TypeBasedAA> {
- friend AnalysisBase<TypeBasedAA>;
+class TypeBasedAA : public AnalysisInfoMixin<TypeBasedAA> {
+ friend AnalysisInfoMixin<TypeBasedAA>;
static char PassID;
public:
};
/// \brief Analysis pass which computes a \c DominatorTree.
-class DominatorTreeAnalysis : public AnalysisBase<DominatorTreeAnalysis> {
- friend AnalysisBase<DominatorTreeAnalysis>;
+class DominatorTreeAnalysis : public AnalysisInfoMixin<DominatorTreeAnalysis> {
+ friend AnalysisInfoMixin<DominatorTreeAnalysis>;
static char PassID;
public:
};
/// \brief Printer pass for the \c DominatorTree.
-class DominatorTreePrinterPass : public PassBase<DominatorTreePrinterPass> {
+class DominatorTreePrinterPass
+ : public PassInfoMixin<DominatorTreePrinterPass> {
raw_ostream &OS;
public:
};
/// \brief Verifier pass for the \c DominatorTree.
-struct DominatorTreeVerifierPass : PassBase<DominatorTreeVerifierPass> {
+struct DominatorTreeVerifierPass : PassInfoMixin<DominatorTreeVerifierPass> {
PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM);
};
// Forward declare the analysis manager template.
template <typename IRUnitT> class AnalysisManager;
-/// A CRTP mix-in base class to help define types that are valid passes.
+/// A CRTP mix-in to automatically provide informational APIs needed for
+/// passes.
///
/// This provides some boiler plate for types that are passes.
-template <typename DerivedT> struct PassBase {
+template <typename DerivedT> struct PassInfoMixin {
/// Returns the name of the derived pass type.
static StringRef name() {
StringRef Name = getTypeName<DerivedT>();
}
};
-/// A CRTP mix-in base class to help define types that are valid analyses.
+/// A CRTP mix-in to automatically provide informational APIs needed for
+/// analysis passes.
///
-/// This provides some boiler plate for types that are analysis passes.
-template <typename DerivedT> struct AnalysisBase : PassBase<DerivedT> {
+/// This provides some boiler plate for types that are analysis passes. It
+/// automatically mixes in \c PassInfoMixin and adds informational APIs
+/// specifically used for analyses.
+template <typename DerivedT>
+struct AnalysisInfoMixin : PassInfoMixin<DerivedT> {
/// Returns an opaque, unique ID for this pass type.
///
/// Note that this requires the derived type provide a static member whose
/// manager's invalidation routine with the PreservedAnalyses of each pass it
/// runs.
template <typename IRUnitT>
-class PassManager : public PassBase<PassManager<IRUnitT>> {
+class PassManager : public PassInfoMixin<PassManager<IRUnitT>> {
public:
/// \brief Construct a pass manager.
///
/// provides.
template <typename AnalysisManagerT, typename IRUnitT>
class InnerAnalysisManagerProxy
- : public AnalysisBase<
+ : public AnalysisInfoMixin<
InnerAnalysisManagerProxy<AnalysisManagerT, IRUnitT>> {
public:
class Result {
Result run(IRUnitT &IR) { return Result(*AM); }
private:
- friend AnalysisBase<InnerAnalysisManagerProxy<AnalysisManagerT, IRUnitT>>;
+ friend AnalysisInfoMixin<
+ InnerAnalysisManagerProxy<AnalysisManagerT, IRUnitT>>;
static char PassID;
AnalysisManagerT *AM;
/// returned PreservedAnalysis set.
template <typename AnalysisManagerT, typename IRUnitT>
class OuterAnalysisManagerProxy
- : public AnalysisBase<
+ : public AnalysisInfoMixin<
OuterAnalysisManagerProxy<AnalysisManagerT, IRUnitT>> {
public:
/// \brief Result proxy object for \c OuterAnalysisManagerProxy.
Result run(IRUnitT &) { return Result(*AM); }
private:
- friend AnalysisBase<OuterAnalysisManagerProxy<AnalysisManagerT, IRUnitT>>;
+ friend AnalysisInfoMixin<
+ OuterAnalysisManagerProxy<AnalysisManagerT, IRUnitT>>;
static char PassID;
const AnalysisManagerT *AM;
/// violate this principle.
template <typename FunctionPassT>
class ModuleToFunctionPassAdaptor
- : public PassBase<ModuleToFunctionPassAdaptor<FunctionPassT>> {
+ : public PassInfoMixin<ModuleToFunctionPassAdaptor<FunctionPassT>> {
public:
explicit ModuleToFunctionPassAdaptor(FunctionPassT Pass)
: Pass(std::move(Pass)) {}
/// This is a no-op pass which simply forces a specific analysis pass's result
/// to be available when it is run.
template <typename AnalysisT>
-struct RequireAnalysisPass : PassBase<RequireAnalysisPass<AnalysisT>> {
+struct RequireAnalysisPass : PassInfoMixin<RequireAnalysisPass<AnalysisT>> {
/// \brief Run this pass over some unit of IR.
///
/// This pass can be run over any unit of IR and use any analysis manager
/// This is a no-op pass which simply forces a specific analysis result to be
/// invalidated when it is run.
template <typename AnalysisT>
-struct InvalidateAnalysisPass : PassBase<InvalidateAnalysisPass<AnalysisT>> {
+struct InvalidateAnalysisPass
+ : PassInfoMixin<InvalidateAnalysisPass<AnalysisT>> {
/// \brief Run this pass over some unit of IR.
///
/// This pass can be run over any unit of IR and use any analysis manager
///
/// As a consequence fo not preserving any analyses, this pass will force all
/// analysis passes to be re-run to produce fresh results if any are needed.
-struct InvalidateAllAnalysesPass : PassBase<InvalidateAllAnalysesPass> {
+struct InvalidateAllAnalysesPass : PassInfoMixin<InvalidateAllAnalysesPass> {
/// \brief Run this pass over some unit of IR.
template <typename IRUnitT> PreservedAnalyses run(IRUnitT &Arg) {
return PreservedAnalyses::none();
/// nothing to do with \c VerifierPass.
FunctionPass *createVerifierPass(bool FatalErrors = true);
-class VerifierPass : public PassBase<VerifierPass> {
+class VerifierPass : public PassInfoMixin<VerifierPass> {
bool FatalErrors;
public:
/// Pass which forces specific function attributes into the IR, primarily as
/// a debugging tool.
-struct ForceFunctionAttrsPass : PassBase<ForceFunctionAttrsPass> {
+struct ForceFunctionAttrsPass : PassInfoMixin<ForceFunctionAttrsPass> {
PreservedAnalyses run(Module &M);
};
/// access memory, or only read memory, and give them the readnone/readonly
/// attribute. It also discovers function arguments that are not captured by
/// the function and marks them with the nocapture attribute.
-struct PostOrderFunctionAttrsPass : PassBase<PostOrderFunctionAttrsPass> {
+struct PostOrderFunctionAttrsPass : PassInfoMixin<PostOrderFunctionAttrsPass> {
PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager *AM);
};
/// A pass which infers function attributes from the names and signatures of
/// function declarations in a module.
-struct InferFunctionAttrsPass : PassBase<InferFunctionAttrsPass> {
+struct InferFunctionAttrsPass : PassInfoMixin<InferFunctionAttrsPass> {
PreservedAnalyses run(Module &M, AnalysisManager<Module> *AM);
};
namespace llvm {
/// Pass to remove unused function declarations.
-struct StripDeadPrototypesPass : PassBase<StripDeadPrototypesPass> {
+struct StripDeadPrototypesPass : PassInfoMixin<StripDeadPrototypesPass> {
PreservedAnalyses run(Module &M);
};
namespace llvm {
-class InstCombinePass : public PassBase<InstCombinePass> {
+class InstCombinePass : public PassInfoMixin<InstCombinePass> {
InstCombineWorklist Worklist;
bool ExpensiveCombines;
/// instructions are dead until proven otherwise. This allows it to eliminate
/// dead computations that other DCE passes do not catch, particularly involving
/// loop computations.
-struct ADCEPass : PassBase<ADCEPass> {
+struct ADCEPass : PassInfoMixin<ADCEPass> {
PreservedAnalyses run(Function &F);
};
}
/// canonicalize things as it goes. It is intended to be fast and catch obvious
/// cases so that instcombine and other passes are more effective. It is
/// expected that a later pass of GVN will catch the interesting/hard cases.
-struct EarlyCSEPass : PassBase<EarlyCSEPass> {
+struct EarlyCSEPass : PassInfoMixin<EarlyCSEPass> {
/// \brief Run the pass over the function.
PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM);
};
///
/// FIXME: We should have a good summary of the GVN algorithm implemented by
/// this particular pass here.
-class GVN : public PassBase<GVN> {
+class GVN : public PassInfoMixin<GVN> {
public:
/// \brief Run the pass over the function.
namespace llvm {
-struct LowerExpectIntrinsicPass : PassBase<LowerExpectIntrinsicPass> {
+struct LowerExpectIntrinsicPass : PassInfoMixin<LowerExpectIntrinsicPass> {
/// \brief Run the pass over the function.
///
/// This will lower all of th expect intrinsic calls in this function into
/// onto insert and extract operations on a vector value, and convert them to
/// this form. By doing so, it will enable promotion of vector aggregates to
/// SSA vector values.
-class SROA : public PassBase<SROA> {
+class SROA : public PassInfoMixin<SROA> {
LLVMContext *C;
DominatorTree *DT;
AssumptionCache *AC;
/// This pass iteratively simplifies the entire CFG of a function, removing
/// unnecessary control flows and bringing it into the canonical form expected
/// by the rest of the mid-level optimizer.
-class SimplifyCFGPass : public PassBase<SimplifyCFGPass> {
+class SimplifyCFGPass : public PassInfoMixin<SimplifyCFGPass> {
int BonusInstThreshold;
public:
};
/// \brief No-op module analysis.
-class NoOpModuleAnalysis : public AnalysisBase<NoOpModuleAnalysis> {
- friend AnalysisBase<NoOpModuleAnalysis>;
+class NoOpModuleAnalysis : public AnalysisInfoMixin<NoOpModuleAnalysis> {
+ friend AnalysisInfoMixin<NoOpModuleAnalysis>;
static char PassID;
public:
};
/// \brief No-op CGSCC analysis.
-class NoOpCGSCCAnalysis : public AnalysisBase<NoOpCGSCCAnalysis> {
- friend AnalysisBase<NoOpCGSCCAnalysis>;
+class NoOpCGSCCAnalysis : public AnalysisInfoMixin<NoOpCGSCCAnalysis> {
+ friend AnalysisInfoMixin<NoOpCGSCCAnalysis>;
static char PassID;
public:
};
/// \brief No-op function analysis.
-class NoOpFunctionAnalysis : public AnalysisBase<NoOpFunctionAnalysis> {
- friend AnalysisBase<NoOpFunctionAnalysis>;
+class NoOpFunctionAnalysis : public AnalysisInfoMixin<NoOpFunctionAnalysis> {
+ friend AnalysisInfoMixin<NoOpFunctionAnalysis>;
static char PassID;
public:
};
/// \brief No-op loop analysis.
-class NoOpLoopAnalysis : public AnalysisBase<NoOpLoopAnalysis> {
- friend AnalysisBase<NoOpLoopAnalysis>;
+class NoOpLoopAnalysis : public AnalysisInfoMixin<NoOpLoopAnalysis> {
+ friend AnalysisInfoMixin<NoOpLoopAnalysis>;
static char PassID;
public:
namespace {
-class TestFunctionAnalysis : public AnalysisBase<TestFunctionAnalysis> {
+class TestFunctionAnalysis : public AnalysisInfoMixin<TestFunctionAnalysis> {
public:
struct Result {
Result(int Count) : InstructionCount(Count) {}
}
private:
- friend AnalysisBase<TestFunctionAnalysis>;
+ friend AnalysisInfoMixin<TestFunctionAnalysis>;
static char PassID;
int &Runs;
char TestFunctionAnalysis::PassID;
-class TestModuleAnalysis : public AnalysisBase<TestModuleAnalysis> {
+class TestModuleAnalysis : public AnalysisInfoMixin<TestModuleAnalysis> {
public:
struct Result {
Result(int Count) : FunctionCount(Count) {}
}
private:
- friend AnalysisBase<TestModuleAnalysis>;
+ friend AnalysisInfoMixin<TestModuleAnalysis>;
static char PassID;
int &Runs;
char TestModuleAnalysis::PassID;
-struct TestModulePass : PassBase<TestModulePass> {
+struct TestModulePass : PassInfoMixin<TestModulePass> {
TestModulePass(int &RunCount) : RunCount(RunCount) {}
PreservedAnalyses run(Module &M) {
int &RunCount;
};
-struct TestPreservingModulePass : PassBase<TestPreservingModulePass> {
+struct TestPreservingModulePass : PassInfoMixin<TestPreservingModulePass> {
PreservedAnalyses run(Module &M) { return PreservedAnalyses::all(); }
};
-struct TestMinPreservingModulePass : PassBase<TestMinPreservingModulePass> {
+struct TestMinPreservingModulePass
+ : PassInfoMixin<TestMinPreservingModulePass> {
PreservedAnalyses run(Module &M, ModuleAnalysisManager *AM) {
PreservedAnalyses PA;
}
};
-struct TestFunctionPass : PassBase<TestFunctionPass> {
+struct TestFunctionPass : PassInfoMixin<TestFunctionPass> {
TestFunctionPass(int &RunCount, int &AnalyzedInstrCount,
int &AnalyzedFunctionCount,
bool OnlyUseCachedResults = false)
// A test function pass that invalidates all function analyses for a function
// with a specific name.
-struct TestInvalidationFunctionPass : PassBase<TestInvalidationFunctionPass> {
+struct TestInvalidationFunctionPass
+ : PassInfoMixin<TestInvalidationFunctionPass> {
TestInvalidationFunctionPass(StringRef FunctionName) : Name(FunctionName) {}
PreservedAnalyses run(Function &F) {