From: David Blaikie Date: Sun, 15 Mar 2015 01:21:34 +0000 (+0000) Subject: IntervalIterator: Add move semantics rather than relying on broken implicit copy... X-Git-Tag: llvmorg-3.7.0-rc1~9201 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bdd9b3caad073058a5dcba60f6bc7934faf15c31;p=platform%2Fupstream%2Fllvm.git IntervalIterator: Add move semantics rather than relying on broken implicit copy ctor (found with -Wdeprecated) We were just getting lucky because the copy ctor would be elided by RVO. llvm-svn: 232297 --- diff --git a/llvm/include/llvm/Analysis/IntervalIterator.h b/llvm/include/llvm/Analysis/IntervalIterator.h index ab70ad9..da622fd 100644 --- a/llvm/include/llvm/Analysis/IntervalIterator.h +++ b/llvm/include/llvm/Analysis/IntervalIterator.h @@ -105,6 +105,12 @@ public: } } + IntervalIterator(IntervalIterator &&x) + : IntStack(std::move(x.IntStack)), Visited(std::move(x.Visited)), + OrigContainer(x.OrigContainer), IOwnMem(x.IOwnMem) { + x.IOwnMem = false; + } + IntervalIterator(IntervalPartition &IP, bool OwnMemory) : IOwnMem(OwnMemory) { OrigContainer = &IP; if (!ProcessInterval(IP.getRootInterval())) {