diff options
Diffstat (limited to 'llvm/include')
30 files changed, 73 insertions, 85 deletions
diff --git a/llvm/include/llvm/Analysis/AliasAnalysis.h b/llvm/include/llvm/Analysis/AliasAnalysis.h index 424ea0f74d6..2d06965b84e 100644 --- a/llvm/include/llvm/Analysis/AliasAnalysis.h +++ b/llvm/include/llvm/Analysis/AliasAnalysis.h @@ -866,10 +866,10 @@ public: ResultGetters.push_back(&getModuleAAResultImpl<AnalysisT>); } - Result run(Function &F, AnalysisManager<Function> *AM) { - Result R(AM->getResult<TargetLibraryAnalysis>(F)); + Result run(Function &F, AnalysisManager<Function> &AM) { + Result R(AM.getResult<TargetLibraryAnalysis>(F)); for (auto &Getter : ResultGetters) - (*Getter)(F, *AM, R); + (*Getter)(F, AM, R); return R; } diff --git a/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h b/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h index 2b9573e8b7b..3bdd8dbf726 100644 --- a/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h +++ b/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h @@ -55,7 +55,7 @@ public: static StringRef name() { return "AAEvaluator"; } /// \brief Run the pass over the function. - PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM); + PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM); private: // Allow the legacy pass to run this using an internal API. diff --git a/llvm/include/llvm/Analysis/AssumptionCache.h b/llvm/include/llvm/Analysis/AssumptionCache.h index f76a73780a4..9e8243492c0 100644 --- a/llvm/include/llvm/Analysis/AssumptionCache.h +++ b/llvm/include/llvm/Analysis/AssumptionCache.h @@ -115,7 +115,7 @@ class AssumptionPrinterPass : public PassInfoMixin<AssumptionPrinterPass> { public: explicit AssumptionPrinterPass(raw_ostream &OS) : OS(OS) {} - PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM); + PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM); static StringRef name() { return "AssumptionPrinterPass"; } }; diff --git a/llvm/include/llvm/Analysis/BasicAliasAnalysis.h b/llvm/include/llvm/Analysis/BasicAliasAnalysis.h index 43752c7d725..a1ac3ed57bc 100644 --- a/llvm/include/llvm/Analysis/BasicAliasAnalysis.h +++ b/llvm/include/llvm/Analysis/BasicAliasAnalysis.h @@ -187,7 +187,7 @@ class BasicAA : public AnalysisInfoMixin<BasicAA> { public: typedef BasicAAResult Result; - BasicAAResult run(Function &F, AnalysisManager<Function> *AM); + BasicAAResult run(Function &F, AnalysisManager<Function> &AM); }; /// Legacy wrapper pass to provide the BasicAAResult object. diff --git a/llvm/include/llvm/Analysis/CFLAliasAnalysis.h b/llvm/include/llvm/Analysis/CFLAliasAnalysis.h index 08848700239..5ee4dddb94e 100644 --- a/llvm/include/llvm/Analysis/CFLAliasAnalysis.h +++ b/llvm/include/llvm/Analysis/CFLAliasAnalysis.h @@ -116,7 +116,7 @@ class CFLAA : public AnalysisInfoMixin<CFLAA> { public: typedef CFLAAResult Result; - CFLAAResult run(Function &F, AnalysisManager<Function> *AM); + CFLAAResult run(Function &F, AnalysisManager<Function> &AM); }; /// Legacy wrapper pass to provide the CFLAAResult object. diff --git a/llvm/include/llvm/Analysis/CGSCCPassManager.h b/llvm/include/llvm/Analysis/CGSCCPassManager.h index d69ee3f4f19..989305ebb27 100644 --- a/llvm/include/llvm/Analysis/CGSCCPassManager.h +++ b/llvm/include/llvm/Analysis/CGSCCPassManager.h @@ -88,20 +88,18 @@ public: } /// \brief Runs the CGSCC pass across every SCC in the module. - PreservedAnalyses run(Module &M, ModuleAnalysisManager *AM) { - assert(AM && "We need analyses to compute the call graph!"); - + PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM) { // Setup the CGSCC analysis manager from its proxy. CGSCCAnalysisManager &CGAM = - AM->getResult<CGSCCAnalysisManagerModuleProxy>(M).getManager(); + AM.getResult<CGSCCAnalysisManagerModuleProxy>(M).getManager(); // Get the call graph for this module. - LazyCallGraph &CG = AM->getResult<LazyCallGraphAnalysis>(M); + LazyCallGraph &CG = AM.getResult<LazyCallGraphAnalysis>(M); PreservedAnalyses PA = PreservedAnalyses::all(); for (LazyCallGraph::RefSCC &OuterC : CG.postorder_ref_sccs()) for (LazyCallGraph::SCC &C : OuterC) { - PreservedAnalyses PassPA = Pass.run(C, &CGAM); + PreservedAnalyses PassPA = Pass.run(C, CGAM); // We know that the CGSCC pass couldn't have invalidated any other // SCC's analyses (that's the contract of a CGSCC pass), so @@ -180,11 +178,10 @@ public: } /// \brief Runs the function pass across every function in the module. - PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager *AM) { - FunctionAnalysisManager *FAM = nullptr; - if (AM) - // Setup the function analysis manager from its proxy. - FAM = &AM->getResult<FunctionAnalysisManagerCGSCCProxy>(C).getManager(); + PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM) { + // Setup the function analysis manager from its proxy. + FunctionAnalysisManager &FAM = + AM.getResult<FunctionAnalysisManagerCGSCCProxy>(C).getManager(); PreservedAnalyses PA = PreservedAnalyses::all(); for (LazyCallGraph::Node &N : C) { @@ -195,8 +192,7 @@ public: // directly handle the function analysis manager's invalidation here. // Also, update the preserved analyses to reflect that once invalidated // these can again be preserved. - if (FAM) - PassPA = FAM->invalidate(N.getFunction(), std::move(PassPA)); + PassPA = FAM.invalidate(N.getFunction(), std::move(PassPA)); // Then intersect the preserved set so that invalidation of module // analyses will eventually occur when the module pass completes. diff --git a/llvm/include/llvm/Analysis/CallGraph.h b/llvm/include/llvm/Analysis/CallGraph.h index d4f9d25ed3e..565c20569cf 100644 --- a/llvm/include/llvm/Analysis/CallGraph.h +++ b/llvm/include/llvm/Analysis/CallGraph.h @@ -315,7 +315,7 @@ class CallGraphPrinterPass : public PassInfoMixin<CallGraphPrinterPass> { public: explicit CallGraphPrinterPass(raw_ostream &OS) : OS(OS) {} - PreservedAnalyses run(Module &M, AnalysisManager<Module> *AM); + PreservedAnalyses run(Module &M, AnalysisManager<Module> &AM); }; /// \brief The \c ModulePass which wraps up a \c CallGraph and the logic to diff --git a/llvm/include/llvm/Analysis/DominanceFrontier.h b/llvm/include/llvm/Analysis/DominanceFrontier.h index 65940e92a1c..79672e4e422 100644 --- a/llvm/include/llvm/Analysis/DominanceFrontier.h +++ b/llvm/include/llvm/Analysis/DominanceFrontier.h @@ -178,7 +178,7 @@ public: typedef DominanceFrontier Result; /// \brief Run the analysis pass over a function and produce a dominator tree. - DominanceFrontier run(Function &F, AnalysisManager<Function> *AM); + DominanceFrontier run(Function &F, AnalysisManager<Function> &AM); }; /// \brief Printer pass for the \c DominanceFrontier. @@ -188,7 +188,7 @@ class DominanceFrontierPrinterPass public: explicit DominanceFrontierPrinterPass(raw_ostream &OS); - PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM); + PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM); }; } // End llvm namespace diff --git a/llvm/include/llvm/Analysis/GlobalsModRef.h b/llvm/include/llvm/Analysis/GlobalsModRef.h index 555b25d9afa..4c0a9894977 100644 --- a/llvm/include/llvm/Analysis/GlobalsModRef.h +++ b/llvm/include/llvm/Analysis/GlobalsModRef.h @@ -125,7 +125,7 @@ class GlobalsAA : public AnalysisInfoMixin<GlobalsAA> { public: typedef GlobalsAAResult Result; - GlobalsAAResult run(Module &M, AnalysisManager<Module> *AM); + GlobalsAAResult run(Module &M, AnalysisManager<Module> &AM); }; /// Legacy wrapper pass to provide the GlobalsAAResult object. diff --git a/llvm/include/llvm/Analysis/LazyCallGraph.h b/llvm/include/llvm/Analysis/LazyCallGraph.h index d9047323a81..4e72052b9b8 100644 --- a/llvm/include/llvm/Analysis/LazyCallGraph.h +++ b/llvm/include/llvm/Analysis/LazyCallGraph.h @@ -920,7 +920,7 @@ class LazyCallGraphPrinterPass public: explicit LazyCallGraphPrinterPass(raw_ostream &OS); - PreservedAnalyses run(Module &M, ModuleAnalysisManager *AM); + PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); }; } diff --git a/llvm/include/llvm/Analysis/LoopInfo.h b/llvm/include/llvm/Analysis/LoopInfo.h index de0e3a5b972..934db11abf5 100644 --- a/llvm/include/llvm/Analysis/LoopInfo.h +++ b/llvm/include/llvm/Analysis/LoopInfo.h @@ -794,7 +794,7 @@ class LoopAnalysis : public AnalysisInfoMixin<LoopAnalysis> { public: typedef LoopInfo Result; - LoopInfo run(Function &F, AnalysisManager<Function> *AM); + LoopInfo run(Function &F, AnalysisManager<Function> &AM); }; /// \brief Printer pass for the \c LoopAnalysis results. @@ -803,7 +803,7 @@ class LoopPrinterPass : public PassInfoMixin<LoopPrinterPass> { public: explicit LoopPrinterPass(raw_ostream &OS) : OS(OS) {} - PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM); + PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM); }; /// \brief The legacy pass manager's analysis pass to compute loop information. diff --git a/llvm/include/llvm/Analysis/LoopPassManager.h b/llvm/include/llvm/Analysis/LoopPassManager.h index 1b723c35df6..e7d9578c1f8 100644 --- a/llvm/include/llvm/Analysis/LoopPassManager.h +++ b/llvm/include/llvm/Analysis/LoopPassManager.h @@ -78,14 +78,12 @@ public: } /// \brief Runs the loop passes across every loop in the function. - PreservedAnalyses run(Function &F, FunctionAnalysisManager *AM) { - assert(AM && "We need analyses to compute the loop structure!"); - + PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM) { // Setup the loop analysis manager from its proxy. - LoopAnalysisManager *LAM = - &AM->getResult<LoopAnalysisManagerFunctionProxy>(F).getManager(); + LoopAnalysisManager &LAM = + AM.getResult<LoopAnalysisManagerFunctionProxy>(F).getManager(); // Get the loop structure for this function - LoopInfo &LI = AM->getResult<LoopAnalysis>(F); + LoopInfo &LI = AM.getResult<LoopAnalysis>(F); PreservedAnalyses PA = PreservedAnalyses::all(); @@ -109,7 +107,7 @@ public: // loop analysis manager's invalidation here. Also, update the // preserved analyses to reflect that once invalidated these can again // be preserved. - PassPA = LAM->invalidate(*L, std::move(PassPA)); + PassPA = LAM.invalidate(*L, std::move(PassPA)); // Then intersect the preserved set so that invalidation of module // analyses will eventually occur when the module pass completes. diff --git a/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h b/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h index 7c8bd2f5cdc..b92dec9a7bc 100644 --- a/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h +++ b/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h @@ -479,7 +479,7 @@ class MemoryDependenceAnalysis public: typedef MemoryDependenceResults Result; - MemoryDependenceResults run(Function &F, AnalysisManager<Function> *AM); + MemoryDependenceResults run(Function &F, AnalysisManager<Function> &AM); }; /// A wrapper analysis pass for the legacy pass manager that exposes a \c diff --git a/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h b/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h index 06a2ce77b6f..067a964bcce 100644 --- a/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h +++ b/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h @@ -68,7 +68,7 @@ class ObjCARCAA : public AnalysisInfoMixin<ObjCARCAA> { public: typedef ObjCARCAAResult Result; - ObjCARCAAResult run(Function &F, AnalysisManager<Function> *AM); + ObjCARCAAResult run(Function &F, AnalysisManager<Function> &AM); }; /// Legacy wrapper pass to provide the ObjCARCAAResult object. diff --git a/llvm/include/llvm/Analysis/PostDominators.h b/llvm/include/llvm/Analysis/PostDominators.h index dd6e9d36436..28a1b0d0dc7 100644 --- a/llvm/include/llvm/Analysis/PostDominators.h +++ b/llvm/include/llvm/Analysis/PostDominators.h @@ -58,7 +58,7 @@ class PostDominatorTreePrinterPass public: explicit PostDominatorTreePrinterPass(raw_ostream &OS); - PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM); + PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM); }; struct PostDominatorTreeWrapperPass : public FunctionPass { diff --git a/llvm/include/llvm/Analysis/RegionInfo.h b/llvm/include/llvm/Analysis/RegionInfo.h index c3cbc9e2fb3..91bfd435f08 100644 --- a/llvm/include/llvm/Analysis/RegionInfo.h +++ b/llvm/include/llvm/Analysis/RegionInfo.h @@ -930,7 +930,7 @@ class RegionInfoAnalysis : public AnalysisInfoMixin<RegionInfoAnalysis> { public: typedef RegionInfo Result; - RegionInfo run(Function &F, AnalysisManager<Function> *AM); + RegionInfo run(Function &F, AnalysisManager<Function> &AM); }; /// \brief Printer pass for the \c RegionInfo. @@ -939,12 +939,12 @@ class RegionInfoPrinterPass : public PassInfoMixin<RegionInfoPrinterPass> { public: explicit RegionInfoPrinterPass(raw_ostream &OS); - PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM); + PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM); }; /// \brief Verifier pass for the \c RegionInfo. struct RegionInfoVerifierPass : PassInfoMixin<RegionInfoVerifierPass> { - PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM); + PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM); }; template <> diff --git a/llvm/include/llvm/Analysis/ScalarEvolution.h b/llvm/include/llvm/Analysis/ScalarEvolution.h index 040b16d0dd8..775f526b1a2 100644 --- a/llvm/include/llvm/Analysis/ScalarEvolution.h +++ b/llvm/include/llvm/Analysis/ScalarEvolution.h @@ -1438,7 +1438,7 @@ namespace llvm { public: typedef ScalarEvolution Result; - ScalarEvolution run(Function &F, AnalysisManager<Function> *AM); + ScalarEvolution run(Function &F, AnalysisManager<Function> &AM); }; /// \brief Printer pass for the \c ScalarEvolutionAnalysis results. @@ -1448,7 +1448,7 @@ namespace llvm { public: explicit ScalarEvolutionPrinterPass(raw_ostream &OS) : OS(OS) {} - PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM); + PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM); }; class ScalarEvolutionWrapperPass : public FunctionPass { diff --git a/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h b/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h index 89e4a0035ca..ac10370b413 100644 --- a/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h +++ b/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h @@ -45,7 +45,7 @@ class SCEVAA : public AnalysisInfoMixin<SCEVAA> { public: typedef SCEVAAResult Result; - SCEVAAResult run(Function &F, AnalysisManager<Function> *AM); + SCEVAAResult run(Function &F, AnalysisManager<Function> &AM); }; /// Legacy wrapper pass to provide the SCEVAAResult object. diff --git a/llvm/include/llvm/Analysis/ScopedNoAliasAA.h b/llvm/include/llvm/Analysis/ScopedNoAliasAA.h index a5cba3f54b1..87b85d4e663 100644 --- a/llvm/include/llvm/Analysis/ScopedNoAliasAA.h +++ b/llvm/include/llvm/Analysis/ScopedNoAliasAA.h @@ -54,7 +54,7 @@ class ScopedNoAliasAA : public AnalysisInfoMixin<ScopedNoAliasAA> { public: typedef ScopedNoAliasAAResult Result; - ScopedNoAliasAAResult run(Function &F, AnalysisManager<Function> *AM); + ScopedNoAliasAAResult run(Function &F, AnalysisManager<Function> &AM); }; /// Legacy wrapper pass to provide the ScopedNoAliasAAResult object. diff --git a/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h b/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h index 9b497504b22..229b0f97b98 100644 --- a/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h +++ b/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h @@ -55,7 +55,7 @@ class TypeBasedAA : public AnalysisInfoMixin<TypeBasedAA> { public: typedef TypeBasedAAResult Result; - TypeBasedAAResult run(Function &F, AnalysisManager<Function> *AM); + TypeBasedAAResult run(Function &F, AnalysisManager<Function> &AM); }; /// Legacy wrapper pass to provide the TypeBasedAAResult object. diff --git a/llvm/include/llvm/IR/Dominators.h b/llvm/include/llvm/IR/Dominators.h index 8efff1c0c46..f4990b0557e 100644 --- a/llvm/include/llvm/IR/Dominators.h +++ b/llvm/include/llvm/IR/Dominators.h @@ -201,12 +201,12 @@ class DominatorTreePrinterPass public: explicit DominatorTreePrinterPass(raw_ostream &OS); - PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM); + PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM); }; /// \brief Verifier pass for the \c DominatorTree. struct DominatorTreeVerifierPass : PassInfoMixin<DominatorTreeVerifierPass> { - PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM); + PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM); }; /// \brief Legacy analysis pass which computes a \c DominatorTree. diff --git a/llvm/include/llvm/IR/PassManager.h b/llvm/include/llvm/IR/PassManager.h index 6ed6a366867..799f4aa6a00 100644 --- a/llvm/include/llvm/IR/PassManager.h +++ b/llvm/include/llvm/IR/PassManager.h @@ -235,7 +235,7 @@ public: } /// \brief Run all of the passes in this manager over the IR. - PreservedAnalyses run(IRUnitT &IR, AnalysisManager<IRUnitT> *AM = nullptr) { + PreservedAnalyses run(IRUnitT &IR, AnalysisManager<IRUnitT> &AM) { PreservedAnalyses PA = PreservedAnalyses::all(); if (DebugLogging) @@ -248,13 +248,11 @@ public: PreservedAnalyses PassPA = Passes[Idx]->run(IR, AM); - // If we have an active analysis manager at this level we want to ensure - // we update it as each pass runs and potentially invalidates analyses. - // We also update the preserved set of analyses based on what analyses we - // have already handled the invalidation for here and don't need to - // invalidate when finished. - if (AM) - PassPA = AM->invalidate(IR, std::move(PassPA)); + // Update the analysis manager as each pass runs and potentially + // invalidates analyses. We also update the preserved set of analyses + // based on what analyses we have already handled the invalidation for + // here and don't need to invalidate when finished. + PassPA = AM.invalidate(IR, std::move(PassPA)); // Finally, we intersect the final preserved analyses to compute the // aggregate preserved set for this pass manager. @@ -533,7 +531,7 @@ private: if (DebugLogging) dbgs() << "Running analysis: " << P.name() << "\n"; AnalysisResultListT &ResultList = AnalysisResultLists[&IR]; - ResultList.emplace_back(PassID, P.run(IR, this)); + ResultList.emplace_back(PassID, P.run(IR, *this)); // P.run may have inserted elements into AnalysisResults and invalidated // RI. @@ -885,11 +883,10 @@ public: } /// \brief Runs the function pass across every function in the module. - PreservedAnalyses run(Module &M, ModuleAnalysisManager *AM) { - FunctionAnalysisManager *FAM = nullptr; - if (AM) - // Setup the function analysis manager from its proxy. - FAM = &AM->getResult<FunctionAnalysisManagerModuleProxy>(M).getManager(); + PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM) { + // Setup the function analysis manager from its proxy. + FunctionAnalysisManager &FAM = + AM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager(); PreservedAnalyses PA = PreservedAnalyses::all(); for (Function &F : M) { @@ -903,8 +900,7 @@ public: // directly handle the function analysis manager's invalidation here and // update our preserved set to reflect that these have already been // handled. - if (FAM) - PassPA = FAM->invalidate(F, std::move(PassPA)); + PassPA = FAM.invalidate(F, std::move(PassPA)); // Then intersect the preserved set so that invalidation of module // analyses will eventually occur when the module pass completes. @@ -944,9 +940,8 @@ struct RequireAnalysisPass : PassInfoMixin<RequireAnalysisPass<AnalysisT>> { /// created, these methods can be instantiated to satisfy whatever the /// context requires. template <typename IRUnitT> - PreservedAnalyses run(IRUnitT &Arg, AnalysisManager<IRUnitT> *AM) { - if (AM) - (void)AM->template getResult<AnalysisT>(Arg); + PreservedAnalyses run(IRUnitT &Arg, AnalysisManager<IRUnitT> &AM) { + (void)AM.template getResult<AnalysisT>(Arg); return PreservedAnalyses::all(); } @@ -967,11 +962,10 @@ struct InvalidateAnalysisPass /// created, these methods can be instantiated to satisfy whatever the /// context requires. template <typename IRUnitT> - PreservedAnalyses run(IRUnitT &Arg, AnalysisManager<IRUnitT> *AM) { - if (AM) - // We have to directly invalidate the analysis result as we can't - // enumerate all other analyses and use the preserved set to control it. - (void)AM->template invalidate<AnalysisT>(Arg); + PreservedAnalyses run(IRUnitT &Arg, AnalysisManager<IRUnitT> &AM) { + // We have to directly invalidate the analysis result as we can't + // enumerate all other analyses and use the preserved set to control it. + AM.template invalidate<AnalysisT>(Arg); return PreservedAnalyses::all(); } diff --git a/llvm/include/llvm/IR/PassManagerInternal.h b/llvm/include/llvm/IR/PassManagerInternal.h index 92de10bcd75..e5bdd226a1c 100644 --- a/llvm/include/llvm/IR/PassManagerInternal.h +++ b/llvm/include/llvm/IR/PassManagerInternal.h @@ -40,7 +40,7 @@ template <typename IRUnitT> struct PassConcept { /// Note that actual pass object can omit the analysis manager argument if /// desired. Also that the analysis manager may be null if there is no /// analysis manager in the pass pipeline. - virtual PreservedAnalyses run(IRUnitT &IR, AnalysisManager<IRUnitT> *AM) = 0; + virtual PreservedAnalyses run(IRUnitT &IR, AnalysisManager<IRUnitT> &AM) = 0; /// \brief Polymorphic method to access the name of a pass. virtual StringRef name() = 0; @@ -55,7 +55,7 @@ class PassRunAcceptsAnalysisManager { char a, b; }; - template <typename T, ResultT (T::*)(IRUnitT &, AnalysisManager<IRUnitT> *)> + template <typename T, ResultT (T::*)(IRUnitT &, AnalysisManager<IRUnitT> &)> struct Checker; template <typename T> static SmallType f(Checker<T, &T::run> *); @@ -96,7 +96,7 @@ struct PassModel<IRUnitT, PassT, PreservedAnalysesT, true> return *this; } - PreservedAnalysesT run(IRUnitT &IR, AnalysisManager<IRUnitT> *AM) override { + PreservedAnalysesT run(IRUnitT &IR, AnalysisManager<IRUnitT> &AM) override { return Pass.run(IR, AM); } StringRef name() override { return PassT::name(); } @@ -122,7 +122,7 @@ struct PassModel<IRUnitT, PassT, PreservedAnalysesT, false> return *this; } - PreservedAnalysesT run(IRUnitT &IR, AnalysisManager<IRUnitT> *AM) override { + PreservedAnalysesT run(IRUnitT &IR, AnalysisManager<IRUnitT> &) override { return Pass.run(IR); } StringRef name() override { return PassT::name(); } @@ -252,7 +252,7 @@ template <typename IRUnitT> struct AnalysisPassConcept { /// \returns A unique_ptr to the analysis result object to be queried by /// users. virtual std::unique_ptr<AnalysisResultConcept<IRUnitT>> - run(IRUnitT &IR, AnalysisManager<IRUnitT> *AM) = 0; + run(IRUnitT &IR, AnalysisManager<IRUnitT> &AM) = 0; /// \brief Polymorphic method to access the name of a pass. virtual StringRef name() = 0; @@ -294,7 +294,7 @@ struct AnalysisPassModel<IRUnitT, PassT, true> : AnalysisPassConcept<IRUnitT> { /// /// The return is wrapped in an \c AnalysisResultModel. std::unique_ptr<AnalysisResultConcept<IRUnitT>> - run(IRUnitT &IR, AnalysisManager<IRUnitT> *AM) override { + run(IRUnitT &IR, AnalysisManager<IRUnitT> &AM) override { return make_unique<ResultModelT>(Pass.run(IR, AM)); } @@ -332,7 +332,7 @@ struct AnalysisPassModel<IRUnitT, PassT, false> : AnalysisPassConcept<IRUnitT> { /// /// The return is wrapped in an \c AnalysisResultModel. std::unique_ptr<AnalysisResultConcept<IRUnitT>> - run(IRUnitT &IR, AnalysisManager<IRUnitT> *) override { + run(IRUnitT &IR, AnalysisManager<IRUnitT> &) override { return make_unique<ResultModelT>(Pass.run(IR)); } diff --git a/llvm/include/llvm/Transforms/IPO/FunctionAttrs.h b/llvm/include/llvm/Transforms/IPO/FunctionAttrs.h index aab7d8ba9f3..83fad94ef84 100644 --- a/llvm/include/llvm/Transforms/IPO/FunctionAttrs.h +++ b/llvm/include/llvm/Transforms/IPO/FunctionAttrs.h @@ -30,7 +30,7 @@ namespace llvm { /// attribute. It also discovers function arguments that are not captured by /// the function and marks them with the nocapture attribute. struct PostOrderFunctionAttrsPass : PassInfoMixin<PostOrderFunctionAttrsPass> { - PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager *AM); + PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM); }; /// Create a legacy pass manager instance of a pass to compute function attrs diff --git a/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h b/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h index a26205d5403..f5cbf9eb061 100644 --- a/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h +++ b/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h @@ -24,7 +24,7 @@ namespace llvm { /// A pass which infers function attributes from the names and signatures of /// function declarations in a module. struct InferFunctionAttrsPass : PassInfoMixin<InferFunctionAttrsPass> { - PreservedAnalyses run(Module &M, AnalysisManager<Module> *AM); + PreservedAnalyses run(Module &M, AnalysisManager<Module> &AM); }; /// Create a legacy pass manager instance of a pass to infer function diff --git a/llvm/include/llvm/Transforms/InstCombine/InstCombine.h b/llvm/include/llvm/Transforms/InstCombine/InstCombine.h index b03017fd8b6..d70b847c689 100644 --- a/llvm/include/llvm/Transforms/InstCombine/InstCombine.h +++ b/llvm/include/llvm/Transforms/InstCombine/InstCombine.h @@ -43,7 +43,7 @@ public: return *this; } - PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM); + PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM); }; /// \brief The legacy pass manager's instcombine pass. diff --git a/llvm/include/llvm/Transforms/Scalar/EarlyCSE.h b/llvm/include/llvm/Transforms/Scalar/EarlyCSE.h index 8d1dc321b35..80e3c602a2b 100644 --- a/llvm/include/llvm/Transforms/Scalar/EarlyCSE.h +++ b/llvm/include/llvm/Transforms/Scalar/EarlyCSE.h @@ -28,7 +28,7 @@ namespace llvm { /// expected that a later pass of GVN will catch the interesting/hard cases. struct EarlyCSEPass : PassInfoMixin<EarlyCSEPass> { /// \brief Run the pass over the function. - PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM); + PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM); }; } diff --git a/llvm/include/llvm/Transforms/Scalar/GVN.h b/llvm/include/llvm/Transforms/Scalar/GVN.h index 342b3df1eb9..849e1db7246 100644 --- a/llvm/include/llvm/Transforms/Scalar/GVN.h +++ b/llvm/include/llvm/Transforms/Scalar/GVN.h @@ -46,7 +46,7 @@ class GVN : public PassInfoMixin<GVN> { public: /// \brief Run the pass over the function. - PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM); + PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM); /// This removes the specified instruction from /// our various maps and marks it for deletion. diff --git a/llvm/include/llvm/Transforms/Scalar/SROA.h b/llvm/include/llvm/Transforms/Scalar/SROA.h index 9581cb7b5bf..72e7d63d4df 100644 --- a/llvm/include/llvm/Transforms/Scalar/SROA.h +++ b/llvm/include/llvm/Transforms/Scalar/SROA.h @@ -102,7 +102,7 @@ public: SROA() : C(nullptr), DT(nullptr), AC(nullptr) {} /// \brief Run the pass over the function. - PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM); + PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM); private: friend class sroa::AllocaSliceRewriter; diff --git a/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h b/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h index 514a86b95bd..53f427a7d19 100644 --- a/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h +++ b/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h @@ -36,7 +36,7 @@ public: SimplifyCFGPass(int BonusInstThreshold); /// \brief Run the pass over the function. - PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM); + PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM); }; } |