]> granicus.if.org Git - llvm/commitdiff
Appease MSVC
authorSanjoy Das <sanjoy@playingwithpointers.com>
Mon, 26 Sep 2016 00:22:18 +0000 (00:22 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Mon, 26 Sep 2016 00:22:18 +0000 (00:22 +0000)
... by not default move constructors and operator= s. Defaulting these
works in clang, but not in MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282370 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/ScalarEvolution.h

index cd917b740375861a412348cd2e5589c903db4e72..4b5fb473dce6a2300eec9f8a93322cab95bdd1fa 100644 (file)
@@ -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,