[PM] Make AnalysisManager::registerPass take its parameter by universal reference.

Summary:
Previously, we were forcing a copy if you passed an lvalue argument; now
we'll take it by reference.

Reviewers: chandlerc

Subscribers: mehdi_amini, silvas, llvm-commits

Differential Revision: https://reviews.llvm.org/D27370

llvm-svn: 288594
This commit is contained in:
Justin Lebar 2016-12-03 19:49:19 +00:00
parent 125b13abea
commit 9b085dd723
1 changed files with 2 additions and 1 deletions

View File

@ -548,7 +548,8 @@ public:
/// interface also lends itself to minimizing the number of times we have to
/// do lookups for analyses or construct complex passes only to throw them
/// away.
template <typename PassBuilderT> bool registerPass(PassBuilderT PassBuilder) {
template <typename PassBuilderT>
bool registerPass(PassBuilderT &&PassBuilder) {
typedef decltype(PassBuilder()) PassT;
typedef detail::AnalysisPassModel<IRUnitT, PassT, PreservedAnalyses,
Invalidator, ExtraArgTs...>