[PM] In the PassManager template, remove a pointless indirection through

a nested class template for the PassModel, and use the T-suffix for the
two typedefs to match the code in the AnalysisManager.

This is the last of the fairly fundamental code cleanups here. Will be
focusing on the printing of analyses next to finish that aspect off.

llvm-svn: 225785
This commit is contained in:
Chandler Carruth 2015-01-13 11:36:43 +00:00
parent 3e498400da
commit 0550e11fd0
1 changed files with 4 additions and 9 deletions

View File

@ -236,24 +236,19 @@ public:
}
template <typename PassT> void addPass(PassT Pass) {
Passes.emplace_back(new PassModel<PassT>(std::move(Pass)));
typedef detail::PassModel<IRUnitT, PassT> PassModelT;
Passes.emplace_back(new PassModelT(std::move(Pass)));
}
static StringRef name() { return "PassManager"; }
private:
// Pull in the concept type and model template specialized for modules.
typedef detail::PassConcept<IRUnitT> PassConcept;
template <typename PassT>
struct PassModel : detail::PassModel<IRUnitT, PassT> {
PassModel(PassT Pass)
: detail::PassModel<IRUnitT, PassT>(std::move(Pass)) {}
};
typedef detail::PassConcept<IRUnitT> PassConceptT;
PassManager(const PassManager &) LLVM_DELETED_FUNCTION;
PassManager &operator=(const PassManager &) LLVM_DELETED_FUNCTION;
std::vector<std::unique_ptr<PassConcept>> Passes;
std::vector<std::unique_ptr<PassConceptT>> Passes;
};
/// \brief Convenience typedef for a pass manager over modules.