[llvm] r282370 - Appease MSVC

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 25 17:22:19 PDT 2016


Author: sanjoy
Date: Sun Sep 25 19:22:18 2016
New Revision: 282370

URL: http://llvm.org/viewvc/llvm-project?rev=282370&view=rev
Log:
Appease MSVC

... by not default move constructors and operator= s. Defaulting these
works in clang, but not in MSVC.

Modified:
    llvm/trunk/include/llvm/Analysis/ScalarEvolution.h

Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=282370&r1=282369&r2=282370&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Sun Sep 25 19:22:18 2016
@@ -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<EdgeExitInfo> ExitCounts, bool Complete,




More information about the llvm-commits mailing list