From bdd9b3caad073058a5dcba60f6bc7934faf15c31 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sun, 15 Mar 2015 01:21:34 +0000 Subject: [PATCH] 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 --- llvm/include/llvm/Analysis/IntervalIterator.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/llvm/include/llvm/Analysis/IntervalIterator.h b/llvm/include/llvm/Analysis/IntervalIterator.h index ab70ad91b841..da622fd5fb6a 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())) {