Skip to content

Commit

Permalink
[PM] Make AnalysisManager::registerPass take its parameter by univers…
Browse files Browse the repository at this point in the history
…al 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288594 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Justin Lebar committed Dec 3, 2016
1 parent bd6d576 commit 0f33f07
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/llvm/IR/PassManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,8 @@ template <typename IRUnitT, typename... ExtraArgTs> class AnalysisManager {
/// 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...>
Expand Down

0 comments on commit 0f33f07

Please sign in to comment.