From e99d82664a5b69b59ae22f17e87ff183fbc49ecf 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232297 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/IntervalIterator.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/llvm/Analysis/IntervalIterator.h b/include/llvm/Analysis/IntervalIterator.h index ab70ad91b84..da622fd5fb6 100644 --- a/include/llvm/Analysis/IntervalIterator.h +++ b/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())) { -- 2.34.1