-class FunctionAnalysisManager {
-public:
- FunctionAnalysisManager() {}
-
- /// \brief Get the result of an analysis pass for a function.
- ///
- /// If there is not a valid cached result in the manager already, this will
- /// re-run the analysis to produce a valid result.
- template <typename PassT>
- const typename PassT::Result &getResult(Function *F) {
- assert(FunctionAnalysisPasses.count(PassT::ID()) &&
- "This analysis pass was not registered prior to being queried");
-
- const detail::AnalysisResultConcept<Function *> &ResultConcept =
- getResultImpl(PassT::ID(), F);
- typedef detail::AnalysisResultModel<Function *, PassT,
- typename PassT::Result> ResultModelT;
- return static_cast<const ResultModelT &>(ResultConcept).Result;
- }
-
- /// \brief Get the cached result of an analysis pass for a function if
- /// available.
- ///
- /// Does not run the analysis ever.
- /// \returns null if a cached result is not available.
- template <typename PassT>
- const typename PassT::Result *getCachedResult(Function *F) {
- assert(FunctionAnalysisPasses.count(PassT::ID()) &&
- "This analysis pass was not registered prior to being queried");
-
- const detail::AnalysisResultConcept<Function *> *ResultConcept =
- getCachedResultImpl(PassT::ID(), F);
- if (!ResultConcept)
- return 0;
-
- typedef detail::AnalysisResultModel<Function *, PassT,
- typename PassT::Result> ResultModelT;
- return &static_cast<const ResultModelT *>(ResultConcept)->Result;
- }
+class FunctionAnalysisManager
+ : public detail::AnalysisManagerBase<FunctionAnalysisManager, Function *> {
+ friend class detail::AnalysisManagerBase<FunctionAnalysisManager, Function *>;
+ typedef detail::AnalysisManagerBase<FunctionAnalysisManager, Function *> BaseT;
+ typedef typename BaseT::ResultConceptT ResultConceptT;
+ typedef typename BaseT::PassConceptT PassConceptT;