diff options
-rw-r--r-- | llvm/include/llvm/Analysis/CGSCCPassManager.h | 4 | ||||
-rw-r--r-- | llvm/include/llvm/Analysis/LoopAnalysisManager.h | 3 | ||||
-rw-r--r-- | llvm/include/llvm/IR/PassManager.h | 12 | ||||
-rw-r--r-- | llvm/lib/Analysis/CGSCCPassManager.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Analysis/LoopAnalysisManager.cpp | 3 |
5 files changed, 16 insertions, 8 deletions
diff --git a/llvm/include/llvm/Analysis/CGSCCPassManager.h b/llvm/include/llvm/Analysis/CGSCCPassManager.h index 95d79e7dabb..398bbfb0c41 100644 --- a/llvm/include/llvm/Analysis/CGSCCPassManager.h +++ b/llvm/include/llvm/Analysis/CGSCCPassManager.h @@ -191,8 +191,8 @@ CGSCCAnalysisManagerModuleProxy::run(Module &M, ModuleAnalysisManager &AM); // template. extern template class InnerAnalysisManagerProxy<CGSCCAnalysisManager, Module>; -extern template class OuterAnalysisManagerProxy<ModuleAnalysisManager, - LazyCallGraph::SCC>; +extern template class OuterAnalysisManagerProxy< + ModuleAnalysisManager, LazyCallGraph::SCC, LazyCallGraph &>; /// A proxy from a \c ModuleAnalysisManager to an \c SCC. typedef OuterAnalysisManagerProxy<ModuleAnalysisManager, LazyCallGraph::SCC, LazyCallGraph &> diff --git a/llvm/include/llvm/Analysis/LoopAnalysisManager.h b/llvm/include/llvm/Analysis/LoopAnalysisManager.h index 640c086be23..17da516889b 100644 --- a/llvm/include/llvm/Analysis/LoopAnalysisManager.h +++ b/llvm/include/llvm/Analysis/LoopAnalysisManager.h @@ -141,7 +141,8 @@ LoopAnalysisManagerFunctionProxy::run(Function &F, FunctionAnalysisManager &AM); // template. extern template class InnerAnalysisManagerProxy<LoopAnalysisManager, Function>; -extern template class OuterAnalysisManagerProxy<FunctionAnalysisManager, Loop>; +extern template class OuterAnalysisManagerProxy<FunctionAnalysisManager, Loop, + LoopStandardAnalysisResults &>; /// A proxy from a \c FunctionAnalysisManager to a \c Loop. typedef OuterAnalysisManagerProxy<FunctionAnalysisManager, Loop, LoopStandardAnalysisResults &> diff --git a/llvm/include/llvm/IR/PassManager.h b/llvm/include/llvm/IR/PassManager.h index 61b6278ea0b..c845112baa4 100644 --- a/llvm/include/llvm/IR/PassManager.h +++ b/llvm/include/llvm/IR/PassManager.h @@ -351,6 +351,8 @@ template <typename IRUnitT, typename... ExtraArgTs> class AnalysisManager; template <typename DerivedT> struct PassInfoMixin { /// Gets the name of the pass we are mixed into. static StringRef name() { + static_assert(std::is_base_of<PassInfoMixin, DerivedT>::value, + "Must pass the derived type as the template argument!"); StringRef Name = getTypeName<DerivedT>(); if (Name.startswith("llvm::")) Name = Name.drop_front(strlen("llvm::")); @@ -379,7 +381,11 @@ struct AnalysisInfoMixin : PassInfoMixin<DerivedT> { /// known platform with this limitation is Windows DLL builds, specifically /// building each part of LLVM as a DLL. If we ever remove that build /// configuration, this mixin can provide the static key as well. - static AnalysisKey *ID() { return &DerivedT::Key; } + static AnalysisKey *ID() { + static_assert(std::is_base_of<AnalysisInfoMixin, DerivedT>::value, + "Must pass the derived type as the template argument!"); + return &DerivedT::Key; + } }; /// \brief Manages a sequence of passes over a particular unit of IR. @@ -1028,7 +1034,7 @@ extern template class InnerAnalysisManagerProxy<FunctionAnalysisManager, template <typename AnalysisManagerT, typename IRUnitT, typename... ExtraArgTs> class OuterAnalysisManagerProxy : public AnalysisInfoMixin< - OuterAnalysisManagerProxy<AnalysisManagerT, IRUnitT>> { + OuterAnalysisManagerProxy<AnalysisManagerT, IRUnitT, ExtraArgTs...>> { public: /// \brief Result proxy object for \c OuterAnalysisManagerProxy. class Result { @@ -1090,7 +1096,7 @@ public: private: friend AnalysisInfoMixin< - OuterAnalysisManagerProxy<AnalysisManagerT, IRUnitT>>; + OuterAnalysisManagerProxy<AnalysisManagerT, IRUnitT, ExtraArgTs...>>; static AnalysisKey Key; const AnalysisManagerT *AM; diff --git a/llvm/lib/Analysis/CGSCCPassManager.cpp b/llvm/lib/Analysis/CGSCCPassManager.cpp index c93d584668d..7cede981313 100644 --- a/llvm/lib/Analysis/CGSCCPassManager.cpp +++ b/llvm/lib/Analysis/CGSCCPassManager.cpp @@ -24,7 +24,7 @@ template class PassManager<LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, CGSCCUpdateResult &>; template class InnerAnalysisManagerProxy<CGSCCAnalysisManager, Module>; template class OuterAnalysisManagerProxy<ModuleAnalysisManager, - LazyCallGraph::SCC>; + LazyCallGraph::SCC, LazyCallGraph &>; template class OuterAnalysisManagerProxy<CGSCCAnalysisManager, Function>; /// Explicitly specialize the pass manager run method to handle call graph diff --git a/llvm/lib/Analysis/LoopAnalysisManager.cpp b/llvm/lib/Analysis/LoopAnalysisManager.cpp index 6ca9c273771..e4a0f90b2f7 100644 --- a/llvm/lib/Analysis/LoopAnalysisManager.cpp +++ b/llvm/lib/Analysis/LoopAnalysisManager.cpp @@ -23,7 +23,8 @@ namespace llvm { template class AllAnalysesOn<Loop>; template class AnalysisManager<Loop, LoopStandardAnalysisResults &>; template class InnerAnalysisManagerProxy<LoopAnalysisManager, Function>; -template class OuterAnalysisManagerProxy<FunctionAnalysisManager, Loop>; +template class OuterAnalysisManagerProxy<FunctionAnalysisManager, Loop, + LoopStandardAnalysisResults &>; bool LoopAnalysisManagerFunctionProxy::Result::invalidate( Function &F, const PreservedAnalyses &PA, |