From 77907c75553b579e774ad29cccf9882374fb6c70 Mon Sep 17 00:00:00 2001 From: Adam Nemet Date: Thu, 30 Jul 2015 04:21:13 +0000 Subject: [PATCH] [LoopVer] Add missing std::move The reason I was passing this vector by value in the constructor so that I wouldn't have to copy when initializing the corresponding member but then I forgot the std::move. The use-case is LoopDistribution which filters the checks then std::moves it to LoopVersioning's constructor. With this interface we can avoid any copies. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243616 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/LoopVersioning.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/Utils/LoopVersioning.cpp b/lib/Transforms/Utils/LoopVersioning.cpp index b2182bd6409..e4af2e3cc95 100644 --- a/lib/Transforms/Utils/LoopVersioning.cpp +++ b/lib/Transforms/Utils/LoopVersioning.cpp @@ -27,7 +27,8 @@ LoopVersioning::LoopVersioning( const LoopAccessInfo &LAI, Loop *L, LoopInfo *LI, DominatorTree *DT, const SmallVector *PtrToPartition) : VersionedLoop(L), NonVersionedLoop(nullptr), - PtrToPartition(PtrToPartition), Checks(Checks), LAI(LAI), LI(LI), DT(DT) { + PtrToPartition(PtrToPartition), Checks(std::move(Checks)), LAI(LAI), + LI(LI), DT(DT) { assert(L->getExitBlock() && "No single exit block"); assert(L->getLoopPreheader() && "No preheader"); }