From d175b1cefcfd8c6e509c96a6e324d8d0859f38a0 Mon Sep 17 00:00:00 2001 From: Sanjoy Das Date: Mon, 26 Sep 2016 00:22:18 +0000 Subject: [PATCH] Appease MSVC ... by not default move constructors and operator= s. Defaulting these works in clang, but not in MSVC. llvm-svn: 282370 --- llvm/include/llvm/Analysis/ScalarEvolution.h | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/llvm/include/llvm/Analysis/ScalarEvolution.h b/llvm/include/llvm/Analysis/ScalarEvolution.h index cd917b7..4b5fb47 100644 --- a/llvm/include/llvm/Analysis/ScalarEvolution.h +++ b/llvm/include/llvm/Analysis/ScalarEvolution.h @@ -597,8 +597,19 @@ private: // Clang builds fine without this, but MSVC does not. ExitNotTakenInfo(const ExitNotTakenInfo &) = delete; - ExitNotTakenInfo(ExitNotTakenInfo &&) = default; - ExitNotTakenInfo &operator=(ExitNotTakenInfo &&) = default; + + ExitNotTakenInfo(ExitNotTakenInfo &&Other) { + ExitingBlock = std::move(Other.ExitingBlock); + ExactNotTaken = std::move(Other.ExactNotTaken); + Predicate = std::move(Other.Predicate); + } + + ExitNotTakenInfo &operator=(ExitNotTakenInfo &&Other) { + ExitingBlock = std::move(Other.ExitingBlock); + ExactNotTaken = std::move(Other.ExactNotTaken); + Predicate = std::move(Other.Predicate); + return *this; + } }; /// Information about the backedge-taken count of a loop. This currently @@ -628,8 +639,17 @@ private: BackedgeTakenInfo() : MaxAndComplete(nullptr, 0) {} BackedgeTakenInfo(const BackedgeTakenInfo &) = delete; - BackedgeTakenInfo(BackedgeTakenInfo &&) = default; - BackedgeTakenInfo &operator=(BackedgeTakenInfo &&) = default; + + BackedgeTakenInfo(BackedgeTakenInfo &&Other) { + ExitNotTaken = std::move(Other.ExitNotTaken); + MaxAndComplete = std::move(Other.MaxAndComplete); + } + + BackedgeTakenInfo &operator=(BackedgeTakenInfo &&Other) { + ExitNotTaken = std::move(Other.ExitNotTaken); + MaxAndComplete = std::move(Other.MaxAndComplete); + return *this; + } /// Initialize BackedgeTakenInfo from a list of exact exit counts. BackedgeTakenInfo(ArrayRef ExitCounts, bool Complete, -- 2.7.4